/** * 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 { FeeParameters, feeParametersBeet } from '../types/FeeParameters' /** * @category Instructions * @category ChangeProtocolFees * @category generated */ export type ChangeProtocolFeesInstructionArgs = { settleFees: beet.COption defaultFees: beet.COption assetAddFee: beet.COption } /** * @category Instructions * @category ChangeProtocolFees * @category generated */ export const changeProtocolFeesStruct = new beet.FixableBeetArgsStruct< ChangeProtocolFeesInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['settleFees', beet.coption(feeParametersBeet)], ['defaultFees', beet.coption(feeParametersBeet)], ['assetAddFee', beet.coption(beet.u64)], ], 'ChangeProtocolFeesInstructionArgs' ) /** * Accounts required by the _changeProtocolFees_ instruction * * @property [**signer**] authority * @property [_writable_] protocol * @category Instructions * @category ChangeProtocolFees * @category generated */ export type ChangeProtocolFeesInstructionAccounts = { authority: web3.PublicKey protocol: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const changeProtocolFeesInstructionDiscriminator = [ 252, 117, 94, 243, 188, 62, 240, 52, ] /** * Creates a _ChangeProtocolFees_ 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 ChangeProtocolFees * @category generated */ export function createChangeProtocolFeesInstruction( accounts: ChangeProtocolFeesInstructionAccounts, args: ChangeProtocolFeesInstructionArgs, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = changeProtocolFeesStruct.serialize({ instructionDiscriminator: changeProtocolFeesInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.authority, isWritable: false, isSigner: true, }, { pubkey: accounts.protocol, 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 }