+
@@ -450,12 +459,12 @@ loadAccount(props.address);
{{ format.messages(v.tx.body.messages) }}
-
-
+ class="text-success text-lg"
+ />
+
|
{{ format.toDay(v.timestamp, 'from') }} |
@@ -470,10 +479,5 @@ loadAccount(props.address);
-
Account does not exists on chain
+
Account does not exists on chain
-
diff --git a/src/modules/[chain]/block/block.ts b/src/modules/[chain]/block/block.ts
index c561e94a..ead62cb3 100644
--- a/src/modules/[chain]/block/block.ts
+++ b/src/modules/[chain]/block/block.ts
@@ -55,13 +55,13 @@ export const useBlockModule = defineStore('blockModule', {
});
},
async fetchLatest() {
- this.latest = await this.blockchain.rpc.getBaseBlockLatest();
+ this.latest = await this.blockchain.rpc?.getBaseBlockLatest();
if (this.recents.length >= 50) this.recents.shift();
this.recents.push(this.latest);
return this.latest;
},
async fetchBlock(height: string) {
- this.current = await this.blockchain.rpc.getBaseBlockAt(height);
+ this.current = await this.blockchain.rpc?.getBaseBlockAt(height);
return this.current;
},
},
diff --git a/src/modules/[chain]/gov/[proposal_id].vue b/src/modules/[chain]/gov/[proposal_id].vue
index c8b829ac..5929572f 100644
--- a/src/modules/[chain]/gov/[proposal_id].vue
+++ b/src/modules/[chain]/gov/[proposal_id].vue
@@ -193,103 +193,103 @@ const processList = computed(()=>{
Timeline
-
-
-
-
- Submited at: {{ format.toDay(proposal.submit_time) }}
-
- {{ shortTime(proposal.submit_time) }}
-
-
+ class="mt-2"
+ side="end"
+ align="start"
+ line-inset="8"
+ truncate-line="both"
+ density="compact"
+ >
+
+
+
+
+ Submited at: {{ format.toDay(proposal.submit_time) }}
+
+ {{ shortTime(proposal.submit_time) }}
+
+
-
-
-
-
- Deposited at: {{ format.toDay(proposal.status==="PROPOSAL_STATUS_DEPOSIT_PERIOD"?proposal.deposit_end_time: proposal.voting_start_time) }}
-
- {{ shortTime(proposal.status==="PROPOSAL_STATUS_DEPOSIT_PERIOD"?proposal.deposit_end_time: proposal.voting_start_time) }}
-
+
+
+
+
+ Deposited at: {{ format.toDay(proposal.status==="PROPOSAL_STATUS_DEPOSIT_PERIOD"?proposal.deposit_end_time: proposal.voting_start_time) }}
+
+ {{ shortTime(proposal.status==="PROPOSAL_STATUS_DEPOSIT_PERIOD"?proposal.deposit_end_time: proposal.voting_start_time) }}
+
-
-
- {{ x.depositor }} {{ format.formatTokens(x.amount) }}
-
-
+
+
+ {{ x.depositor }} {{ format.formatTokens(x.amount) }}
+
+
-
-
+
+
-
-
-
-
- Voting start from {{ format.toDay(proposal.voting_start_time) }}
-
- {{ shortTime(proposal.voting_start_time) }}
-
+
+
+
+
+ Voting start from {{ format.toDay(proposal.voting_start_time) }}
+
+ {{ shortTime(proposal.voting_start_time) }}
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
- Voting end {{ format.toDay(proposal.voting_end_time) }}
-
- {{ shortTime(proposal.voting_end_time) }}
-
+
+
+
+
+ Voting end {{ format.toDay(proposal.voting_end_time) }}
+
+ {{ shortTime(proposal.voting_end_time) }}
+
-
-
- Current Status: {{ proposal.status }}
-
-
-
-
-
-
- Upgrade Plan:
- (EST)
- {{ format.toDay(proposal.content?.plan?.time) }}
-
- {{ shortTime(proposal.voting_end_time) }}
-
+
+
+ Current Status: {{ proposal.status }}
+
+
+
+
+
+
+ Upgrade Plan:
+ (EST)
+ {{ format.toDay(proposal.content?.plan?.time) }}
+
+ {{ shortTime(proposal.voting_end_time) }}
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/modules/[chain]/gov/index.vue b/src/modules/[chain]/gov/index.vue
index aea5d2ef..0d25cdc1 100644
--- a/src/modules/[chain]/gov/index.vue
+++ b/src/modules/[chain]/gov/index.vue
@@ -7,7 +7,7 @@ const store = useGovStore();
onMounted(() => {
store.fetchProposals('2').then((x) => {
- if (x.proposals.length === 0) {
+ if (x?.proposals?.length === 0) {
tab.value = '3';
store.fetchProposals('3');
}
diff --git a/src/modules/[chain]/indexStore.ts b/src/modules/[chain]/indexStore.ts
index 003878e3..83277b17 100644
--- a/src/modules/[chain]/indexStore.ts
+++ b/src/modules/[chain]/indexStore.ts
@@ -142,14 +142,14 @@ export const useIndexModule = defineStore('module-index', {
title: 'Height',
color: 'primary',
icon: 'mdi-pound',
- stats: String(base.latest.block?.header?.height || 0),
+ stats: String(base?.latest?.block?.header?.height || 0),
change: 0,
},
{
title: 'Validators',
color: 'error',
icon: 'mdi-human-queue',
- stats: String(base.latest.block?.last_commit?.signatures.length || 0),
+ stats: String(base?.latest?.block?.last_commit?.signatures.length || 0),
change: 0,
},
{
@@ -198,9 +198,9 @@ export const useIndexModule = defineStore('module-index', {
useDistributionStore()
.fetchCommunityPool()
.then((x) => {
- this.communityPool = x.pool
- .filter((t) => t.denom.length < 10)
- .map((t) => ({
+ this.communityPool = x?.pool
+ ?.filter((t) => t.denom.length < 10)
+ ?.map((t) => ({
amount: String(parseInt(t.amount)),
denom: t.denom,
}));
diff --git a/src/modules/[chain]/tx/[hash].vue b/src/modules/[chain]/tx/[hash].vue
index f2ae2d28..ecafb43b 100644
--- a/src/modules/[chain]/tx/[hash].vue
+++ b/src/modules/[chain]/tx/[hash].vue
@@ -49,7 +49,7 @@ const messages = computed(() => {
| Status |
- oioio
+ oioio
import misc404 from '@images/pages/404.png';
-
-import miscObj from '@images/pages/misc-404-object.png';
-import miscMaskDark from '@images/pages/misc-mask-dark.png';
-import miscMaskLight from '@images/pages/misc-mask-light.png';
-
-import { useGenerateImageVariant } from '@/plugins/vuetify/@core/composable/useGenerateImageVariant';
-
-const miscThemeMask = useGenerateImageVariant(miscMaskLight, miscMaskDark);
-
-
+
+
+ 404
+ Page Not Found
+
+ We couldn't find the page you are looking for.
+
+
-
- Back to Home
-
-
-
+
+ Back to Home
+
+
-
-
meta:
layout: blank
diff --git a/src/pages/second-page.vue b/src/pages/second-page.vue
deleted file mode 100644
index 7291f3df..00000000
--- a/src/pages/second-page.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- This is your second page.
-
- Chocolate sesame snaps pie carrot cake pastry pie lollipop muffin.
- Carrot cake dragΓ©e chupa chups jujubes. Macaroon liquorice cookie wafer
- tart marzipan bonbon. Gingerbread jelly-o dragΓ©e chocolate.
-
-
-
-
-
-meta:
- layout: blank
- bgColor: yellow
-
diff --git a/src/stores/useBaseStore.ts b/src/stores/useBaseStore.ts
index 3259d3ea..835c18f0 100644
--- a/src/stores/useBaseStore.ts
+++ b/src/stores/useBaseStore.ts
@@ -33,11 +33,11 @@ export const useBaseStore = defineStore('baseStore', {
return useBlockchain();
},
txsInRecents() {
- const txs = [] as { height: string, hash: string; tx: DecodedTxRaw }[];
+ const txs = [] as { height: string; hash: string; tx: DecodedTxRaw }[];
this.recents.forEach((b) =>
b.block?.data?.txs.forEach((tx: string) => {
if (tx) {
- const raw = fromBase64(tx)
+ const raw = fromBase64(tx);
try {
txs.push({
height: b.block.header.height,
@@ -45,7 +45,7 @@ export const useBaseStore = defineStore('baseStore', {
tx: decodeTxRaw(raw),
});
} catch (e) {
- console.error(e)
+ console.error(e);
}
}
})
@@ -61,18 +61,22 @@ export const useBaseStore = defineStore('baseStore', {
this.recents = [];
},
async fetchLatest() {
- this.latest = await this.blockchain.rpc.getBaseBlockLatest();
+ this.latest = await this.blockchain.rpc?.getBaseBlockLatest();
if (
!this.earlest ||
- this.earlest.block?.header?.chain_id !=
- this.latest.block?.header?.chain_id
+ this.earlest?.block?.header?.chain_id !=
+ this.latest?.block?.header?.chain_id
) {
//reset earlest and recents
this.earlest = this.latest;
this.recents = [];
}
//check if the block exists in recents
- if(this.recents.findIndex(x => x.block_id.hash === this.latest.block_id.hash) === -1 ) {
+ if (
+ this.recents.findIndex(
+ (x) => x?.block_id?.hash === this.latest?.block_id?.hash
+ ) === -1
+ ) {
if (this.recents.length >= 50) {
this.recents.pop();
}
@@ -87,7 +91,7 @@ export const useBaseStore = defineStore('baseStore', {
async fetchLatestValidators(offset = 0) {
return this.blockchain.rpc.getBaseValidatorsetLatest(offset);
},
- async fetchBlock(height?: number|string) {
+ async fetchBlock(height?: number | string) {
return this.blockchain.rpc.getBaseBlockAt(String(height));
},
async fetchAbciInfo() {
diff --git a/src/stores/useDistributionStore.ts b/src/stores/useDistributionStore.ts
index 7784605c..d2dc0a8f 100644
--- a/src/stores/useDistributionStore.ts
+++ b/src/stores/useDistributionStore.ts
@@ -12,7 +12,7 @@ export const useDistributionStore = defineStore('distributionStore', {
},
actions: {
async fetchCommunityPool() {
- return this.blockchain.rpc.getDistributionCommunityPool();
+ return this.blockchain.rpc?.getDistributionCommunityPool();
},
},
});
diff --git a/src/stores/useFormatter.ts b/src/stores/useFormatter.ts
index 2830718e..b3978c05 100644
--- a/src/stores/useFormatter.ts
+++ b/src/stores/useFormatter.ts
@@ -54,8 +54,8 @@ export const useFormatter = defineStore('formatter', {
return useBankStore();
},
dashboard() {
- return useDashboard()
- }
+ return useDashboard();
+ },
},
actions: {
async fetchDenomTrace(denom: string) {
@@ -69,30 +69,31 @@ export const useFormatter = defineStore('formatter', {
return trace;
},
priceInfo(denom: string) {
- const id = this.dashboard.coingecko[denom]?.coinId
- const prices = this.dashboard.prices[id]
- return prices
+ const id = this.dashboard.coingecko[denom]?.coinId;
+ const prices = this.dashboard.prices[id];
+ return prices;
},
- price(denom: string, currency = "usd") {
+ price(denom: string, currency = 'usd') {
const info = this.priceInfo(denom);
- return info? info[currency]||0 : 0
+ return info ? info[currency] || 0 : 0;
},
- priceChanges(denom: string, currency="usd"): number {
+ priceChanges(denom: string, currency = 'usd'): number {
const info = this.priceInfo(denom);
- return info? info[`${currency}_24h_change`]||0 : 0
+ return info ? info[`${currency}_24h_change`] || 0 : 0;
},
showChanges(v: number) {
- return numeral(v).format("+0,0.[00]")
+ return numeral(v).format('+0,0.[00]');
},
tokenValue(token: Coin) {
- // find the symbol,
- const symbol = this.dashboard.coingecko[token.denom]?.symbol || ""
+ // find the symbol,
+ const symbol = this.dashboard.coingecko[token.denom]?.symbol || '';
// convert denomation to to symbol
- const exponent = this.dashboard.coingecko[symbol.toLowerCase()]?.exponent || 0
+ const exponent =
+ this.dashboard.coingecko[symbol.toLowerCase()]?.exponent || 0;
// cacualte amount of symbol
- const amount = Number(token.amount) / (10 ** exponent)
- const value = amount * this.price(token.denom)
- return numeral(value).format('0,0.[00]')
+ const amount = Number(token.amount) / 10 ** exponent;
+ const value = amount * this.price(token.denom);
+ return numeral(value).format('0,0.[00]');
},
formatTokenAmount(token: { denom: string; amount: string }) {
return this.formatToken(token, false);
@@ -105,7 +106,7 @@ export const useFormatter = defineStore('formatter', {
withDenom = true,
fmt = '0.0a'
): string {
- if (token && token.amount) {
+ if (token && token.amount && token?.denom) {
let amount = Number(token.amount);
let denom = token.denom;
@@ -211,11 +212,11 @@ export const useFormatter = defineStore('formatter', {
}
return dayjs(time).format('YYYY-MM-DD HH:mm:ss');
},
- messages(msgs: { '@type'?: string, typeUrl?: string }[]) {
+ messages(msgs: { '@type'?: string; typeUrl?: string }[]) {
if (msgs) {
const sum: Record = msgs
.map((msg) => {
- const msgType = msg['@type'] || msg.typeUrl || 'unknown'
+ const msgType = msg['@type'] || msg.typeUrl || 'unknown';
return msgType
.substring(msgType.lastIndexOf('.') + 1)
.replace('Msg', '');
diff --git a/src/stores/useGovStore.ts b/src/stores/useGovStore.ts
index 056fdaf3..13e42169 100644
--- a/src/stores/useGovStore.ts
+++ b/src/stores/useGovStore.ts
@@ -29,10 +29,10 @@ export const useGovStore = defineStore('govStore', {
if (!this.loading[status]) {
this.loading[status] = LoadingStatus.Loading;
const proposals = reactive(
- await this.blockchain.rpc.getGovProposals(status)
+ await this.blockchain.rpc?.getGovProposals(status)
);
if (status === '2') {
- proposals.proposals.forEach(async (x1) => {
+ proposals?.proposals?.forEach(async (x1) => {
await this.fetchTally(x1.proposal_id).then((res) => {
x1.final_tally_result = res?.tally;
});
diff --git a/src/stores/useMintStore.ts b/src/stores/useMintStore.ts
index 0957ee2c..fff1680e 100644
--- a/src/stores/useMintStore.ts
+++ b/src/stores/useMintStore.ts
@@ -17,14 +17,16 @@ export const useMintStore = defineStore('mintStore', {
this.fetchInflation();
},
async fetchInflation() {
- this.blockchain.rpc
- .getMintInflation()
- .then((x) => {
- this.inflation = x.inflation;
- })
- .catch(() => {
+ try {
+ const res = await this.blockchain?.rpc?.getMintInflation().catch(() => {
this.inflation = '0';
});
+ if (res) {
+ this.inflation = res.inflation;
+ }
+ } catch (e) {
+ console.log(e);
+ }
},
},
});
diff --git a/src/stores/useParamsStore.ts b/src/stores/useParamsStore.ts
index 75cf803a..f4bd5bed 100644
--- a/src/stores/useParamsStore.ts
+++ b/src/stores/useParamsStore.ts
@@ -203,19 +203,19 @@ export const useParamStore = defineStore('paramstore', {
console.log('handleAbciInfo', this.nodeVersion.items);
},
async getBaseTendermintBlockLatest() {
- return await this.blockchain.rpc.getBaseBlockLatest();
+ return await this.blockchain.rpc?.getBaseBlockLatest();
},
async getMintParam() {
- return await this.blockchain.rpc.getMintParam();
+ return await this.blockchain.rpc?.getMintParam();
},
async getStakingParams() {
- return await this.blockchain.rpc.getStakingParams();
+ return await this.blockchain.rpc?.getStakingParams();
},
async getStakingPool() {
- return await this.blockchain.rpc.getStakingPool();
+ return await this.blockchain.rpc?.getStakingPool();
},
async getBankTotal(denom: string) {
- return await this.blockchain.rpc.getBankSupplyByDenom(denom);
+ return await this.blockchain.rpc?.getBankSupplyByDenom(denom);
// if (compareVersions(this.config.sdk_version, '0.46.2') > 0) {
// return this.get(`/cosmos/bank/v1beta1/supply/by_denom?denom=${denom}`).then(data => commonProcess(data).amount)
// }
@@ -225,22 +225,22 @@ export const useParamStore = defineStore('paramstore', {
// return this.get(`/cosmos/bank/v1beta1/supply/${denom}`).then(data => commonProcess(data).amount)
},
async getSlashingParams() {
- return await this.blockchain.rpc.getSlashingParams();
+ return await this.blockchain.rpc?.getSlashingParams();
},
async getDistributionParams() {
- return await this.blockchain.rpc.getDistributionParams();
+ return await this.blockchain.rpc?.getDistributionParams();
},
async getGovParamsVoting() {
- return await this.blockchain.rpc.getGovParamsVoting();
+ return await this.blockchain.rpc?.getGovParamsVoting();
},
async getGovParamsDeposit() {
- return await this.blockchain.rpc.getGovParamsDeposit();
+ return await this.blockchain.rpc?.getGovParamsDeposit();
},
async getGovParamsTally() {
- return await this.blockchain.rpc.getGovParamsTally();
+ return await this.blockchain.rpc?.getGovParamsTally();
},
async fetchAbciInfo() {
- return this.blockchain.rpc.getBaseNodeInfo();
+ return this.blockchain.rpc?.getBaseNodeInfo();
},
},
});
diff --git a/src/stores/useStakingStore.ts b/src/stores/useStakingStore.ts
index 74e7291e..450f7e16 100644
--- a/src/stores/useStakingStore.ts
+++ b/src/stores/useStakingStore.ts
@@ -47,14 +47,16 @@ export const useStakingStore = defineStore('stakingStore', {
);
},
async fetchParams() {
- const response = await this.blockchain.rpc.getStakingParams();
- if (response.params) this.params = response.params;
+ const response = await this.blockchain.rpc?.getStakingParams();
+ if (response?.params) this.params = response.params;
return this.params;
},
async fetchPool() {
- const response = await this.blockchain.rpc.getStakingPool();
- response.pool.bonded_tokens;
- this.pool = response.pool;
+ const response = await this.blockchain.rpc?.getStakingPool();
+ if (response) {
+ response.pool.bonded_tokens;
+ this.pool = response.pool;
+ }
},
async fetchAcitveValdiators() {
return this.fetchValidators('BOND_STATUS_BONDED');
@@ -69,13 +71,13 @@ export const useStakingStore = defineStore('stakingStore', {
validatorAddr: string,
delegatorAddr: string
) {
- return await this.blockchain.rpc.getStakingValidatorsDelegationsDelegator(
+ return await this.blockchain.rpc?.getStakingValidatorsDelegationsDelegator(
validatorAddr,
delegatorAddr
);
},
async fetchValidators(status: string) {
- return this.blockchain.rpc.getStakingValidators(status).then((res) => {
+ return this.blockchain.rpc?.getStakingValidators(status).then((res) => {
const vals = res.validators.sort(
(a, b) => Number(b.delegator_shares) - Number(a.delegator_shares)
);
|