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.44k stars 906 forks source link

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

Closed thekesslereffect closed 3 weeks ago

thekesslereffect commented 1 month 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 1 month ago

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

jordaaash commented 3 weeks ago

Thanks for linking the Stack Overflow post!