Developer Questions

Ask a Question

What is the type of response for api call (get transaction details using transaction id)

We are retrieving transaction details using transaction id using JSON-RPC method but we need to know the type of response for API call. For example, if we try to retrieve Account NFTs we'll get response of type AccountNFTsResponse, likewise need response type for API call get transaction details using transaction id. Sample code to retrieve transaction details, const txInfo = await fetch({ method: 'tx', params: [ { transaction: txid, binary: false } ] }); What is the type of txInfo object?

Xumm SDK, payload with multiple transactions?

Hi, for what I need (a simple payment page, in the browser, no backend needed, no nodejs, pure vanilla js) I found a working demo: https://oauth2-pkce-demo.xumm.dev/jsmodule-payload and working example here: https://github.com/XRPL-Labs/XummPkce/blob/main/sample/jsmodule-payload.html However, I'm trying to batch a few transactions in the same payload, is that possible? How? I've got a few code suggestions by chatgpt: const transaction1 = { TransactionType: 'Payment', Destination: 'rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ', Amount: '100111' } const transaction2 = { TransactionType: 'Payment', Destination: 'rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ', Amount: '700777' } const payloadData = { Transactions: [transaction1, transaction2], Fee: '12' } const encodedPayloadData = sdk.encode(payloadData) console.log('encoded', encodedPayloadData) const payload = await sdk.payload.create(encodedPayloadData) but it's not working: sdk.encode is not a function ps I used the same address, but of course I intend using 2 different addresses for the 2 transactions. Ideas? Thank you

WebSocket event for ignored/closed sign requests

Hi, My client side code listens to events/transaction status updates using the WebSocket approach. I noticed that when the user chooses the "Close" button instead of Accept/Decline in the transaction sign request, it doesn't emit/send any event to the websocket connection. Is there a way to know when the user closes or ignores the sign request? Or will a feature for this be added in future versions? Thanks

Hi im from XRPDomains - xrpdomains.xyz

Hello friends I'm from xrpdomains.xyz, I used the view NFTs function on Xumm wallet and found that currently URIs don't support non-ascii characters and emoji, it won't read it and says no name found. Hope you can help update it. xrp.cafe can display it very well. xrp.cafe: https://xrp.cafe/nft/00080000413DEC6E282BBCEA55B71140D0CB35F01673BBE051E86273000000D8 URI: https://mainnet.xrpdomains.xyz/api/nftdomains/metadata/we%E2%9D%A4%EF%B8%8Fxrp.xrp Thanks so much

Is it possible to send webhooks also when the payload becomes expired?

Seems like webhooks are only sent when the payload is rejected or signed but it would be extremely useful if an expiration notification would also be delivered. Any plans to enable this in the near future? Thanks.

How to close connection or is it how it meant to work

this is my code i'm using to send a signIn payload. everything works fine. only problem i'm wondering is is it normal to keep it logging "New payload event: { expires_in_seconds: xxxxx}" in console every seconds. i understand the events logs when its in process of signing in but the problem i have is it keep logging even after everything is done. resolved. i think it sorta build up and logs more and more each time. i create a payload eg. a user tried to generate a qrcode. so my question is how to close connection after its been resolved or reject. const request= { TransactionType: "SignIn", }; const subscription = await Sdk.payload.createAndSubscribe( request, (event) => { console.log("New payload event:", event.data); if (event.data.signed === true) { return event.data; } if (event.data.signed === false) { return false; } } ); const resolveData: any = await subscription.resolved; console.log("resolved") if (resolveData.signed === false) { console.log("The sign request was rejected :("); } if (resolveData.signed === true) { console.log("Woohoo! The sign request was signed :)");
ANSWERED

createAndSubscribe payload resolving before being signed

I am following the https://xumm.readme.io/recipes/xumm-sdk-with-jwt in a XAPP, and I want to run a function after the payload is signed. The payload logs 'resolved' before the transaction is actually signed. Is this intended? Do I need to poll the backend to see if it has been signed manually?
ANSWERED

trying to mint NFT using NFTokenMint

this is my payload const request: any = { txjson: { TransactionType: "NFTokenMint", Account: publicAddress, URI: "697066733A2F2F6261666B72656965696979727A613670706179687635716675366E6B636477646D377233366775666F366A796B64357A6C6D7A7735617467716479", Flags: 8, TransferFee: 10, NFTokenTaxon: 0, }, user_token: issued_user_token, }; const subscription = await Sdk.payload.createAndSubscribe( request, (event) => { console.log("New payload event:", event.data); if (event.data.signed === true) { return event.data; } if (event.data.signed === false) { return false; } } ); const resolveData: any = await subscription.resolved; if (resolveData.signed === false) { console.log("The sign request was rejected :("); } if (resolveData.signed === true) { console.log("Woohoo! The sign request was signed :)"); } the error im getting Error: Payload encoding error: checksum_invalid
ANSWERED

Browserified frontend JWT getOTT not working

Hi, I'm trying to make a simple frontend page to make a payment using XUMM. I don't want any backend. I've found in the docs that there is a frontend only way to accomplish this, using JWT endpoints. See here: https://xumm.readme.io/reference/xapps-jwt-endpoints In Option #1: Use the XUMM SDK in your xApp frontend I've created an api key/secret at https://apps.xumm.dev/ I created a page with the code to get OTT (I replaced the api key with my key): const {XummSdkJwt} = require('xumm-sdk') const Sdk = new XummSdkJwt('8525e32b-1bd0-4839-af2f-f794874a80b0') Sdk.getOttData().then(c => { console.log('OTT Data', c) Sdk.ping().then(c => { console.log('Pong', c) }) }) I load the page, but there is no console log with "OTT Data", nor "Pong". So basically the code provided is wrong, or the SDK is buggy (or has changed and the example is not working anymore). Also the jsfiddle provided (I also updated the jsfiddle with my api key) in the page doesn't work. It tells to check the browser logs, but no logs appear. Help please.
ANSWERED

XUMM HELP

I cant access my primary xumm I got all the seed phrase n my XUMM WALLET except all the numbers in ROW "E" >ANY IDEA HOW MANY ATTEMPTS TO INPUT SEED PHRASE BEFORE IT FREEZES THE ACCOUNT? >And any app that can decode or make combinations to crack it? HELLP :(