Skip to content

Updated Wallet Provider API Methods page#6

Open
HakPoghosyan wants to merge 3 commits intomainfrom
update-wallet-provider-api-methods-page
Open

Updated Wallet Provider API Methods page#6
HakPoghosyan wants to merge 3 commits intomainfrom
update-wallet-provider-api-methods-page

Conversation

@HakPoghosyan
Copy link

@HakPoghosyan HakPoghosyan commented Jan 16, 2026

PR Type

Documentation


Description

  • Removed NOT_LOGGED_IN error from sign and signTransaction methods

  • Added new xmTransaction method for cross-chain transactions

  • Reorganized Identity section with subsections for XM, Web2, and Unstoppable Domains

  • Added Discord and Github identity methods with examples

  • Added Unstoppable Domains identity methods with comprehensive examples

  • Enhanced addTwitterIdentity with optional referral code parameter


Diagram Walkthrough

flowchart LR
  A["Wallet Provider API Methods"] --> B["Transaction Methods"]
  A --> C["Identity Methods"]
  B --> D["Add xmTransaction"]
  C --> E["XM Identities"]
  C --> F["Web2 Identities"]
  C --> G["Unstoppable Domains"]
  F --> H["Add Discord/Github methods"]
  F --> I["Enhanced Twitter with referral"]
  G --> J["Add UD challenge/resolution/identity"]
Loading

File Walkthrough

Relevant files
Documentation
wallet-provider-api-methods.mdx
Add Unstoppable Domains and new identity methods                 

frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx

  • Removed NOT_LOGGED_IN error from sign and signTransaction method error
    lists
  • Added new xmTransaction method for cross-chain transaction handling
    with validation popup
  • Reorganized Identity section into three subsections: Cross-Chain (XM)
    Identities, Web2 Identities, and Unstoppable Domains
  • Enhanced addTwitterIdentity with optional referralCode parameter and
    updated example
  • Added two new Web2 identity methods: addDiscordIdentity and
    addGithubIdentity with full documentation
  • Added three new Unstoppable Domains methods: getUDChallenge,
    getUDResolution, and addUDIdentity with comprehensive examples and
    implementation notes
  • Removed NOT_LOGGED_IN error from getWeb2IdentityProofPayload method
+129/-7 

Summary by CodeRabbit

  • Documentation
    • Added XM transaction flow and expanded Cross‑Chain (XM) identity docs with examples and error lists.
    • Added Web2 identity docs: list/retrieval, proof payload flow, and Twitter/Discord/GitHub onboarding examples; Twitter supports optional referral codes.
    • Added Unstoppable Domains challenge/resolution and identity flow with optional referral code and examples.
    • Added Nomis score and identity management docs.
    • Clarified sign/transaction error lists and identity success wording.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Walkthrough

Updates the Wallet Provider API documentation: removes NOT_LOGGED_IN from sign errors, adds xmTransaction, expands XM identities, adds Web2 identity methods (Twitter, Discord, Github) and getWeb2Identities, introduces Unstoppable Domains challenge/resolution/add flows, and adds Nomis identity/score methods and related examples.

Changes

Cohort / File(s) Summary
Docs: Wallet Provider API
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx
Comprehensive documentation additions and edits: removed NOT_LOGGED_IN from sign/signTransaction errors; added xmTransaction helper; expanded Identity section with XM identities and addXmIdentity; added Web2 identities (getWeb2Identities, getWeb2IdentityProofPayload, addTwitterIdentity (optional referralCode), addDiscordIdentity, addGithubIdentity) with params, behaviors, success/error schemas and examples; added Unstoppable Domains flows (getUDChallenge, getUDResolution, addUDIdentity) including signing-address notes and examples; added Nomis methods (getNomisScore, addNomisIdentity, removeNomisIdentity).

Sequence Diagram(s)

