fixed api has changed

This commit is contained in:
liangping 2024-12-07 15:29:39 +08:00
parent 277c68d30a
commit c02b0ccb50

View File

@ -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<string, string>;
const consumer_id = Object.keys(id_map).find((k) => chain_id.startsWith(k)) || 0;
return client.getInterchainSecurityConsumerValidators(id_map[consumer_id])
} else {
return { validators: [] }
}