Transfers tokens to another Spark Address via the IssuerSparkWallet.
Method Signature
async function transferTokens({
tokenIdentifier,
tokenAmount,
receiverSparkAddress,
outputSelectionStrategy,
selectedOutputs,
}: {
tokenIdentifier: Bech32mTokenIdentifier;
tokenAmount: bigint;
receiverSparkAddress: string;
outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST";
selectedOutputs?: OutputWithPreviousTransactionData[];
}): Promise<string>;
Parameters
tokenIdentifier
Bech32mTokenIdentifier
required
Bech32m token identifier (eg: btkn1…) of the token to transfer
Amount of tokens to transfer
Recipient’s Spark Address
Strategy for selecting outputs: "SMALL_FIRST" or "LARGE_FIRST" (defaults to "SMALL_FIRST")
selectedOutputs
OutputWithPreviousTransactionData[]
Specific outputs to use for transfer (overrides selection strategy)
Returns
Example
const txId = await issuerWallet.transferTokens({
tokenIdentifier: "btkn1...",
tokenAmount: 1000n,
receiverSparkAddress: "spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
});
console.log("Tokens transferred:", txId);