import { BN, Program } from "@project-serum/anchor"; import { TransactionInstruction } from "@solana/web3.js"; import { Cronos } from "../idl"; import { Account } from "../account"; export type ConfigUpdateWorkerFeeArgs = { newWorkerFee: BN; }; export class ConfigUpdateWorkerFee { private account: Account; private cronos: Program; constructor(account: Account, cronos: Program) { this.account = account; this.cronos = cronos; } public async configUpdateWorkerFee({ newWorkerFee, }: ConfigUpdateWorkerFeeArgs): Promise { const configPDA = await this.account.config.pda(); const configData = await this.account.config.data(configPDA.address); return this.cronos.instruction.configUpdateWorkerFee(newWorkerFee, { accounts: { admin: configData.admin, config: configPDA.address, }, }); } }