/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ import * as web3 from '@solana/web3.js' import * as beetSolana from '@convergence-rfq/beet-solana' import * as beet from '@convergence-rfq/beet' /** * @category Instructions * @category CreateWhitelist * @category generated */ export type CreateWhitelistInstructionArgs = { whitelist: web3.PublicKey[] } /** * @category Instructions * @category CreateWhitelist * @category generated */ export const createWhitelistStruct = new beet.FixableBeetArgsStruct< CreateWhitelistInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['whitelist', beet.array(beetSolana.publicKey)], ], 'CreateWhitelistInstructionArgs' ) /** * Accounts required by the _createWhitelist_ instruction * * @property [_writable_, **signer**] whitelistAccount * @property [_writable_, **signer**] creator * @category Instructions * @category CreateWhitelist * @category generated */ export type CreateWhitelistInstructionAccounts = { whitelistAccount: web3.PublicKey creator: web3.PublicKey systemProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const createWhitelistInstructionDiscriminator = [ 89, 182, 231, 206, 68, 173, 60, 6, ] /** * Creates a _CreateWhitelist_ instruction. * * @param accounts that will be accessed while the instruction is processed * @param args to provide as instruction data to the program * * @category Instructions * @category CreateWhitelist * @category generated */ export function createCreateWhitelistInstruction( accounts: CreateWhitelistInstructionAccounts, args: CreateWhitelistInstructionArgs, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = createWhitelistStruct.serialize({ instructionDiscriminator: createWhitelistInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.whitelistAccount, isWritable: true, isSigner: true, }, { pubkey: accounts.creator, isWritable: true, isSigner: true, }, { pubkey: accounts.systemProgram ?? web3.SystemProgram.programId, isWritable: false, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } const ix = new web3.TransactionInstruction({ programId, keys, data, }) return ix }