Prerequisites

  • An initialized Issuer Wallet with pre-minted tokens
  • The recipient’s Spark address or identifier
  • Basic understanding of Spark network operations

Sending Tokens via Spark Token Transactions

Send payments to other Spark users:

const transactionId = await wallet.transferTokens(
  "03e9cd9c3077c97457d44b1eb8f88bb95186c855bfffa247a5404b5bd8cd46229a", // receiverSparkAddress
  100000n // amountToTransfer
);

console.log("Spark Transaction ID:", transactionId);

Receiving Tokens

Receiving tokens on Spark does not require any action. Users can uniquely identify your Issuer wallet by sending to the token identifying Token Public Key that also matches your Issuer spark address.

Run getBalance() with the forceRefetch option to claim and view the balance for recently received tokens.

const balance = await wallet.getBalance(true /* forceRefetch */);
console.log(`Balance:`, balance);

Features and Benefits

  • Instant settlements
  • Lower fees compared to on-chain transactions
  • Standard pubkey addressing system

Next Steps

After sending and receiving tokens, you might need to freeze or unfreeze tokens for compliance reasons.