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

  • txns must be a non-empty array of transaction objects.
  • An XLS-56 Batch must be sent on its own (a one-item list), because its inner transactions use the following sequence numbers.
  • With submit: true and autofill: 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:

  • message is the XRPL result code, such as tecUNFUNDED_PAYMENT.
  • data is 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
}