1

I created a WSOL token account so I don't have to be creating temporary token accounts every time I want to make a transaction.

Thing is, I created that account using Python and the function that does this returns a WSOL_Keypair, which I did not store anywhere. Now that I have WSOL there, how can I use it to make transactions? I'm assuming I don't need the WSOL_Keypair because the function that closes the account doesn't use it as a parameter. But I'm not sure how to use the existing WSOL to make a swap, for example. Do I just sign it with the keypair from the main wallet?

1
  • 1
    Nevermind, I realized that signing the transaction with the main account wallet solves the problem and the Keypair for the WSOL account is not needed
    – lsrth
    Commented Feb 1 at 21:39

1 Answer 1

2

When you create a wrapped token account or associated token account, you use the Associated Token Program to transfer wrapped tokens. You do not need the Keypair of the ATA, only the "owner" of the ATA has to sign. You specified an owner when you made the WSOL account.

In whatever web3 library you are using the ATA program's transfer is usually aliased token::Transfer or something similar to differentiate it from systemProgram::Transfer.

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.