Skip to content

Commit

Permalink
solana: Add createRevertTokenAuthorityInstruction helper
Browse files Browse the repository at this point in the history
  • Loading branch information
nvsriram committed Dec 24, 2024
1 parent b0cb204 commit d31d8e1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions solana/ts/lib/ntt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,33 @@ export namespace NTT {
.instruction();
}

export async function createRevertTokenAuthorityInstruction(
program: Program<NttBindings.NativeTokenTransfer<IdlVersion>>,
config: NttBindings.Config<IdlVersion>,
args: {
rentPayer: PublicKey;
owner: PublicKey;
},
pdas?: Pdas
) {
pdas = pdas ?? NTT.pdas(program.programId);
return program.methods
.revertTokenAuthority()
.accountsStrict({
common: {
config: pdas.configAccount(),
mint: config.mint,
tokenAuthority: pdas.tokenAuthority(),
tokenProgram: config.tokenProgram,
systemProgram: SystemProgram.programId,
rentPayer: args.rentPayer,
pendingTokenAuthority: pdas.pendingTokenAuthority(),
},
owner: args.owner,
})
.instruction();
}

export async function createSetPeerInstruction(
program: Program<NttBindings.NativeTokenTransfer<IdlVersion>>,
args: {
Expand Down

0 comments on commit d31d8e1

Please sign in to comment.