anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.61k stars 962 forks source link

Sending SPL token using getOrCreateAssociatedTokenAccount wallets without the token doesn't work #979

Closed thekesslereffect closed 5 months ago

thekesslereffect commented 5 months ago

Trying to send an SPL token using the getOrCreateAssociatedTokenAccount function.

I can send it to an account that already owns the token, but get TokenAccountNotFoundError when they havent been opened yet.

Not sure if this is a bug, or if we need an example for the correct way to do this with the wallet-adapter. I can't find any working examples.

thekesslereffect commented 5 months ago

Found the solution: https://stackoverflow.com/a/73943145

jordaaash commented 5 months ago

Thanks for linking the Stack Overflow post!