Mobile (WalletConnect)
xrpl_signTransactionBulk
Sign, and by default submit, several transactions with one approval.
Request
{
txns: Transaction[]; // non-empty; each Account must be the session account
submit?: boolean; // default true
autofill?: boolean; // see Methods
}
Usage
const result = await provider.request(
{
method: 'xrpl_signTransactionBulk',
params: {
txns: [
{ TransactionType: 'AccountSet', Account: 'r…' },
{ TransactionType: 'AccountSet', Account: 'r…' },
],
submit: true,
},
},
'xrpl:0',
);
Warning
wc-client 1.0.4's core.methods.signTransactionBatch sends a different method name that Joey doesn't support. Call provider.request with xrpl_signTransactionBulk as shown above.
Rules
txnsmust be a non-empty array of transaction objects.- An XLS-56
Batchmust be sent on its own (a one-item list), because its inner transactions use the following sequence numbers. - With
submit: trueandautofill: false, every transaction must be fully prepared.
Response
- More than one transaction: an array,
[{ tx_json }, { tx_json }, …]. - One transaction: a single
{ tx_json }object.
Partial failure
Transactions are submitted in order. If one is rejected, the request fails with error -32003:
messageis the XRPL result code, such astecUNFUNDED_PAYMENT.datais a JSON string:{"failedIndex": n, "signedTxs": [...]}.
Transactions before failedIndex were submitted successfully.
try {
await provider.request({ method: 'xrpl_signTransactionBulk', params: { txns } }, chain);
} catch (error: any) {
const { failedIndex, signedTxs } = JSON.parse(error.data ?? '{}');
// Transactions [0, failedIndex) succeeded
}