Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
const [tokenIdentifier] = await wallet.getIssuerTokenIdentifiers(); if (!tokenIdentifier) throw new Error("No token identifiers found for this issuer"); await wallet.transferTokens({ tokenIdentifier, tokenAmount: 100_000000n, // 100 tokens (6 decimals) receiverSparkAddress: "spark1abc..." });
await wallet.batchTransferTokens([ { tokenIdentifier, tokenAmount: 1000_000000n, receiverSparkAddress: "spark1alice..." }, { tokenIdentifier, tokenAmount: 500_000000n, receiverSparkAddress: "spark1bob..." }, { tokenIdentifier, tokenAmount: 250_000000n, receiverSparkAddress: "spark1carol..." } ]);
tokenIdentifier
function toBaseUnits(amount: string, decimals: number): bigint { const [whole, fraction = ""] = amount.split("."); const fractionPadded = (fraction + "0".repeat(decimals)).slice(0, decimals); return BigInt(whole || "0") * 10n ** BigInt(decimals) + BigInt(fractionPadded || "0"); } await wallet.transferTokens({ tokenIdentifier, tokenAmount: toBaseUnits("50.5", 6), receiverSparkAddress: "spark1..." });
const { tokenBalances } = await wallet.getBalance(); tokenBalances.forEach((data, key) => { console.log(data.tokenMetadata.tokenName, ":", data.ownedBalance); });