### Xumm SDK Backend Store
Source: https://docs.xaman.dev/concepts/getting-started
Provides methods for interacting with backend storage for application-specific data.
```APIDOC
Xumm.backendstore.get()
- Retrieves data from the backend store.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.backendstore.set({ ... })
- Stores data in the backend store.
- Parameters:
- Object containing data to store.
- Returns: void
```
```APIDOC
Xumm.backendstore.delete()
- Deletes data from the backend store.
- Returns: void
```
--------------------------------
### Xumm SDK Runtime Information
Source: https://docs.xaman.dev/concepts/getting-started
Provides access to information about the runtime environment of the Xaman SDK.
```APIDOC
Xumm.runtime { ... }
- Namespace for runtime-related information.
```
--------------------------------
### Xumm SDK Environment Object
Source: https://docs.xaman.dev/concepts/getting-started
Provides access to information about the current Xaman SDK environment.
```APIDOC
Xumm.environment { ... }
- Namespace for environment-related information.
```
--------------------------------
### Xumm SDK Push Notifications
Source: https://docs.xaman.dev/concepts/getting-started
Manages sending push notifications via the Xaman platform.
```APIDOC
Xumm.push.event( ... )
- Sends an event-based push notification.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.push.notification( ... )
- Sends a general push notification.
- Parameters: (details not provided in source)
- Returns: void
```
--------------------------------
### Xumm SDK Core Methods
Source: https://docs.xaman.dev/concepts/getting-started
Provides essential methods for interacting with the Xaman SDK, including pinging the service, subscribing to events, and unsubscribing.
```APIDOC
Xumm.ping()
- Checks the connection status to the Xaman service.
- Returns: A promise that resolves if the service is reachable.
```
```APIDOC
Xumm.on(event, fn)
- Subscribes a callback function to a specific SDK event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'disconnect').
- fn: The callback function to execute when the event is triggered.
- Returns: void
```
```APIDOC
Xumm.off(event, fn)
- Unsubscribes a callback function from a specific SDK event.
- Parameters:
- event: The name of the event to unsubscribe from.
- fn: The specific callback function to remove.
- Returns: void
```
--------------------------------
### Xumm SDK User Object
Source: https://docs.xaman.dev/concepts/getting-started
Provides access to user-specific functionalities within the Xaman SDK.
```APIDOC
Xumm.user { ... }
- Namespace for user-related operations.
```
--------------------------------
### Basic xApp Integration with Xumm SDK
Source: https://docs.xaman.dev/environments/xapps-dapps
This snippet demonstrates the fundamental setup for an xApp. It includes loading the Xumm SDK, initializing it with an API key, listening for the 'ready' event, and retrieving the user's XRPL account address.
```html
...
```
--------------------------------
### Xumm SDK Helpers
Source: https://docs.xaman.dev/concepts/getting-started
Access utility functions for various data retrieval and processing tasks, such as fetching exchange rates, NFT details, and KYC status.
```APIDOC
Xumm.helpers.ping()
- Alias for Xumm.ping().
- Returns: A promise that resolves if the service is reachable.
```
```APIDOC
Xumm.helpers.getRates( ... )
- Retrieves currency exchange rates.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getRails()
- Fetches information about supported payment rails.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getHookHash( ... )
- Retrieves a specific hook hash.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getHookHashes()
- Retrieves all available hook hashes.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getCuratedAssets()
- Fetches a list of curated assets.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getNftokenDetail( ... )
- Retrieves detailed information for a specific NFT.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getKycStatus( ... )
- Checks the KYC status for a given account.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.verifyUserTokens([ ... ])
- Verifies a list of user tokens.
- Parameters:
- Array of user tokens.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getTransaction( ... )
- Retrieves details for a specific XRP Ledger transaction.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
--------------------------------
### Xumm SDK Payload Management
Source: https://docs.xaman.dev/concepts/getting-started
Handles the creation, subscription, and retrieval of Xaman payloads for transaction signing.
```APIDOC
Xumm.payload.create( ... )
- Creates a new payload for signing a transaction.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.createAndSubscribe( ... )
- Creates a payload and subscribes to its status updates.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.cancel( ... )
- Cancels an existing payload.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.subscribe( ... )
- Subscribes to the status updates of an existing payload.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.get( ... )
- Retrieves the details of a specific payload.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
--------------------------------
### Xumm SDK Runtime Information
Source: https://docs.xaman.dev/concepts
Provides access to information about the runtime environment of the Xaman SDK.
```APIDOC
Xumm.runtime { ... }
- Namespace for runtime-related information.
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/concepts/implementation-checklist
A basic example of initiating a sign request.
```javascript
// Basic sign request initiation
// Xumm.create({ TransactionType: "SignIn" }).then(payload => {
// console.log(payload.next.always);
// });
```
--------------------------------
### Xumm SDK Environment Object
Source: https://docs.xaman.dev/concepts
Provides access to information about the current Xaman SDK environment.
```APIDOC
Xumm.environment { ... }
- Namespace for environment-related information.
```
--------------------------------
### Xumm SDK Backend Store
Source: https://docs.xaman.dev/concepts
Provides methods for interacting with backend storage for application-specific data.
```APIDOC
Xumm.backendstore.get()
- Retrieves data from the backend store.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.backendstore.set({ ... })
- Stores data in the backend store.
- Parameters:
- Object containing data to store.
- Returns: void
```
```APIDOC
Xumm.backendstore.delete()
- Deletes data from the backend store.
- Returns: void
```
--------------------------------
### Xumm SDK XApp Interface
Source: https://docs.xaman.dev/concepts/getting-started
Provides methods for XApps to interact with the Xaman mobile application, including opening sign requests, scanning QR codes, and managing navigation.
```APIDOC
Xumm.xapp.ready()
- Signals that the XApp is ready to interact.
- Returns: void
```
```APIDOC
Xumm.xapp.openSignRequest({ ... })
- Opens a sign request within the Xaman app.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.selectDestination({ ... })
- Allows the user to select a destination within the Xaman app.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.scanQr()
- Opens the Xaman app's QR code scanner.
- Returns: A promise resolving with the scanned data.
```
```APIDOC
Xumm.xapp.tx({ ... })
- Handles transaction-related operations within an XApp context.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.close({ ... })
- Closes the current XApp view.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.share({ ... })
- Shares content from the XApp.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.navigate({ ... })
- Navigates to a different view or URL within the Xaman app.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.openBrowser({ ... })
- Opens an external URL in the Xaman app's in-app browser.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.on(xAppEvent, fn)
- Subscribes to XApp-specific events.
- Parameters:
- xAppEvent: The name of the XApp event.
- fn: The callback function.
- Returns: void
```
```APIDOC
Xumm.xapp.off(xAppEvent, fn)
- Unsubscribes from XApp-specific events.
- Parameters:
- xAppEvent: The name of the XApp event.
- fn: The callback function to remove.
- Returns: void
```
--------------------------------
### Xumm SDK User Store
Source: https://docs.xaman.dev/concepts/getting-started
Manages persistent storage for user-specific data within the Xaman SDK.
```APIDOC
Xumm.userstore.list()
- Lists all stored user data keys.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.userstore.get( ... )
- Retrieves a specific piece of user data.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.userstore.delete( ... )
- Deletes a specific piece of user data.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.userstore.set( ... , { ... } )
- Stores or updates a piece of user data.
- Parameters:
- Key for the data.
- Value to store.
- Returns: void
```
--------------------------------
### Xumm SDK (Backend, Typescript) Example
Source: https://docs.xaman.dev/~gitbook/pdf
A link to a CodeSandbox example demonstrating the usage of the Xumm SDK for backend applications, specifically written in TypeScript. This can serve as a starting point for integrating Xumm's services.
```URL
https://codesandbox.io/p/sandbox/xumm-sdk-6gm4du?file=/src/index.ts
```
--------------------------------
### Xumm SDK Core Methods
Source: https://docs.xaman.dev/concepts
Provides essential methods for interacting with the Xaman SDK, including pinging the service, subscribing to events, and unsubscribing.
```APIDOC
Xumm.ping()
- Checks the connection status to the Xaman service.
- Returns: A promise that resolves if the service is reachable.
```
```APIDOC
Xumm.on(event, fn)
- Subscribes a callback function to a specific SDK event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'disconnect').
- fn: The callback function to execute when the event is triggered.
- Returns: void
```
```APIDOC
Xumm.off(event, fn)
- Unsubscribes a callback function from a specific SDK event.
- Parameters:
- event: The name of the event to unsubscribe from.
- fn: The specific callback function to remove.
- Returns: void
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/environments
A basic example for a simple sign request.
```APIDOC
Simple Sign Request
- A miscellaneous example for signing requests.
```
--------------------------------
### Xumm SDK Authentication
Source: https://docs.xaman.dev/concepts/getting-started
Handles user authorization and logout processes within the Xaman SDK.
```APIDOC
Xumm.authorize()
- Initiates the user authorization flow.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.logout()
- Logs the current user out.
- Returns: void
```
--------------------------------
### Sign Request Payload Examples
Source: https://docs.xaman.dev/concepts/implementation-checklist
Examples demonstrating how to sign requests using payloads in different environments.
```javascript
// Example for Browser
// const payload = {
// TransactionType: "Payment",
// Account: "r...",
```
```javascript
// Example for xApp
// const payload = {
// TransactionType: "Payment",
// Account: "r..."
```
```javascript
// Example for Backend
// const payload = {
// TransactionType: "Payment",
// Account: "r..."
```
--------------------------------
### Xaman SDK Installation (NPM)
Source: https://docs.xaman.dev/js-ts-sdk/xumm-sdk-intro
Instructions for installing the Xaman Javascript/TypeScript SDK using NPM.
```bash
npm install xumm
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/environments/browser-web3
A basic example for a simple sign request.
```APIDOC
Simple Sign Request
- A miscellaneous example for signing requests.
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/environments/xapps-dapps/your-own-backend-auth
A basic example of initiating a sign request.
```javascript
// Example for a simple sign request
// Xumm.payload.create({ TransactionType: 'Payment', ... }).then(response => { ... });
```
--------------------------------
### Unified Xumm Package Installation
Source: https://docs.xaman.dev/js-ts-sdk/xumm-sdk-intro
Information on the deprecation of legacy Xumm SDK packages and the recommended installation of the unified 'xumm' package via npm for all backend and frontend interactions.
```npm
npm install xumm
```
--------------------------------
### Sign Request Examples
Source: https://docs.xaman.dev/environments
Demonstrates how to sign requests using payloads in different environments.
```APIDOC
Sign Requests (payloads) - Browser
- Example for signing requests in a web browser environment.
```
```APIDOC
Sign Requests (payloads) - xApp
- Example for signing requests within an xApp.
```
```APIDOC
Sign Requests (payloads) - Backend
- Example for signing requests from a backend service.
```
--------------------------------
### Sign Requests Payload Examples
Source: https://docs.xaman.dev/environments/xapps-dapps
Examples demonstrating how to sign requests using payloads in different environments.
```javascript
// Example for Browser
// const payload = { ... };
// Xumm.payload.create(payload).then(response => { ... });
// Example for xApp
// Xumm.xapp.openSignRequest({ ... });
// Example for Backend
// const payload = { ... };
// Xumm.payload.create(payload).then(response => { ... });
```
--------------------------------
### Xaman SDK Installation (NPM)
Source: https://docs.xaman.dev/js-ts-sdk
Instructions for installing the Xaman Javascript/TypeScript SDK using NPM.
```bash
npm install xumm
```
--------------------------------
### Sign Request Examples
Source: https://docs.xaman.dev/environments/browser-web3
Demonstrates how to sign requests using payloads in different environments.
```APIDOC
Sign Requests (payloads) - Browser
- Example for signing requests in a web browser environment.
```
```APIDOC
Sign Requests (payloads) - xApp
- Example for signing requests within an xApp.
```
```APIDOC
Sign Requests (payloads) - Backend
- Example for signing requests from a backend service.
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/environments/browser-web3/cors-browser
A basic example for performing a simple sign request.
```APIDOC
Simple Sign Request
- A miscellaneous example for a straightforward sign request.
- Link: /js-ts-sdk/examples-user-stories/misc-todo
```
--------------------------------
### Xumm SDK Get Hook Hash
Source: https://docs.xaman.dev/~gitbook/pdf
Example of retrieving hook information using the Xumm SDK by providing a hook hash. This method is used to get details about a specific XRPL hook.
```JavaScript
const hookInfo = await Sdk.getHookHash('64hexchars');
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/environments/xapps-dapps/xappbuilder
A basic example for performing a simple sign request, likely for miscellaneous tasks.
```APIDOC
Simple Sign Request
- A straightforward example demonstrating a basic sign request operation.
```
--------------------------------
### Xumm SDK Authentication
Source: https://docs.xaman.dev/concepts
Handles user authorization and logout processes within the Xaman SDK.
```APIDOC
Xumm.authorize()
- Initiates the user authorization flow.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.logout()
- Logs the current user out.
- Returns: void
```
--------------------------------
### Unified Xumm Package Installation
Source: https://docs.xaman.dev/js-ts-sdk
Information on the deprecation of legacy Xumm SDK packages and the recommended installation of the unified 'xumm' package via npm for all backend and frontend interactions.
```npm
npm install xumm
```
--------------------------------
### Xumm SDK Push Notifications
Source: https://docs.xaman.dev/concepts
Manages sending push notifications via the Xaman platform.
```APIDOC
Xumm.push.event( ... )
- Sends an event-based push notification.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.push.notification( ... )
- Sends a general push notification.
- Parameters: (details not provided in source)
- Returns: void
```
--------------------------------
### Xumm SDK Examples: Signing Requests
Source: https://docs.xaman.dev/concepts/payloads-sign-requests/workflow
Examples demonstrating how to sign requests using the Xumm SDK in different environments.
```APIDOC
Sign Requests (payloads)
- Browser: Example for signing requests from a web browser.
- xApp: Example for signing requests within an Xumm XApp.
- Backend: Example for signing requests from a server-side application.
Verify Payload signature
- Demonstrates how to verify the signature of a payload.
Simple Sign Request
- A basic example of initiating a sign request.
```
--------------------------------
### Initialize and Use Xumm SDK
Source: https://docs.xaman.dev/environments/backend-sdk-api
Demonstrates initializing the Xumm SDK with API keys, pinging the service to check connectivity, and creating a 'SignIn' transaction payload. This functionality requires the 'xumm' package to be installed.
```typescript
import { Xumm } from "xumm";
const xumm = new Xumm("some-api-key", "some-secret-key");
(async () => {
console.log("pong", await xumm.ping());
const transaction = { TransactionType: 'SignIn' };
console.log("payload", await xumm.payload?.create(transaction))
})()
```
```javascript
const { Xumm } = require('xumm')
const xumm = new Xumm('apikey', 'apisecret')
xumm.ping().then(pong => console.log(pong))
const transaction = { TransactionType: "SignIn" }
xumm.payload?.create(transaction).then(payload => console.log(payload))
```
--------------------------------
### Xumm SDK User Object
Source: https://docs.xaman.dev/concepts
Provides access to user-specific functionalities within the Xaman SDK.
```APIDOC
Xumm.user { ... }
- Namespace for user-related operations.
```
--------------------------------
### Xumm Core Methods
Source: https://docs.xaman.dev/js-ts-sdk/sdk-syntax/xumm.userstore/get
Core methods for initializing and managing the Xumm SDK instance, including pinging the server, subscribing to events, and unsubscribing.
```APIDOC
Xumm.ping()
- Checks the connection status to the Xumm API.
- Returns: A Promise resolving to a boolean indicating success or failure.
Xumm.on(event, fn)
- Subscribes to a specific Xumm event.
- Parameters:
- event: The name of the event to listen for (e.g., 'payload').
- fn: The callback function to execute when the event is triggered.
- Returns: void
Xumm.off(event, fn)
- Unsubscribes from a specific Xumm event.
- Parameters:
- event: The name of the event to unsubscribe from.
- fn: The specific callback function to remove.
- Returns: void
```
--------------------------------
### Sign Request Payload Examples
Source: https://docs.xaman.dev/environments/xapps-dapps/xappbuilder
Illustrates how to sign requests using payloads in different environments: Browser, xApp, and Backend.
```APIDOC
Sign Requests (payloads)
- Browser: Example for signing requests in a web browser environment.
- xApp: Example for signing requests within an xApp.
- Backend: Example for signing requests from a backend service.
```
--------------------------------
### Xumm SDK Core Methods
Source: https://docs.xaman.dev/environments/xapps-dapps/style-guide
Provides an overview of fundamental Xumm SDK methods for initialization, event handling, and authorization.
```APIDOC
Xumm.ping()
- Checks if the Xumm SDK is connected and responsive.
- Returns: A promise that resolves if the SDK is available.
```
```APIDOC
Xumm.on(event, fn)
- Registers a callback function for a specific SDK event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'error').
- fn: The callback function to execute when the event occurs.
- Returns: void
```
```APIDOC
Xumm.off(event, fn)
- Removes a previously registered event listener.
- Parameters:
- event: The name of the event to stop listening to.
- fn: The specific callback function to remove.
- Returns: void
```
```APIDOC
Xumm.authorize()
- Initiates the authorization flow for the user.
- Returns: A promise resolving with authorization details.
```
```APIDOC
Xumm.logout()
- Logs the user out of the Xumm application.
- Returns: void
```
--------------------------------
### Xumm Userstore get() Method
Source: https://docs.xaman.dev/js-ts-sdk/sdk-syntax/xumm.userstore/get
Retrieves a user-specific key/value record from the Xumm userstore. The userstore allows persistent storage of data associated with a user's JWT. The `get` method returns a promise that resolves with the stored object.
```javascript
xumm.userstore.get(key)
- Retrieves a userstore value (object) by key.
- The userstore allows persistent storage of key/value records specific to an application and the user for which the JWT was issued.
- The `get` method returns a promise that resolves with the object stored for the given key.
- Example Usage:
xumm.userstore.get('userdetails').then(storedObject => { /* handle stored object */ });
```
--------------------------------
### Xumm SDK Browser Integration Example
Source: https://docs.xaman.dev/environments
Demonstrates integrating the Xumm SDK into a web page for user authentication and session management. It includes script inclusion from a CDN, SDK initialization, event handling for user login/logout, and updating the UI with the user's XRP Ledger account address. Requires an API key for initialization.
```html
...
```
--------------------------------
### Xumm SDK User Store
Source: https://docs.xaman.dev/concepts
Manages persistent storage for user-specific data within the Xaman SDK.
```APIDOC
Xumm.userstore.list()
- Lists all stored user data keys.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.userstore.get( ... )
- Retrieves a specific piece of user data.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.userstore.delete( ... )
- Deletes a specific piece of user data.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.userstore.set( ... , { ... } )
- Stores or updates a piece of user data.
- Parameters:
- Key for the data.
- Value to store.
- Returns: void
```
--------------------------------
### Xumm Payment Request URL Examples
Source: https://docs.xaman.dev/~gitbook/pdf
Examples of constructing URLs for initiating payment requests via Xumm, including variations for specific networks and asset types, and fallback mechanisms for non-Xumm users.
```APIDOC
https://xaman.app/detect/request?to=rwietse...&amount=2¤cy=XAH
https://xaman.app/detect/request?to=rwietse...&amount=2¤cy=USD&issuer=rvY...&custom_network=xahau
xrpl://request?to=rwietse...&amount=2¤cy=XAH
```
--------------------------------
### Xumm SDK Payload Management
Source: https://docs.xaman.dev/concepts
Handles the creation, subscription, and retrieval of Xaman payloads for transaction signing.
```APIDOC
Xumm.payload.create( ... )
- Creates a new payload for signing a transaction.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.createAndSubscribe( ... )
- Creates a payload and subscribes to its status updates.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.cancel( ... )
- Cancels an existing payload.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.subscribe( ... )
- Subscribes to the status updates of an existing payload.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.payload.get( ... )
- Retrieves the details of a specific payload.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
--------------------------------
### Xumm Environment and Runtime
Source: https://docs.xaman.dev/environments/xapps-dapps/requirements
Provides information about the current SDK environment and runtime context.
```APIDOC
Xumm.environment
- An object containing environment-specific configuration and information.
```
```APIDOC
Xumm.runtime
- An object providing details about the current runtime context (e.g., browser, xApp).
```
--------------------------------
### Xumm Environment Configuration
Source: https://docs.xaman.dev/simple-link-qr
Provides access to information about the current Xumm environment.
```APIDOC
Xumm.environment
- Accesses properties related to the SDK's runtime environment.
```
--------------------------------
### Xumm Core SDK Methods
Source: https://docs.xaman.dev/simple-link-qr
Provides access to fundamental Xumm SDK operations including ping, event subscription, and unsubscription.
```APIDOC
Xumm.ping()
- Checks the connection status to the Xumm API.
- Returns: A promise that resolves if the connection is successful.
```
```APIDOC
Xumm.on(event, fn)
- Subscribes to a specific Xumm event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'error').
- fn: The callback function to execute when the event is triggered.
- Returns: void
```
```APIDOC
Xumm.off(event, fn)
- Unsubscribes from a specific Xumm event.
- Parameters:
- event: The name of the event to unsubscribe from.
- fn: The specific callback function to remove.
- Returns: void
```
--------------------------------
### XRPL Protocol Handler for Payment Requests
Source: https://docs.xaman.dev/simple-link-qr
A universal protocol handler that can be used by any XRPL-supporting application. It does not provide a fallback webpage if no supporting app is installed.
```URL
xrpl://rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ?amount=2&network=XRPL&dt=123&issuer=rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De¤cy=524C555344000000000000000000000000000000&invoiceid=0CAFEBABE000DEADBEEF000CAFEBABE000DEADBEEF000CAFEBABE000DEADBEEF
```
--------------------------------
### XRPL Protocol Handler for Payment Requests
Source: https://docs.xaman.dev/simple-link-qr/payment-request-link
A universal protocol handler that can be used by any XRPL-supporting application. It does not provide a fallback webpage if no supporting app is installed.
```URL
xrpl://rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ?amount=2&network=XRPL&dt=123&issuer=rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De¤cy=524C555344000000000000000000000000000000&invoiceid=0CAFEBABE000DEADBEEF000CAFEBABE000DEADBEEF000CAFEBABE000DEADBEEF
```
--------------------------------
### Xumm Core SDK Methods
Source: https://docs.xaman.dev/concepts/implementation-checklist
Core methods for interacting with the Xumm SDK, including ping, event listeners, and authorization.
```APIDOC
Xumm.ping()
- Checks if the Xumm API is reachable.
- Returns: A promise that resolves if the API is available.
Xumm.on(event, fn)
- Registers a callback function for a specific SDK event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'disconnect').
- fn: The callback function to execute when the event occurs.
- Returns: void
Xumm.off(event, fn)
- Removes a previously registered event listener.
- Parameters:
- event: The name of the event to stop listening to.
- fn: The specific callback function to remove.
- Returns: void
Xumm.authorize()
- Initiates the authorization flow for the user.
- Returns: A promise resolving with authorization details.
Xumm.logout()
- Logs the user out of the Xumm session.
- Returns: void
```
--------------------------------
### Xumm SDK Helpers
Source: https://docs.xaman.dev/concepts
Access utility functions for various data retrieval and processing tasks, such as fetching exchange rates, NFT details, and KYC status.
```APIDOC
Xumm.helpers.ping()
- Alias for Xumm.ping().
- Returns: A promise that resolves if the service is reachable.
```
```APIDOC
Xumm.helpers.getRates( ... )
- Retrieves currency exchange rates.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getRails()
- Fetches information about supported payment rails.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getHookHash( ... )
- Retrieves a specific hook hash.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getHookHashes()
- Retrieves all available hook hashes.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getCuratedAssets()
- Fetches a list of curated assets.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getNftokenDetail( ... )
- Retrieves detailed information for a specific NFT.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getKycStatus( ... )
- Checks the KYC status for a given account.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.verifyUserTokens([ ... ])
- Verifies a list of user tokens.
- Parameters:
- Array of user tokens.
- Returns: (details not provided in source)
```
```APIDOC
Xumm.helpers.getTransaction( ... )
- Retrieves details for a specific XRP Ledger transaction.
- Parameters: (details not provided in source)
- Returns: (details not provided in source)
```
--------------------------------
### Initialize Xumm SDK
Source: https://docs.xaman.dev/~gitbook/pdf
Demonstrates how to create a new Xumm SDK instance using your Xumm API key and xApp token.
```javascript
const xumm = new Xumm(apiKey, xAppToken)
```
--------------------------------
### Xumm Backend Store Management
Source: https://docs.xaman.dev/concepts/payloads-sign-requests/delivery/desktop-browser
APIs for managing data stored on the backend, accessible by the Xumm application. Includes methods to get, set, and delete data from the backend store.
```APIDOC
Xumm.backendstore.get()
- Retrieves data from the backend store.
- Returns: A promise resolving to the stored data.
Xumm.backendstore.set(data: object)
- Stores or updates data in the backend store.
- Parameters:
- data: The data object to store.
- Returns: A promise indicating the success of the operation.
Xumm.backendstore.delete()
- Deletes data from the backend store.
- Returns: A promise indicating the success of the deletion.
```
--------------------------------
### Xumm SDK XApp Interface
Source: https://docs.xaman.dev/concepts
Provides methods for XApps to interact with the Xaman mobile application, including opening sign requests, scanning QR codes, and managing navigation.
```APIDOC
Xumm.xapp.ready()
- Signals that the XApp is ready to interact.
- Returns: void
```
```APIDOC
Xumm.xapp.openSignRequest({ ... })
- Opens a sign request within the Xaman app.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.selectDestination({ ... })
- Allows the user to select a destination within the Xaman app.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.scanQr()
- Opens the Xaman app's QR code scanner.
- Returns: A promise resolving with the scanned data.
```
```APIDOC
Xumm.xapp.tx({ ... })
- Handles transaction-related operations within an XApp context.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.close({ ... })
- Closes the current XApp view.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.share({ ... })
- Shares content from the XApp.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.navigate({ ... })
- Navigates to a different view or URL within the Xaman app.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.openBrowser({ ... })
- Opens an external URL in the Xaman app's in-app browser.
- Parameters: (details not provided in source)
- Returns: void
```
```APIDOC
Xumm.xapp.on(xAppEvent, fn)
- Subscribes to XApp-specific events.
- Parameters:
- xAppEvent: The name of the XApp event.
- fn: The callback function.
- Returns: void
```
```APIDOC
Xumm.xapp.off(xAppEvent, fn)
- Unsubscribes from XApp-specific events.
- Parameters:
- xAppEvent: The name of the XApp event.
- fn: The callback function to remove.
- Returns: void
```
--------------------------------
### Xumm Runtime Module
Source: https://docs.xaman.dev/concepts/implementation-checklist
Provides information about the Xumm runtime environment.
```APIDOC
Xumm.runtime
- Accesses runtime-specific information.
```
--------------------------------
### Validate Xumm JWT with Node.js
Source: https://docs.xaman.dev/~gitbook/pdf
Provides a Node.js example for validating a Xumm JWT using the 'jsonwebtoken' package and your Xumm API secret. It includes steps for installation, verification, and an optional check for the client_id for enhanced security.
```javascript
const jwt = require('jsonwebtoken')
const apiKey = '' // Your Xumm API key here
const apiSecret = '' // Your Xumm API secret (BACKEND ONLY!)
const bearer = await xumm.environment.bearer
try {
// If decoded comes back as an object, the JWT is valid.
// Otherwise, the catch block is activated
const decoded = jwt.verify(bearer, apiSecret);
// For extra security, check if the decoded JWT contains
// the client_id of your xApp, e.g. the API Key from the developer console
if(decoded.client_id === apiKey) {
// JWT is valid and signed for this client (client_id matched)
} else {
// Valid JWT, but for another client? There's something
// wrong with an otherwise valid JWT.
}
} catch (error) {
// Handle your error here and inform the user that their access is denied.
}
```
--------------------------------
### Xaman Payment Request URL (Native Asset)
Source: https://docs.xaman.dev/simple-link-qr
A direct payment link for Xaman users to pay the native asset on a specified network. If Xaman is not installed, it falls back to a web page with payment details and download links.
```URL
https://xaman.app/detect/request:rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ?amount=2&network=XAHAU
```
--------------------------------
### Xaman Payment Request URL (Native Asset)
Source: https://docs.xaman.dev/simple-link-qr/payment-request-link
A direct payment link for Xaman users to pay the native asset on a specified network. If Xaman is not installed, it falls back to a web page with payment details and download links.
```URL
https://xaman.app/detect/request:rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ?amount=2&network=XAHAU
```
--------------------------------
### Xumm Environment Module
Source: https://docs.xaman.dev/environments/browser-web3
Provides information about the current runtime environment and SDK configuration.
```APIDOC
Xumm.environment { … }
- Accesses environment-specific properties and methods.
```
--------------------------------
### Sign Request Examples
Source: https://docs.xaman.dev/environments/native-apps
Illustrates how to sign requests in different environments.
```APIDOC
Sign Requests (payloads) - Browser
- Example for signing requests in a browser environment.
```
```APIDOC
Sign Requests (payloads) - xApp
- Example for signing requests within an xApp.
```
```APIDOC
Sign Requests (payloads) - Backend
- Example for signing requests from a backend service.
```
```APIDOC
Verify Payload signature
- Documentation on how to verify the signature of a payload.
```
```APIDOC
Simple Sign Request
- A basic example of initiating a sign request.
```
--------------------------------
### Get Exchange Rates vs XRP
Source: https://docs.xaman.dev/~gitbook/pdf
Retrieves aggregated exchange rates for various fiat and crypto assets against XRP. The data is sourced from multiple providers. The example response shows rates for USD and XRP, along with metadata for the currency.
```JavaScript
const rate = await Sdk.getRates('BTC');
```
--------------------------------
### Xumm Runtime Information
Source: https://docs.xaman.dev/simple-link-qr
Provides access to information about the runtime environment of the Xumm SDK.
```APIDOC
Xumm.runtime
- Accesses properties related to the SDK's runtime environment.
```
--------------------------------
### Create Simple Sign Request (Backend)
Source: https://docs.xaman.dev/js-ts-sdk/examples-user-stories/misc-todo
This snippet shows how to initialize the Xumm SDK, ping the service to get application details, and then create a basic sign request payload. It's designed for backend environments using Node.js.
```typescript
import { Xumm } from "xumm"
const Sdk = new Xumm(process.env.XUMM_KEY, process.env.XUMM_SECRET)
const pong = await Sdk?.ping()
const payload = await Sdk.payload?.create({
custom_meta: {
instruction: "Sign request from " + pong?.application.name,
},
txjson: {
TransactionType: "SignIn",
},
})
console.log(payload)
```
```javascript
const { Xumm } = require("xumm")
const Sdk = new Xumm(process.env.XUMM_KEY, process.env.XUMM_SECRET)
const pong = await Sdk?.ping()
const payload = await Sdk.payload?.create({
custom_meta: {
instruction: "Sign request from " + pong?.application.name,
},
txjson: {
TransactionType: "SignIn",
},
})
console.log(payload)
```
--------------------------------
### Xumm Environment Module
Source: https://docs.xaman.dev/concepts/implementation-checklist
Provides information about the current Xumm runtime environment.
```APIDOC
Xumm.environment
- Accesses information about the SDK's operating environment.
```
--------------------------------
### Verify Payload Signature Example
Source: https://docs.xaman.dev/environments/browser-web3/cors-browser
Example demonstrating how to verify the signature of a payload.
```APIDOC
Verify Payload Signature
- Example for verifying an OAuth2 signature of a payload.
- Link: /js-ts-sdk/examples-user-stories/verify-oauth2-signature
```
--------------------------------
### Xumm xApp: Select Destination Account Example
Source: https://docs.xaman.dev/~gitbook/pdf
Demonstrates how to initialize the Xumm SDK, embed it in an HTML page, and use the `xumm.xapp.selectDestination()` method to allow users to pick an account. It also shows how to handle the 'destination' event to receive the selected account details.
```html
...
```
--------------------------------
### Xumm SDK Core Methods
Source: https://docs.xaman.dev/environments/xapps-dapps/xappbuilder
Provides essential methods for interacting with the Xumm platform, including pinging the service, subscribing to and unsubscribing from events, and accessing helper modules.
```APIDOC
Xumm.ping()
- Checks the connection status to the Xumm API.
- Returns: A promise that resolves if the service is reachable.
Xumm.on(event, fn)
- Subscribes a callback function to a specific event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'disconnect').
- fn: The callback function to execute when the event is triggered.
- Returns: void
Xumm.off(event, fn)
- Unsubscribes a callback function from a specific event.
- Parameters:
- event: The name of the event to unsubscribe from.
- fn: The specific callback function to remove.
- Returns: void
Xumm.helpers { ... }
- Accesses a collection of utility functions for various data retrieval and processing tasks.
```
--------------------------------
### Verify Payload Signature Example
Source: https://docs.xaman.dev/concepts/implementation-checklist
Example code for verifying the signature of a payload.
```javascript
// Example for verifying signature
// const signatureData = { ... };
// const isValid = Xumm.verifySignature(signatureData);
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/concepts/special-transaction-types
A basic example for performing a simple sign request.
```APIDOC
Simple Sign Request
- A straightforward example of initiating a sign request.
```
--------------------------------
### Xumm Core SDK Methods
Source: https://docs.xaman.dev/environments
Provides access to fundamental Xumm SDK functionalities including checking service status, subscribing to and unsubscribing from events, and accessing helper utilities.
```APIDOC
Xumm.ping()
- Checks if the Xumm service is available.
- Returns: A promise that resolves if the service is reachable.
```
```APIDOC
Xumm.on(event, fn)
- Subscribes a callback function to a specific SDK event.
- Parameters:
- event: The name of the event to listen for (e.g., 'message', 'error').
- fn: The callback function to execute when the event is triggered.
- Returns: void
```
```APIDOC
Xumm.off(event, fn)
- Unsubscribes a callback function from a specific SDK event.
- Parameters:
- event: The name of the event to unsubscribe from.
- fn: The specific callback function to remove.
- Returns: void
```
--------------------------------
### Simple Sign Request Example
Source: https://docs.xaman.dev/concepts/payloads-sign-requests/status-updates
A basic example for performing a simple sign request.
```APIDOC
Simple Sign Request
- A straightforward example for initiating a sign request.
- Link: /js-ts-sdk/examples-user-stories/misc-todo
```
--------------------------------
### Verify Payload Signature Example
Source: https://docs.xaman.dev/concepts/special-transaction-types
Example demonstrating how to verify a payload signature using OAuth2.
```APIDOC
Verify OAuth2 Signature
- Example for verifying the signature of a payload using OAuth2.
```
--------------------------------
### Xumm Environment Module
Source: https://docs.xaman.dev/environments
Provides information about the current runtime environment and SDK configuration.
```APIDOC
Xumm.environment { … }
- Accesses environment-specific properties and methods.
```
--------------------------------
### Xumm SDK Core Methods
Source: https://docs.xaman.dev/js-ts-sdk/sdk-syntax/xumm.xapp/selectdestination
Provides an overview of fundamental Xumm SDK methods for initialization, event handling, and basic operations.
```APIDOC
Xumm.ping()
- Checks if the Xumm API is reachable.
- Returns: A promise that resolves to a boolean indicating connectivity.
Xumm.on(event, fn)
- Registers a callback function for a specific SDK event.
- Parameters:
- event: The name of the event to listen for (e.g., 'connect', 'error').
- fn: The callback function to execute when the event occurs.
- Returns: void
Xumm.off(event, fn)
- Deregisters a previously registered event listener.
- Parameters:
- event: The name of the event to stop listening to.
- fn: The specific callback function to remove.
- Returns: void
```
--------------------------------
### Sign Request Payload Examples
Source: https://docs.xaman.dev/environments/browser-web3/cors-browser
Examples demonstrating how to sign requests using payloads in different environments.
```APIDOC
Sign Request (Browser)
- Example for signing requests from a web browser environment.
- Link: /js-ts-sdk/examples-user-stories/sign-requests-payloads/browser
```
```APIDOC
Sign Request (xApp)
- Example for signing requests initiated from within an Xumm XApp.
- Link: /js-ts-sdk/examples-user-stories/sign-requests-payloads/xapp
```
```APIDOC
Sign Request (Backend)
- Example for signing requests from a backend server context.
- Link: /js-ts-sdk/examples-user-stories/sign-requests-payloads/backend
```
--------------------------------
### Sign Request Payload Examples
Source: https://docs.xaman.dev/concepts/special-transaction-types
Examples demonstrating how to sign requests using payloads in different environments.
```APIDOC
Browser Sign Request Payload
- Example for signing requests in a browser environment.
```
```APIDOC
xApp Sign Request Payload
- Example for signing requests within an xApp.
```
```APIDOC
Backend Sign Request Payload
- Example for signing requests from a backend service.
```
--------------------------------
### Xumm xApp Interactions
Source: https://docs.xaman.dev/simple-link-qr
Methods for interacting with the Xumm xApp environment, enabling rich user experiences within the Xumm app.
```APIDOC
Xumm.xapp
- Accesses methods for xApp functionality.
```
```APIDOC
Xumm.xapp.ready()
- Signals that the xApp is ready to receive events.
- Returns: void
```
```APIDOC
Xumm.xapp.openSignRequest(options: object)
- Opens a sign request within the xApp context.
- Parameters:
- options: Configuration object for opening the sign request.
- Returns: void
```
```APIDOC
Xumm.xapp.selectDestination(options: object)
- Allows the user to select a destination within the xApp.
- Parameters:
- options: Configuration object for destination selection.
- Returns: void
```
```APIDOC
Xumm.xapp.scanQr()
- Opens the QR code scanner within the xApp.
- Returns: void
```
```APIDOC
Xumm.xapp.tx(options: object)
- Handles transaction-related operations within the xApp.
- Parameters:
- options: Transaction-specific options.
- Returns: void
```
```APIDOC
Xumm.xapp.close(options: object)
- Closes the current xApp view.
- Parameters:
- options: Options for closing the xApp.
- Returns: void
```
```APIDOC
Xumm.xapp.share(options: object)
- Shares content from the xApp.
- Parameters:
- options: Content to share.
- Returns: void
```
```APIDOC
Xumm.xapp.navigate(options: object)
- Navigates to a different view or URL within the xApp.
- Parameters:
- options: Navigation details.
- Returns: void
```
```APIDOC
Xumm.xapp.openBrowser(options: object)
- Opens an external browser from within the xApp.
- Parameters:
- options: URL and configuration for the browser.
- Returns: void
```
```APIDOC
Xumm.xapp.on(xAppEvent, fn)
- Subscribes to xApp-specific events.
- Parameters:
- xAppEvent: The name of the xApp event.
- fn: The callback function.
- Returns: void
```
```APIDOC
Xumm.xapp.off(xAppEvent, fn)
- Unsubscribes from xApp-specific events.
- Parameters:
- xAppEvent: The name of the xApp event.
- fn: The callback function to remove.
- Returns: void
```
--------------------------------
### Xumm SDK Core Methods
Source: https://docs.xaman.dev/js-ts-sdk/examples-user-stories
Documentation for core methods of the Xumm SDK, including ping, event listeners, authorization, and logout.
```APIDOC
Xumm.ping()
- Checks if the Xumm SDK is connected and responsive.
- Parameters: None
- Returns: Promise indicating connection status.
Xumm.on(event, fn)
- Registers an event listener for SDK events.
- Parameters:
- event: The name of the event to listen for (e.g., 'session_start', 'session_end').
- fn: The callback function to execute when the event is triggered.
- Returns: void
Xumm.off(event, fn)
- Removes an event listener.
- Parameters:
- event: The name of the event to stop listening to.
- fn: The specific callback function to remove.
- Returns: void
Xumm.authorize()
- Initiates the authorization flow for the user.
- Parameters: None
- Returns: Promise