Skip to main content
Send tokens to any Spark address. Transfers are instant, free, and recipients receive them automatically.
Transfer Tokens

Send Tokens

const tokenId = await wallet.getIssuerTokenIdentifier();

await wallet.transferTokens({
  tokenIdentifier: tokenId,
  tokenAmount: BigInt(100_000000), // 100 tokens (6 decimals)
  receiverSparkAddress: "spark1abc..."
});

Batch Transfer

Send to multiple recipients in a single transaction:
await wallet.batchTransferTokens([
  { tokenIdentifier: tokenId, tokenAmount: BigInt(1000_000000), receiverSparkAddress: "spark1alice..." },
  { tokenIdentifier: tokenId, tokenAmount: BigInt(500_000000), receiverSparkAddress: "spark1bob..." },
  { tokenIdentifier: tokenId, tokenAmount: BigInt(250_000000), receiverSparkAddress: "spark1carol..." }
]);
Batch transfers are atomic. All succeed or none do. Each item in the array must include its own tokenIdentifier.

Token Amounts

All amounts are in base units. If your token has 6 decimals:
HumanBase Units
11,000,000
100100,000,000
0.5500,000
function toBaseUnits(amount: number, decimals: number): bigint {
  return BigInt(Math.floor(amount * Math.pow(10, decimals)));
}

await wallet.transferTokens({
  tokenIdentifier: tokenId,
  tokenAmount: toBaseUnits(50.5, 6),
  receiverSparkAddress: "spark1..."
});

Receiving Tokens

Recipients don’t need to do anything. Tokens appear instantly:
const { tokenBalances } = await wallet.getBalance();

tokenBalances.forEach((data, key) => {
  console.log(data.tokenMetadata.tokenName, ":", data.balance);
});