{
txjson: {
TransactionType : 'Payment',
Destination : 'rwiETSee2wMz3SBnAG8hkMsCgvGy9LWbZ1',
Amount: '1337'
}
}{
txjson: {
TransactionType: "Payment",
Destination: "r...",
Amount: "1000000"
},
options: {
return_url: {
app: "https://sample.test/?...",
web: "https://sample.test/?id={id}"
},
force_network: "MAINNET"
},
custom_meta: {
identifier: "123123",
instruction: "Please sign this to..."
}
}{
"uuid": "1289e9ae-7d5d-4d5f-b89c-18633112ce09",
"next": {
"always": "https://xumm.app/sign/1289e9ae-7d5d-4d5f-b89c-18633112ce09",
"no_push_msg_received": "https://xumm.app/sign/1289e9ae-7d5d-4d5f-b89c-18633112ce09/qr"
},
"refs": {
"qr_png": "https://xumm.app/sign/1289e9ae-7d5d-4d5f-b89c-18633112ce09_q.png",
"qr_matrix": "https://xumm.app/sign/1289e9ae-7d5d-4d5f-b89c-18633112ce09_q.json",
"qr_uri_quality_opts": ["m", "q", "h"],
"websocket_status": "wss://xumm.app/sign/1289e9ae-7d5d-4d5f-b89c-18633112ce09"
},
"pushed": true
}async Sdk.payload.create (
payload: CreatePayload,
returnErrors: boolean = false
): Promise<CreatedPayload | null>const payload = await Sdk.payload.get("aaaaaaaa-bbbb-cccc-dddd-1234567890ab");await Sdk.payload.get("aaaaaaaa-bbbb-cccc-dddd-1234567890ab", true)const newPayload: XummTypes.CreatePayload = {txjson: {...}}
const created: XummTypes.CreatedPayload = await Sdk.payload.create(newPayload)
const payload: XummTypes.XummPayload = await Sdk.payload.get(created)async Sdk.payload.get (
payload: string | CreatedPayload,
returnErrors: boolean = false
): Promise<XummPayload | null>async Sdk.payload.cancel (
payload: string | XummPayload | CreatedPayload,
returnErrors: boolean = false
): Promise<DeletedPayload | null>xumm.payload.createAndSubscribe({
TransactionType: 'Payment',
Destination: 'rfHn6cB5mmqZ6fHZ4fdemCDSxqLTijgMwo',
Amount: String(1000000) // one million drops, 1 XRP
}, eventMessage => {
if (Object.keys(eventMessage.data).indexOf('opened') > -1) {
// Update the UI? The payload was opened.
}
if (Object.keys(eventMessage.data).indexOf('signed') > -1) {
// The `signed` property is present, true (signed) / false (rejected)
return eventMessage
}
})
.then(({ created, resolved }) => {
console.log('Payload URL:', created.next.always)
console.log('Payload QR:', created.refs.qr_png)
return resolved // Return payload promise for the next `then`
})
.then(payload => console.log('Payload resolved', payload))
// This is where you can do `xumm.payload.get(...)` to fetch detailsasync Sdk.payload.createAndSubscribe (
payload: CreatePayload,
callback?: onPayloadEvent
): Promise<PayloadAndSubscription>{
payload: XummPayload,
resolved: Promise<unknown> | undefined
resolve: (resolveData?: unknown) => void
websocket: WebSocket
}async Sdk.payload.subscribe (
payload: string | XummPayload | CreatedPayload,
callback?: onPayloadEvent
): Promise<PayloadSubscription>