Merge remote-tracking branch 'origin/feat/prettier' into feat/prettier

This commit is contained in:
2xburnt 2025-07-10 10:40:51 -05:00
commit dbd01f2301
No known key found for this signature in database
GPG Key ID: 0FC7634F60B3CAE3
35 changed files with 543 additions and 147 deletions

View File

@ -26,7 +26,10 @@
</div>
<script type="module" src="/src/main.ts"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SSBKVF3GMX"></script>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-SSBKVF3GMX"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {

View File

@ -58,7 +58,11 @@ function metaItem(metadata: string | undefined): { title: string; summary: strin
:to="`/${chain.chainName}/gov/${item?.proposal_id}`"
class="text-main text-base mb-1 block hover:text-indigo-400 truncate"
>
{{ item?.content?.title || item?.title || metaItem(item?.metadata)?.title }}
{{
item?.content?.title ||
item?.title ||
metaItem(item?.metadata)?.title
}}
</RouterLink>
<div
v-if="item.content"

View File

@ -176,7 +176,10 @@ function callFunction(title: string, method: string, arg: Argument) {
} else {
// QueryMsg
wasmStore.wasmClient
.getWasmContractSmartQuery(props.contract, `{"${method}": ${JSON.stringify(args)}}`)
.getWasmContractSmartQuery(
props.contract,
`{"${method}": ${JSON.stringify(args)}}`
)
.then((x) => {
result.value[`${title}-${method}`] = x;
})

View File

@ -31,7 +31,9 @@ function selectObject(v: Object, direct?: string) {
return UInt8Array;
case Array.isArray(v):
return ArrayElement;
case v && Object.keys(v).includes('amount') && Object.keys(v).includes('denom'): {
case v &&
Object.keys(v).includes('amount') &&
Object.keys(v).includes('denom'): {
return TokenElement;
}
case direct === 'horizontal':

View File

@ -14,7 +14,12 @@ import { useBaseStore, useBlockchain } from '@/stores';
import NavBarI18n from './NavBarI18n.vue';
import NavBarWallet from './NavBarWallet.vue';
import type { NavGroup, NavLink, NavSectionTitle, VerticalNavItems } from '../types';
import type {
NavGroup,
NavLink,
NavSectionTitle,
VerticalNavItems,
} from '../types';
import dayjs from 'dayjs';
import AdBanner from '@/components/ad/AdBanner.vue';
@ -89,7 +94,10 @@ const show_ad = computed(() => {
<img class="w-10 h-10" src="../../assets/logo.svg" />
<h1 class="flex-1 ml-3 text-2xl font-semibold dark:text-white">Ping.pub</h1>
</RouterLink>
<div class="pr-4 cursor-pointer xl:!hidden" @click="sidebarShow = false">
<div
class="pr-4 cursor-pointer xl:!hidden"
@click="sidebarShow = false"
>
<Icon icon="mdi-close" class="text-2xl" />
</div>
</div>
@ -121,7 +129,11 @@ const show_ad = computed(() => {
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200 whitespace-nowrap">
{{ item?.title }}
</div>
<div v-if="item?.badgeContent" class="mr-6 badge badge-sm text-white border-none" :class="item?.badgeClass">
<div
v-if="item?.badgeContent"
class="mr-6 badge badge-sm text-white border-none"
:class="item?.badgeClass"
>
{{ item?.badgeContent }}
</div>
</div>
@ -201,11 +213,18 @@ const show_ad = computed(() => {
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200 whitespace-nowrap">
{{ item?.title }}
</div>
<div v-if="item?.badgeContent" class="badge badge-sm text-white border-none" :class="item?.badgeClass">
<div
v-if="item?.badgeContent"
class="badge badge-sm text-white border-none"
:class="item?.badgeClass"
>
{{ item?.badgeContent }}
</div>
</RouterLink>
<div v-if="isNavTitle(item)" class="px-4 text-sm text-gray-400 pb-2 uppercase">
<div
v-if="isNavTitle(item)"
class="px-4 text-sm text-gray-400 pb-2 uppercase"
>
{{ item?.heading }}
</div>
</div>
@ -218,7 +237,10 @@ const show_ad = computed(() => {
<Icon icon="mdi:frequently-asked-questions" class="text-xl mr-2" />
<div class="text-base capitalize flex-1 text-gray-600 dark:text-gray-200">Wallet Helper</div>
</RouterLink>
<div v-if="showDiscord" class="px-4 text-sm pt-2 text-gray-400 pb-2 uppercase">
<div
v-if="showDiscord"
class="px-4 text-sm pt-2 text-gray-400 pb-2 uppercase"
>
{{ $t('module.sponsors') }}
</div>
<Sponsors v-if="showDiscord" />
@ -252,8 +274,13 @@ const show_ad = computed(() => {
</div>
<div class="xl:!ml-64 px-3 pt-4">
<!-- header -->
<div class="flex items-center py-3 bg-base-100 mb-4 rounded px-4 sticky top-0 z-10">
<div class="text-2xl pr-3 cursor-pointer xl:!hidden" @click="sidebarShow = true">
<div
class="flex items-center py-3 bg-base-100 mb-4 rounded px-4 sticky top-0 z-10"
>
<div
class="text-2xl pr-3 cursor-pointer xl:!hidden"
@click="sidebarShow = true"
>
<Icon icon="mdi-menu" />
</div>
@ -285,7 +312,11 @@ const show_ad = computed(() => {
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
></path>
</svg>
<span>{{ $t('pages.out_of_sync') }} {{ blocktime.format() }} ({{ blocktime.fromNow() }})</span>
<span
>{{ $t('pages.out_of_sync') }} {{ blocktime.format() }} ({{
blocktime.fromNow()
}})</span
>
</div>
</div>
<RouterView v-slot="{ Component }">

View File

@ -47,12 +47,22 @@ const params = computed(() => {
<template>
<div class="dropdown dropdown-hover dropdown-end">
<label tabindex="0" class="btn btn-sm btn-primary m-1 lowercase truncate !inline-flex text-xs md:!text-sm">
<label
tabindex="0"
class="btn btn-sm btn-primary m-1 lowercase truncate !inline-flex text-xs md:!text-sm"
>
<Icon icon="mdi:wallet" />
<span class="ml-1 hidden md:block"> {{ walletStore.shortAddress || 'Wallet' }}</span>
</label>
<div tabindex="0" class="dropdown-content menu shadow p-2 bg-base-100 rounded w-52 md:!w-64 overflow-auto">
<label v-if="!walletStore?.currentAddress" for="PingConnectWallet" class="btn btn-sm btn-primary">
<div
tabindex="0"
class="dropdown-content menu shadow p-2 bg-base-100 rounded w-52 md:!w-64 overflow-auto"
>
<label
v-if="!walletStore?.currentAddress"
for="PingConnectWallet"
class="btn btn-sm btn-primary"
>
<Icon icon="mdi:wallet" /><span class="ml-1 block">Connect Wallet</span>
</label>
<div class="px-2 mb-1 text-gray-500 dark:text-gray-400 font-semibold">
@ -69,10 +79,18 @@ const params = computed(() => {
</a>
<div class="divider mt-1 mb-1"></div>
<RouterLink to="/wallet/accounts">
<div class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer">Accounts</div>
<div
class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer"
>
Accounts
</div>
</RouterLink>
<RouterLink to="/wallet/portfolio">
<div class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer">Portfolio</div>
<div
class="block py-2 px-2 hover:!bg-gray-100 rounded cursor-pointer"
>
Portfolio
</div>
</RouterLink>
<div v-if="walletStore.currentAddress" class="divider mt-1 mb-1"></div>
<a

View File

@ -45,7 +45,8 @@ export function consumerKeyToBase64Address(consumerKey?: Record<string, string>)
if (consumerKey.secp256k1) {
const pubkey = fromBase64(consumerKey.secp256k1);
if (pubkey) return toBase64(new Ripemd160().update(sha256(pubkey)).digest());
if (pubkey)
return toBase64(new Ripemd160().update(sha256(pubkey)).digest());
}
return raw;
}

View File

@ -25,7 +25,10 @@ export function proposalAdapter(p: any): GovProposal {
// xion custom request
export const requests: Partial<RequestRegistry> = {
bank_supply_by_denom: { url: '/cosmos/bank/v1beta1/supply/by_denom?denom={denom}', adapter },
bank_supply_by_denom: {
url: '/cosmos/bank/v1beta1/supply/by_denom?denom={denom}',
adapter,
},
gov_params_voting: { url: '/cosmos/gov/v1/params/voting', adapter },
gov_params_tally: { url: '/cosmos/gov/v1/params/tallying', adapter },
gov_params_deposit: { url: '/cosmos/gov/v1/params/deposit', adapter },

View File

@ -7,7 +7,10 @@ export const DEFAULT: RequestRegistry = {
url: '/cosmos/auth/v1beta1/accounts/{address}',
adapter,
},
params: { url: '/cosmos/params/v1beta1/params?subspace={subspace}&key={key}', adapter },
params: {
url: '/cosmos/params/v1beta1/params?subspace={subspace}&key={key}',
adapter,
},
bank_params: { url: '/cosmos/bank/v1beta1/params', adapter },
bank_balances_address: {
url: '/cosmos/bank/v1beta1/balances/{address}',

View File

@ -219,7 +219,9 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
<div class="text-sm font-semibold">
{{ format.formatToken(rewardItem) }}
</div>
<div class="text-xs">{{ format.calculatePercent(rewardItem.amount, totalAmount) }}</div>
<div class="text-xs">
{{ format.calculatePercent(rewardItem.amount, totalAmount) }}
</div>
</div>
<div class="text-xs truncate relative py-1 px-3 rounded-full w-fit text-primary dark:invert mr-2">
<span class="inset-x-0 inset-y-0 opacity-10 absolute bg-primary dark:invert text-sm"></span>${{
@ -257,7 +259,9 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
</div>
</div>
</div>
<div class="mt-4 text-lg font-semibold mr-5 pl-5 border-t pt-4 text-right">
<div
class="mt-4 text-lg font-semibold mr-5 pl-5 border-t pt-4 text-right"
>
{{ $t('account.total_value') }}: ${{ totalValue }}
</div>
</div>
@ -436,12 +440,17 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
</tr>
<tr v-for="(v, index) in txs" :key="index">
<td class="text-sm py-3">
<RouterLink :to="`/${chain}/block/${v.height}`" class="text-primary dark:invert">{{
v.height
}}</RouterLink>
<RouterLink
:to="`/${chain}/block/${v.height}`"
class="text-primary dark:invert"
>{{ v.height }}</RouterLink
>
</td>
<td class="truncate py-3" style="max-width: 200px">
<RouterLink :to="`/${chain}/tx/${v.txhash}`" class="text-primary dark:invert">
<RouterLink
:to="`/${chain}/tx/${v.txhash}`"
class="text-primary dark:invert"
>
{{ v.txhash }}
</RouterLink>
</td>
@ -483,12 +492,17 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
</tr>
<tr v-for="(v, index) in recentReceived" :key="index">
<td class="text-sm py-3">
<RouterLink :to="`/${chain}/block/${v.height}`" class="text-primary dark:invert">{{
v.height
}}</RouterLink>
<RouterLink
:to="`/${chain}/block/${v.height}`"
class="text-primary dark:invert"
>{{ v.height }}</RouterLink
>
</td>
<td class="truncate py-3" style="max-width: 200px">
<RouterLink :to="`/${chain}/tx/${v.txhash}`" class="text-primary dark:invert">
<RouterLink
:to="`/${chain}/tx/${v.txhash}`"
class="text-primary dark:invert"
>
{{ v.txhash }}
</RouterLink>
</td>

View File

@ -94,7 +94,9 @@ onBeforeRouteUpdate(async (to, from, next) => {
</tr>
<tr>
<td>{{ $t('block.current_height') }}:</td>
<td class="text-right">#{{ store.latest?.block?.header.height }}</td>
<td class="text-right">
#{{ store.latest?.block?.header.height }}
</td>
</tr>
<tr>
<td>{{ $t('block.remaining_blocks') }}:</td>
@ -102,7 +104,9 @@ onBeforeRouteUpdate(async (to, from, next) => {
</tr>
<tr>
<td>{{ $t('block.average_block_time') }}:</td>
<td class="text-right">{{ (store.blocktime / 1000).toFixed(1) }}s</td>
<td class="text-right">
{{ (store.blocktime / 1000).toFixed(1) }}s
</td>
</tr>
</tbody>
</table>
@ -134,17 +138,23 @@ onBeforeRouteUpdate(async (to, from, next) => {
</div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('block.block_header') }}</h2>
<h2 class="card-title flex flex-row justify-between">
{{ $t('block.block_header') }}
</h2>
<DynamicComponent :value="current.block?.header" />
</div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('account.transactions') }}</h2>
<h2 class="card-title flex flex-row justify-between">
{{ $t('account.transactions') }}
</h2>
<TxsElement :value="current.block?.data?.txs" />
</div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('block.last_commit') }}</h2>
<h2 class="card-title flex flex-row justify-between">
{{ $t('block.last_commit') }}
</h2>
<DynamicComponent :value="current.block?.last_commit" />
</div>
</div>

View File

@ -162,7 +162,9 @@ async function update() {
<select v-model="rpc" class="select select-bordered w-full flex-1">
<option v-for="(item, index) in rpcList" :key="index">{{ item?.address }}/consensus_state</option>
</select>
<button class="btn btn-primary" @click="onChange">{{ $t('consensus.monitor') }}</button>
<button class="btn btn-primary" @click="onChange">
{{ $t('consensus.monitor') }}
</button>
</label>
</div>
<div v-if="httpstatus !== 200" class="text-error mt-1">{{ httpstatus }}: {{ httpStatusText }}</div>
@ -224,7 +226,9 @@ async function update() {
<div class="flex flex-1 flex-col truncate">
<h2 class="text-sm card-title text-error mb-6">{{ $t('consensus.updated_at') }} {{ newTime || '' }}</h2>
<div v-for="item in roundState.height_vote_set" :key="item.round">
<div class="text-xs mb-1">{{ $t('consensus.round') }}: {{ item.round }}</div>
<div class="text-xs mb-1">
{{ $t('consensus.round') }}: {{ item.round }}
</div>
<div class="text-xs break-words">{{ item.prevotes_bit_array }}</div>
<div class="flex flex-rows flex-wrap py-6">

View File

@ -1,5 +1,9 @@
import { BaseRestClient } from '@/libs/client';
import { adapter, type AbstractRegistry, type Request } from '@/libs/api/registry';
import {
adapter,
type AbstractRegistry,
type Request,
} from '@/libs/api/registry';
import { defineStore } from 'pinia';
import type {
CodeInfo,

View File

@ -50,7 +50,9 @@ function showInfo(address: string) {
<table class="table table-compact w-full mt-4">
<thead class="bg-base-200">
<tr>
<th style="position: relative; z-index: 2">{{ $t('cosmwasm.contract_list') }}</th>
<th style="position: relative; z-index: 2">
{{ $t('cosmwasm.contract_list') }}
</th>
<th>{{ $t('account.action') }}</th>
</tr>
</thead>

View File

@ -1,7 +1,16 @@
<script lang="ts" setup>
import PaginationBar from '@/components/PaginationBar.vue';
import { useBaseStore, useBlockchain, useFormatter, useTxDialog } from '@/stores';
import { PageRequest, type PaginatedBalances, type PaginatedTxs } from '@/types';
import {
useBaseStore,
useBlockchain,
useFormatter,
useTxDialog,
} from '@/stores';
import {
PageRequest,
type PaginatedBalances,
type PaginatedTxs,
} from '@/types';
import { Icon } from '@iconify/vue';
import { onMounted, ref } from 'vue';
import { useWasmStore } from '../WasmStore';

View File

@ -114,7 +114,9 @@ const upgradeCountdown = computed((): number => {
if (height > 0) {
const base = useBaseStore();
const current = Number(base.latest?.block?.header?.height || 0);
return (height - current) * Number((base.blocktime / 1000).toFixed()) * 1000;
return (
(height - current) * Number((base.blocktime / 1000).toFixed()) * 1000
);
}
const now = new Date();
const end = new Date(proposal.value.content?.plan?.time || '');
@ -214,7 +216,9 @@ function metaItem(metadata: string | undefined): { title: string; summary: strin
<template>
<div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-col md:!justify-between md:!flex-row mb-2">
<h2
class="card-title flex flex-col md:!justify-between md:!flex-row mb-2"
>
<p class="truncate w-full">
{{ proposal_id }}. {{ proposal.title || proposal.content?.title || metaItem(proposal?.metadata)?.title }}
</p>
@ -230,7 +234,11 @@ function metaItem(metadata: string | undefined): { title: string; summary: strin
</div>
<div v-if="(proposal.summary && !proposal.content?.description) || metaItem(proposal?.metadata)?.summary">
<MdEditor
:model-value="format.multiLine(proposal.summary || metaItem(proposal?.metadata)?.summary)"
:model-value="
format.multiLine(
proposal.summary || metaItem(proposal?.metadata)?.summary
)
"
previewOnly
class="md-editor-recover"
></MdEditor>
@ -281,7 +289,8 @@ function metaItem(metadata: string | undefined): { title: string; summary: strin
<div class="flex items-center mb-4 mt-2">
<div class="w-2 h-2 rounded-full bg-error mr-3"></div>
<div class="text-base flex-1 text-main">
{{ $t('gov.submit_at') }}: {{ format.toDay(proposal.submit_time) }}
{{ $t('gov.submit_at') }}:
{{ format.toDay(proposal.submit_time) }}
</div>
<div class="text-sm">{{ shortTime(proposal.submit_time) }}</div>
</div>
@ -311,7 +320,8 @@ function metaItem(metadata: string | undefined): { title: string; summary: strin
<div class="flex items-center">
<div class="w-2 h-2 rounded-full bg-yes mr-3"></div>
<div class="text-base flex-1 text-main">
{{ $t('gov.vote_start_from') }} {{ format.toDay(proposal.voting_start_time) }}
{{ $t('gov.vote_start_from') }}
{{ format.toDay(proposal.voting_start_time) }}
</div>
<div class="text-sm">
{{ shortTime(proposal.voting_start_time) }}
@ -325,14 +335,16 @@ function metaItem(metadata: string | undefined): { title: string; summary: strin
<div class="flex items-center mb-1">
<div class="w-2 h-2 rounded-full bg-success mr-3"></div>
<div class="text-base flex-1 text-main">
{{ $t('gov.vote_end') }} {{ format.toDay(proposal.voting_end_time) }}
{{ $t('gov.vote_end') }}
{{ format.toDay(proposal.voting_end_time) }}
</div>
<div class="text-sm">
{{ shortTime(proposal.voting_end_time) }}
</div>
</div>
<div class="pl-5 text-sm">
{{ $t('gov.current_status') }}: {{ $t(`gov.proposal_statuses.${proposal.status}`) }}
{{ $t('gov.current_status') }}:
{{ $t(`gov.proposal_statuses.${proposal.status}`) }}
</div>
</div>

View File

@ -115,7 +115,9 @@ function color(v: string) {
<dl class="grid grid-cols-1 gap-x-6 text-center lg:!grid-cols-3">
<div class="mx-auto flex items-center">
<div>
<div class="order-first text-3xl font-semibold tracking-tight text-main mb-1">
<div
class="order-first text-3xl font-semibold tracking-tight text-main mb-1"
>
{{ baseStore.latest?.block?.header?.chain_id }}
</div>
<div class="text-sm text-gray-500 dark:text-gray-400">{{ conn.client_id }} {{ props.connection_id }}</div>
@ -130,7 +132,9 @@ function color(v: string) {
</div>
</div>
<div class="mx-auto">
<div class="order-first text-3xl font-semibold tracking-tight text-main mb-2">
<div
class="order-first text-3xl font-semibold tracking-tight text-main mb-2"
>
{{ clientState.client_state?.chain_id }}
</div>
<div class="text-sm text-gray-500 dark:text-gray-400">
@ -163,15 +167,21 @@ function color(v: string) {
</tr>
<tr>
<td class="w-52">{{ $t('ibc.trusting_period') }}:</td>
<td>{{ formatSeconds(clientState.client_state?.trusting_period) }}</td>
<td>
{{ formatSeconds(clientState.client_state?.trusting_period) }}
</td>
</tr>
<tr>
<td class="w-52">{{ $t('ibc.unbonding_period') }}:</td>
<td>{{ formatSeconds(clientState.client_state?.unbonding_period) }}</td>
<td>
{{ formatSeconds(clientState.client_state?.unbonding_period) }}
</td>
</tr>
<tr>
<td class="w-52">{{ $t('ibc.max_clock_drift') }}:</td>
<td>{{ formatSeconds(clientState.client_state?.max_clock_drift) }}</td>
<td>
{{ formatSeconds(clientState.client_state?.max_clock_drift) }}
</td>
</tr>
<tr>
<td class="w-52">{{ $t('ibc.frozen_height') }}:</td>
@ -208,7 +218,9 @@ function color(v: string) {
</tr>
<tr>
<td class="w-52">{{ $t('ibc.upgrade_path') }}:</td>
<td class="text-right">{{ clientState.client_state?.upgrade_path.join(', ') }}</td>
<td class="text-right">
{{ clientState.client_state?.upgrade_path.join(', ') }}
</td>
</tr>
</tbody>
</table>
@ -221,7 +233,9 @@ function color(v: string) {
<thead>
<tr>
<th>{{ $t('ibc.txs') }}</th>
<th style="position: relative; z-index: 2">{{ $t('ibc.channel_id') }}</th>
<th style="position: relative; z-index: 2">
{{ $t('ibc.channel_id') }}
</th>
<th>{{ $t('ibc.port_id') }}</th>
<th>{{ $t('ibc.state') }}</th>
<th>{{ $t('ibc.counterparty') }}</th>
@ -260,12 +274,26 @@ function color(v: string) {
<tr v-for="v in channels">
<td>
<div class="flex gap-1">
<button class="btn btn-xs" @click="fetchSendingTxs(v.channel_id, v.port_id)" :disabled="loading">
<span v-if="loading" class="loading loading-spinner loading-sm"></span>
<button
class="btn btn-xs"
@click="fetchSendingTxs(v.channel_id, v.port_id)"
:disabled="loading"
>
<span
v-if="loading"
class="loading loading-spinner loading-sm"
></span>
{{ $t('ibc.btn_out') }}
</button>
<button class="btn btn-xs" @click="fetchRecevingTxs(v.channel_id, v.port_id)" :disabled="loading">
<span v-if="loading" class="loading loading-spinner loading-sm"></span>
<button
class="btn btn-xs"
@click="fetchRecevingTxs(v.channel_id, v.port_id)"
:disabled="loading"
>
<span
v-if="loading"
class="loading loading-spinner loading-sm"
></span>
{{ $t('ibc.btn_in') }}
</button>
</div>
@ -275,8 +303,14 @@ function color(v: string) {
</td>
<td>{{ v.port_id }}</td>
<td>
<div class="text-xs truncate relative py-2 px-4 rounded-full w-fit" :class="`text-${color(v.state)}`">
<span class="inset-x-0 inset-y-0 opacity-10 absolute" :class="`bg-${color(v.state)}`"></span>
<div
class="text-xs truncate relative py-2 px-4 rounded-full w-fit"
:class="`text-${color(v.state)}`"
>
<span
class="inset-x-0 inset-y-0 opacity-10 absolute"
:class="`bg-${color(v.state)}`"
></span>
{{ v.state }}
</div>
</td>
@ -305,13 +339,20 @@ function color(v: string) {
<td>{{ resp.height }}</td>
<td>
<div class="text-xs truncate text-primary dark:invert">
<RouterLink :to="`/${chainStore.chainName}/tx/${resp.txhash}`">{{ resp.txhash }}</RouterLink>
<RouterLink
:to="`/${chainStore.chainName}/tx/${resp.txhash}`"
>{{ resp.txhash }}</RouterLink
>
</div>
</td>
<td>
<div class="flex">
{{ format.messages(resp.tx.body.messages) }}
<Icon v-if="resp.code === 0" icon="mdi-check" class="text-success text-lg" />
<Icon
v-if="resp.code === 0"
icon="mdi-check"
class="text-success text-lg"
/>
<Icon v-else icon="mdi-multiply" class="text-error text-lg" />
</div>
</td>
@ -319,7 +360,11 @@ function color(v: string) {
</tr>
</tbody>
</table>
<PaginationBar :limit="page.limit" :total="txs.pagination?.total" :callback="pageload" />
<PaginationBar
:limit="page.limit"
:total="txs.pagination?.total"
:callback="pageload"
/>
</div>
</div>
</template>

View File

@ -126,7 +126,9 @@ const amount = computed({
</div>
<div class="text-xs mt-2">
{{ $t('index.rank') }}:
<div class="badge text-xs badge-error bg-[#fcebea] dark:bg-[#41384d] text-red-400">
<div
class="badge text-xs badge-error bg-[#fcebea] dark:bg-[#41384d] text-red-400"
>
#{{ coinInfo.market_cap_rank }}
</div>
</div>
@ -150,7 +152,9 @@ const amount = computed({
class="bg-gray-100 dark:bg-[#384059] flex items-center justify-between px-4 py-2 cursor-pointer rounded"
>
<div>
<div class="font-semibold text-xl text-[#666] dark:text-white">
<div
class="font-semibold text-xl text-[#666] dark:text-white"
>
{{ ticker?.market?.name || '' }}
</div>
<div class="text-info text-sm">
@ -161,7 +165,9 @@ const amount = computed({
</div>
<div class="text-right">
<div class="text-xl font-semibold text-[#666] dark:text-white">
<div
class="text-xl font-semibold text-[#666] dark:text-white"
>
${{ ticker?.converted_last?.usd }}
</div>
<div class="text-sm" :class="store.priceColor">{{ store.priceChange }}%</div>
@ -171,10 +177,19 @@ const amount = computed({
<div class="dropdown-content pt-1">
<div class="h-64 overflow-auto w-full shadow rounded">
<ul class="menu w-full bg-gray-100 rounded dark:bg-[#384059]">
<li v-for="(item, index) in store.coinInfo.tickers" :key="index" @click="store.selectTicker(index)">
<div class="flex items-center justify-between hover:bg-base-100">
<li
v-for="(item, index) in store.coinInfo.tickers"
:key="index"
@click="store.selectTicker(index)"
>
<div
class="flex items-center justify-between hover:bg-base-100"
>
<div class="flex-1">
<div class="text-main text-sm" :class="trustColor(item.trust_score)">
<div
class="text-main text-sm"
:class="trustColor(item.trust_score)"
>
{{ item?.market?.name }}
</div>
<div class="text-sm text-gray-500 dark:text-gray-400">
@ -224,9 +239,13 @@ const amount = computed({
<input type="checkbox" id="calculator" class="modal-toggle" />
<div class="modal">
<div class="modal-box">
<h3 class="text-lg font-bold">{{ $t('index.price_calculator') }}</h3>
<h3 class="text-lg font-bold">
{{ $t('index.price_calculator') }}
</h3>
<div class="flex flex-col w-full mt-5">
<div class="grid h-20 flex-grow card rounded-box place-items-center">
<div
class="grid h-20 flex-grow card rounded-box place-items-center"
>
<div class="join w-full">
<label class="join-item btn">
<span class="uppercase">{{ coinInfo.symbol }}</span>
@ -241,7 +260,9 @@ const amount = computed({
</div>
</div>
<div class="divider">=</div>
<div class="grid h-20 flex-grow card rounded-box place-items-center">
<div
class="grid h-20 flex-grow card rounded-box place-items-center"
>
<div class="join w-full">
<label class="join-item btn">
<span>USD</span>
@ -257,7 +278,9 @@ const amount = computed({
</div>
</div>
</div>
<label class="modal-backdrop" for="calculator">{{ $t('index.close') }}</label>
<label class="modal-backdrop" for="calculator">{{
$t('index.close')
}}</label>
</div>
<a
class="my-5 !text-white btn grow"
@ -277,7 +300,10 @@ const amount = computed({
</div>
<div class="h-[1px] w-full bg-gray-100 dark:bg-[#384059]"></div>
<div class="max-h-[250px] overflow-auto p-4 text-sm">
<MdEditor :model-value="coinInfo.description?.en" previewOnly></MdEditor>
<MdEditor
:model-value="coinInfo.description?.en"
previewOnly
></MdEditor>
</div>
<div class="mx-4 flex flex-wrap items-center">
<div
@ -295,14 +321,20 @@ const amount = computed({
</div>
</div>
<div v-if="blockchain.supportModule('governance')" class="bg-base-100 rounded mt-4 shadow">
<div
v-if="blockchain.supportModule('governance')"
class="bg-base-100 rounded mt-4 shadow"
>
<div class="px-4 pt-4 pb-2 text-lg font-semibold text-main">
{{ $t('index.active_proposals') }}
</div>
<div class="px-4 pb-4">
<ProposalListItem :proposals="store?.proposals" />
</div>
<div class="pb-8 text-center" v-if="store.proposals?.proposals?.length === 0">
<div
class="pb-8 text-center"
v-if="store.proposals?.proposals?.length === 0"
>
{{ $t('index.no_active_proposals') }}
</div>
</div>
@ -317,7 +349,9 @@ const amount = computed({
>{{ $t('index.more') }}</RouterLink
>
</div>
<div class="grid grid-cols-1 md:!grid-cols-4 auto-cols-auto gap-4 px-4 pb-6">
<div
class="grid grid-cols-1 md:!grid-cols-4 auto-cols-auto gap-4 px-4 pb-6"
>
<div class="bg-gray-100 dark:bg-[#373f59] rounded-sm px-4 py-3">
<div class="text-sm mb-1">{{ $t('account.balance') }}</div>
<div class="text-lg font-semibold text-main">
@ -348,7 +382,10 @@ const amount = computed({
</div>
</div>
<div v-if="walletStore.delegations.length > 0" class="px-4 pb-4 overflow-auto">
<div
v-if="walletStore.delegations.length > 0"
class="px-4 pb-4 overflow-auto"
>
<table class="table table-compact w-full table-zebra">
<thead>
<tr>
@ -434,7 +471,10 @@ const amount = computed({
{{ $t('index.app_versions') }}
</div>
<!-- Application Version -->
<ArrayObjectElement :value="paramStore.appVersion?.items" :thead="false" />
<ArrayObjectElement
:value="paramStore.appVersion?.items"
:thead="false"
/>
<div class="h-4"></div>
</div>

View File

@ -157,7 +157,9 @@ export const useIndexModule = defineStore('module-index', {
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,
},
{
@ -254,7 +256,11 @@ export const useIndexModule = defineStore('module-index', {
* @param value - The value to set for the parameter.
* @returns The new URL with the parameter added or replaced.
*/
export function addOrReplaceUrlParam(url: string, param: string, value: string): string {
export function addOrReplaceUrlParam(
url: string,
param: string,
value: string
): string {
// Parse the URL
const urlObj = new URL(url, window.location.origin);

View File

@ -1,5 +1,9 @@
import { BaseRestClient } from '@/libs/client';
import { adapter, type AbstractRegistry, type Request } from '@/libs/api/registry';
import {
adapter,
type AbstractRegistry,
type Request,
} from '@/libs/api/registry';
import { PageRequest, type PaginatedResponse } from '@/types';
export interface Classes {

View File

@ -70,7 +70,8 @@ const apr = computed(() => {
const rate = Number(v.value.commission?.commission_rates.rate || 0);
const inflation = useMintStore().inflation;
const communityTax = Number(useDistributionStore().params.community_tax);
const bondedRatio = Number(staking.pool.bonded_tokens) / Number(useBankStore().supply.amount);
const bondedRatio =
Number(staking.pool.bonded_tokens) / Number(useBankStore().supply.amount);
return format.percent(((1 - communityTax) * (1 - rate) * Number(inflation)) / bondedRatio);
});
@ -123,7 +124,8 @@ onMounted(() => {
staking.fetchValidator(validator).then((res) => {
v.value = res.validator;
identity.value = res.validator?.description?.identity || '';
if (identity.value && !avatars.value[identity.value]) loadAvatar(identity.value);
if (identity.value && !avatars.value[identity.value])
loadAvatar(identity.value);
addresses.value.hex = consensusPubkeyToHexAddress(v.value.consensus_pubkey);
addresses.value.valCons = pubKeyToValcons(
@ -293,7 +295,9 @@ function mapDelegators(messages: any[]) {
<div class="card-list">
<div class="flex items-center mb-2">
<Icon icon="mdi-web" class="text-xl mr-1" />
<span class="font-bold mr-2">{{ $t('staking.website') }}: </span>
<span class="font-bold mr-2"
>{{ $t('staking.website') }}:
</span>
<a
:href="v?.description?.website || '#'"
:class="v?.description?.website ? 'cursor-pointer' : 'cursor-default'"
@ -303,7 +307,9 @@ function mapDelegators(messages: any[]) {
</div>
<div class="flex items-center">
<Icon icon="mdi-email-outline" class="text-xl mr-1" />
<span class="font-bold mr-2">{{ $t('staking.contact') }}: </span>
<span class="font-bold mr-2"
>{{ $t('staking.contact') }}:
</span>
<a
v-if="v.description?.security_contact"
:href="'mailto:' + v.description.security_contact || '#'"
@ -313,7 +319,9 @@ function mapDelegators(messages: any[]) {
</a>
</div>
</div>
<p class="text-sm mt-4 mb-3 font-medium">{{ $t('staking.validator_status') }}</p>
<p class="text-sm mt-4 mb-3 font-medium">
{{ $t('staking.validator_status') }}
</p>
<div class="card-list">
<div class="flex items-center mb-2">
<Icon icon="mdi-shield-account-outline" class="text-xl mr-1" />
@ -328,7 +336,9 @@ function mapDelegators(messages: any[]) {
<span> {{ v.jailed || '-' }} </span>
</div>
</div>
<p class="text-sm mt-4 mb-3 font-medium">{{ $t('staking.liquid_staking') }}</p>
<p class="text-sm mt-4 mb-3 font-medium">
{{ $t('staking.liquid_staking') }}
</p>
<div class="card-list">
<div class="flex items-center mb-2">
<Icon icon="mdi-lock" class="text-xl mr-1" />
@ -339,7 +349,9 @@ function mapDelegators(messages: any[]) {
</div>
<div class="flex items-center">
<Icon icon="mdi-waves-arrow-right" class="text-xl mr-1" />
<span class="font-bold mr-2">{{ $t('staking.liquid_staking_shares') }}: </span>
<span class="font-bold mr-2"
>{{ $t('staking.liquid_staking_shares') }}:
</span>
<span>
{{ format.formatToken({ amount: v.liquid_shares, denom: staking.params.bond_denom }, false) }}
</span>
@ -401,7 +413,9 @@ function mapDelegators(messages: any[]) {
</div>
<div class="ml-3 flex flex-col justify-center">
<h4>{{ v.unbonding_height }}</h4>
<span class="text-sm">{{ $t('staking.unbonding_height') }}</span>
<span class="text-sm">{{
$t('staking.unbonding_height')
}}</span>
</div>
</div>
@ -567,7 +581,9 @@ function mapDelegators(messages: any[]) {
</div>
<div class="mt-5 bg-base-100 shadow rounded p-4">
<div class="text-lg mb-4 font-semibold">{{ $t('account.transactions') }}</div>
<div class="text-lg mb-4 font-semibold">
{{ $t('account.transactions') }}
</div>
<div class="rounded overflow-auto">
<table class="table validatore-table w-full">
<thead>
@ -575,7 +591,9 @@ function mapDelegators(messages: any[]) {
{{ $t('account.height') }}
</th>
<th class="text-left pl-4">{{ $t('account.hash') }}</th>
<th class="text-left pl-4" width="40%">{{ $t('account.messages') }}</th>
<th class="text-left pl-4" width="40%">
{{ $t('account.messages') }}
</th>
<th class="text-left pl-4">{{ $t('account.time') }}</th>
</thead>
<tbody>
@ -625,12 +643,17 @@ function mapDelegators(messages: any[]) {
<thead>
<th class="text-left pl-4">{{ $t('account.delegator') }}</th>
<th class="text-left pl-4">{{ $t('account.amount') }}</th>
<th class="text-left pl-4">{{ $t('account.height') }} / {{ $t('account.time') }}</th>
<th class="text-left pl-4">
{{ $t('account.height') }} / {{ $t('account.time') }}
</th>
</thead>
<tbody>
<tr v-for="(item, i) in events.tx_responses">
<td class="pr-2 truncate text-primary" style="max-width: 250px">
<RouterLink v-for="d in mapDelegators(item.tx?.body?.messages)" :to="`/${props.chain}/account/${d}`">
<RouterLink
v-for="d in mapDelegators(item.tx?.body?.messages)"
:to="`/${props.chain}/account/${d}`"
>
{{ d }}
</RouterLink>
</td>

View File

@ -56,7 +56,8 @@ onMounted(() => {
{{ $t('statesync.title_2') }}
</h2>
<div class="text-sm">
1. {{ $t('statesync.text_1') }} ({{ appName }} {{ $t('statesync.version') }}:
1. {{ $t('statesync.text_1') }} ({{ appName }}
{{ $t('statesync.version') }}:
{{ nodeInfo.application_version?.version || '' }})
<br />
{{ $t('statesync.text_1_1') }}.
@ -65,15 +66,31 @@ onMounted(() => {
2. {{ $t('statesync.text_2') }}<br />
{{ $t('statesync.text_2_1') }}. <br /><br />
<div class="mockup-code bg-base-200 my-2">
<pre data-prefix=">"><code class="text-gray-800 dark:invert">[state-sync]</code></pre>
<pre data-prefix=">"><code class="text-gray-800 dark:invert">enable = true</code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert">[state-sync]</code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert">enable = true</code></pre>
<pre data-prefix=">"><code class="text-gray-800"></code></pre>
<pre data-prefix=">"><code class="text-gray-800 dark:invert">rpc_servers = "{{ rpcs }}"</code></pre>
<pre data-prefix=">"><code class="text-gray-800 dark:invert">trust_height = {{ height }} </code></pre>
<pre data-prefix=">"><code class="text-gray-800 dark:invert">trust_hash = "{{ hash }}"</code></pre>
<pre data-prefix=">"><code class="text-gray-800 dark:invert"></code></pre>
<pre data-prefix=">"><code class="text-green-400"># 2/3 of unbonding time</code></pre>
<pre data-prefix=">"><code class="text-gray-800 dark:invert">trust_period = "168h"</code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert">rpc_servers = "{{ rpcs }}"</code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert">trust_height = {{ height }} </code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert">trust_hash = "{{ hash }}"</code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert"></code></pre>
<pre
data-prefix=">"
><code class="text-green-400"># 2/3 of unbonding time</code></pre>
<pre
data-prefix=">"
><code class="text-gray-800 dark:invert">trust_period = "168h"</code></pre>
</div>
<br />
3. {{ $t('statesync.text_3') }}:
@ -94,7 +111,6 @@ onMounted(() => {
{{ $t('statesync.text_title_3') }}
<br /><br />
<div class="mockup-code bg-base-200 my-2">
<pre data-prefix=">"><code class="text-gray-800 dark:invert">[state-sync]</code></pre>
<pre
data-prefix=">"
><code class="text-green-400"># snapshot-interval specifies the block interval at which local state sync snapshots are</code></pre>

View File

@ -1,7 +1,12 @@
<script lang="ts" setup>
import { ref } from '@vue/reactivity';
import { useBlockchain, useFormatter } from '@/stores';
import { PageRequest, type Pagination, type Coin, type DenomMetadata } from '@/types';
import {
PageRequest,
type Pagination,
type Coin,
type DenomMetadata,
} from '@/types';
import { onMounted } from 'vue';
import type { Asset } from '@ping-pub/chain-registry-client/dist/types';
import PaginationBar from '@/components/PaginationBar.vue';
@ -90,7 +95,11 @@ function pageload(p: number) {
<td>{{ item.base }}</td>
</tr>
</table>
<PaginationBar :limit="pageRequest.limit" :total="pageResponse.total" :callback="pageload" />
<PaginationBar
:limit="pageRequest.limit"
:total="pageResponse.total"
:callback="pageload"
/>
</div>
</template>

View File

@ -123,7 +123,9 @@ function color(v: string) {
<template>
<div>
<div class="overflow-x-auto w-full">
<div class="lg:!flex lg:!items-center lg:!justify-between bg-base-100 p-5">
<div
class="lg:!flex lg:!items-center lg:!justify-between bg-base-100 p-5"
>
<div class="min-w-0 flex-1">
<h2 class="text-2xl font-bold leading-7 sm:!truncate sm:!text-3xl sm:!tracking-tight">
{{ $t('uptime.my_validators') }}
@ -175,9 +177,24 @@ function color(v: string) {
}}</span>
</td>
<td>
<div v-if="v.sigingInfo && !v.sigingInfo?.jailed_until.startsWith('1970')" class="text-xs flex flex-wrap">
<div class="mt-1">{{ format.toLocaleDate(v.sigingInfo?.jailed_until) }}</div>
<div class="badge">{{ format.toDay(v.sigingInfo.jailed_until, 'from') }}</div>
<span v-if="v.sigingInfo">{{
Number(v.sigingInfo.index_offset) -
Number(v.sigingInfo.start_height)
}}</span>
</td>
<td>
<div
v-if="
v.sigingInfo && !v.sigingInfo?.jailed_until.startsWith('1970')
"
class="text-xs flex flex-wrap"
>
<div class="mt-1">
{{ format.toLocaleDate(v.sigingInfo?.jailed_until) }}
</div>
<div class="badge">
{{ format.toDay(v.sigingInfo.jailed_until, 'from') }}
</div>
</div>
</td>
<td class="capitalize">{{ v.sigingInfo?.tombstoned }}</td>
@ -197,14 +214,25 @@ function color(v: string) {
</div>
<div class="text-center">
<label for="add-validator" class="btn btn-primary mt-5">{{ $t('uptime.add_validators') }}</label>
<label for="add-validator" class="btn btn-primary mt-5">{{
$t('uptime.add_validators')
}}</label>
</div>
<!-- Put this part before </body> tag -->
<input type="checkbox" id="add-validator" class="modal-toggle" @change="initial" />
<input
type="checkbox"
id="add-validator"
class="modal-toggle"
@change="initial"
/>
<div class="modal">
<div class="modal-box relative">
<label for="add-validator" class="btn btn-sm btn-circle absolute right-2 top-2"></label>
<label
for="add-validator"
class="btn btn-sm btn-circle absolute right-2 top-2"
></label
>
<h3 class="text-lg font-bold">{{ $t('uptime.add_validators') }}</h3>
<div class="form-control my-5 border-2">
<div class="input-group input-group-md">
@ -245,7 +273,9 @@ function color(v: string) {
</table>
</div>
<div class="modal-action">
<label class="btn btn-primary" @click="add">{{ $t('uptime.add') }}</label>
<label class="btn btn-primary" @click="add">{{
$t('uptime.add')
}}</label>
</div>
</div>
</div>

View File

@ -228,7 +228,9 @@ function changeTab(v: string) {
<div v-for="(unit, i) in grid" :key="i">
<div class="flex justify-between py-0 w-[248px]">
<label class="truncate text-sm">
<span class="ml-1 text-black dark:text-white">{{ i + 1 }}.{{ unit.moniker }}</span>
<span class="ml-1 text-black dark:text-white"
>{{ i + 1 }}.{{ unit.moniker }}</span
>
</label>
<div
v-if="Number(unit?.missed_blocks_counter || 0) > 10"
@ -236,7 +238,10 @@ function changeTab(v: string) {
>
{{ unit?.missed_blocks_counter }}
</div>
<div v-else class="badge badge-sm bg-transparent text-green-600 border-0 font-bold">
<div
v-else
class="badge badge-sm bg-transparent text-green-600 border-0 font-bold"
>
{{ unit?.missed_blocks_counter }}
</div>
</div>
@ -246,7 +251,8 @@ function changeTab(v: string) {
<div class="mt-5 text-xs flex justify-center gap-2">
<span class="font-bold">{{ $t('uptime.legend') }}: </span>
<span class="bg-green-500">&nbsp;</span> {{ $t('uptime.committed') }}
<span class="bg-yellow-500">&nbsp;</span> {{ $t('uptime.precommitted') }}
<span class="bg-yellow-500">&nbsp;</span>
{{ $t('uptime.precommitted') }}
<span class="bg-red-500">&nbsp;</span> {{ $t('uptime.missed') }}
</div>
</div>
@ -275,9 +281,16 @@ function changeTab(v: string) {
</span>
</td>
<td>
<span v-if="v.signing && !v.signing.jailed_until.startsWith('1970')">
<div class="tooltip" :data-tip="format.toDay(v.signing.jailed_until, 'long')">
<span>{{ format.toDay(v.signing.jailed_until, 'from') }}</span>
<span
v-if="v.signing && !v.signing.jailed_until.startsWith('1970')"
>
<div
class="tooltip"
:data-tip="format.toDay(v.signing.jailed_until, 'long')"
>
<span>{{
format.toDay(v.signing.jailed_until, 'from')
}}</span>
</div>
</span>
</td>

View File

@ -216,10 +216,18 @@ async function loadBalances(chainName: string, endpoint: string, address: string
</div>
</div>
<AdBanner id="account-banner-ad" unit="banner" width="970px" height="90px" />
<AdBanner
id="account-banner-ad"
unit="banner"
width="970px"
height="90px"
/>
<div class="overflow-x-auto">
<div v-for="{ key, subaccounts } in accounts" class="bg-base-100 rounded-md my-5 py-5">
<div
v-for="{ key, subaccounts } in accounts"
class="bg-base-100 rounded-md my-5 py-5"
>
<div class="flex justify-self-center">
<div class="mx-2 p-2">
<svg
@ -234,7 +242,11 @@ async function loadBalances(chainName: string, endpoint: string, address: string
xml:space="preserve"
>
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
<g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"
></g>
<g id="SVGRepo_iconCarrier">
<g>
<g>
@ -278,7 +290,9 @@ async function loadBalances(chainName: string, endpoint: string, address: string
<ul class="!menu w-full">
<div v-for="x in subaccounts">
<li v-if="x.delegation.amount">
<RouterLink :to="`/${x.account.chainName}/account/${x.account.address}`">
<RouterLink
:to="`/${x.account.chainName}/account/${x.account.address}`"
>
<img :src="x.account.logo" class="w-6 h-6 mr-2" />
<span class="font-bold"
>{{ format.formatToken(x.delegation, true, '0,0.[00]', 'all') }} <br /><span
@ -309,7 +323,9 @@ async function loadBalances(chainName: string, endpoint: string, address: string
<ul class="!menu w-full">
<div v-for="s in subaccounts">
<li v-for="x in s.balances">
<RouterLink :to="`/${s.account.chainName}/account/${s.account.address}`">
<RouterLink
:to="`/${s.account.chainName}/account/${s.account.address}`"
>
<img :src="s.account.logo" class="w-6 h-6 mr-2" />
<span class="font-bold"
>{{ format.formatToken(x, true, '0,0.[00]', 'all') }} <br /><span
@ -352,7 +368,11 @@ async function loadBalances(chainName: string, endpoint: string, address: string
<!-- Put this part before </body> tag -->
<div class="modal" id="address-modal">
<div class="modal-box">
<a href="#" class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"></a>
<a
href="#"
class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"
></a
>
<h3 class="font-bold text-lg mb-2">Derive Account From Address</h3>
<div>
<label class="my-2">
@ -365,7 +385,10 @@ async function loadBalances(chainName: string, endpoint: string, address: string
<input v-model="sourceHdPath" class="input input-bordered w-full input-sm" placeholder="m/44/118/0'/0/0" />
</label>
</div>
<div v-show="importStep === 'step2'" class="py-4 max-h-72 overflow-y-auto">
<div
v-show="importStep === 'step2'"
class="py-4 max-h-72 overflow-y-auto"
>
<table class="table table-compact">
<tr v-for="acc in availableAccount">
<td>
@ -392,7 +415,10 @@ async function loadBalances(chainName: string, endpoint: string, address: string
</div>
</td>
<td class="text-right">
<span class="btn !bg-yes !border-yes btn-xs text-white" @click="addAddress(acc)">
<span
class="btn !bg-yes !border-yes btn-xs text-white"
@click="addAddress(acc)"
>
<Icon icon="mdi:plus" />
</span>
</td>
@ -400,7 +426,12 @@ async function loadBalances(chainName: string, endpoint: string, address: string
</table>
</div>
<div class="modal-action mt-2 mb-0">
<a href="#" class="btn btn-primary btn-sm" @click="importStep = 'step1'">Close</a>
<a
href="#"
class="btn btn-primary btn-sm"
@click="importStep = 'step1'"
>Close</a
>
</div>
</div>
</div>

View File

@ -264,8 +264,16 @@ const currencySign = computed(() => {
</div>
<div class="text-right">
<div>Total Value</div>
<div class="text-success font-bold">{{ currencySign }} {{ format.formatNumber(totalValue, '0,0.[00]') }}</div>
<div class="text-xs" :class="{ 'text-success': totalChangeIn24 > 0, 'text-error': totalChangeIn24 < 0 }">
<div class="text-success font-bold">
{{ currencySign }} {{ format.formatNumber(totalValue, '0,0.[00]') }}
</div>
<div
class="text-xs"
:class="{
'text-success': totalChangeIn24 > 0,
'text-error': totalChangeIn24 < 0,
}"
>
{{ format.formatNumber(totalChangeIn24, '+0,0.[00]') }}
</div>
</div>
@ -280,7 +288,12 @@ const currencySign = computed(() => {
/>
</div>
<div class="md:col-span-2">
<ApexCharts type="area" height="280" :options="chartConfig" :series="changeData" />
<ApexCharts
type="area"
height="280"
:options="chartConfig"
:series="changeData"
/>
</div>
</div>
<div class="overflow-x-auto mt-4">
@ -306,7 +319,9 @@ const currencySign = computed(() => {
<span class="capitalize">{{ x.chainName }} </span>
</div>
</td>
<td class="text-right">{{ currencySign }}{{ format.formatNumber(x.value, '0,0.[00]') }}</td>
<td class="text-right">
{{ currencySign }}{{ format.formatNumber(x.value, '0,0.[00]') }}
</td>
<td class="text-right">{{ format.percent(x.percentage) }}</td>
</tr>
</tbody>
@ -315,7 +330,9 @@ const currencySign = computed(() => {
<div class="p-4 text-center" v-if="tokenList.length === 0">No Data</div>
</div>
<div class="text-center my-5 bg-base-200">
<RouterLink to="./accounts" class="btn btn-link">Add More Asset</RouterLink>
<RouterLink to="./accounts" class="btn btn-link"
>Add More Asset</RouterLink
>
</div>
</div>
</template>

View File

@ -9,14 +9,19 @@ const qrcode = useQRCode(walletStore.currentAddress);
<template>
<div class="bg-base-100 p-4 rounded text-center">
<div class="text-xl font-semibold text-center">Pay Me</div>
<div v-if="walletStore.currentAddress" class="flex items-center justify-center mt-8 mb-4">
<div
v-if="walletStore.currentAddress"
class="flex items-center justify-center mt-8 mb-4"
>
<img :src="qrcode" alt="QR Code" class="rounded-sm overflow-hidden" />
</div>
<div class="text-main">
{{ walletStore.currentAddress }}
</div>
<div class="mt-4 mb-4">
<button class="btn !bg-yes !border-yes text-white px-10">Go To Pay</button>
<button class="btn !bg-yes !border-yes text-white px-10">
Go To Pay
</button>
</div>
</div>
</template>

View File

@ -1,7 +1,12 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { suggestChain } from '@leapwallet/cosmos-snap-provider';
import { useDashboard, type ChainConfig, useBlockchain, NetworkType } from '@/stores';
import {
useDashboard,
type ChainConfig,
useBlockchain,
NetworkType,
} from '@/stores';
import { CosmosRestClient } from '@/libs/client';
import { onMounted } from 'vue';
import AdBanner from '@/components/ad/AdBanner.vue';

View File

@ -35,7 +35,9 @@ const chainStore = useBlockchain();
</script>
<template>
<div class="">
<div class="flex md:!flex-row flex-col items-center justify-center mb-6 mt-14 gap-2">
<div
class="flex md:!flex-row flex-col items-center justify-center mb-6 mt-14 gap-2"
>
<div class="w-16 rounded-full">
<svg
version="1.0"

View File

@ -170,7 +170,8 @@ export function fromLocal(lc: LocalConfig): ChainConfig {
cosmosSdk: lc.sdk_version,
};
conf.bech32Prefix = lc.addr_prefix;
conf.bech32ConsensusPrefix = lc.consensus_prefix ?? lc.addr_prefix + 'valcons';
conf.bech32ConsensusPrefix =
lc.consensus_prefix ?? lc.addr_prefix + 'valcons';
conf.chainName = lc.chain_name;
conf.coinType = lc.coin_type;
conf.prettyName = lc.registry_name || lc.chain_name;
@ -364,7 +365,11 @@ export const useDashboard = defineStore('dashboard', {
const blockchain = useBlockchain();
const keys = Object.keys(this.favoriteMap);
for (let i = 0; i < keys.length; i++) {
if (!blockchain.chainName && this.chains[keys[i]] && this.favoriteMap[keys[i]]) {
if (
!blockchain.chainName &&
this.chains[keys[i]] &&
this.favoriteMap[keys[i]]
) {
blockchain.setCurrent(keys[i]);
break;
}

View File

@ -131,7 +131,9 @@ export const useFormatter = defineStore('formatter', {
// find the symbol
const symbol = this.dashboard.coingecko[token.denom]?.symbol || token.denom;
// convert denomination to symbol
const exponent = this.dashboard.coingecko[symbol?.toLowerCase()]?.exponent || this.specialDenom(token.denom);
const exponent =
this.dashboard.coingecko[symbol?.toLowerCase()]?.exponent ||
this.specialDenom(token.denom);
// caculate amount of symbol
const amount = Number(token.amount) / 10 ** exponent;
return amount;

View File

@ -4,8 +4,18 @@ import { useBlockchain } from './useBlockchain';
import { get } from '@/libs/http';
import type { StakingParam, StakingPool, Validator } from '@/types';
import { CosmosRestClient } from '@/libs/client';
import { consensusPubkeyToHexAddress, pubKeyToValcons, valconsToBase64 } from '@/libs';
import { toHex, fromBase64, toBase64, fromHex, fromBech32 } from '@cosmjs/encoding';
import {
consensusPubkeyToHexAddress,
pubKeyToValcons,
valconsToBase64,
} from '@/libs';
import {
toHex,
fromBase64,
toBase64,
fromHex,
fromBech32,
} from '@cosmjs/encoding';
import { useBaseStore } from './useBaseStore';
export const useStakingStore = defineStore('stakingStore', {

View File

@ -32,7 +32,12 @@ export const useTxDialog = defineStore('txDialogStore', {
setParams(param: any) {
this.params = JSON.stringify(param);
},
openWithArgument(type: string, sender: string, endpoint: string, param: any) {
openWithArgument(
type: string,
sender: string,
endpoint: string,
param: any
) {
this.type = type;
this.sender = sender;
this.endpoint = endpoint;

View File

@ -1,6 +1,11 @@
{
"extends": "@vue/tsconfig/tsconfig.node.json",
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"types": ["node"]