All pages
Powered by GitBook
1 of 20

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Payloads (sign requests)

Xumm Payloads: creating, delivering, and utilizing incomplete XRP Ledger transactions as a Sign Request to end users.

The difference between XRP Ledger Transaction JSON and a Xumm Payload is that the XRP Ledger JSON needs to be complete and signed locally, while a Xumm Payload can contain an incomplete transaction.

The incomplete transaction, referred to as a Transaction Template, can be delivered to Xumm users allowing end users to view the Payload in the form of a "Sign Request": a transaction to sign and submit, or reject.

Xumm will then add the missing fields like the signer account, network Fee, Account Sequence, based on the context the user provides.

Xumm Payloads use the exact same syntax as the XRP Ledger JSON transaction format.

To easily test a payload, you can enter the Transaction JSON template on this page and try to create a payload:

Your application crafts the XRPL transaction template. The difference between a regular XRPL JSON transaction and a Xumm transaction template is that you can leave out some fields (or leave them blank) as the Xumm app on the device of the end user will fill them automatically.

Your application backend will send the transaction template to the Xumm API / SDK. Your application will receive a unique Payload ID that contains your Sign Request.

Typical fields Xumm provides:

  • Fee will be automatically filled with the appropriate network fee, but when set in the Payload, Xumm will respect your provided fee.

  • Sequence will be automatically filled with the Account sequence of the account interacting with your payload.

  • Account will be automatically filled with the account interacting with your payload.

Secure Payment Verification

Once a payment has been sent and the payload resolved on Xumm, some checks are performed to ensure secure payment verification. This document walks you through verifying a payment transaction on Xumm.

Payload Completion and Verification

After a payload completes its lifecycle, which includes creation, user interaction, transaction signing, and transaction submission to the XRP Ledger by Xumm, your application will receive (if configured) a Webhook callback.

This callback should trigger your application to fetch the payload results. It is highly advisable to fetch the payload results again on your "thank you" or "return" page in case you did not persist the payload results after receiving a Webhook.

Verifying Payment Transactions

Here are the steps to verify that you have indeed received a payment:

  1. Check Payload Output: Verify if the Payload output contains meta.resolved. This value should be true. Otherwise, the payload is still pending or has been abandoned by the user. Also, check if the Payload output contains meta.signed. This value should be true, indicating that the user signed the transaction.

  2. Check Response Dispatched Node Type: Verify the response.dispatched_nodetype value. If you are expecting a real payment, this value should contain MAINNET

Fetching Transaction Details

You can fetch transaction details using the XRPL Transaction Data fetcher or the JSON RPC (HTTP POST) method at .

Utilizing (flow+code) the xrpl-txdata Package (JS/TS) for Transaction Verification

After sending a Sign Request () to Xumm, you receive a response with the signed transaction hash (: payloadResponse.txid, : txid).

You're in luck if you immediately check this transaction hash on the XRP Ledger, and it's already in a validated ledger. However, if the transaction hasn't been included in a closed ledger, you might encounter a "Not Found" error, while if you had checked a few seconds later, you'd have found the transaction.

To streamline this process, use the xrpl-txdata NPM package (JS/TS). This package simplifies:

  1. Establishing a redundant (multi-node, failover) and reliable (auto-timeout, auto-retry) connection to the XRP Ledger

  2. Fetching a transaction by hash

  3. Optionally, monitoring the XRP Ledger (all closed ledgers, all the transactions in those ledgers) and waiting for a specified time (seconds).

Once your transaction is found, the package returns the transaction outcome and validated balance changes.

Here's how to use it in JavaScript:

Good Practice: Cross-verify with the XRPL

It is always a good practice to cross-verify with the XRPL for absolute certainty. Using the tx method, you can fetch transaction details directly from the XRPL ledger.

More information on how to do this can be found in the .