sequenceDiagram
  participant App as "App / Client"
  participant WP as "Wallet Provider SDK"
  participant IDP as "Identity Provider (Twitter/UD/etc.)"
  participant Chain as "Blockchain / RPC"

  rect rgba(100,150,240,0.5)
    App->>WP: request addUDIdentity(params)
    WP->>IDP: getUDChallenge(demosPublicKey, signingAddress)
    IDP-->>WP: challenge payload
    WP->>App: prompt user to sign challenge
    App-->>WP: signed challenge (signature)
    WP->>IDP: getUDResolution(domain) / submit signed challenge
    IDP-->>WP: resolution / proof
    WP->>Chain: optionally submit on-chain (addUDIdentity)
    Chain-->>WP: tx result
    WP-->>App: return success or error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through lines of docs so bright,

Cross-chain carrots gleam in morning light,
Twitter, Discord, UD in a row,
Nomis scores and referrals help them grow,
A joyful hop — the wallet garden's right!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Updated Wallet Provider API Methods page' accurately and concisely summarizes the main change—updating the documentation page with new API methods and reorganized sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-wallet-provider-api-methods-page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link

qodo-code-review bot commented Jan 16, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
Audit logging unknown: The new/updated API methods described (e.g., xmTransaction, identity linking methods)
represent critical actions but the diff is documentation-only and does not show whether
corresponding implementations generate audit logs with user/context/outcome.

Referred Code
#### xmTransaction

* **Params**: `[ payload: XMScript ]`
* **Behavior**: creates an XM (cross-chain) transaction payload, validates it, and opens validation popup for user confirmation and broadcast.
* **Success data**: `{ result, validityData }`
* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`

Example:

```ts
const payload = {/* XMScript from SDK */};
const res = await provider.request({ method: 'xmTransaction', params: [payload] });

Identity

Cross-Chain (XM) Identities

getXmIdentities

  • Params: none

... (clipped 165 lines)


</details>

> Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a>
</details></td></tr>
<tr><td><details>
<summary><strong>Generic: Robust Error Handling and Edge Case Management</strong></summary><br>

**Objective:** Ensure comprehensive error handling that provides meaningful context and graceful <br>degradation<br>

**Status:** <br><a href='https://github.com/kynesyslabs/documentation-mintlify/pull/6/files#diff-1d120341556bd919c9855fe7b1c70499b2ff9c9c1ca80485768e4470d8d498afR114-R329'><strong>Edge cases unverified</strong></a>: The documentation updates add/adjust error lists and behaviors for new flows (e.g., XM <br>validation popup, UD challenge/resolution) but the diff does not include implementation <br>details to verify actual error handling and edge-case management.<br>
<details open><summary>Referred Code</summary>

```txt
#### xmTransaction

* **Params**: `[ payload: XMScript ]`
* **Behavior**: creates an XM (cross-chain) transaction payload, validates it, and opens validation popup for user confirmation and broadcast.
* **Success data**: `{ result, validityData }`
* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`

Example:

```ts
const payload = {/* XMScript from SDK */};
const res = await provider.request({ method: 'xmTransaction', params: [payload] });

Identity

Cross-Chain (XM) Identities

getXmIdentities

  • Params: none

... (clipped 195 lines)


</details>

> Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a>
</details></td></tr>
<tr><td><details>
<summary><strong>Generic: Security-First Input Validation and Data Handling</strong></summary><br>

**Objective:** Ensure all data inputs are validated, sanitized, and handled securely to prevent <br>vulnerabilities<br>

**Status:** <br><a href='https://github.com/kynesyslabs/documentation-mintlify/pull/6/files#diff-1d120341556bd919c9855fe7b1c70499b2ff9c9c1ca80485768e4470d8d498afR114-R329'><strong>Validation not provable</strong></a>: New external-input-bearing methods documented (e.g., <code>xmTransaction</code> payload, UD <code>domain</code>, <br><code>signingAddress</code>, <code>signature</code>, <code>resolutionData</code>, optional <code>referralCode</code>) require strong <br>validation and authz controls, but the diff is documentation-only and cannot confirm <br>secure input validation/data handling in the underlying code.<br>
<details open><summary>Referred Code</summary>

```txt
#### xmTransaction

* **Params**: `[ payload: XMScript ]`
* **Behavior**: creates an XM (cross-chain) transaction payload, validates it, and opens validation popup for user confirmation and broadcast.
* **Success data**: `{ result, validityData }`
* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`

Example:

```ts
const payload = {/* XMScript from SDK */};
const res = await provider.request({ method: 'xmTransaction', params: [payload] });

Identity

