/** * 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 '@convergence-rfq/beet' import * as web3 from '@solana/web3.js' /** * @category Instructions * @category PrepareToSettle * @category generated */ export type PrepareToSettleInstructionArgs = { input: number[] /* size: 3 */ } /** * @category Instructions * @category PrepareToSettle * @category generated */ export const prepareToSettleStruct = new beet.BeetArgsStruct< PrepareToSettleInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['input', beet.uniformFixedSizeArray(beet.u8, 3)], ], 'PrepareToSettleInstructionArgs' ) /** * Accounts required by the _prepareToSettle_ instruction * * @property [**signer**] protocol * @property [] rfq * @property [] response * @property [_writable_, **signer**] caller * @property [_writable_] callerTokenAccount * @property [] mint * @property [_writable_] escrow * @category Instructions * @category PrepareToSettle * @category generated */ export type PrepareToSettleInstructionAccounts = { protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey caller: web3.PublicKey callerTokenAccount: web3.PublicKey mint: web3.PublicKey escrow: web3.PublicKey systemProgram?: web3.PublicKey tokenProgram?: web3.PublicKey rent?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const prepareToSettleInstructionDiscriminator = [ 254, 209, 39, 188, 15, 5, 140, 146, ] /** * Creates a _PrepareToSettle_ 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 PrepareToSettle * @category generated */ export function createPrepareToSettleInstruction( accounts: PrepareToSettleInstructionAccounts, args: PrepareToSettleInstructionArgs, programId = new web3.PublicKey('HpmyVA3t3uNGgdx86AuwZww7gnAWB57vepnk3732vEr9') ) { const [data] = prepareToSettleStruct.serialize({ instructionDiscriminator: prepareToSettleInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.protocol, isWritable: false, isSigner: true, }, { pubkey: accounts.rfq, isWritable: false, isSigner: false, }, { pubkey: accounts.response, isWritable: false, isSigner: false, }, { pubkey: accounts.caller, isWritable: true, isSigner: true, }, { pubkey: accounts.callerTokenAccount, isWritable: true, isSigner: false, }, { pubkey: accounts.mint, isWritable: false, isSigner: false, }, { pubkey: accounts.escrow, isWritable: true, isSigner: false, }, { pubkey: accounts.systemProgram ?? web3.SystemProgram.programId, isWritable: false, isSigner: false, }, { pubkey: accounts.tokenProgram ?? splToken.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false, }, { pubkey: accounts.rent ?? web3.SYSVAR_RENT_PUBKEY, 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 }