/** * 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 { VerifyParams, verifyParamsBeet } from '../types/VerifyParams' /** * @category Instructions * @category Verify * @category generated */ export type VerifyInstructionArgs = { params: VerifyParams } /** * @category Instructions * @category Verify * @category generated */ export const verifyStruct = new beet.BeetArgsStruct< VerifyInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['params', verifyParamsBeet], ], 'VerifyInstructionArgs' ) /** * Accounts required by the _verify_ instruction * * @property [**signer**] receiveLibrary * @property [] receiveLibraryConfig * @property [] defaultReceiveLibraryConfig * @property [_writable_] nonce * @property [_writable_] pendingInboundNonce * @property [_writable_] payloadHash * @property [] eventAuthority * @property [] program * @category Instructions * @category Verify * @category generated */ export type VerifyInstructionAccounts = { receiveLibrary: web3.PublicKey receiveLibraryConfig: web3.PublicKey defaultReceiveLibraryConfig: web3.PublicKey nonce: web3.PublicKey pendingInboundNonce: web3.PublicKey payloadHash: web3.PublicKey eventAuthority: web3.PublicKey program: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const verifyInstructionDiscriminator = [ 133, 161, 141, 48, 120, 198, 88, 150, ] /** * Creates a _Verify_ 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 Verify * @category generated */ export function createVerifyInstruction( accounts: VerifyInstructionAccounts, args: VerifyInstructionArgs, programId: web3.PublicKey ) { const [data] = verifyStruct.serialize({ instructionDiscriminator: verifyInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.receiveLibrary, isWritable: false, isSigner: true, }, { pubkey: accounts.receiveLibraryConfig, isWritable: false, isSigner: false, }, { pubkey: accounts.defaultReceiveLibraryConfig, isWritable: false, isSigner: false, }, { pubkey: accounts.nonce, isWritable: true, isSigner: false, }, { pubkey: accounts.pendingInboundNonce, isWritable: true, isSigner: false, }, { pubkey: accounts.payloadHash, isWritable: true, isSigner: false, }, { pubkey: accounts.eventAuthority, isWritable: false, isSigner: false, }, { pubkey: accounts.program, 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 _Verify_ instructionAccounts. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category Verify * @category generated */ export function createVerifyInstructionAccounts( accounts: VerifyInstructionAccounts, programId: web3.PublicKey ) { const keys: web3.AccountMeta[] = [ { pubkey: accounts.receiveLibrary, isWritable: false, isSigner: true, }, { pubkey: accounts.receiveLibraryConfig, isWritable: false, isSigner: false, }, { pubkey: accounts.defaultReceiveLibraryConfig, isWritable: false, isSigner: false, }, { pubkey: accounts.nonce, isWritable: true, isSigner: false, }, { pubkey: accounts.pendingInboundNonce, isWritable: true, isSigner: false, }, { pubkey: accounts.payloadHash, isWritable: true, isSigner: false, }, { pubkey: accounts.eventAuthority, isWritable: false, isSigner: false, }, { pubkey: accounts.program, isWritable: false, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } return keys }