Cross-Chain (XM) Identities

getXmIdentities

  • Params: none

... (clipped 195 lines)


</details>

> Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a>
</details></td></tr>

<tr><td align="center" colspan="2">

- [ ] Update <!-- /compliance --update_compliance=true -->

</td></tr></tbody></table>
<details><summary>Compliance status legend</summary>
🟢 - Fully Compliant<br>
🟡 - Partial Compliant<br>
🔴 - Not Compliant<br>
⚪ - Requires Further Human Verification<br>
🏷️ - Compliance label<br>
</details>

@qodo-code-review
Copy link

qodo-code-review bot commented Jan 16, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Clarify behavior for unauthenticated users

The documentation for methods like sign and signTransaction should be updated to
explain the behavior when a user is not logged in, as the NOT_LOGGED_IN error
has been removed.

Examples:

frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx [44]
* **Errors**: `signError`, `signCancelled`, `TIMEOUT`
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx [57]
* **Errors**: `signTransactionError`, `signTransactionCancelled`, `TIMEOUT`

Solution Walkthrough:

Before:

#### sign

* **Params**: `[ message: string ]`
* **Behavior**: opens a sign popup for a plain message.
* **Success data**: `{ signature: string }`
* **Errors**: `signError`, `signCancelled`, `TIMEOUT`

#### signTransaction

* **Params**: `[ unsignedTransaction: Transaction ]`
* **Behavior**: opens a sign-transaction popup and returns the signed transaction.
* **Errors**: `signTransactionError`, `signTransactionCancelled`, `TIMEOUT`

After:

#### sign

* **Params**: `[ message: string ]`
* **Behavior**: opens a sign popup for a plain message. If the user is not logged in, they will be prompted to log in first.
* **Success data**: `{ signature: string }`
* **Errors**: `signError`, `signCancelled`, `TIMEOUT`

#### signTransaction

* **Params**: `[ unsignedTransaction: Transaction ]`
* **Behavior**: opens a sign-transaction popup and returns the signed transaction. If the user is not logged in, they will be prompted to log in first.
* **Errors**: `signTransactionError`, `signTransactionCancelled`, `TIMEOUT`
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a critical documentation gap for methods like sign and signTransaction, where removing the NOT_LOGGED_IN error without explaining the new behavior for unauthenticated users leaves developers guessing about a common scenario.

Medium
General
Fix xmTransaction cancellation error name

For the xmTransaction method, rename the validationCancelled error to
xmTransactionCancelled to maintain consistency with other methods.

frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx [119]

-* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`
+* **Errors**: `xmTransactionError`, `xmTransactionCancelled`, `TIMEOUT`
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies that the cancellation error for the new xmTransaction method, validationCancelled, is inconsistent with the naming convention (<methodName>Cancelled) used for all other methods in the API documentation.

Low
Possible issue
Avoid redeclaring a const variable

In the addTwitterIdentity example, rename the second res constant to avoid a
redeclaration error.

frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx [211-212]

 // With referral code
-const res = await provider.request({ method: 'addTwitterIdentity', params: [proof, 'REFERRAL123'] });
+const resWithReferral = await provider.request({ method: 'addTwitterIdentity', params: [proof, 'REFERRAL123'] });
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies a const redeclaration error in the addTwitterIdentity example code, which would prevent it from being runnable. Fixing this improves the quality and usability of the documentation.

Low
  • Update

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx`:
- Around line 114-119: The xmTransaction docs currently omit POPUP_ERROR and use
a generic validationCancelled; update the xmTransaction error list to include
POPUP_ERROR (same semantics as sendTransaction/nativeTransfer) and rename the
cancellation error from validationCancelled to xmTransactionCancelled to match
the naming pattern used by nativeTransferCancelled and other transaction
helpers; update any related descriptions mentioning the validation popup to
reflect POPUP_ERROR as a possible outcome and ensure references to
xmTransactionCancelled are consistent across the xmTransaction documentation and
examples.
🧹 Nitpick comments (2)
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx (2)

132-136: Make getXmIdentities success data concrete.

“list of XM identities from SDK” is vague. Consider specifying the exact type (e.g., XmIdentity[]) to match the precision used elsewhere.

