/** * 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 beet from '@metaplex-foundation/beet' import * as web3 from '@solana/web3.js' import { InitVerifyParams, initVerifyParamsBeet, } from '../types/InitVerifyParams' /** * @category Instructions * @category InitVerify * @category generated */ export type InitVerifyInstructionArgs = { params: InitVerifyParams } /** * @category Instructions * @category InitVerify * @category generated */ export const initVerifyStruct = new beet.BeetArgsStruct< InitVerifyInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['params', initVerifyParamsBeet], ], 'InitVerifyInstructionArgs' ) /** * Accounts required by the _initVerify_ instruction * * @property [_writable_, **signer**] payer * @property [_writable_] confirmations * @category Instructions * @category InitVerify * @category generated */ export type InitVerifyInstructionAccounts = { payer: web3.PublicKey confirmations: web3.PublicKey systemProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const initVerifyInstructionDiscriminator = [ 76, 246, 244, 124, 115, 17, 235, 91, ] /** * Creates a _InitVerify_ 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 InitVerify * @category generated */ export function createInitVerifyInstruction( accounts: InitVerifyInstructionAccounts, args: InitVerifyInstructionArgs, programId: web3.PublicKey ) { const [data] = initVerifyStruct.serialize({ instructionDiscriminator: initVerifyInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.payer, isWritable: true, isSigner: true, }, { pubkey: accounts.confirmations, isWritable: true, isSigner: false, }, { 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 } /** * Creates a _InitVerify_ instructionAccounts. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category InitVerify * @category generated */ export function createInitVerifyInstructionAccounts( accounts: InitVerifyInstructionAccounts, programId: web3.PublicKey ) { const keys: web3.AccountMeta[] = [ { pubkey: accounts.payer, isWritable: true, isSigner: true, }, { pubkey: accounts.confirmations, isWritable: true, isSigner: false, }, { pubkey: accounts.systemProgram ?? web3.SystemProgram.programId, isWritable: false, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } return keys }