diff --git a/ts/client/src/client.ts b/ts/client/src/client.ts index f13c469b2..87d6e3c18 100644 --- a/ts/client/src/client.ts +++ b/ts/client/src/client.ts @@ -134,7 +134,7 @@ export class MangoClient { securityAdmin?: PublicKey, testing?: number, version?: number, - depositLimitQuote?: number, + depositLimitQuote?: BN, ): Promise { return await this.program.methods .groupEdit( @@ -143,7 +143,7 @@ export class MangoClient { securityAdmin ?? null, testing ?? null, version ?? null, - depositLimitQuote !== undefined ? new BN(depositLimitQuote) : null, + depositLimitQuote !== undefined ? depositLimitQuote : null, ) .accounts({ group: group.publicKey, diff --git a/ts/client/src/scripts/mb-admin.ts b/ts/client/src/scripts/mb-admin.ts index b11d55df0..f3c3cbcc9 100644 --- a/ts/client/src/scripts/mb-admin.ts +++ b/ts/client/src/scripts/mb-admin.ts @@ -161,6 +161,26 @@ async function changeAdmin() { ); } +async function setDepositLimit() { + const result = await buildAdminClient(); + const client = result[0]; + const admin = result[1]; + const creator = result[2]; + + const group = await client.getGroupForCreator(creator.publicKey, GROUP_NUM); + + console.log(`Setting a deposit limit...`); + await client.groupEdit( + group, + new PublicKey('DSiGNQaKhFCSZbg4HczqCtPAPb1xV51c9GfbfqcVKTB4'), + new PublicKey('DSiGNQaKhFCSZbg4HczqCtPAPb1xV51c9GfbfqcVKTB4'), + new PublicKey('DSiGNQaKhFCSZbg4HczqCtPAPb1xV51c9GfbfqcVKTB4'), + undefined, + undefined, + toNative(100, 6), + ); +} + async function registerTokens() { const result = await buildAdminClient(); const client = result[0]; @@ -630,6 +650,7 @@ async function main() { try { // await createGroup(); // await changeAdmin(); + // await setDepositLimit(); } catch (error) { console.log(error); }