💡 Suggested wording
-* **Success data**: list of XM identities from SDK
+* **Success data**: `XmIdentity[]` (from SDK)

293-302: Clarify that the challenge must be signed by signingAddress.

Consider explicitly stating that the signature should be produced by signing the getUDChallenge string with the same signingAddress to avoid ambiguity.

💡 Suggested clarification
 <Note>
 The `signingAddress` should be an EVM address (e.g., `0x...`) or Solana address based on the chosen chain. Similarly, the `signature` should be an EVM signature or Solana signature corresponding to the chain used for signing.
+The signature should be created by signing the challenge returned by `getUDChallenge` with the same `signingAddress`.
 </Note>
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c0d7652 and 3712c81.

📒 Files selected for processing (1)
  • frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx
🔇 Additional comments (2)
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx (2)

39-57: Confirm removal of NOT_LOGGED_IN matches current provider errors.

Please verify that sign and signTransaction no longer emit NOT_LOGGED_IN; otherwise integrators may miss handling it.


172-241: Web2 identity additions are clear and actionable.

The new methods, parameters, and examples read well and are consistent with the rest of the page.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +114 to +119
#### xmTransaction

* **Params**: `[ payload: XMScript ]`
* **Behavior**: creates an XM (cross-chain) transaction payload, validates it, and opens validation popup for user confirmation and broadcast.
* **Success data**: `{ result, validityData }`
* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find the file and explore its structure
find . -type f -name "*.mdx" | head -20

Repository: kynesyslabs/documentation-mintlify

Length of output: 1092


🏁 Script executed:

# Look for the wallet provider API file
git ls-files | grep -i "wallet-provider" | grep -i "mdx"

Repository: kynesyslabs/documentation-mintlify

Length of output: 192


🏁 Script executed:

# Search for xmTransaction in the codebase to find implementation
rg "xmTransaction" --type ts --type tsx --type js --type jsx -A 5 -B 2

Repository: kynesyslabs/documentation-mintlify

Length of output: 105


🏁 Script executed:

# Search for error definitions related to popup and transactions
rg "POPUP_ERROR|validationCancelled|xmTransactionError" --type ts --type tsx --type js --type jsx

Repository: kynesyslabs/documentation-mintlify

Length of output: 105


🏁 Script executed:

# Look at the full documentation file to understand the pattern for other methods
wc -l frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx

Repository: kynesyslabs/documentation-mintlify

Length of output: 148


🏁 Script executed:

# Read the entire documentation file to see error patterns for other methods
cat -n frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx

Repository: kynesyslabs/documentation-mintlify

Length of output: 12470


xmTransaction is missing POPUP_ERROR in its error list.

Since this method opens a validation popup like sendTransaction and nativeTransfer, it should include POPUP_ERROR in its documented errors. Additionally, the cancellation code validationCancelled is generic; consider using xmTransactionCancelled to align with the naming pattern of similar transaction-helper methods (e.g., nativeTransferCancelled).

