Skip to main content
Transfers tokens to multiple recipients in a single transaction via the IssuerSparkWallet.

Method Signature

async function batchTransferTokens({
  tokenIdentifier: string,
  transfers: { tokenAmount: bigint, receiverSparkAddress: string }[],
  selectedOutputs?: OutputWithPreviousTransactionData[]
}): Promise<string>;

Parameters

tokenIdentifier
string
required
Bech32m token identifier (eg: btkn1…) of the token to transfer
transfers
{ tokenAmount: bigint, receiverSparkAddress: string }[]
required
Array of transfer objects containing recipient addresses and amounts
selectedOutputs
OutputWithPreviousTransactionData[]
Specific outputs to use for transfer

Returns

txId
string
required
Transaction ID

Example

const txId = await issuerWallet.batchTransferTokens({
  tokenIdentifier: "btkn1...",
  transfers: [
    { tokenAmount: 1000n, receiverSparkAddress: "spark:address1" },
    { tokenAmount: 500n, receiverSparkAddress: "spark:address2" },
    { tokenAmount: 250n, receiverSparkAddress: "spark:address3" }
  ]
});

console.log("Batch transfer completed:", txId);