UNPKG

@accessprotocol/distributor

Version:

Access Protocol Distributor Library

17 lines (16 loc) 878 B
import { TransactionInstruction } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars import { PROGRAM_ID } from "../programId"; export function clawback(accounts, programId = PROGRAM_ID) { const keys = [ { pubkey: accounts.distributor, isSigner: false, isWritable: true }, { pubkey: accounts.from, isSigner: false, isWritable: true }, { pubkey: accounts.to, isSigner: false, isWritable: true }, { pubkey: accounts.admin, isSigner: true, isWritable: true }, { pubkey: accounts.systemProgram, isSigner: false, isWritable: false }, { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false }, ]; const identifier = Buffer.from([111, 92, 142, 79, 33, 234, 82, 27]); const data = identifier; const ix = new TransactionInstruction({ keys, programId, data }); return ix; }