2

Somebody from Discord was nice enough to point me to look at https://solana-labs.github.io/solana-program-library/token/js/modules.html#transfer but where do I specify what SPL token I want to transfer, let's say USDC.

And are source and owner the same which is the sender wallet?

enter image description here

1 Answer 1

1

Both the Source and the Destination should be the token's associated account. An associated token account (ATA for short) is specific to a single token, so that's how the transfer() method knows which token to transfer.

You get the source and destination ATAs with getAssociatedTokenAddress(): https://solana-labs.github.io/solana-program-library/token/js/modules.html#getAssociatedTokenAddress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.