diff --git a/src/components/Countdown.vue b/src/components/Countdown.vue index 588cb085..dd87f30c 100644 --- a/src/components/Countdown.vue +++ b/src/components/Countdown.vue @@ -11,7 +11,6 @@ const props = defineProps({ :time="time > 0 ? time : 0" v-slot="{ days, hours, minutes, seconds }" > - Time Remainingļ¼š{{ days }} days, {{ hours }} hours, {{ minutes }} minutes, - {{ seconds }} seconds. + {{ days }} days {{ hours }} hours {{ minutes }} minutes {{ seconds }} seconds diff --git a/src/modules/[chain]/account/[address].vue b/src/modules/[chain]/account/[address].vue index cb62204e..ac4dcffe 100644 --- a/src/modules/[chain]/account/[address].vue +++ b/src/modules/[chain]/account/[address].vue @@ -19,6 +19,7 @@ import type { UnbondingResponses, } from '@/types'; import type { Coin } from '@cosmjs/amino'; +import Countdown from '@/components/Countdown.vue'; const props = defineProps(['address', 'chain']); @@ -65,6 +66,11 @@ const totalAmount = computed(() => { return totalAmountByCategory.value.reduce((p, c) => c + p, 0); }); +const totalValue = computed(() => { + return 0; +}); + + function loadAccount(address: string) { blockchain.rpc.getAuthAccount(address).then((x) => { account.value = x.account; @@ -125,14 +131,10 @@ function updateEvent() {
-

Assets

-
-
- -
-
- -
+
+

Assets

+ +
+
+
+
+ +
+
@@ -299,7 +307,7 @@ function updateEvent() {
- {{ totalAmount }} + Total Value: ${{ totalValue }}
@@ -307,20 +315,22 @@ function updateEvent() {
-

Delegations

-
- - +
+

Delegations

+
+ + +
@@ -338,12 +348,12 @@ function updateEvent() { {{ - format.validatorFromBech32(v.delegation.validator_address) + format.validatorFromBech32(v.delegation.validator_address) || v.delegation.validator_address }} - -
+
- @@ -462,11 +471,10 @@ function updateEvent() { }} - - +
- {{ format.formatToken(v.balance, true, '0,0.[00]') }} + {{ format.formatToken(v.balance, true, '0,0.[000000]') }} {{ @@ -356,7 +366,7 @@ function updateEvent() { }} -
+
+ {{ - format.validatorFromBech32(v.validator_address) + v.validator_address }} - {{ format.toDay(entry.completion_time, 'to') }} +
diff --git a/src/stores/useDashboard.ts b/src/stores/useDashboard.ts index 077ba03e..5f763a8d 100644 --- a/src/stores/useDashboard.ts +++ b/src/stores/useDashboard.ts @@ -280,7 +280,7 @@ export const useDashboard = defineStore('dashboard', { const coinIds = [] as string[] Object.keys(this.favoriteMap).forEach(k => { if(this.chains[k]) this.chains[k].assets.forEach(a => { - if(a.coingecko_id !== undefined) { + if(a.coingecko_id !== undefined && a.coingecko_id.length > 0) { coinIds.push(a.coingecko_id) a.denom_units.forEach(u => { this.coingecko[u.denom] = { diff --git a/src/stores/useFormatter.ts b/src/stores/useFormatter.ts index 4c7385c3..f801adf9 100644 --- a/src/stores/useFormatter.ts +++ b/src/stores/useFormatter.ts @@ -85,6 +85,7 @@ export const useFormatter = defineStore('formatter', { } }, price(denom: string, currency = "usd") { + if(!denom || denom.length < 2) return 0 const info = this.priceInfo(denom); return info ? info[currency] || 0 : 0; }, @@ -101,13 +102,21 @@ export const useFormatter = defineStore('formatter', { } return "" }, + specialDenom(denom: string) { + switch(true) { + case denom.startsWith('u'): return 6 + case denom.startsWith("a"): return 18 + case denom==='inj': return 18 + } + return 0 + }, tokenValueNumber(token?: Coin) { - if(!token) return 0 + if(!token || !token.denom) return 0 // find the symbol, - const symbol = this.dashboard.coingecko[token.denom]?.symbol || "" + const symbol = this.dashboard.coingecko[token.denom]?.symbol || token.denom // convert denomation to to symbol const exponent = - this.dashboard.coingecko[symbol.toLowerCase()]?.exponent || 0; + this.dashboard.coingecko[symbol?.toLowerCase()]?.exponent || this.specialDenom(token.denom); // cacualte amount of symbol const amount = Number(token.amount) / (10 ** exponent) const value = amount * this.price(token.denom)