From c02b0ccb50213494886816db50e1c058daf65caa Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sat, 7 Dec 2024 15:29:39 +0800 Subject: [PATCH] fixed api has changed --- src/stores/useStakingStore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/useStakingStore.ts b/src/stores/useStakingStore.ts index e833259c..e5c56a2c 100644 --- a/src/stores/useStakingStore.ts +++ b/src/stores/useStakingStore.ts @@ -134,7 +134,9 @@ export const useStakingStore = defineStore('stakingStore', { if(this.blockchain.current?.providerChain?.api && this.blockchain.current.providerChain.api.length > 0) { const client = CosmosRestClient.newDefault(this.blockchain.current.providerChain.api[0].address) await client.getStakingValidators('BOND_STATUS_BONDED', 500).then((res) => { this.validators = res.validators }); - return client.getInterchainSecurityConsumerValidators(chain_id) + const id_map = {"neutron": "0", "stride": "1"} as Record; + const consumer_id = Object.keys(id_map).find((k) => chain_id.startsWith(k)) || 0; + return client.getInterchainSecurityConsumerValidators(id_map[consumer_id]) } else { return { validators: [] } }