2

I know it is possible to change the mint authority using solana-spl as shown here. How can I achieve the same thing using TypeScript/JS?

1 Answer 1

3

You can use setAuthority from @solana/spl-token and select AuthorityType.MintTokens

https://solana-labs.github.io/solana-program-library/token/js/modules.html#setAuthority

For example, something like this:

  const transactionSignature = await setAuthority(
    connection,
    payer,
    tokenMint,
    payer.publicKey, // current authority goes here (must also be signer)
    AuthorityType.MintTokens,
    newMintAuthority.publickey // new authority goes here
  )

You can also use createSetAuthorityInstruction if you want to just create the instruction and add then to a transaction.

https://solana-labs.github.io/solana-program-library/token/js/modules.html#createSetAuthorityInstruction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.