/** * 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 { CloseVerifyParams, closeVerifyParamsBeet, } from '../types/CloseVerifyParams' /** * @category Instructions * @category CloseVerify * @category generated */ export type CloseVerifyInstructionArgs = { params: CloseVerifyParams } /** * @category Instructions * @category CloseVerify * @category generated */ export const closeVerifyStruct = new beet.BeetArgsStruct< CloseVerifyInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['params', closeVerifyParamsBeet], ], 'CloseVerifyInstructionArgs' ) /** * Accounts required by the _closeVerify_ instruction * * @property [**signer**] dvn * @property [_writable_] receiver * @property [_writable_] confirmations * @category Instructions * @category CloseVerify * @category generated */ export type CloseVerifyInstructionAccounts = { dvn: web3.PublicKey receiver: web3.PublicKey confirmations: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const closeVerifyInstructionDiscriminator = [ 44, 133, 228, 138, 169, 242, 53, 36, ] /** * Creates a _CloseVerify_ 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 CloseVerify * @category generated */ export function createCloseVerifyInstruction( accounts: CloseVerifyInstructionAccounts, args: CloseVerifyInstructionArgs, programId: web3.PublicKey ) { const [data] = closeVerifyStruct.serialize({ instructionDiscriminator: closeVerifyInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.dvn, isWritable: false, isSigner: true, }, { pubkey: accounts.receiver, isWritable: true, isSigner: false, }, { pubkey: accounts.confirmations, isWritable: true, 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 _CloseVerify_ instructionAccounts. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category CloseVerify * @category generated */ export function createCloseVerifyInstructionAccounts( accounts: CloseVerifyInstructionAccounts, programId: web3.PublicKey ) { const keys: web3.AccountMeta[] = [ { pubkey: accounts.dvn, isWritable: false, isSigner: true, }, { pubkey: accounts.receiver, isWritable: true, isSigner: false, }, { pubkey: accounts.confirmations, isWritable: true, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } return keys }