getOrCreateAssociatedTokenAccount method always returns TokenAccountNotFoundError
getOrCreateAssociatedTokenAccount method always returns TokenAccountNotFoundError
Loading saved threads...
xiay · External communityPost link
External question — Solana Stack Exchange
Author: xiay
Original post: https://solana.stackexchange.com/questions/13000
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
In @ solana/SPL - token repository getOrCreateAssociatedTokenAccount method, when there is no this scrip address yourself why always returns TokenAccountNotFoundError. I'm pretty sure my parameters are fine because they can be successfully fetched when the recipient has a token address. I used @solana/spl-token0.4.3 and here's my code in vue:
const recipientAssociatedTokenAccount = await SplToken.getOrCreateAssociatedTokenAccount(
connection,
senderPublicKey,
usdtMintAddress,
receiverPublicKey
);
Quote
Report
Bobz · External communityPost link
External answer — Solana Stack Exchange
Author: Bobz
Original post: https://solana.stackexchange.com/a/13004
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I got the same error but after setting the commitment Confiremd, it was fixed.
Try this
const conn = new Connection(clusterApiUrl("devnet"), {
commitment: "confirmed",
});
Quote
Report
Post Reply
Checking account access…