From 4465b8773ff815d80b0822d1d8a44209789dc0f8 Mon Sep 17 00:00:00 2001 From: Zamiel Chia Date: Mon, 15 Apr 2024 16:47:37 +0800 Subject: [PATCH] feat: add vote state with latency (#25) --- .../src/idls/shank/native/vote.ts | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/packages/explorerkit-idls/src/idls/shank/native/vote.ts b/packages/explorerkit-idls/src/idls/shank/native/vote.ts index ade30a0..a2ef3ec 100644 --- a/packages/explorerkit-idls/src/idls/shank/native/vote.ts +++ b/packages/explorerkit-idls/src/idls/shank/native/vote.ts @@ -84,6 +84,79 @@ export const VoteIDL: Idl = { ], }, }, + { + name: "VoteStateWithLatency", + type: { + kind: "struct", + fields: [ + { + name: "node_pubkey", + type: "publicKey", + }, + { + name: "authorized_withdrawer", + type: "publicKey", + }, + { + name: "commission", + type: "u8", + }, + { + name: "votes", + type: { + vec: { + defined: "LandedVote", + }, + size: "u64", + }, + }, + { + name: "root_slot", + type: { + option: "u64", + }, + }, + { + name: "authorized_voters", + type: { + bTreeMap: ["u64", "publicKey"], + size: "u64", + }, + }, + { + name: "prior_voters", + type: { + defined: "PriorVoters", + }, + }, + { + name: "epoch_credits", + type: { + vec: { + tuple: [ + { + defined: "Epoch", + }, + { + defined: "Credits", + }, + { + defined: "PrevCredits", + }, + ], + }, + size: "u64", + }, + }, + { + name: "last_timestamp", + type: { + defined: "BlockTimestamp", + }, + }, + ], + }, + }, ], instructions: [ { @@ -828,6 +901,24 @@ export const VoteIDL: Idl = { ], }, }, + { + name: "LandedVote", + type: { + kind: "struct", + fields: [ + { + name: "latency", + type: "u8", + }, + { + name: "lockout", + type: { + defined: "Lockout", + }, + }, + ], + }, + }, ], metadata: { origin: "shank",