https://xumm.dev/signing-tool
.
If it doesn't, you might be accepting a TESTNET payment
!
  • Check Transaction ID: The response.txid value is the on-ledger transaction hash. You must verify this transaction on the ledger. Note that it may take around 4 seconds for a ledger to close and slightly longer for the ledger and transaction info to propagate. You may want to repeat async/delay fetching this info if you don't get a result at first or if your result contains a validated: false value.

  • ⚠️ Check Delivered Amount: After fetching the transaction details, check the meta.delivered_amount value to see if the amount of XRP (in drops, one million drops = one XRP) equals the expected amount to be paid. This is a crucial step in the verification process.

  • https://xrplcluster.com
    payload
    Webhook
    WebSocket
    XRPL Transaction Documentation

    Workflow

    Xumm's workflow is designed to streamline the process of transaction signing and interaction with the XRP Ledger.

    Here's a step-by-step guide to understanding and implementing Xumm's workflow in your application:

    1. Create a Payload: Start by using Xumm's API to create a payload. A payload is essentially a transaction template containing all the details for the transaction you want the User to sign.

    2. Deliver the Payload to the User: Once the payload is created, you need to deliver it to the User for signing. Xumm offers multiple delivery options, including push notifications, QR codes, and deep links. Choose the method that best suits your application.

    3. User Interaction: The User will interact with the payload through the Xumm app. They have the option to either sign or reject the transaction.

    4. Retrieve the Result: After the User has interacted with the payload, your application needs to retrieve the result . This can be done by fetching the result from Xumm's API. The result will indicate whether the User signed or rejected the transaction.

    5. Interact with the XRP Ledger: If the User signed the transaction, your application can now interact with the XRP Ledger to finalize the transaction. This involves submitting the signed transaction to the XRP Ledger and handling any responses or confirmations.

    6. Provide Feedback to the User: Finally, provide appropriate Feedback based on the transaction's outcome. This could be a confirmation message for a successful transaction or an error message if something went wrong.

    By following these steps, you can effectively integrate Xumm's workflow into your application and leverage its features for secure and streamlined transactions on the XRP Ledger.

    const {TxData} = require('xrpl-txdata')
    
    const TxHash = '8F3CE0481EF31A1BE44AD7D744D286B0F440780CD0056951948F93A803D47F8B'
    
    const VerifyTx = new TxData([
      'wss://xrplcluster.com',
      'wss://xrpl.link',
      // Or:
      // 'wss://testnet.xrpl-labs.com'
    ], {
      OverallTimeoutMs: 6000,
      EndpointTimeoutMs: 1500,
      // If using testnet, see above:
      // AllowNoFullHistory: true
    })
    
    // Specify the transaction hash to verify and the # of seconds
    // to wait & monitor the XRPL if not found initially.
    VerifyTx.getOne(TxHash, 20)
      .then(tx => {
        console.log(`Got the TX, details:`, tx)
      })
    Status updates
    npm version
    GitHub Actions NodeJS status

    QR Scanning

    QR scanning is an engaging way to have users interact with payloads, especially in physical mediums. It is simple, quick, and versatile.

    Benefits of QR Scanning:

    • Use Cases: QR scanning is common in retail scenarios or multi-device interactions. It is perfect for physical interaction, Point-of-sale terminals, or when users interact across devices (desktop to mobile).

    • Multi-Device Scenarios: In cases like desktop to mobile, users can scan the QR code on the desktop screen with their mobile device. Typically, there's no need for a return URL as the desktop browser can pick up the results.

    • How It Works: Generate a QR code for the payload using Xumm. Users scan this QR code with the Xumm app to access and interact with the payload.

    User Perspective:

    For end users, QR scanning is intuitive and engaging. They scan the QR code with their mobile device and are immediately taken to the payload in the Xumm app. This method is particularly effective in retail environments or when users operate across multiple devices.

    Mobile (iOS/Android)

    Mobile payload delivery is essential for a seamless experience in mobile applications.

    Payload delivery from your native iOS / Android app happens through "Deep Links".

    Deep Linking allows your mobile app to communicate directly with the Xumm app, enabling users to interact with payloads effortlessly.

    For a detailed guide on implementing mobile payload delivery through Deep Linking, please refer to the Deep Linking page.

    Desktop browser

    For web applications accessed through desktop browsers, Xumm provides an optimized delivery method.

    This includes options like QR code scanning and deep linking, adapted for larger screens.

    • If you can't already identify the user, refer to the QR Scanning

    • If you have already identified the user and obtained a user_token, refer to the Push

    Signature verification

    Signature verification is crucial for ensuring the integrity and authenticity of the data received. It involves verifying that the data was sent by Xumm and has not been tampered with.

    If you want to make sure a WebHook received by your platform has been sent by the Xumm platform, verify the signature the platform sends in an HTTP header.

    Every WebHook call contains a signature to verify the authenticity. It sends an HMAC using your application secret as a key. Sample verification in NodeJS:

    import crypto from 'crypto'
    
    // Xumm App secret (Xumm developer console)
    const secret = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
    
    const timestamp = req.headers?.['x-xumm-request-timestamp'] || ''
    const json = req.body
    
    const hmac = crypto.createHmac('sha1', secret.replace('-', ''))
      .update(timestamp + JSON.stringify(json))
      .digest('hex')
    
    console.log(hmac, hmac === req.headers?.['x-xumm-request-signature'])

    Sample POS lifecycle

    API Call (polling)

    Polling, or repeated API calls, is a common method to fetch updates. However, in Xumm, it's not the recommended approach due to rate limits.

    Instead of polling, consider these efficient alternatives:

    • Webhooks: Once a payload is resolved, Xumm can send a WebHook to your platform, eliminating the need for constant polling. Learn more: Webhooks.

    • Websocket Subscription: Use Websocket to receive live status updates. Learn more: Websocket.

    Excessive polling can lead to your application being temporarily rate limited, disrupting your service. If your application has been rate limited, you will receive a notification email later the same day on the e-mail address entered in the application details in the .

    Payload Delivery

    Payload delivery in Xumm is a crucial step in the transaction lifecycle. It involves delivering the payload to the user for signing.

    What is a Payload?

    In Xumm, a payload is a sign request sent by applications or developers to users for interaction. Users review the payload and decide to reject or accept by signing.

    xApps

    xApps are custom applications that run within the Xumm environment. As a developer working with xApps, delivering payloads is crucial for a seamless user experience.

    Delivering Payloads within xApps

    Delivering payloads within xApps is about efficiency and user experience. Since the user is already engaged with your xApp inside Xumm, delivering the payload directly within the xApp streamlines the process. This minimizes context switching for the user and keeps them focused on the task at hand.

    Deep Linking

    Deep linking in Xumm enables developers to provide a seamless user experience by swiftly guiding users to interact with payloads.

    Deep Links are a well known flow to allow users to automatically launch and open another app in a specific state. Xumm allows for a Deep Link workflow, where your application (browser based or native) can trigger Xumm to open and immediately show your sign request.

    Benefits of Deep Linking:

    • When to Use: Opt for deep linking when you want to minimize user steps and create a fluid transition between your app and Xumm.

    Tx Explorer(s)

    To easily link to transaction explorers, you can link to the Xumm explorer launchpad and allow users to pick their preferred explorer.

    Don't keep a list of explorer links youself: you can easily rely on our explorer launchpad URL.

    When using TX Hash

    The network param can be mainnet, xahau and any other key from the rails endpoint

    Status updates

    Xumm's Payload status updates bridge the gap between your application and the end user by providing real-time feedback on payload interactions.

    Overview

    When users interact with payloads, Xumm provides real-time status updates and results (e.g., rejected, signed with signature). These updates allow you to make your application user interface reflect the status of the interaction with the user, and return sign request results to your application.

    Delivery Methods

    Xumm offers various payload delivery methods:

    • Deep Linking: Open the Xumm app with the payload already loaded.

    • QR Code Scanning: Users scan a QR code to access the payload.

    • Push Notifications: Send payloads as push notifications.

    Status Updates

    After delivering a payload, tracking its status is vital to know whether the user has interacted with it. Xumm provides mechanisms for obtaining notifications and results of payload interactions. You can learn more about this in the Status updates section.

    Moving Forward

    Now that you have an overview of what payload delivery entails in Xumm, you can delve into the specifics of each delivery method.

  • Device Compatibility: Deep linking works when the origin (your app or browser) and Xumm are on the same device (iOS/Android).

  • Link Creation: Generate a deep link that opens Xumm with the payload ready for interaction, making interactions more seamless while keeping users engaged.

  • Return URL: Set a return URL in the payload to redirect users back to your app or browser post-interaction, maintaining a smooth flow.

  • Note for Web Origins:

    For web origins, users return to the default browser, not necessarily the original tab. In order to make this smooth, handle session restoration to ensure continuity.

    User Perspective:

    For end users, deep linking is a breeze. They tap a link, interact with the payload in Xumm, and return to your app effortlessly.

    Real-Time Status Updates
    • Keep track of user interactions with the payload.

    • Update the UI to reflect statuses like "opened" or "signed".

    • They provide status but not the final resolved data (for security reasons, resolved data like signatures can only be separately fetched from the Xumm platform).

    Websocket Usage

    • Receive real-time updates in your front-end and back-end.

    • Frontend: Keep the user informed about the status.

    • Backend: Determine when you can fetch final results.

    • This ensures responsiveness and keeps the end-user informed.

    Fetching End Results

    • Webhook: Once the payload is resolved, a Webhook can be sent to your platform for backend processing. For more on WebHooks, see Webhooks.

    • API/SDK: Alternatively, fetch the payload end results using the Xumm API or SDK https://github.com/XRPL-Labs/Developer-Help-Center/blob/main/js-ts-sdk/sdk-syntax/xumm.payload for more control and flexibility.

    Status Updates for End users

    Understanding the end user's workflow/experience is vital. The real-time status updates and Webhooks are not just technical tools but communication channels between your application and the user.

    By effectively using these features, you ensure an engaging and informed experience for the user.

    Xumm Developer Console
    - also available in our SDK:

    When using CTID

    CTID is a more efficient way to link to transactions, as they contain the ledger index, transaction index in that ledger and the NetworkID.

    More info: https://xrpl.org/ctid.html

    https://xumm.app/explorer/{network}/{txhash}
    https://xumm.app/explorer/{ctid}
    https://xumm.app/api/v1/platform/rails
    getRails()
    How to Deliver Payloads within xApps
    1. Create a Payload: First, you need to create a payload with the transaction details. This payload is essentially a sign request you want the user to interact with. See:Sign Requests (payloads)

    2. Use Xumm SDK: To deliver the payload within your xApp, use the Xumm SDK. The SDK provides functions allowing you to seamlessly integrate the payload within your xApp. See: openSignRequest({ … })

    3. Once integrated, the payload will be displayed to the user within your xApp. The user can then review and interact with the payload without leaving the xApp.

    4. Handle Status Updates: Implement logic to handle status updates. This includes whether the user signed or rejected the payload. Xumm SDK provides functions that allow you to receive status updates and take appropriate actions based on the user's response, see:

    Push

    Delivering Sign Requests using a push notification can be a very convenient way for end users to interact with your application: they don't even have to scan a QR code.

    xApps ("dApps") and Browser ("Web3") are signed in with user context, so payloads created in those environments will automatically be pushed to the signed-in user.

    This means if you're using the xApp / Browser (Web3) flow, you do not have to specify the user_token as the payloads created from the xApp / Browser (Web3) flow are automatically pushed to the signed-in user.

    If you are building a backend integration, the flow is slightly different.

    Backend

    If your application features user sign-in (to identify your user) and you obtained a user_token from a previously signed payload from this specific user, you can add the user_token to the next payload to deliver the payload through a push notification.

    The first interaction (to obtain the user_token) will always involve either: showing a QR code for the user to scan with the Xumm app or a deep link to the Xumm app to sign a payload.

    A payload containing a user token looks like this:

    After posting the payload the Xumm SDK/API, the response will confirm push notification delivery:

    User token expiration

    The issued user token expires 30 days after the last successfully signed payload of your application by the Xumm user using the same issued user token. If there's a good reason for your application to have longer living user tokens, please contact Xumm Support and explain your use case.

    Obtaining the `user_token`

    From a webhook

    After the end user resolves the sign request by signing, the configured application Webhook URL will receive a JSON body per POST request containing the accessToken section:

    From a resolved Payload

    When you get the payload results, the application.issued_user_token contains the user token.

    Webhooks

    Webhooks are HTTP callbacks that allow you to receive notifications when a Payload (Sign Request) has been resolved (rejected or signed).

    Webhooks are essential for asynchronous communication and can trigger specific actions in your application based on events in Xumm.

    If you entered a valid Webhook URL in your Application Settings at the Xumm Xumm Developer Console, your application would receive an HTTP POST containing a JSON body with limited details for the given payload.

    Please note a Webhook will not contain the entire payload: to get the entire payload, you should GET the payload using an SDK/API call.

    A sample webhook looks like this:

    If a user token (userToken.user_token) is issued and you plan on payload delivery using push notifications in the future, your application could/should store the token. See

    Use the payloadResponse.payload_uuidv4 to confirm and get payload outcome using an SDK/API call.

    Expected result / retry

    If your backend does not respond within 15 seconds, or responds with a non 200 HTTP status code, the Xumm platform will retry the webhook four more times (bringing the max. total attempts at five).

    The first retry will take place after 10 seconds. The next after 60 seconds. Then two more retries will take place at a 600 second (10 minute) interval.

    Safety

    If you want to make sure the Webhook your application received came from the Xumm platform, there are two things you can do:

    1. Send a GET for the payload to get the full payload using the SDK/API to the Xumm platform:

    2. Verify the signature we send in a HTTP Header when we deliver the Webhook: \

    Networks

    The Xumm API/SDK is designed to be network-independent, providing flexibility for developers and end users. This means that the end user determines the network on which transactions occur.

    However, a payload can include a forced network identifier to specify a particular network. When a user signs a payload, the result includes information about the network the user was on when signing, allowing developers to track and manage transactions across different networks.

    If your payload contains a NetworkID, it is only valid for the given network. Xumm will ask a user to switch to the given network (starting Xumm 2.6.0)

    Key Points:

    1. Network Independence: The Xumm API/SDK operates independently of the network, giving the end user the freedom to choose their preferred network in the Xumm app.

    2. Network Information in Results: The results of a signed payload include information about the network the user was on at the time of signing.

    3. Forced Network Identifier: A user can be on any network while signing. You must check for the expected result in the Payload results. Alternatively, you can include a forced network identifier in a payload to specify a particular network.

    Lifecycle

    Xumm's transaction lifecycle is a sequence of steps that ensures secure and efficient transaction processing on the XRP Ledger.

    Here's a comprehensive guide to understanding and implementing Xumm's transaction lifecycle:

    1. Transaction Template

    Start by composing the transaction you want to be signed in JSON format, as per the . You can include all except "Account" and "Sequence", which will be automatically filled by Xumm.

    Therefore, any JSON value you'd use to sign and send to an XRPL node can be sent to the Xumm SDK/API, with the (signing) account fields being added/filled being the only major difference.

    {
      "meta": {
        "url": "<your-webhook-endpoint>",
        "application_uuidv4": "<some-uuid>",
        "payload_uuidv4": "<some-uuid>",
        "opened_by_deeplink": true
      },
      "custom_meta": {
        "identifier": "some_identifier_1337",
        "blob": {},
        "instruction": "Hey ❤️ ..."
      },
      "payloadResponse": {
        "payload_uuidv4": "<some-uuid>",
        "reference_call_uuidv4": "<some-uuid>",
        "signed": true,
        "user_token": true,
        "return_url": {
          "app": "<your-url>",
          "web": "<your-url>"
        },
        "txid": "<some-tx-hash>"
      },
      "userToken": {
        "user_token": "<some-token>",
        "token_issued": 1635000000,
        "token_expiration": 1637500000
      }
    }

    Network Information in OTT Data: xApp OTT data also includes network information, providing additional resources for developers to manage transactions.

  • User Experience: The choice of the network result in loss of goods or funds: imagine getting paid on Testnet, while delivering actual sold goods expecting a mainnet payment. It's important to consider this in your application development process.

  • on(xAppEvent, fn)
    Push
    get( … )
    Signature verification
    All fields and values in the JSON transaction template sent to the Xumm SDK/API are passed on as-is, except for the following:
    1. Account: If this field is part of the transaction template, it will be completely ignored, as the Account will be automatically filled based on the account the end user uses to sign the transaction with in the Xumm app.

    2. Sequence: Based on the account used to sign by the end user in the Xumm app, the Sequence will be automatically filled by Xumm.

    3. LastLedgerSequence: If a valid ledger index is entered in the LastLedgerSequence field, it will be passed on unchanged to the Xumm app. However, if a value < 32570 is entered, the Xumm app will automatically calculate the {current ledger index} + the given amount of ledgers, where {current ledger index} is based on the most recent closed ledger index at the moment the end user taps the button to accept & sign the sign request.

    2. Payload Options

    Configure Payload Options: Configure the payload options to customize the transaction request. Refer to the Payload Options Documentation for detailed information on the available options.

    3. User Token (Optional)

    If you are using a backend flow, you can optionally include a user token. This token is specific to the user and can be used for personalized transactions.

    4. Submit the Payload

    Submit the payload to Xumm through the Xumm SDK or API. You can also use alternative language SDKs for this step. This initiates the transaction signing process.

    5. Handle Client Interaction

    The client, a mobile app, xApp, or desktop application, will interact with the payload. Implement logic to handle this interaction and guide the user through the signing process.

    6. Resolve the Transaction

    The user will either sign or reject the transaction. Your application should be ready to handle both outcomes and take appropriate action.

    7. Retrieve Payload Results

    After resolution, retrieve the payload results to understand the outcome of the transaction. You can use WebHooks, and WebSockets or verify through the SDK/API.

    8. On-Ledger Verification

    Finally, verify the transaction on the XRP Ledger. You can use libraries like xrpl-client or verify-xrpl-signature for on-ledger verification. Ensure to check for delivered_amount and other relevant fields.

    Understanding and implementing Xumm's transaction lifecycle is crucial for creating secure and efficient transactions on the XRP Ledger through the Xumm platform.

    XRPL transaction format specification at xrpl.org
    common fields
    CDNJS Browserified
    CDNJS Browserified Minified
    {
      "user_token": "c5bc4ccc-28fa-4080-b702-0d3aac97b993",
      "txjson": { ... }
    }
    {
      "uuid": "<some-uuid>",
      ...
      "pushed": true
    }
    {
      "meta": { ... },
      "payloadResponse": { ... },
      "userToken": {
        "user_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
        ...
      }
    }
    {
      "meta": { ... },
      "application": {
        "issued_user_token": "e5fff0d0-698d-425d-bdcf-3156e744282d",
        ...
      },
      ...
    }

    Payload Return URL

    After a user signs a payload, a user can return to a URL (your website / app).

    The Return URL (return_url) determines where the user is sent when the payload is signed. If none is given, the user will simply be displayed Close button in Xumm. Otherwise, the user will be presented a button which launches the Return URL.

    Warning! iOS and Android do not allow the user to return to the browser tab they came from (if your flow starts in a browser). Make sure you restore state based on the payload / session / custom identifier or custom metadata assigned to the payload.

    When a payload is created using the Xumm SDK in an xApp flow, the return URL is ignoded as the user will return to the xApp post signing, where an SDK event will be triggered.

    Replacement variables

    You can add the following replacement tags in your Return URL. They will be replaced with the appropriate values by Xumm.

    • {id} will be replaced with the xumm payload UUID.

    • {cid} will be replaced with the optional custom payload identifier.

    • {txid} will be replaced with the signed transaction hash.

    Routing / origin logic

    If both the app and web return URL values are present, and if they are identical, the XUMM platform will execute logic to see if the user is coming from a browser tab (local device or remote, e.g. desktop browser). If so, and if the origin browser window is still active, only the origin browser window will redirect, and the app won't. Else (if the browser window is not active anymore) XUMM will redirect to the return URL.

    This behaviour prevents a double redirect (both on mobile and on desktop / browser window).

    Sample payload body

    {txblob} will be replaced with the signed transaction HEX blob.

    {
      "txjson": {
        "TransactionType": "..."
      },
      "options": {
        "return_url": {
          "app": "https://...",
          "web": "https://..."
        }
      }
    }

    Websocket

    Websockets provide real-time payload updates

    All payloads get assigned a payload-specific Websocket URL. You can connect to this socket from the client side of your application to receive live status updates (if the user opens the payload on their device and the user resolves the payload).

    The pushed information contains minimal information; it is meant to trigger your application to fetch more information from your application's backend.

    If a payload doesn't exist, the Websocket connection will receive an {"message":"..."} update, and the socket will be closed. If the payload has expired, the connection will receive a {"expired":true"} message.

    If the payload exists and did not expire, the connection will start with a message containing the remaining seconds until expiration: {"expires_in_seconds":51}. This message will be sent every 15 seconds for keepalive reasons. If the connection is still active when the payload expires, a {"expired":true"} message will be sent. The connection will be kept alive, leaving it up to the client to disconnect.

    Expiration

    The expiration should be handled as an OPEN/SCAN BEFORE, not a RESOLVE BEFORE. If the end user opens the payload (from the push notification, deep link, or QR scanning) but it didn't resolve before expiration, they will not receive a notification and will still be able to resolve it as if the payload hadn't expired.

    When the user resolves after the expiration moment, the webhook and callback will handle the response as they would when the payload wasn't expired.

    Websocket Events

    Websocket events to expect

    Event
    JSON

    WARNING! Do not just rely on a `signed: true` indication! If you receive a websocket message with `signed: true` indication, always fetch the payload to confirm that all payment details are as expected.

    Sample

    The Websocket payload resolve message looks like:

    The payload information the Websocket connection delivers does not contain the entire payload object. It should be considered a trigger to GET the entire payload using an SDK/API call:

    When the payload is resolved

    {"payload_uuidv4": "...", [...] } With: signed: true/false

    When the payload is expired

    {"expired":true}

    Connected

    {"message":"Welcome <payload-uuid>"}

    After connecting and every 15 seconds while the connection is alive, a negative value means the transaction expired that many seconds ago

    {"expires_in_seconds":54}

    When the user received the payload, eg. push notification, deeplink or QR scan

    {"opened":true}

    When the Xumm SDK/API fetched the payload details

    {"devapp_fetched":true}

    When the user starts the signing routine

    {"pre_signed":true}

    When the submission to a node starts

    {"dispatched":true}

    get( … )
    {
      "payload_uuidv4": "<some-uuid>",
      "reference_call_uuidv4": "<some-uuid>",
      "return_url":{
        "app": "<some-url>",
        "web": "<some-url>",
      },
      "signed": true,
      "opened_by_deeplink": false,
      "user_token": true,
      "custom_meta":{
        "identifier": "<some-identifier>",
        "blob": {},
        "instruction": "<some-instruction>"
      },
      "txid": "<some-tx-hash>"
    }