💡 Suggested doc tweak
-* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`
+* **Errors**: `xmTransactionError`, `xmTransactionCancelled`, `TIMEOUT`, `POPUP_ERROR`
🤖 Prompt for AI Agents
In `@frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx` around
lines 114 - 119, The xmTransaction docs currently omit POPUP_ERROR and use a
generic validationCancelled; update the xmTransaction error list to include
POPUP_ERROR (same semantics as sendTransaction/nativeTransfer) and rename the
cancellation error from validationCancelled to xmTransactionCancelled to match
the naming pattern used by nativeTransferCancelled and other transaction
helpers; update any related descriptions mentioning the validation popup to
reflect POPUP_ERROR as a possible outcome and ensure references to
xmTransactionCancelled are consistent across the xmTransaction documentation and
examples.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx (1)

39-45: Add POPUP_ERROR to sign and signTransaction error lists.

Both methods explicitly open popups (lines 42 and 55), yet omit POPUP_ERROR from their error contracts. This is inconsistent with other popup-based methods in the same file (e.g., sendTransaction, sendSignedTransaction, nativeTransfer, xmTransaction), which all include POPUP_ERROR. Since the common error codes section documents POPUP_ERROR for popup failures, it should be listed here too.

📌 Suggested doc update
-* **Errors**: `signError`, `signCancelled`, `TIMEOUT`
+* **Errors**: `signError`, `signCancelled`, `TIMEOUT`, `POPUP_ERROR`

-* **Errors**: `signTransactionError`, `signTransactionCancelled`, `TIMEOUT`
+* **Errors**: `signTransactionError`, `signTransactionCancelled`, `TIMEOUT`, `POPUP_ERROR`

Also applies to: 52-57

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3712c81 and 66f5357.

📒 Files selected for processing (1)
  • frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx
🔇 Additional comments (7)
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx (7)

114-127: xmTransaction section is clear and consistent with other helpers.

Concise params/behavior/errors plus a clean example—nice addition.


128-136: XM identities reorg + clarified success data look good.


172-191: Web2 identities section and proof payload error update look good.


198-213: Referral code support for addTwitterIdentity is well documented.


215-228: addDiscordIdentity docs are clear and aligned with Web2 identity patterns.


229-241: addGithubIdentity docs are clear and aligned with Web2 identity patterns.


259-330: Unstoppable Domains workflow and signing-address note are thorough.
The end‑to‑end example reads well and should be easy to follow.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx`:
- Around line 306-330: The code sample declares `const res` twice which causes a
duplicate declaration error; update the second call to `provider.request` (the
one that includes the referral code) to use a different variable name (e.g.,
`resWithReferral` or `res2`) or reuse the same binding by removing `const` and
assigning into the prior `res`, ensuring the second `addUDIdentity` invocation
that uses signingAddress, signature, challengeRes.data, resolutionRes.data, and
the referral string is uniquely named.
♻️ Duplicate comments (1)
frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx (1)

114-126: Inconsistent cancellation error naming.

The error validationCancelled should be xmTransactionCancelled to match the naming convention used by other transaction methods (e.g., nativeTransferCancelled, sendTransactionCancelled).

📝 Suggested fix
-* **Errors**: `xmTransactionError`, `validationCancelled`, `TIMEOUT`, `POPUP_ERROR`
+* **Errors**: `xmTransactionError`, `xmTransactionCancelled`, `TIMEOUT`, `POPUP_ERROR`

Comment on lines +306 to +330
```ts
// First get the challenge
const challengeRes = await provider.request({
method: 'getUDChallenge',
params: [demosPublicKey, signingAddress],
});

// Get resolution data
const resolutionRes = await provider.request({
method: 'getUDResolution',
params: ['mydomain.crypto'],
});

// Sign the challenge with user's wallet (EVM or Solana), then add identity
const res = await provider.request({
method: 'addUDIdentity',
params: [signingAddress, signature, challengeRes.data, resolutionRes.data],
});

// With referral code
const res = await provider.request({
method: 'addUDIdentity',
params: [signingAddress, signature, challengeRes.data, resolutionRes.data, 'REFERRAL123'],
});
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix duplicate variable declaration in code example.

The example declares const res twice (lines 320 and 326) within the same code block, which would cause a syntax error in JavaScript/TypeScript. Use different variable names or restructure as separate examples.

📝 Suggested fix
 // Sign the challenge with user's wallet (EVM or Solana), then add identity
 const res = await provider.request({
   method: 'addUDIdentity',
   params: [signingAddress, signature, challengeRes.data, resolutionRes.data],
 });

 // With referral code
-const res = await provider.request({
+const resWithReferral = await provider.request({
   method: 'addUDIdentity',
   params: [signingAddress, signature, challengeRes.data, resolutionRes.data, 'REFERRAL123'],
 });
🤖 Prompt for AI Agents
In `@frontend/demos-wallet-provider-api/wallet-provider-api-methods.mdx` around
lines 306 - 330, The code sample declares `const res` twice which causes a
duplicate declaration error; update the second call to `provider.request` (the
one that includes the referral code) to use a different variable name (e.g.,
`resWithReferral` or `res2`) or reuse the same binding by removing `const` and
assigning into the prior `res`, ensuring the second `addUDIdentity` invocation
that uses signingAddress, signature, challengeRes.data, resolutionRes.data, and
the referral string is uniquely named.

@HakPoghosyan HakPoghosyan requested a review from tcsenpai January 20, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant