Skip to main content

Solana Token Transfer (TypeScript)

Transfer SPL tokens between wallets using @solana/web3.js and @solana/spl-token. Transfer SPL tokens between wallets using @solana/web3.js and @solana/spl-token.

Explanation

SPL token transfers move tokens between Associated Token Accounts (ATAs). getOrCreateAssociatedTokenAccount ensures the destination ATA exists. The transfer instruction moves amount (in base units, accounting for decimals) from source to destination.

Code


Canonical knowledge ID: code-example:solana-token-transfer-ts