/** * 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 '@convergence-rfq/beet' import * as web3 from '@solana/web3.js' import { AuthoritySide, authoritySideBeet } from '../types/AuthoritySide' /** * @category Instructions * @category PrepareEscrowSettlement * @category generated */ export type PrepareEscrowSettlementInstructionArgs = { side: AuthoritySide legAmountToPrepare: number } /** * @category Instructions * @category PrepareEscrowSettlement * @category generated */ export const prepareEscrowSettlementStruct = new beet.BeetArgsStruct< PrepareEscrowSettlementInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['side', authoritySideBeet], ['legAmountToPrepare', beet.u8], ], 'PrepareEscrowSettlementInstructionArgs' ) /** * Accounts required by the _prepareEscrowSettlement_ instruction * * @property [_writable_, **signer**] caller * @property [] protocol * @property [] rfq * @property [_writable_] response * @category Instructions * @category PrepareEscrowSettlement * @category generated */ export type PrepareEscrowSettlementInstructionAccounts = { caller: web3.PublicKey protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const prepareEscrowSettlementInstructionDiscriminator = [ 126, 154, 245, 107, 10, 20, 9, 16, ] /** * Creates a _PrepareEscrowSettlement_ 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 PrepareEscrowSettlement * @category generated */ export function createPrepareEscrowSettlementInstruction( accounts: PrepareEscrowSettlementInstructionAccounts, args: PrepareEscrowSettlementInstructionArgs, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = prepareEscrowSettlementStruct.serialize({ instructionDiscriminator: prepareEscrowSettlementInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.caller, isWritable: true, isSigner: true, }, { pubkey: accounts.protocol, isWritable: false, isSigner: false, }, { pubkey: accounts.rfq, isWritable: false, isSigner: false, }, { pubkey: accounts.response, 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 }