Skip to content
In this step you send 100 EXF, the asset from step 3, to a new holder. It’s the same instruction as sending dollars in step 2, for a different mint.

​Send the asset

Save this as send-asset.ts next to client.ts and run npx tsx send-asset.ts. It reads the asset’s address from asset.json (the CLI tab uses exf.json).
TypeScript
Output of npx tsx send-asset.tsLocal test network (Surfpool)
npx tsx send-asset.ts
Sent 100 EXF to GtU8gbvgsAfARGxXTDnCaQPPRg2KHcVxiRF8ZxmLSstk
Signature: 27EnUyCoCpAxDBtdz8uD9YKCLwuy7Ps3RUNvN8FcgFB3LsE9ZbKpiPyqp4QSSGCwFBZBSvVfmmiWr8YoeVquCibK
Explorer: https://explorer.solana.com/tx/27EnUyCoCpAxDBtdz8uD9YKCLwuy7Ps3RUNvN8FcgFB3LsE9ZbKpiPyqp4QSSGCwFBZBSvVfmmiWr8YoeVquCibK?cluster=devnet
Holder balance: 100 EXF
Confirmed
The script prints a link to the transfer in Solana Explorer. What the code does:
  • generateKeyPairSigner(true) creates the holder: a second wallet. writeKeyPairSigner saves it in holder.json, so step 5 can sign for it. In a real app, each holder keeps their own key.
  • client.token2022.instructions.transferToATA(...) builds two instructions:
    1. Open the holder’s EXF token account, which they don’t have yet. Your wallet pays its small deposit.
    2. Move 100 EXF: 10,000 base units, because EXF has 2 decimals. Like the USDC transfer, it’s a TransferChecked instruction.
  • .sendTransaction() sends both in one transaction, paid and signed by your wallet, and waits until it’s confirmed.
The script prints Holder balance: 100 EXF. You now hold 900.