/** * 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 { SetPriceFeedParams, setPriceFeedParamsBeet, } from '../types/SetPriceFeedParams' /** * @category Instructions * @category SetPriceFeed * @category generated */ export type SetPriceFeedInstructionArgs = { params: SetPriceFeedParams } /** * @category Instructions * @category SetPriceFeed * @category generated */ export const setPriceFeedStruct = new beet.FixableBeetArgsStruct< SetPriceFeedInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['params', setPriceFeedParamsBeet], ], 'SetPriceFeedInstructionArgs' ) /** * Accounts required by the _setPriceFeed_ instruction * * @property [_writable_, **signer**] admin * @property [_writable_] priceFeed * @category Instructions * @category SetPriceFeed * @category generated */ export type SetPriceFeedInstructionAccounts = { admin: web3.PublicKey priceFeed: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const setPriceFeedInstructionDiscriminator = [ 13, 15, 231, 129, 61, 7, 28, 122, ] /** * Creates a _SetPriceFeed_ 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 SetPriceFeed * @category generated */ export function createSetPriceFeedInstruction( accounts: SetPriceFeedInstructionAccounts, args: SetPriceFeedInstructionArgs, programId: web3.PublicKey ) { const [data] = setPriceFeedStruct.serialize({ instructionDiscriminator: setPriceFeedInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.admin, isWritable: true, isSigner: true, }, { pubkey: accounts.priceFeed, 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 } /** * Creates a _SetPriceFeed_ instructionAccounts. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category SetPriceFeed * @category generated */ export function createSetPriceFeedInstructionAccounts( accounts: SetPriceFeedInstructionAccounts, programId: web3.PublicKey ) { const keys: web3.AccountMeta[] = [ { pubkey: accounts.admin, isWritable: true, isSigner: true, }, { pubkey: accounts.priceFeed, isWritable: true, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } return keys }