INNER CODE UNIT · TypeScript
buildCloseOnlyInstructions
bitman09/pumpfun-sniper-bot · src/burn.ts:71
async function buildCloseOnlyInstructions(
pubkey: PublicKey,
mint: PublicKey,
payer: PublicKey,
programId: PublicKey
): Promise<TransactionInstruction[]> {
const ix: TransactionInstruction[] = [];
if (programId.equals(TOKEN_2022_PROGRAM_ID)) {
ix.push(
createHarvestWithheldTokensToMintInstruction(mint, [pubkey], TOKEN_2022_PROGRAM_ID)
);
}
ix.push(
createCloseAccountInstruction(pubkey, payer, payer, [], programId)
);