/** * 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 { QuoteSide, quoteSideBeet } from '../types/QuoteSide' /** * @category Instructions * @category ConfirmResponse * @category generated */ export type ConfirmResponseInstructionArgs = { side: QuoteSide overrideLegMultiplierBps: beet.COption } /** * @category Instructions * @category ConfirmResponse * @category generated */ export const confirmResponseStruct = new beet.FixableBeetArgsStruct< ConfirmResponseInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['side', quoteSideBeet], ['overrideLegMultiplierBps', beet.coption(beet.u64)], ], 'ConfirmResponseInstructionArgs' ) /** * Accounts required by the _confirmResponse_ instruction * * @property [**signer**] taker * @property [] protocol * @property [_writable_] rfq * @property [_writable_] response * @property [_writable_] collateralInfo * @property [_writable_] makerCollateralInfo * @property [] collateralToken * @property [] riskEngine * @category Instructions * @category ConfirmResponse * @category generated */ export type ConfirmResponseInstructionAccounts = { taker: web3.PublicKey protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey collateralInfo: web3.PublicKey makerCollateralInfo: web3.PublicKey collateralToken: web3.PublicKey riskEngine: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const confirmResponseInstructionDiscriminator = [ 24, 85, 232, 207, 17, 227, 4, 132, ] /** * Creates a _ConfirmResponse_ 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 ConfirmResponse * @category generated */ export function createConfirmResponseInstruction( accounts: ConfirmResponseInstructionAccounts, args: ConfirmResponseInstructionArgs, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = confirmResponseStruct.serialize({ instructionDiscriminator: confirmResponseInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.taker, isWritable: false, isSigner: true, }, { pubkey: accounts.protocol, isWritable: false, isSigner: false, }, { pubkey: accounts.rfq, isWritable: true, isSigner: false, }, { pubkey: accounts.response, isWritable: true, isSigner: false, }, { pubkey: accounts.collateralInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.makerCollateralInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.collateralToken, isWritable: false, isSigner: false, }, { pubkey: accounts.riskEngine, 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 }