@accessprotocol/distributor
Version:
Access Protocol Distributor Library
20 lines (19 loc) • 989 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.clawback = clawback;
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
const programId_1 = require("../programId");
function clawback(accounts, programId = programId_1.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 web3_js_1.TransactionInstruction({ keys, programId, data });
return ix;
}