/** * 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 '@metaplex-foundation/beet' import * as web3 from '@solana/web3.js' import { QuoteExecutorParams, quoteExecutorParamsBeet, } from '../types/QuoteExecutorParams' /** * @category Instructions * @category QuoteExecutor * @category generated */ export type QuoteExecutorInstructionArgs = { params: QuoteExecutorParams } /** * @category Instructions * @category QuoteExecutor * @category generated */ export const quoteExecutorStruct = new beet.FixableBeetArgsStruct< QuoteExecutorInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['params', quoteExecutorParamsBeet], ], 'QuoteExecutorInstructionArgs' ) /** * Accounts required by the _quoteExecutor_ instruction * * @property [] executorConfig * @property [] priceFeedProgram * @property [] priceFeedConfig * @category Instructions * @category QuoteExecutor * @category generated */ export type QuoteExecutorInstructionAccounts = { executorConfig: web3.PublicKey priceFeedProgram: web3.PublicKey priceFeedConfig: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const quoteExecutorInstructionDiscriminator = [ 84, 246, 255, 191, 82, 65, 164, 92, ] /** * Creates a _QuoteExecutor_ 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 QuoteExecutor * @category generated */ export function createQuoteExecutorInstruction( accounts: QuoteExecutorInstructionAccounts, args: QuoteExecutorInstructionArgs, programId: web3.PublicKey ) { const [data] = quoteExecutorStruct.serialize({ instructionDiscriminator: quoteExecutorInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.executorConfig, isWritable: false, isSigner: false, }, { pubkey: accounts.priceFeedProgram, isWritable: false, isSigner: false, }, { pubkey: accounts.priceFeedConfig, 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 } /** * Creates a _QuoteExecutor_ instructionAccounts. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category QuoteExecutor * @category generated */ export function createQuoteExecutorInstructionAccounts( accounts: QuoteExecutorInstructionAccounts, programId: web3.PublicKey ) { const keys: web3.AccountMeta[] = [ { pubkey: accounts.executorConfig, isWritable: false, isSigner: false, }, { pubkey: accounts.priceFeedProgram, isWritable: false, isSigner: false, }, { pubkey: accounts.priceFeedConfig, isWritable: false, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } return keys }