Developer Questions
How to request `EscrowCreate` Sequence number for `EscrowFinish` payload?
ChatGPT would like to apologize for the confusion, so how to request Sequence number for EscrowFinish, wherein the following code successfully connects and signs an`EscrowCreate`, after which the suggested `sdk.getTransaction(txid)` line throws `undefined`:
```<script type="module">
import 'https://xumm.app/assets/cdn/xumm-oauth2-pkce.min.js?v=2.7.1'
const xumm = new XummPkce(‘……………..xumm public key……………….’, {
implicit: true, // Implicit: allows to e.g. move from social browser to stock browser
redirectUrl: document.location.href + '?custom_state=test'
})
const { sdk } = await xumm.state()
const payload = await sdk.payload.create({
TransactionType: 'EscrowCreate',
Destination: borrowerXRPaddressField,
Amount: String(1_000_000),
CancelAfter: cancelAfter,
Condition: condition,
})
if (payload.pushed) {
alert('Payload `' + payload.uuid + '` pushed to your phone.')
} else {
// You can also render `payload.refs.qr_png` in your UI
alert('Payload not pushed, opening payload...')
window.open(payload.next.always)
}
// START ADD REQUEST SEQUENCE CODE FOR EscrowFinish
async function getEscrowSequence(txid) {
const { sdk } = await xumm.state();
const transaction = await sdk.getTransaction(txid); // (foobar.html:446:30)
return transaction.sequence;
}
const sequence = await getEscrowSequence(payload.txid);
console.log('Sequence:', sequence);
// END ADD REQUEST SEQUENCE CODE
}
</script>```
throws:
```TypeError: Cannot read properties of undefined (reading 'trim')
at r.Meta.<anonymous> (xumm-oauth2-pkce.min.js?v=2.7.1:1:43121)
at Generator.next (<anonymous>)
at xumm-oauth2-pkce.min.js?v=2.7.1:1:38446
at new Promise (<anonymous>)
at n (xumm-oauth2-pkce.min.js?v=2.7.1:1:38191)
at r.Meta.getTransaction (xumm-oauth2-pkce.min.js?v=2.7.1:1:43051)
at r.XummSdkJwt.getTransaction (xumm-oauth2-pkce.min.js?v=2.7.1:1:48931)
at getEscrowSequence (foobar.html:443:47)
at async document.getElementById.onclick (foobar.html:446:30)```
Posted by @tensornerdo 3 months ago
Error: access_denied
Hey, I've read the docs and all I can find on this error. I am currently using your test code to make sure there was no other issues and I still get the the error.
I am currently running on localhost:5173. I have whitelisted `https://localhost:5173`. It's a single page react app copy and paste of your tester code with my api key.
I see in https://xumm.readme.io/discuss/633aea416f5766002e10ad5d the full path was mentioned. It has no / path. Is `https://localhost:5173` the full path? I don't understand what I'm getting wrong here
I've had it working from backend using SDK with key and secret, but I am trying to implement from a front end application.
Posted by A Man 3 months ago
Uncaught Error: Cannot find module 'crypto-js' at n (xumm-sdk.min.js:1:155)
The module 'crypto-js' is installed in `node_modules` but no matter what I've tried for about a month and a half now trying to generate xrpl.org escrow condition and fulfillment always references xumm-sdk throwing `Uncaught Error: Cannot find module 'crypto-js' at n (xumm-sdk.min.js:1:155) ` when running:
```
const cc = require('crypto-js');
const crypto = require('crypto');
const preimageData = crypto.randomBytes(32);
const fulfillment = new cc.PreimageSha256();
fulfillment.setPreimage(preimageData);
const condition = fulfillment.getConditionBinary().toString('hex').toUpperCase();
console.log('Condition:', condition);
// Keep secret until you want to finish the escrow
const fulfillment_hex = fulfillment.serializeBinary().toString('hex').toUpperCase();
console.log('Fulfillment:', fulfillment_hex);
```
Posted by @tensornerdo 3 months ago
Decoding JWT from XummPkce
I have followed the XummPkce tutorial here https://github.com/XRPL-Labs/XummPkce/blob/main/sample/jsmodule.html . When you call the XUMM state after being signed in, you can access a JWT token. Decoded on jwt.io , it contains information about the signed payload, the user's wallet, payload etc. What is the intended usage of this? I want to decode it & authenticate this information, so if possible, how can I go about that?
Posted by hackathon 3 months ago
After change settings webhook not working
Could you check why webhooks not working? Where I could check response code?
Posted by Armin 3 months ago
LocalStorage usage
Hello. Is localStorage API available inside your iframe (xApp)?
For example, would `localStorage.getItem()` work? And I'm talking about client-side only.
Posted by Mike 3 months ago
I'm fetching runtime.xapp value and i use this value in clientside getting Hydration failed issue.
I'm using xumm:1.2.0 SDK and using that I'm fetching runtime.xapp value in client-side code. But if I use that xapp Boolean value getting Hydration failed issue. Could you please help me to resolve this issue.
Posted by xumm-sdk-test 3 months ago
dashboard login issue
im not able to login to developers dashboard
Posted by vishnu 3 months ago
Xumm QR Scanning returns opened: true twice
While integrating XUMM with my react app, what I did was created a websocket connection that listens to the events.
1. On opening the XUMM QR using the app the socket returned {opened: true} (expected behaviour)
However, when I signed the QR or pulled the slider, it first returned {opened: true} and then the payload response.
In my opinion only payload response should be recieved in this case, maybe there's an error at my end, not sure or is it an expected behaviour
Posted by Tushar Pardhe 4 months ago
Expired transactions
Hello. I'm stumbling upon an issue where transactions generated through the Xumm SDK are failing shortly if not immediately after being generated. The request itself is not failing as the QR code and websocket data are being generated properly, however, the socket sends an { expired: true } event shortly after the transaction is created. This is only happening in some transactions we generate and our team is wondering if this is a normal occurrence with the SDK and just something we should account for or if there is something not being submitted properly along the request
Posted by Fortunes 4 months ago