/** * 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 { RiskCategory, riskCategoryBeet } from '../types/RiskCategory' import { OracleSource, oracleSourceBeet } from '../types/OracleSource' import { CustomOptionalPubkey, customOptionalPubkeyBeet, } from '../types/CustomOptionalPubkey' import { CustomOptionalF64, customOptionalF64Beet, } from '../types/CustomOptionalF64' /** * @category Instructions * @category ChangeBaseAssetParameters * @category generated */ export type ChangeBaseAssetParametersInstructionArgs = { enabled: beet.COption riskCategory: beet.COption oracleSource: beet.COption switchboardOracle: CustomOptionalPubkey pythOracle: CustomOptionalPubkey inPlacePrice: CustomOptionalF64 strict: beet.COption } /** * @category Instructions * @category ChangeBaseAssetParameters * @category generated */ export const changeBaseAssetParametersStruct = new beet.FixableBeetArgsStruct< ChangeBaseAssetParametersInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['enabled', beet.coption(beet.bool)], ['riskCategory', beet.coption(riskCategoryBeet)], ['oracleSource', beet.coption(oracleSourceBeet)], ['switchboardOracle', customOptionalPubkeyBeet], ['pythOracle', customOptionalPubkeyBeet], ['inPlacePrice', customOptionalF64Beet], ['strict', beet.coption(beet.bool)], ], 'ChangeBaseAssetParametersInstructionArgs' ) /** * Accounts required by the _changeBaseAssetParameters_ instruction * * @property [**signer**] authority * @property [] protocol * @property [_writable_] baseAsset * @category Instructions * @category ChangeBaseAssetParameters * @category generated */ export type ChangeBaseAssetParametersInstructionAccounts = { authority: web3.PublicKey protocol: web3.PublicKey baseAsset: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const changeBaseAssetParametersInstructionDiscriminator = [ 122, 90, 152, 153, 43, 228, 148, 7, ] /** * Creates a _ChangeBaseAssetParameters_ 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 ChangeBaseAssetParameters * @category generated */ export function createChangeBaseAssetParametersInstruction( accounts: ChangeBaseAssetParametersInstructionAccounts, args: ChangeBaseAssetParametersInstructionArgs, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = changeBaseAssetParametersStruct.serialize({ instructionDiscriminator: changeBaseAssetParametersInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.authority, isWritable: false, isSigner: true, }, { pubkey: accounts.protocol, isWritable: false, isSigner: false, }, { pubkey: accounts.baseAsset, 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 }