🟠signMultipleTransactions

This is an Xverse custom method. It can only be invoked for users using the Xverse wallet.

import { signMultipleTransactions } from 'sats-connect'

To request signing of multiple PSBTs, you can use the signMultipleTransactions function.

psbt
Description

psbtBase64

a valid psbt encoded in base64

inputsToSign

an array of objects describing the address and index of input to sign

import { signMultipleTransactions } from 'sats-connect'

const psbtsBase64 = [...,...,...]

await signMultipleTransactions({
      payload: {
        network: {
          type: network,
        },
        message: "Sign Transaction",
        psbts: [
          {
            psbtBase64: psbtsBase64[0],
            inputsToSign: [
              {
                address: paymentAddress,
                signingIndexes: [0],
                sigHash: btc.SignatureHash.SINGLE | btc.SignatureHash.ANYONECANPAY,
              },
              {
                address: ordinalsAddress,
                signingIndexes: [1],
                sigHash: btc.SignatureHash.SINGLE | btc.SignatureHash.ANYONECANPAY,
              },
            ],
          },
          {
            psbtBase64: psbtsBase64[1],
            inputsToSign: [
              {
                address: paymentAddress,
                signingIndexes: [0],
                sigHash: btc.SignatureHash.SINGLE | btc.SignatureHash.ANYONECANPAY,
              },
              {
                address: ordinalsAddress,
                signingIndexes: [1],
                sigHash: btc.SignatureHash.SINGLE | btc.SignatureHash.ANYONECANPAY,
              },
            ],
          }
        ]
      },
      onFinish: (response) => {
        console.log('Bulk tx signing response:', response);
      },
      onCancel: () => alert("Canceled"),
    });
  };