UNPKG

@accessprotocol/distributor

Version:

Access Protocol Distributor Library

14 lines (13 loc) 655 B
import { TransactionInstruction } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars import { PROGRAM_ID } from "../programId"; export function setAdmin(accounts, programId = PROGRAM_ID) { const keys = [ { pubkey: accounts.distributor, isSigner: false, isWritable: true }, { pubkey: accounts.admin, isSigner: true, isWritable: true }, { pubkey: accounts.newAdmin, isSigner: false, isWritable: true }, ]; const identifier = Buffer.from([251, 163, 0, 52, 91, 194, 187, 92]); const data = identifier; const ix = new TransactionInstruction({ keys, programId, data }); return ix; }