diff --git a/packages/dashboard/src/plugins/pinia/ClientProperties.ts b/packages/dashboard/src/plugins/pinia/ClientProperties.ts
new file mode 100644
index 00000000..d8320a37
--- /dev/null
+++ b/packages/dashboard/src/plugins/pinia/ClientProperties.ts
@@ -0,0 +1,11 @@
+import type { RPCClient } from '@/libs/client.rpc'
+import 'pinia'
+import type { Ref } from 'vue'
+
+declare module 'pinia' {
+ export interface PiniaCustomProperties {
+ // by using a setter we can allow both strings and refs
+ set rpc(value: RPCClient | Ref)
+ get rpc(): RPCClient
+ }
+}
\ No newline at end of file
diff --git a/packages/dashboard/src/plugins/pinia/dashboardPlugin.ts b/packages/dashboard/src/plugins/pinia/dashboardPlugin.ts
new file mode 100644
index 00000000..9e4a6415
--- /dev/null
+++ b/packages/dashboard/src/plugins/pinia/dashboardPlugin.ts
@@ -0,0 +1,10 @@
+import type { PiniaPluginContext } from "pinia"
+
+export function DashboardPlugin(context: PiniaPluginContext) {
+ context.pinia // the pinia created with `createPinia()`
+ context.app // the current app created with `createApp()` (Vue 3 only)
+ context.store // the store the plugin is augmenting
+ context.options // the options object defining the store passed to `defineStore()`
+ // ...
+ context.store.$subscribe((m, s) => console.log(m, s))
+}
\ No newline at end of file
diff --git a/packages/dashboard/src/plugins/vuetify/styles/styles.scss b/packages/dashboard/src/plugins/vuetify/styles/styles.scss
index 3118a334..bc98a842 100644
--- a/packages/dashboard/src/plugins/vuetify/styles/styles.scss
+++ b/packages/dashboard/src/plugins/vuetify/styles/styles.scss
@@ -1 +1,4 @@
// Write your overrides
+.card-box {
+ border: 1px solid rgb(var(--v-theme-primary));
+}
\ No newline at end of file
diff --git a/packages/dashboard/src/stores/useBankStore.ts b/packages/dashboard/src/stores/useBankStore.ts
index c6668d03..21dafbcc 100644
--- a/packages/dashboard/src/stores/useBankStore.ts
+++ b/packages/dashboard/src/stores/useBankStore.ts
@@ -1,65 +1,48 @@
import { defineStore } from "pinia";
import { useBlockchain } from "./useBlockchain";
-import { createBankClientForChain } from "@/libs/client";
-import { QuerySupplyOfRequest, type QueryTotalSupplyRequest, type QueryTotalSupplyResponseSDKType } from "@ping-pub/codegen/src/cosmos/bank/v1beta1/query";
-import type { CoinSDKType } from "@ping-pub/codegen/src/cosmos/base/v1beta1/coin";
+import type { QueryTotalSupplyResponse, QueryTotalSupplyRequest } from "@ping-pub/codegen/src/cosmos/bank/v1beta1/query";
+import type { Coin } from "@ping-pub/codegen/src/cosmos/base/v1beta1/coin";
import { useStakingStore } from "./useStakingStore";
+import { createRpcQueryExtension } from '@ping-pub/codegen/src/cosmos/bank/v1beta1/query.rpc.Query'
+import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
+import { QueryClient } from "@cosmjs/stargate";
export const useBankStore = defineStore('bankstore', {
state: () => {
return {
- supply: {} as CoinSDKType,
- balances: {} as Record,
- totalSupply: {supply: []} as QueryTotalSupplyResponseSDKType,
+ supply: {} as Coin,
+ balances: {} as Record,
+ totalSupply: {supply: []} as QueryTotalSupplyResponse,
}
},
getters: {
blockchain() {
return useBlockchain()
},
- client() {
- const chain = useBlockchain()
- return createBankClientForChain(chain.chainName, chain.restClient)
- },
staking() {
return useStakingStore()
}
},
actions: {
initial() {
- this.supply = {} as CoinSDKType
- const denom = this.staking.params.bond_denom || this.blockchain.current.assets[0].base
- this.fetchSupply(denom).then(res => {
- if(res.amount) this.supply = res.amount
- })
+ this.$reset()
+ this.supply = {} as Coin
+ const denom = this.staking.params.bondDenom || this.blockchain.current?.assets[0].base
+ if(denom) {
+ this.blockchain.rpc.supplyOf(denom).then(res => {
+ if(res.amount) this.supply = res.amount
+ })
+ }
},
-
- // cacheBalance(address: string, balances: CoinSDKType[]) {
- // if(this.balances[address]) {
- // this.balances[address] = [...this.balances[address], ... balances]
- // }else {
- // this.balances[address] = balances
- // }
- // },
- // async fetchBalance(param: QueryBalanceRequest) : Promise {
- // const response : QueryBalanceResponseSDKType = await this.lcdClient.balance(param)
- // if (response.balance) this.cacheBalance(param.address, [response.balance])
- // return response
- // },
- // async fetchAllBalance(param: QueryAllBalancesRequest) : Promise {
- // const response : QueryAllBalancesResponseSDKType = await this.lcdClient.allBalances(param)
- // if (response.balances) this.cacheBalance(param.address, response.balances)
+ // async fetchTotalSupply(param: QueryTotalSupplyRequest): Promise {
+ // const response = await this.blockchain.rpc.(param)
+ // this.totalSupply.supply = [...this.totalSupply.supply, ...response.supply]
+ // this.totalSupply.pagination = response.pagination
// return response
- // },
- async fetchTotalSupply(param: QueryTotalSupplyRequest): Promise {
- const response = await this.client.totalSupply(param)
- this.totalSupply.supply = [...this.totalSupply.supply, ...response.supply]
- this.totalSupply.pagination = response.pagination
- return response
- },
+ // },
async fetchSupply(denom: string) {
- return this.client.supplyOf( { denom } )
+ return this.blockchain.rpc.supplyOf( denom )
}
}
})
diff --git a/packages/dashboard/src/stores/useBaseStore.ts b/packages/dashboard/src/stores/useBaseStore.ts
index 8481af08..a0bc9d7f 100644
--- a/packages/dashboard/src/stores/useBaseStore.ts
+++ b/packages/dashboard/src/stores/useBaseStore.ts
@@ -1,19 +1,35 @@
import { defineStore } from "pinia";
import { createBaseClientForChain } from "@/libs/client";
import { useBlockchain } from "@/stores";
-import type { GetLatestBlockResponseSDKType } from "@ping-pub/codegen/src/cosmos/base/tendermint/v1beta1/query";
+import dayjs from "dayjs";
+import long from "long";
+import { PageRequest } from "@ping-pub/codegen/src/cosmos/base/query/v1beta1/pagination";
+import { newPageRequest } from "@/libs";
+
+import { createRpcQueryExtension } from '@ping-pub/codegen/src/cosmos/base/tendermint/v1beta1/query.rpc.Service'
+import { Tendermint34Client, type BlockResponse } from "@cosmjs/tendermint-rpc";
+import { QueryClient, createProtobufRpcClient, setupBankExtension, Setup } from "@cosmjs/stargate";
export const useBaseStore = defineStore('baseStore', {
state: () => {
return {
- latest: {} as GetLatestBlockResponseSDKType,
- recents: [] as GetLatestBlockResponseSDKType[]
+ earlest: {} as BlockResponse,
+ latest: {} as BlockResponse,
+ recents: [] as BlockResponse[]
}
},
getters: {
- client() {
- const chain = useBlockchain()
- return createBaseClientForChain(chain.chainName, chain.restClient)
+ blocktime(): number {
+ if(this.earlest && this.latest) {
+ if(this.latest.block?.header?.height !== this.earlest.block?.header?.height) {
+ const diff = dayjs(this.latest.block?.header?.time).diff(this.earlest.block?.header?.time)
+ return diff
+ }
+ }
+ return 6000
+ },
+ blockchain() {
+ return useBlockchain()
}
},
actions: {
@@ -22,20 +38,32 @@ export const useBaseStore = defineStore('baseStore', {
},
async clearRecentBlocks() {
this.recents = []
- },
+ },
async fetchLatest() {
- this.latest = await this.client.getLatestBlock()
+ this.latest = await this.blockchain.rpc.block()
+ if(!this.earlest || this.earlest.block?.header?.chainId != this.latest.block?.header?.chainId) {
+ //reset earlest and recents
+ this.earlest = this.latest
+ this.recents = []
+ }
if(this.recents.length>= 50) {
this.recents.pop()
}
this.recents.push(this.latest)
return this.latest
},
- async fetchSync() {
- return this.client.getSyncing()
+
+ async fetchValidatorByHeight(height?: number, offset = 0) {
+ return this.blockchain.rpc.validatorsAtHeight(height)
},
- async fetchNodeInfo() {
- return this.client.getNodeInfo()
- }
+ async fetchLatestValidators(offset = 0) {
+ return this.blockchain.rpc.validatorsAtHeight()
+ },
+ async fetchBlock(height: number) {
+ return this.blockchain.rpc.block(height)
+ },
+ // async fetchNodeInfo() {
+ // return this.blockchain.rpc.no()
+ // }
}
})
\ No newline at end of file
diff --git a/packages/dashboard/src/stores/useBlockchain.ts b/packages/dashboard/src/stores/useBlockchain.ts
index 216e96e5..1a75b91d 100644
--- a/packages/dashboard/src/stores/useBlockchain.ts
+++ b/packages/dashboard/src/stores/useBlockchain.ts
@@ -1,5 +1,5 @@
import { defineStore } from "pinia";
-import { useDashboard, type ChainConfig } from "./useDashboard";
+import { useDashboard, type ChainConfig, type Endpoint, EndpointType } from "./useDashboard";
import { LCDClient } from '@osmonauts/lcd'
import type { VerticalNavItems } from '@/@layouts/types'
import { useRouter } from "vue-router";
@@ -7,36 +7,30 @@ import { useStakingStore } from "./useStakingStore";
import { useBankStore } from "./useBankStore";
import { useBaseStore } from "./useBaseStore";
import { useGovStore } from "./useGovStore";
+import { RPCClient } from '../libs/client.rpc'
+import { ref } from "vue";
export const useBlockchain = defineStore("blockchain", {
state: () => {
return {
status: {} as Record,
rest: '',
- chainName: ""
+ chainName: "",
+ endpoint: {} as {
+ type?: EndpointType,
+ address: string
+ provider: string
+ },
+ connErr: ""
}
},
getters: {
- current() : ChainConfig {
+ current() : ChainConfig | undefined {
return this.dashboard.chains[this.chainName]
},
logo(): string {
return this.current?.logo || ''
},
- availableEndpoint() : string {
- const all = this.current?.endpoints?.rest
- if(all) {
- if(this.rest || all.findIndex(x => x.address === this.rest) < 0) {
- const rn = Math.random()
- const endpoint = all[Math.floor(rn * all.length)]
- this.rest = endpoint?.address || ''
- }
- }
- return this.rest
- },
- restClient() : LCDClient {
- return new LCDClient({restEndpoint: this.rest})
- },
dashboard() {
return useDashboard()
},
@@ -46,6 +40,7 @@ export const useBlockchain = defineStore("blockchain", {
const router = useRouter()
const routes = router?.getRoutes()||[]
+ console.log(routes)
if(this.current && routes) {
currNavItem = [{
title: this.current?.prettyName || this.chainName || '',
@@ -99,16 +94,35 @@ export const useBlockchain = defineStore("blockchain", {
},
actions: {
async initial() {
+ console.log('begin Setup')
+ await this.randomSetupEndpoint()
+ console.log('rpc setup')
await useStakingStore().init()
- await useBankStore().initial()
+ useBankStore().initial()
useBaseStore().initial()
useGovStore().initial()
+
},
- setRestEndpoint(endpoint: string) {
- this.rest = endpoint
+
+ async randomSetupEndpoint() {
+ const all = this.current?.endpoints?.rpc
+ if(all) {
+ const rn = Math.random()
+ const endpoint = all[Math.floor(rn * all.length)]
+ await this.setRestEndpoint(endpoint)
+ }
+ },
+
+ async setRestEndpoint(endpoint: Endpoint) {
+ this.connErr = ''
+ this.endpoint = endpoint
+ this.rpc = new RPCClient(endpoint.address)
+ console.log(this.rpc.endpoint)
},
setCurrent(name: string) {
this.chainName = name
- }
+ console.log('set current', name)
+ },
+
}
})
diff --git a/packages/dashboard/src/stores/useDashboard.ts b/packages/dashboard/src/stores/useDashboard.ts
index 5c21d53b..912cff46 100644
--- a/packages/dashboard/src/stores/useDashboard.ts
+++ b/packages/dashboard/src/stores/useDashboard.ts
@@ -209,10 +209,6 @@ export const useDashboard = defineStore('dashboard', {
}
},
getters: {
- current() : string {
- const blockchain = useBlockchain()
- return blockchain.chainName || this.favorite[0] || ''
- },
length() : number {
return Object.keys(this.chains).length
}
@@ -234,14 +230,29 @@ export const useDashboard = defineStore('dashboard', {
}
},
async loadingFromLocal() {
- const source = this.networkType === NetworkType.Mainnet
+ const source: Record = this.networkType === NetworkType.Mainnet
? import.meta.glob('../../chains/mainnet/*.json', {eager: true})
: import.meta.glob('../../chains/testnet/*.json', {eager: true})
- Object.values(source).forEach((x: LocalConfig) => {
+ Object.values(source).forEach((x: LocalConfig) => {
this.chains[x.chain_name] = fromLocal(x)
})
+ this.setupDefault()
this.status = LoadingStatus.Loaded
},
+ setupDefault() {
+ if(this.length > 0) {
+ const blockchain = useBlockchain()
+ for(let i=0; i < this.favorite.length; i++) {
+ if(!blockchain.chainName && this.chains[this.favorite[i]]) {
+ blockchain.setCurrent(this.favorite[i])
+ }
+ }
+ if(!blockchain.chainName) {
+ const [first] = Object.keys(this.chains)
+ blockchain.setCurrent(first)
+ }
+ }
+ },
setConfigSource(newSource: ConfigSource) {
this.source = newSource
this.initial()
diff --git a/packages/dashboard/src/stores/useDistributionStore.ts b/packages/dashboard/src/stores/useDistributionStore.ts
index 046f8b63..c3129f01 100644
--- a/packages/dashboard/src/stores/useDistributionStore.ts
+++ b/packages/dashboard/src/stores/useDistributionStore.ts
@@ -2,20 +2,23 @@ import { defineStore } from "pinia";
import { useBlockchain } from "./useBlockchain";
import { createDistributionClientForChain } from "@/libs/client";
+import { createRpcQueryExtension } from '@ping-pub/codegen/src/cosmos/distribution/v1beta1/query.rpc.Query'
+import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
+import { QueryClient } from "@cosmjs/stargate";
+
export const useDistributionStore = defineStore('distributionStore', {
state: () => {
return {
}
},
getters: {
- client() {
- const chain = useBlockchain()
- return createDistributionClientForChain(chain.chainName, chain.restClient)
+ blockchain() {
+ return useBlockchain()
}
},
actions: {
- fetchCommunityPool() {
- return this.client.communityPool()
+ async fetchCommunityPool() {
+ return this.blockchain.rpc.communityPool()
}
}
})
\ No newline at end of file
diff --git a/packages/dashboard/src/stores/useFormatter.ts b/packages/dashboard/src/stores/useFormatter.ts
index bba809c5..1fc32f55 100644
--- a/packages/dashboard/src/stores/useFormatter.ts
+++ b/packages/dashboard/src/stores/useFormatter.ts
@@ -47,9 +47,12 @@ export const useFormatter = defineStore('formatter', {
formatTokenAmount(token: {denom: string, amount: string;}) {
return this.formatToken(token, false)
},
- formatToken(token: { denom: string, amount: string;}, withDenom = true) : string {
+ formatToken2(token: { denom: string, amount: string;}, withDenom = true) {
+ return this.formatToken(token, true, '0,0.[00]')
+ },
+ formatToken(token: { denom: string, amount: string;}, withDenom = true, fmt='0.0a') : string {
if(token && token.amount) {
- let amount = Long.fromValue(token.amount)
+ let amount = Number(token.amount)
let denom = token.denom
const conf = this.blockchain.current?.assets?.find(x => x.base === token.denom || x.base.denom === token.denom)
if(conf) {
@@ -61,11 +64,11 @@ export const useFormatter = defineStore('formatter', {
}
})
if(unit && unit.exponent > 0) {
- amount = Long.fromValue(token.amount).divide(Math.pow(10, unit?.exponent))
+ amount = amount / Math.pow(10, unit?.exponent)
denom = unit.denom.toUpperCase()
}
}
- return `${numeral(amount).format('0.0a')} ${withDenom ? denom: ''}`
+ return `${numeral(amount).format(fmt)} ${withDenom ? denom: ''}`
}
return '-'
},
@@ -82,7 +85,7 @@ export const useFormatter = defineStore('formatter', {
}
return '-'
},
- calculatePercent(input?: string, total?: string ) {
+ calculatePercent(input?: string, total?: string|number ) {
if(!input || !total) return '0'
const percent = Number(input)/Number(total)
return numeral(percent).format("0.[00]%")
@@ -90,8 +93,11 @@ export const useFormatter = defineStore('formatter', {
formatDecimalToPercent(decimal: string) {
return numeral(decimal).format('0.[00]%')
},
- formatDateTo(date: string) {
- return dayjs(date).to
+ percent(decimal?: string) {
+ return decimal ? numeral(decimal).format('0.[00]%') : '-'
+ },
+ numberAndSign(input: number, fmt="+0,0") {
+ return numeral(input).format(fmt)
},
toDay(time?: string, format = 'long') {
if(!time) return ''
diff --git a/packages/dashboard/src/stores/useGovStore.ts b/packages/dashboard/src/stores/useGovStore.ts
index 2bf0f927..9f9c74a3 100644
--- a/packages/dashboard/src/stores/useGovStore.ts
+++ b/packages/dashboard/src/stores/useGovStore.ts
@@ -1,52 +1,47 @@
import { defineStore } from "pinia";
import { useBlockchain } from "./useBlockchain";
import { createGovRestClientForChain } from "@/libs/client";
-import type { ProposalStatus } from "@ping-pub/codegen/src/cosmos/gov/v1/gov";
+import type { DepositParams, ProposalStatus } from "@ping-pub/codegen/src/cosmos/gov/v1/gov";
import type { PageRequest } from "@ping-pub/codegen/src/helpers";
-import type { DepositParams, DepositParamsSDKType, TallyParams, TallyParamsSDKType, VotingParams, VotingParamsSDKType } from "@ping-pub/codegen/src/cosmos/gov/v1beta1/gov";
+import { createRpcQueryExtension } from '@ping-pub/codegen/src/cosmos/gov/v1beta1/query.rpc.Query'
+import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
+import { QueryClient } from "@cosmjs/stargate";
export const useGovStore = defineStore('govStore', {
state: () => {
return {
params: {
- deposit: {} as DepositParamsSDKType,
- voting: {} as VotingParamsSDKType,
- tally: {} as TallyParamsSDKType,
+ deposit: {} as DepositParams,
+ voting: {} as VotingParams,
+ tally: {} as TallyParams,
}
}
},
getters: {
- client() {
- const chain = useBlockchain()
- return createGovRestClientForChain(chain.chainName, chain.restClient)
+ blockchain() {
+ return useBlockchain()
}
},
actions: {
initial() {
this.fetchParams()
},
- fetchProposals( proposalStatus: ProposalStatus, pagination?: PageRequest ) {
+ async fetchProposals( proposalStatus: ProposalStatus, pagination?: PageRequest ) {
const param = {
proposalStatus,
voter: '',
depositor: '',
pagination,
}
- return this.client.proposals(param)
+ return this.blockchain.rpc.proposals(proposalStatus, '', '')
},
- fetchParams() {
- this.client.params({paramsType: 'deposit'}).then(x => {
- if(x.deposit_params) this.params.deposit = x.deposit_params
- })
- this.client.params({paramsType: 'voting'}).then(x => {
- if(x.voting_params) this.params.voting = x.voting_params
- })
- this.client.params({paramsType: 'tallying'}).then(x => {
- if(x.tally_params) this.params.tally = x.tally_params
- })
+ async fetchParams() {
+ // this.blockchain.rpc.govParam().then(x => {
+ // this.params.deposit = x.deposit
+ // })
},
- fetchTally(proposalId: Long) {
- return this.client.tallyResult({proposalId})
+ async fetchTally(proposalId: number) {
+ return this.blockchain.rpc.tally(proposalId)
}
}
})
diff --git a/packages/dashboard/src/stores/useMintStore.ts b/packages/dashboard/src/stores/useMintStore.ts
index 920f1002..6b6cb97a 100644
--- a/packages/dashboard/src/stores/useMintStore.ts
+++ b/packages/dashboard/src/stores/useMintStore.ts
@@ -2,6 +2,10 @@ import { defineStore } from "pinia";
import { useBlockchain } from "./useBlockchain";
import { createMintClientForChain } from "@/libs/client";
+import { createRpcQueryExtension } from '@ping-pub/codegen/src/cosmos/mint/v1beta1/query.rpc.Query'
+import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
+import { QueryClient, setupMintExtension } from "@cosmjs/stargate";
+
export const useMintStore = defineStore('mintStore', {
state: () => {
return {
@@ -9,16 +13,16 @@ export const useMintStore = defineStore('mintStore', {
}
},
getters: {
- client() {
- const chain = useBlockchain()
- return createMintClientForChain(chain.chainName, chain.restClient)
+ blockchain() {
+ return useBlockchain()
}
},
actions: {
- fetchInflation() {
- this.client.inflation({}).then(x => {
- this.inflation = String(x.inflation)
- console.log(this.inflation)
+ async fetchInflation() {
+ this.blockchain.rpc.inflation().then(x => {
+ this.inflation = String(x)
+ }).catch(err => {
+ this.inflation = ""
})
}
}
diff --git a/packages/dashboard/src/stores/useStakingStore.ts b/packages/dashboard/src/stores/useStakingStore.ts
index fabd3fab..9894bef9 100644
--- a/packages/dashboard/src/stores/useStakingStore.ts
+++ b/packages/dashboard/src/stores/useStakingStore.ts
@@ -1,36 +1,64 @@
import { defineStore } from "pinia";
import { useBlockchain } from "./useBlockchain";
-import { createStakingRestClientForChain } from "@/libs/client";
-import type { ParamsSDKType, PoolSDKType } from "@ping-pub/codegen/src/cosmos/staking/v1beta1/staking";
+import type { Params, Pool, Validator} from "@ping-pub/codegen/src/cosmos/staking/v1beta1/staking";
+
+import { get } from "@/libs/http";
+
+import type { BondStatusString } from "@/libs/client.rpc";
export const useStakingStore = defineStore('stakingStore', {
state: () => {
return {
- params: {} as ParamsSDKType,
- pool: {} as PoolSDKType,
+ validators: [] as Validator[],
+ params: {} ,
+ pool: {} as Pool | undefined,
}
},
getters: {
- client() {
- const chain = useBlockchain()
- return createStakingRestClientForChain(chain.chainName, chain.restClient)
+ totalPower(): number {
+ const sum = (s:number, e: Validator) => { return s + parseInt(e.delegatorShares) }
+ return this.validators ? this.validators.reduce(sum, 0): 0
+ },
+ blockchain() {
+ return useBlockchain()
}
},
actions: {
async init() {
+ this.$reset()
this.fetchPool()
+ this.fetchAcitveValdiators()
return await this.fetchParams()
},
+ async keybase(identity: string) {
+ return get(`https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=${identity}&fields=pictures`)
+ },
async fetchParams() {
- const response = await this.client.params({})
+ const response = await this.blockchain.rpc.stakingParams()
if(response.params) this.params = response.params
return this.params
},
- async fetchPool() {
- const response = await this.client.pool({})
- if(response.pool) {
- this.pool = response.pool
- }
+ async fetchPool() {
+ const response = await this.blockchain.rpc.stakingPool()
+ this.pool = response.pool
+ },
+ async fetchAcitveValdiators() {
+ return this.fetchValidators('BOND_STATUS_BONDED')
+ },
+ async fetchInacitveValdiators() {
+ return this.fetchValidators('BOND_STATUS_UNBONDED')
+ },
+ async fetchValidator(validatorAddr: string) {
+ return this.blockchain.rpc.validator(validatorAddr)
+ },
+ async fetchValidators(status: BondStatusString) {
+ return this.blockchain.rpc.validators(status, undefined).then(res => {
+ const vals = res.validators.sort((a, b) => (Number(b.delegatorShares) - Number(a.delegatorShares)))
+ if(status==='BOND_STATUS_BONDED') {
+ this.validators = vals
+ }
+ return vals
+ })
}
}
})
\ No newline at end of file
diff --git a/packages/dashboard/tsconfig.json b/packages/dashboard/tsconfig.json
index 8d235999..27ca65df 100644
--- a/packages/dashboard/tsconfig.json
+++ b/packages/dashboard/tsconfig.json
@@ -2,6 +2,10 @@
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
+ "lib": [
+ "es2017",
+ "dom"
+ ],
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]