Skip to main content
Transfers tokens to another Spark Address via the IssuerSparkWallet.

Method Signature

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

Parameters

tokenIdentifier
string
required
Bech32m token identifier (eg: btkn1…) of the token to transfer
tokenAmount
bigint
required
Amount of tokens to transfer
receiverSparkAddress
string
required
Recipient’s Spark Address
selectedOutputs
OutputWithPreviousTransactionData[]
Specific outputs to use for transfer

Returns

txId
string
required
Transaction ID

Example

const txId = await issuerWallet.transferTokens({
  tokenIdentifier: "btkn1...",
  tokenAmount: 1000n,
  receiverSparkAddress: "spark:recipient-address"
});

console.log("Tokens transferred:", txId);