From a1e80c4cdaed3418697015a41e158af443e11f3a Mon Sep 17 00:00:00 2001 From: kelvinlau20100 <53942902+kelvinlau20100@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:25:08 +0800 Subject: [PATCH] trigger admin (#264) --- CHANGELOG.md | 2 ++ src/idl/zeta.json | 27 +++++++++++++++++++++- src/program-types.ts | 1 + src/types/zeta.ts | 54 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a9724dc..e12393c35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Version changes are pinned to SDK releases. ## Unreleased +- Add trigger admin to state account. ([#264](https://github.com/zetamarkets/sdk/pull/264)) + ## [1.8.1] 2023-09-01 - Default reduceOnly to true in trigger orders. ([#263](https://github.com/zetamarkets/sdk/pull/263)) diff --git a/src/idl/zeta.json b/src/idl/zeta.json index 7d7f7a1cf..e2346747b 100644 --- a/src/idl/zeta.json +++ b/src/idl/zeta.json @@ -1002,6 +1002,27 @@ ], "args": [] }, + { + "name": "updateTriggerAdmin", + "accounts": [ + { + "name": "state", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "newAdmin", + "isMut": true, + "isSigner": true + } + ], + "args": [] + }, { "name": "updateReferralsAdmin", "accounts": [ @@ -6710,12 +6731,16 @@ ] } }, + { + "name": "triggerAdmin", + "type": "publicKey" + }, { "name": "padding", "type": { "array": [ "u8", - 338 + 306 ] } } diff --git a/src/program-types.ts b/src/program-types.ts index 060ce1f77..e74c5c7f4 100644 --- a/src/program-types.ts +++ b/src/program-types.ts @@ -36,6 +36,7 @@ export interface State { nativeOpenInterestLimit: anchor.BN; haltStates: Array; haltStatesPadding: Array; + triggerAdmin: PublicKey; padding: Array; } diff --git a/src/types/zeta.ts b/src/types/zeta.ts index 4af80234d..6417b9293 100644 --- a/src/types/zeta.ts +++ b/src/types/zeta.ts @@ -1002,6 +1002,27 @@ export type Zeta = { ], "args": [] }, + { + "name": "updateTriggerAdmin", + "accounts": [ + { + "name": "state", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "newAdmin", + "isMut": true, + "isSigner": true + } + ], + "args": [] + }, { "name": "updateReferralsAdmin", "accounts": [ @@ -6710,12 +6731,16 @@ export type Zeta = { ] } }, + { + "name": "triggerAdmin", + "type": "publicKey" + }, { "name": "padding", "type": { "array": [ "u8", - 338 + 306 ] } } @@ -11091,6 +11116,27 @@ export const IDL: Zeta = { ], "args": [] }, + { + "name": "updateTriggerAdmin", + "accounts": [ + { + "name": "state", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "newAdmin", + "isMut": true, + "isSigner": true + } + ], + "args": [] + }, { "name": "updateReferralsAdmin", "accounts": [ @@ -16799,12 +16845,16 @@ export const IDL: Zeta = { ] } }, + { + "name": "triggerAdmin", + "type": "publicKey" + }, { "name": "padding", "type": { "array": [ "u8", - 338 + 306 ] } }