diff --git a/ts/client/scripts/mb-create-gov-ix.ts b/ts/client/scripts/mb-create-gov-ix.ts index e2e6ac8af..304b7e431 100644 --- a/ts/client/scripts/mb-create-gov-ix.ts +++ b/ts/client/scripts/mb-create-gov-ix.ts @@ -13,7 +13,11 @@ import fs from 'fs'; import { TokenIndex } from '../src/accounts/bank'; import { Builder } from '../src/builder'; import { MangoClient } from '../src/client'; -import { NullTokenEditParams } from '../src/clientIxParamBuilder'; +import { + buildIxGate, + NullTokenEditParams, + TrueIxGateParams, +} from '../src/clientIxParamBuilder'; import { MANGO_V4_ID, OPENBOOK_PROGRAM_ID } from '../src/constants'; import { bpsToDecimal, percentageToDecimal, toNative } from '../src/utils'; @@ -294,12 +298,35 @@ async function perpCreate(): Promise { console.log(serializeInstructionToBase64(ix)); } +async function ixDisable(): Promise { + const result = await buildAdminClient(); + const client = result[0]; + const admin = result[1]; + + const group = await client.getGroup( + new PublicKey('78b8f4cGCwmZ9ysPFMWLaLTkkaYnUjwMJYStWe5RTSSX'), + ); + + const ixGateParams = TrueIxGateParams; + ixGateParams.HealthRegion = false; + const ix = await client.program.methods + .ixGateSet(buildIxGate(ixGateParams)) + .accounts({ + group: group.publicKey, + admin: group.securityAdmin, + }) + .instruction(); + + console.log(await serializeInstructionToBase64(ix)); +} + async function main(): Promise { try { // await tokenRegister(); // await tokenEdit(); // await perpCreate(); - await serum3Register(); + // await serum3Register(); + await ixDisable(); } catch (error) { console.log(error); } diff --git a/ts/client/src/clientIxParamBuilder.ts b/ts/client/src/clientIxParamBuilder.ts index 2fc2dcefb..1148656f5 100644 --- a/ts/client/src/clientIxParamBuilder.ts +++ b/ts/client/src/clientIxParamBuilder.ts @@ -171,6 +171,7 @@ export interface IxGateParams { TokenRegisterTrustless: boolean; TokenUpdateIndexAndRate: boolean; TokenWithdraw: boolean; + AccountBuybackFeesWithMngo: boolean; } // Default with all ixs enabled, use with buildIxGate @@ -226,6 +227,7 @@ export const TrueIxGateParams: IxGateParams = { TokenRegisterTrustless: true, TokenUpdateIndexAndRate: true, TokenWithdraw: true, + AccountBuybackFeesWithMngo: true, }; // build ix gate e.g. buildIxGate(Builder(TrueIxGateParams).TokenDeposit(false).build()).toNumber(), @@ -291,7 +293,7 @@ export function buildIxGate(p: IxGateParams): BN { toggleIx(ixGate, p, 'TokenRegisterTrustless', 45); toggleIx(ixGate, p, 'TokenUpdateIndexAndRate', 46); toggleIx(ixGate, p, 'TokenWithdraw', 47); - toggleIx(ixGate, p, 'AccountSettleFeesWithMngo', 48); + toggleIx(ixGate, p, 'AccountBuybackFeesWithMngo', 48); return ixGate; }