/** * 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'; /** * @category Instructions * @category CloseEscrowAccount * @category generated */ export type CloseEscrowAccountInstructionArgs = { escrowPaymentBump: number; }; /** * @category Instructions * @category CloseEscrowAccount * @category generated */ const closeEscrowAccountStruct = new beet.BeetArgsStruct< CloseEscrowAccountInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */; } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['escrowPaymentBump', beet.u8], ], 'CloseEscrowAccountInstructionArgs', ); /** * Accounts required by the _closeEscrowAccount_ instruction * * @property [**signer**] wallet * @property [_writable_] escrowPaymentAccount * @property [] auctionHouse * @category Instructions * @category CloseEscrowAccount * @category generated */ export type CloseEscrowAccountInstructionAccounts = { wallet: web3.PublicKey; escrowPaymentAccount: web3.PublicKey; auctionHouse: web3.PublicKey; }; const closeEscrowAccountInstructionDiscriminator = [209, 42, 208, 179, 140, 78, 18, 43]; /** * Creates a _CloseEscrowAccount_ 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 CloseEscrowAccount * @category generated */ export function createCloseEscrowAccountInstruction( accounts: CloseEscrowAccountInstructionAccounts, args: CloseEscrowAccountInstructionArgs, ) { const { wallet, escrowPaymentAccount, auctionHouse } = accounts; const [data] = closeEscrowAccountStruct.serialize({ instructionDiscriminator: closeEscrowAccountInstructionDiscriminator, ...args, }); const keys: web3.AccountMeta[] = [ { pubkey: wallet, isWritable: false, isSigner: true, }, { pubkey: escrowPaymentAccount, isWritable: true, isSigner: false, }, { pubkey: auctionHouse, isWritable: false, isSigner: false, }, { pubkey: web3.SystemProgram.programId, isWritable: false, isSigner: false, }, ]; const ix = new web3.TransactionInstruction({ programId: new web3.PublicKey('hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk'), keys, data, }); return ix; }