Skip to content

Commit

Permalink
Merge pull request #3 from WhisperNode/namada-explorer
Browse files Browse the repository at this point in the history
feat: change to get Namada explorer working
  • Loading branch information
gh0stdotexe authored Apr 10, 2024
2 parents 57b2eb2 + 471b9e3 commit c93a9b8
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 41 deletions.
6 changes: 3 additions & 3 deletions chains/testnet/namada.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"chain_name": "namada",
"api": ["http://api.namada.info","http://api.namada.encipher88.tech"],
"rpc": ["http://namada-rpc.zenode.app:80"],
"api": [ "https://api-namada-testnet.whispernode.com:443"],
"rpc": [ "https://rpc-namada-testnet.whispernode.com:443"],
"snapshot_provider": "",
"sdk_version": "0.46.15",
"coin_type": "118",
Expand All @@ -12,7 +12,7 @@
"base": "unam",
"symbol": "NAM",
"exponent": "18",
"coingecko_id": "namada",
"coingecko_id": "",
"logo": "/logos/namada.webp"
}]
}
22 changes: 19 additions & 3 deletions src/modules/[chain]/gov/[proposal_id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,17 @@ function metaItem(metadata: string|undefined): { title: string; summary: string
{{ status }}
</div>
</h2>
<div class="">
<template v-if="chainStore.chainName === 'namada'">
<div class="">
<ObjectElement :value="{'title' : proposal.content?.title , 'description' : proposal.content?.description}" />
</div>
</template>
<template v-else>
<div class="">
<ObjectElement :value="proposal.content" />
</div>
</div>
</template>

<div v-if="proposal.summary && !proposal.content?.description || metaItem(proposal?.metadata)?.summary ">
<MdEditor
:model-value="format.multiLine(proposal.summary || metaItem(proposal?.metadata)?.summary)"
Expand Down Expand Up @@ -245,7 +253,12 @@ function metaItem(metadata: string|undefined): { title: string; summary: string
<p
class="absolute inset-x-0 inset-y-0 text-center text-sm text-[#666] dark:text-[#eee] flex items-center justify-center"
>
<template v-if="item.value === '-'">
0%
</template>
<template v-else>
{{ item.value }}
</template>
</p>
</div>
</div>
Expand Down Expand Up @@ -356,7 +369,8 @@ function metaItem(metadata: string|undefined): { title: string; summary: string
</div>
</div>

<div class="bg-[#ffffff] dark:bg-[#222222] px-4 pt-3 pb-4 rounded mb-4 shadow">
<template v-if="chainStore.chainName !== 'namada'">
<div class="bg-[#ffffff] dark:bg-[#222222] px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title">{{ $t('gov.votes') }}</h2>
<div class="overflow-x-auto">
<table class="table w-full table-zebra">
Expand Down Expand Up @@ -389,5 +403,7 @@ function metaItem(metadata: string|undefined): { title: string; summary: string
/>
</div>
</div>
</template>

</div>
</template>
67 changes: 41 additions & 26 deletions src/modules/[chain]/staking/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,42 +386,57 @@ loadAvatars();
}"
class="font-weight-medium"
>
{{ v.description?.moniker }}
<template v-if="chainStore.chainName === 'namada'">
{{ v.description?.identity || v.description?.website || v.description?.moniker }}
</template>
<template v-else>
{{ v.description?.moniker }}
</template>
</RouterLink>
</span>
<span class="text-xs">{{
v.description?.website ||
v.description?.identity ||
'-'
}}</span>
<span class="text-xs">
{{
v.description?.website ||
v.description?.identity ||
'-'
}}
</span>
</div>
</div>
</td>

<!-- 👉 Voting Power -->
<td class="text-right">
<div class="flex flex-col">
<h6 class="text-sm font-weight-medium whitespace-nowrap ">
{{
format.formatToken(
{
amount: parseInt(
v.tokens
).toString(),
denom: staking.params
.bond_denom,
},
true,
'0,0'
)
}}
</h6>
<template v-if="chainStore.chainName === 'namada'">
<!-- Content to render when specialVariable equals specialValue -->
<h6 class="text-sm font-weight-medium whitespace-nowrap ">
{{ parseInt(v.tokens).toLocaleString() }} NAM
</h6>
</template>
<template v-else>
<h6 class="text-sm font-weight-medium whitespace-nowrap ">
{{
format.formatToken(
{
amount: parseInt(
v.tokens
).toString(),
denom: staking.params
.bond_denom,
},
true,
'0,0'
)
}}
</h6>
</template>
<span class="text-xs">{{
format.calculatePercent(
v.delegator_shares,
staking.totalPower
)
}}</span>
format.calculatePercent(
v.delegator_shares,
staking.totalPower
)
}}</span>
</div>
</td>
<!-- 👉 24h Changes -->
Expand Down
3 changes: 2 additions & 1 deletion src/modules/[chain]/uptime/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ function fetchAllKeyRotation() {
<div class="flex items-center justify-between py-0 w-[298px]">
<label class="truncate text-sm">
<span class="ml-1 text-black dark:text-white"
>{{ i + 1 }}.{{ v.description.moniker }}</span
>{{ i + 1 }}.{{ v.description?.moniker || v.description?.identity || v.description?.website }}
</span
>
</label>
<div
Expand Down
19 changes: 11 additions & 8 deletions src/stores/useParamsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,17 @@ export const useParamStore = defineStore('paramstore', {
async handleAbciInfo() {
const res = await this.fetchAbciInfo();

localStorage.setItem(`sdk_version_${this.blockchain.chainName}`, res.application_version?.cosmos_sdk_version);

this.appVersion.items = Object.entries(res.application_version).map(
([key, value]) => ({ subtitle: key, value: value })
);
this.nodeVersion.items = Object.entries(res.default_node_info).map(
([key, value]) => ({ subtitle: key, value: value })
);
if (res) {
localStorage.setItem(`sdk_version_${this.blockchain.chainName}`, res.application_version?.cosmos_sdk_version);
this.appVersion.items = Object.entries(res.application_version).map(
([key, value]) => ({ subtitle: key, value: value })
);
this.nodeVersion.items = Object.entries(res.default_node_info).map(
([key, value]) => ({ subtitle: key, value: value })
);
} else {
localStorage.setItem(`sdk_version_${this.blockchain.chainName}`, "v0.45.1");
}
},
async getBaseTendermintBlockLatest() {
return await this.blockchain.rpc?.getBaseBlockLatest();
Expand Down

1 comment on commit c93a9b8

@vercel
Copy link

@vercel vercel bot commented on c93a9b8 Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.