/** * 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 splToken from '@solana/spl-token'; import * as beet from '@metaplex-foundation/beet'; import * as web3 from '@solana/web3.js'; /** * @category Instructions * @category Withdraw * @category generated */ export type WithdrawInstructionArgs = { escrowPaymentBump: number; auctioneerAuthorityBump: number; amount: beet.bignum; }; /** * @category Instructions * @category Withdraw * @category generated */ const withdrawStruct = new beet.BeetArgsStruct< WithdrawInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */; } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['escrowPaymentBump', beet.u8], ['auctioneerAuthorityBump', beet.u8], ['amount', beet.u64], ], 'WithdrawInstructionArgs', ); /** * Accounts required by the _withdraw_ instruction * * @property [] auctionHouseProgram * @property [] wallet * @property [_writable_] receiptAccount * @property [_writable_] escrowPaymentAccount * @property [] treasuryMint * @property [] authority * @property [] auctionHouse * @property [_writable_] auctionHouseFeeAccount * @property [] auctioneerAuthority * @property [] ahAuctioneerPda * @category Instructions * @category Withdraw * @category generated */ export type WithdrawInstructionAccounts = { auctionHouseProgram: web3.PublicKey; wallet: web3.PublicKey; receiptAccount: web3.PublicKey; escrowPaymentAccount: web3.PublicKey; treasuryMint: web3.PublicKey; authority: web3.PublicKey; auctionHouse: web3.PublicKey; auctionHouseFeeAccount: web3.PublicKey; auctioneerAuthority: web3.PublicKey; ahAuctioneerPda: web3.PublicKey; }; const withdrawInstructionDiscriminator = [183, 18, 70, 156, 148, 109, 161, 34]; /** * Creates a _Withdraw_ 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 Withdraw * @category generated */ export function createWithdrawInstruction( accounts: WithdrawInstructionAccounts, args: WithdrawInstructionArgs, ) { const { auctionHouseProgram, wallet, receiptAccount, escrowPaymentAccount, treasuryMint, authority, auctionHouse, auctionHouseFeeAccount, auctioneerAuthority, ahAuctioneerPda, } = accounts; const [data] = withdrawStruct.serialize({ instructionDiscriminator: withdrawInstructionDiscriminator, ...args, }); const keys: web3.AccountMeta[] = [ { pubkey: auctionHouseProgram, isWritable: false, isSigner: false, }, { pubkey: wallet, isWritable: false, isSigner: false, }, { pubkey: receiptAccount, isWritable: true, isSigner: false, }, { pubkey: escrowPaymentAccount, isWritable: true, isSigner: false, }, { pubkey: treasuryMint, isWritable: false, isSigner: false, }, { pubkey: authority, isWritable: false, isSigner: false, }, { pubkey: auctionHouse, isWritable: false, isSigner: false, }, { pubkey: auctionHouseFeeAccount, isWritable: true, isSigner: false, }, { pubkey: auctioneerAuthority, isWritable: false, isSigner: false, }, { pubkey: ahAuctioneerPda, isWritable: false, isSigner: false, }, { pubkey: splToken.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false, }, { pubkey: web3.SystemProgram.programId, isWritable: false, isSigner: false, }, { pubkey: splToken.ASSOCIATED_TOKEN_PROGRAM_ID, isWritable: false, isSigner: false, }, { pubkey: web3.SYSVAR_RENT_PUBKEY, isWritable: false, isSigner: false, }, ]; const ix = new web3.TransactionInstruction({ programId: new web3.PublicKey('neer8g6yJq2mQM6KbnViEDAD4gr3gRZyMMf4F2p3MEh'), keys, data, }); return ix; }