0

I'm playing around with Solana Playground using this example - https://beta.solpg.io/6570e5b7fb53fa325bfd0c4e and what I'm trying to do is burn some of the locked token fees, I'm doing it at this check(on row 202 from Playground link):

if (transferFeeAmount !== null && transferFeeAmount.withheldAmount > 0) {
    try {
      const result = await burn(
        connection,
        payer,
        account.address,
        mint,
        account.owner,
        transferFeeAmount.withheldAmount,
        undefined,
        undefined,
        TOKEN_2022_PROGRAM_ID
      )
      console.log('res: ', result)
    }catch (e){
      console.log('error is: ', e)
    }
    accountsToWithdrawFrom.push(accountInfo.pubkey); // Add account to withdrawal list
  }

issue seems to be coming from the 5th argument the owner I'm lost as of what the value of it should be, tried payer.pubkey, payer and whatnot. Any pointers would be appreciated.

1 Answer 1

0

Oh ... I figured it out, the whole time I was thinking that the owner should be the payer, but its not the case

const randomKeypair = new Keypair();
// Create Token Account for random keypair
const destinationTokenAccount = await createAccount(
  connection,
  payer, // Payer to create Token Account
  mint, // Mint Account address
  randomKeypair.publicKey, // Token Account owner
  undefined, // Optional keypair, default to Associated Token Account
  undefined, // Confirmation options
  TOKEN_2022_PROGRAM_ID // Token Extension Program ID
);

the owner was randomKeypair actually and this solved my issue

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.