/** * 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 SettleOnePartyDefault * @category generated */ export const settleOnePartyDefaultStruct = new beet.BeetArgsStruct<{ instructionDiscriminator: number[] /* size: 8 */ }>( [['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'SettleOnePartyDefaultInstructionArgs' ) /** * Accounts required by the _settleOnePartyDefault_ instruction * * @property [] protocol * @property [_writable_] rfq * @property [_writable_] response * @property [_writable_] takerCollateralInfo * @property [_writable_] makerCollateralInfo * @property [_writable_] takerCollateralTokens * @property [_writable_] makerCollateralTokens * @property [_writable_] protocolCollateralTokens * @category Instructions * @category SettleOnePartyDefault * @category generated */ export type SettleOnePartyDefaultInstructionAccounts = { protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey takerCollateralInfo: web3.PublicKey makerCollateralInfo: web3.PublicKey takerCollateralTokens: web3.PublicKey makerCollateralTokens: web3.PublicKey protocolCollateralTokens: web3.PublicKey tokenProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const settleOnePartyDefaultInstructionDiscriminator = [ 133, 121, 215, 90, 134, 49, 138, 180, ] /** * Creates a _SettleOnePartyDefault_ instruction. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category SettleOnePartyDefault * @category generated */ export function createSettleOnePartyDefaultInstruction( accounts: SettleOnePartyDefaultInstructionAccounts, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = settleOnePartyDefaultStruct.serialize({ instructionDiscriminator: settleOnePartyDefaultInstructionDiscriminator, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.protocol, isWritable: false, isSigner: false, }, { pubkey: accounts.rfq, isWritable: true, isSigner: false, }, { pubkey: accounts.response, isWritable: true, isSigner: false, }, { pubkey: accounts.takerCollateralInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.makerCollateralInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.takerCollateralTokens, isWritable: true, isSigner: false, }, { pubkey: accounts.makerCollateralTokens, isWritable: true, isSigner: false, }, { pubkey: accounts.protocolCollateralTokens, isWritable: true, isSigner: false, }, { pubkey: accounts.tokenProgram ?? splToken.TOKEN_PROGRAM_ID, 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 }