0

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 );

1
  • This problem has been successfully handled. First, if the other party does not have a token address, when using the getOrCreateAssociatedTokenAccount method, you must use your own key pair to create the address of the payee (the private key cannot be obtained temporarily and can only be entered), as follows Pass in the parameters, and secondly make sure that the private key party has enough sol to pay for the cost of creating the token address
    – xiay
    Apr 16 at 8:25

1 Answer 1

0

I got the same error but after setting the commitment Confiremd, it was fixed.

Try this

const conn = new Connection(clusterApiUrl("devnet"), { commitment: "confirmed", });

1
  • I have solved, you can read my article:link
    – xiay
    Apr 16 at 8:54

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.