diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..379604ed2b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +public/logo.svg merge=ours +public/favicon.ico merge=ours diff --git a/README.md b/README.md index 051bc973d9..90d8fca6b1 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,49 @@
-![Ping Wallet](./public/logo.svg) +qBTC -

Ping Dashboard

- -**Ping Dashboard is not only an explorer but also a wallet and more ... 🛠** - -[![version](https://img.shields.io/github/tag/ping-pub/explorer.svg)](https://github.com/ping-pub/explorer/releases/latest) -[![GitHub](https://img.shields.io/github/license/ping-pub/explorer.svg)](https://github.com/ping-pub/explorer/blob/master/LICENSE) -[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/bukotsunikki.svg?style=social&label=Follow%20%40ping_pub)](https://twitter.com/ping_pub) -[![https://discord.gg/CmjYVSr6GW](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat)](https://discord.gg/CmjYVSr6GW) +

qBTC Explorer

+**A light block explorer and wallet for the qBTC chain.**
-`Ping Dashboard` is a light explorer for Cosmos-based Blockchains. https://ping.pub . - -## What sets Ping Dashboard apart from other explorers? -**Ping Dashboard** stands out by providing a real-time exploration of blockchain data without relying on caching or pre-processing. It exclusively fetches data from the Cosmos full node via LCD/RPC endpoints, ensuring a truly authentic experience. This approach is referred to as the "Light Explorer." - -## Are you interested in listing your blockchain on https://ping.pub? +`qBTC Explorer` is a single-chain explorer for [qBTC](https://qbtcapi.odindex.io), built on top of [Ping Dashboard](https://github.com/ping-pub/explorer). It fetches data live from the qBTC LCD/RPC endpoints with no caching or pre-processing — what you see is the chain's actual state at the moment of query. -To make this repository clean, please submit your request to https://github.com/ping-pub/ping.pub.git +## Endpoints +| | URL | +|--|--| +| LCD (API) | https://qbtcapi.odindex.io | +| RPC | https://qbtcrpc.odindex.io | +| Address prefix | `qbtc` | -## Why does Ping Dashboard rely on official/trusted third-party public LCD/RPC servers? -There are two primary reasons for this choice: +The chain config lives at [chains/mainnet/qbtc.json](chains/mainnet/qbtc.json). - - Trust: In a decentralized system, it is crucial to avoid relying solely on a single entity. By utilizing official/trusted third-party public LCD/RPC servers, Ping Dashboard ensures that the data is sourced from a network of trusted participants. - - Limited Resources: As Ping Dashboard plans to list hundreds of Cosmos-based blockchains in the future, it is impractical for the Ping team to operate validators or full nodes for all of them. Leveraging trusted third-party servers allows for more efficient resource allocation. +## Local development -## Donation +Requirements: Node.js and Yarn. -Your donation will help us make better products. Thanks in advance. - - - Address for ERC20: USDC, USDT, ETH -``` -0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1 +```bash +yarn install +yarn dev ``` -#### Donations from project +The dev server runs on Vite. Edit [chains/mainnet/qbtc.json](chains/mainnet/qbtc.json) to change endpoints, logo, or other chain metadata — the app will pick up the change on reload. -- Point Network: 1000USDC and $1000 worth of POINT -- Bitsong: 50k BTSG -- IRISnet: 100k IRIS +## Production build -## Hire us +```bash +yarn build +yarn preview +``` -You can hire us by submitting an issue and fund the issue on [IssueHunter](https://issuehunt.io/r/ping-pub/explorer) +The site is deployed on Vercel with a redirect from `/` to `/qbtc` (see [vercel.json](vercel.json)). Chain JSON is bundled into the JS at build time via Vite's `import.meta.glob`, so a change to `chains/mainnet/qbtc.json` requires a rebuild/redeploy to take effect. +## Upstream -## Contributors +This project is a fork of [ping-pub/explorer](https://github.com/ping-pub/explorer). The bulk of the UI, wallet integration, and indexing logic comes from there; this fork periodically syncs `ping-pub:master` into `master`. -Developers: @liangping @dingyiming +## License +[GPL-2.0](LICENSE), inherited from the upstream Ping Dashboard project. diff --git a/chains/mainnet/axelar.json b/chains/mainnet/axelar.json deleted file mode 100644 index 255f99187d..0000000000 --- a/chains/mainnet/axelar.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "chain_name": "axelar", - "api": ["https://rest.axelar.lava.build/lava-referer-97409c72-1a82-4861-8651-119c15151cbe"], - "rpc": ["https://tm.axelar.lava.build/lava-referer-97409c72-1a82-4861-8651-119c15151cbe"], - "snapshot_provider": "", - "sdk_version": "0.45.6", - "coin_type": "118", - "min_tx_fee": "800", - "addr_prefix": "axelar", - "logo": "/logos/axelar.svg", - "theme_color": "#161723", - "assets": [ - { - "base": "uaxl", - "symbol": "AXL", - "exponent": "6", - "coingecko_id": "axelar", - "logo": "/logos/axelar.svg" - }, - { - "base": "uusdc", - "symbol": "axlUSDC", - "exponent": "6", - "coingecko_id": "usd-coin", - "logo": "/logos/usdc.svg" - }, - { - "base": "uusdt", - "symbol": "axlUSDT", - "exponent": "6", - "coingecko_id": "tether", - "logo": "/logos/usdt.svg" - }, - { - "base": "dai-wei", - "symbol": "axlDAI", - "exponent": "18", - "coingecko_id": "dai", - "logo": "/logos/dai.svg" - }, - { - "base": "weth-wei", - "symbol": "axlWETH", - "exponent": "18", - "coingecko_id": "ethereum", - "logo": "/logos/weth.svg" - }, - { - "base": "wmatic-wei", - "symbol": "axlWMATIC", - "exponent": "18", - "coingecko_id": "matic-network", - "logo": "/logos/wmatic.svg" - }, - { - "base": "wavax-wei", - "symbol": "axlWAVAX", - "exponent": "18", - "coingecko_id": "avalanche-2", - "logo": "/logos/wavax.svg" - }, - { - "base": "dot-planck", - "symbol": "axlDOT", - "exponent": "10", - "coingecko_id": "polkadot", - "logo": "/logos/dot.svg" - } - ] -} diff --git a/chains/mainnet/cosmos.json b/chains/mainnet/cosmos.json deleted file mode 100644 index 91e03b71a2..0000000000 --- a/chains/mainnet/cosmos.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "chain_name": "cosmos", - "registry_name": "cosmoshub", - "api": [ - { "provider": "cosmos.directory", "address": "https://rest.cosmos.directory/cosmoshub" }, - { "provider": "publicnode", "address": "https://cosmos-rest.publicnode.com" }, - { "provider": "silknode", "address": "https://cosmos.api.silknodes.io" } - ], - "rpc": [ - { "provider": "icycro", "address": "https://cosmos-rpc.icycro.org" }, - { "provider": "dragonstake", "address": "https://rpc.cosmos.dragonstake.io" }, - { "provider": "Golden Ratio Staking", "address": "https://rpc-cosmoshub.goldenratiostaking.net" } - ], - "sdk_version": "0.45.1", - "coin_type": "118", - "min_tx_fee": "800", - "addr_prefix": "cosmos", - "logo": "/logos/cosmos.svg", - "assets": [ - { - "base": "uatom", - "symbol": "ATOM", - "exponent": "6", - "coingecko_id": "cosmos", - "logo": "/logos/cosmos.svg" - } - ] -} diff --git a/chains/mainnet/neutron.json b/chains/mainnet/neutron.json deleted file mode 100644 index 6d9594a908..0000000000 --- a/chains/mainnet/neutron.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "chain_name": "neutron", - "api": [ - { "provider": "Polkachu", "address": "https://neutron-api.polkachu.com" }, - { "provider": "NodeStake", "address": "https://api.neutron.nodestake.top" }, - { "provider": "Allnodes", "address": "https://neutron-rest.publicnode.com" } - ], - "rpc": [ - { "provider": "Polkachu", "address": "https://neutron-rpc.polkachu.com" }, - { "provider": "NodeStake", "address": "https://rpc.neutron.nodestake.top" }, - { "provider": "Allnodes", "address": "https://neutron-rpc.publicnode.com:443" } - ], - "provider_chain": { - "api": ["https://rest.cosmos.directory/cosmoshub"] - }, - "features": [ - "dashboard", - "blocks", - "ibc", - "cosmwasm", - "uptime", - "parameters", - "state-sync", - "consensus", - "supply", - "widget" - ], - "sdk_version": "0.45.1", - "coin_type": "118", - "min_tx_fee": "8000", - "assets": [ - { - "base": "untrn", - "symbol": "NTRN", - "exponent": "6", - "coingecko_id": "neutron", - "logo": "/logos/neutron.svg" - } - ], - "addr_prefix": "neutron", - "theme_color": "#161723", - "logo": "/logos/neutron.svg" -} diff --git a/chains/mainnet/nolus.json b/chains/mainnet/nolus.json deleted file mode 100644 index 2c832db946..0000000000 --- a/chains/mainnet/nolus.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "chain_name": "nolus", - "coingecko": "nolus", - "api": [ - { "provider": "Nolus", "address": "https://pirin-cl.nolus.network:1317" }, - { "provider": "LavenderFive", "address": "https://nolus-api.lavenderfive.com:443" }, - { "provider": "Allnodes", "address": "https://nolus-rest.publicnode.com" } - ], - "rpc": [ - { "provider": "Nolus", "address": "https://pirin-cl.nolus.network:26657" }, - { "provider": "LavenderFive", "address": "https://nolus-rpc.lavenderfive.com:443" }, - { "provider": "Allnodes", "address": "https://nolus-rpc.publicnode.com:443" } - ], - "snapshot_provider": "", - "sdk_version": "v0.47.6", - "coin_type": "118", - "min_tx_fee": "0", - "addr_prefix": "nolus", - "logo": "/logos/nolus.svg", - "assets": [ - { - "base": "unls", - "symbol": "NLS", - "exponent": "6", - "coingecko_id": "nolus", - "logo": "/logos/nolus.svg" - } - ] -} diff --git a/chains/mainnet/osmosis.json b/chains/mainnet/osmosis.json deleted file mode 100644 index 449480d65d..0000000000 --- a/chains/mainnet/osmosis.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "chain_name": "osmosis", - "coingecko": "osmosis", - "api": [ - "https://lcd.osmosis.zone", - "https://api-osmosis-ia.cosmosia.notional.ventures", - "https://osmosis-api.polkachu.com", - "https://lcd-osmosis.blockapsis.com" - ], - "rpc": [ - "https://rpc.osmosis.zone", - "https://rpc-osmosis-ia.cosmosia.notional.ventures:443", - "https://osmosis-rpc.polkachu.com:443", - "https://osmosis.validator.network:443", - "https://rpc-osmosis.blockapsis.com:443" - ], - "snapshot_provider": "", - "sdk_version": "0.46.1", - "coin_type": "118", - "min_tx_fee": "800", - "addr_prefix": "osmo", - "logo": "/logos/osmosis.jpg", - "theme_color": "#812cd6", - "assets": [ - { - "base": "uosmo", - "symbol": "OSMO", - "exponent": "6", - "coingecko_id": "osmosis", - "logo": "/logos/osmosis.jpg" - }, - { - "base": "uion", - "symbol": "ION", - "exponent": "6", - "coingecko_id": "ion", - "logo": "/logos/osmosis.jpg" - }, - { - "base": "usomm", - "symbol": "SOMM", - "exponent": "6", - "coingecko_id": "somm", - "logo": "" - } - ] -} diff --git a/chains/mainnet/qbtc.json b/chains/mainnet/qbtc.json new file mode 100644 index 0000000000..11177634a3 --- /dev/null +++ b/chains/mainnet/qbtc.json @@ -0,0 +1,24 @@ +{ + "chain_name": "qbtc", + "registry_name": "qbtc", + "logo": "https://raw.githubusercontent.com/vultisig/vultisig-windows/refs/heads/main/core/ui/public/coins/qbtc.svg", + "api": [ + "https://qbtcapi.odindex.io" + ], + "rpc": [ + "https://qbtcrpc.odindex.io" + ], + "sdk_version": "0.53.4", + "coin_type": "118", + "min_tx_fee": "800", + "addr_prefix": "qbtc", + "assets": [ + { + "base": "qbtc", + "symbol": "QBTC", + "exponent": "8", + "coingecko_id": "", + "logo": "https://raw.githubusercontent.com/vultisig/vultisig-windows/refs/heads/main/core/ui/public/coins/qbtc.svg" + } + ] +} \ No newline at end of file diff --git a/chains/mainnet/xion.json b/chains/mainnet/xion.json deleted file mode 100644 index 49dafec078..0000000000 --- a/chains/mainnet/xion.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "chain_name": "xion", - "chain_id": "xion-mainnet-1", - "registry_name": "xion", - "coingecko": "xion", - "network_type": "mainnet", - "rpc": [ - { - "address": "https://rpc.xion-mainnet-1.burnt.com", - "provider": "🔥BurntLabs🔥" - }, - { - "address": "https://rpc-burnt.imperator.co/", - "provider": "Imperator.co" - }, - { - "address": "https://xion-rpc.polkachu.com", - "provider": "Polkachu" - } - ], - "api": [ - { - "address": "https://api.xion-mainnet-1.burnt.com", - "provider": "🔥BurntLabs🔥" - }, - { - "address": "https://lcd-burnt.imperator.co/", - "provider": "Imperator.co" - }, - { - "address": "https://xion-api.polkachu.com", - "provider": "Polkachu" - } - ], - "snapshot_provider": "", - "sdk_version": "0.53.3", - "coin_type": "118", - "min_tx_fee": "100", - "addr_prefix": "xion", - "theme_color": "#96b325", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/xion/images/burnt-round.png", - "assets": [ - { - "base": "uxion", - "symbol": "XION", - "exponent": "6", - "coingecko_id": "xion-2", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/xion/images/burnt-round.png" - }, - { - "base": "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B", - "symbol": "OSMO", - "exponent": "6", - "coingecko_id": "osmosis", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.png" - }, - { - "base": "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", - "symbol": "USDC", - "exponent": "6", - "coingecko_id": "usd-coin", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/USDCoin.png" - }, - { - "base": "ibc/CC7B293B3F08EA7DB96AFD4765BD0C7F95ABD7ECEAF21C74F3ACCBF7CEFB6591", - "symbol": "OSMO", - "exponent": "6", - "coingecko_id": "osmosis", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.png" - }, - { - "base": "ibc/9463E39D230614B313B487836D13A392BD1731928713D4C8427A083627048DB3", - "symbol": "AXL", - "exponent": "6", - "coingecko_id": "axelar", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png" - }, - { - "base": "ibc/6490A7EAB61059BFC1CDDEB05917DD70BDF3A611654162A1A47DB930D40D8AF4", - "symbol": "axlUSDC", - "exponent": "6", - "coingecko_id": "usd-coin", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axlusdc.png" - }, - { - "base": "ibc/0000000000000000000000000000000000000000000000000000000000000000", - "symbol": "axlUSDT", - "exponent": "6", - "coingecko_id": "tether", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axlusdc.png" - }, - { - "base": "ibc/0000000000000000000000000000000000000000000000000000000000000000", - "symbol": "axlDAI", - "exponent": "18", - "coingecko_id": "dai", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axldai.png" - }, - { - "base": "ibc/0000000000000000000000000000000000000000000000000000000000000000", - "symbol": "axlFRAX", - "exponent": "6", - "coingecko_id": "frax", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axlfrax.png" - }, - { - "base": "ibc/AAD7136DD626569C3DDE7C5F764968BB2E939875EFC568AE5712B62081850814", - "symbol": "axlWETH", - "exponent": "18", - "coingecko_id": "axlweth", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png" - }, - { - "base": "ibc/056EA54C3D9B49B3C0418955A27980A91DD4F210914BFE240A1DB19E27895ECA", - "symbol": "KYVE", - "exponent": "6", - "coingecko_id": "kyve-network", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/kyve/images/kyve-token.png" - }, - { - "base": "ibc/DBE9697AC1044255A305A2034AD360B4152632BFBFB5785234731F60196B9645", - "symbol": "ELYS", - "exponent": "6", - "coingecko_id": "elys", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/elys/images/elys.png" - }, - { - "base": "ibc/E706A0C6CACB374ADC2BCF6A74FE1B260840FC822E45DCB776DEA962A57FED30", - "symbol": "axlARB", - "exponent": "18", - "coingecko_id": "arb", - "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/arbitrum/images/arb.png" - } - ], - "features": [ - "dashboard", - "governance", - "staking", - "blocks", - "tx", - "uptime", - "ibc", - "supply", - "parameters", - "consensus", - "cosmwasm", - "account" - ], - "keplr_features": ["ibc-go", "ibc-transfer", "no-legacy-stdTx"] -} diff --git a/chains/testnet/bfhevm.json b/chains/testnet/bfhevm.json deleted file mode 100644 index c136f030db..0000000000 --- a/chains/testnet/bfhevm.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "chain_name": "bfhevm_777-1", - "api": ["https://rest-testnet-bfhevm.xyz:443"], - "rpc": ["https://rpc-bfhevm.xyz:8443"], - "coingecko": "", - "snapshot_provider": "", - "sdk_version": "0.45.7", - "coin_type": "60", - "min_tx_fee": "700", - "addr_prefix": "bfh", - "logo": "", - "assets": [ - { - "base": "abfh", - "symbol": "BFH", - "exponent": "18", - "coingecko_id": "", - "logo": "" - } - ] -} diff --git a/chains/testnet/crossfi.json b/chains/testnet/crossfi.json deleted file mode 100644 index d602617509..0000000000 --- a/chains/testnet/crossfi.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "chain_name": "crossfi-testnet-1", - "api": ["https://crossfi-testnet-api.forpeaky.xyz"], - "rpc": ["https://crossfi-testnet-rpc.forpeaky.xyz"], - "coingecko": "", - "snapshot_provider": "", - "sdk_version": "0.47.1", - "coin_type": "118", - "min_tx_fee": "500", - "addr_prefix": "crossfi" -} diff --git a/chains/testnet/qbtc.json b/chains/testnet/qbtc.json new file mode 100644 index 0000000000..11177634a3 --- /dev/null +++ b/chains/testnet/qbtc.json @@ -0,0 +1,24 @@ +{ + "chain_name": "qbtc", + "registry_name": "qbtc", + "logo": "https://raw.githubusercontent.com/vultisig/vultisig-windows/refs/heads/main/core/ui/public/coins/qbtc.svg", + "api": [ + "https://qbtcapi.odindex.io" + ], + "rpc": [ + "https://qbtcrpc.odindex.io" + ], + "sdk_version": "0.53.4", + "coin_type": "118", + "min_tx_fee": "800", + "addr_prefix": "qbtc", + "assets": [ + { + "base": "qbtc", + "symbol": "QBTC", + "exponent": "8", + "coingecko_id": "", + "logo": "https://raw.githubusercontent.com/vultisig/vultisig-windows/refs/heads/main/core/ui/public/coins/qbtc.svg" + } + ] +} \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico index ef242a96ba..584c666ba3 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/logo.svg b/public/logo.svg index a620f52a3e..0bc874f1fa 100644 Binary files a/public/logo.svg and b/public/logo.svg differ diff --git a/public/logos/qbtc.svg b/public/logos/qbtc.svg new file mode 100644 index 0000000000..03d4ab56f3 --- /dev/null +++ b/public/logos/qbtc.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/layouts/components/NavBarWallet.vue b/src/layouts/components/NavBarWallet.vue index 6207c8576e..b049a87e52 100644 --- a/src/layouts/components/NavBarWallet.vue +++ b/src/layouts/components/NavBarWallet.vue @@ -2,12 +2,29 @@ import { useRoute } from 'vue-router'; import { useBaseStore, useBlockchain, useWalletStore } from '@/stores'; import { Icon } from '@iconify/vue'; -import { ref, computed } from 'vue'; +import { ref, computed, watch } from 'vue'; +import { suggestKeplrChain } from '@/libs/keplr'; const route = useRoute(); const walletStore = useWalletStore(); const chainStore = useBlockchain(); const baseStore = useBaseStore(); + +// Pre-register the active chain with Keplr so the connect modal doesn't +// trip on "no modular chain info" before the user can interact. +// experimentalSuggestChain is a no-op if the chain is already added. +const suggested = new Set(); +watch( + () => chainStore.current?.chainName, + (name) => { + const chain = chainStore.current; + // @ts-ignore + if (!chain || !name || suggested.has(name) || !window.keplr) return; + suggested.add(name); + suggestKeplrChain(chain).catch((e) => console.warn('keplr suggest skipped:', e?.message || e)); + }, + { immediate: true } +); // walletStore.$subscribe((m, s) => { // console.log(m, s); // }); diff --git a/src/libs/keplr.ts b/src/libs/keplr.ts new file mode 100644 index 0000000000..5b62e05e02 --- /dev/null +++ b/src/libs/keplr.ts @@ -0,0 +1,67 @@ +import type { ChainConfig } from '@/types/chaindata'; +import { CosmosRestClient } from '@/libs/client'; + +export async function buildKeplrChainInfo(chain: ChainConfig) { + if (!chain.endpoints?.rest?.at(0)) throw new Error('Endpoint does not set'); + const client = CosmosRestClient.newDefault(chain.endpoints.rest.at(0)!.address); + const b = await client.getBaseBlockLatest(); + const chainId = b.block.header.chain_id; + + const gasPriceStep = chain.keplrPriceStep || { + low: 0.01, + average: 0.025, + high: 0.03, + }; + const coinDecimals = Number(chain.assets[0].exponent ?? 6); + + return { + chainId, + chainName: chain.chainName, + rpc: chain.endpoints?.rpc?.at(0)?.address, + rest: chain.endpoints?.rest?.at(0)?.address, + bip44: { coinType: Number(chain.coinType) }, + coinType: Number(chain.coinType), + bech32Config: { + bech32PrefixAccAddr: chain.bech32Prefix, + bech32PrefixAccPub: `${chain.bech32Prefix}pub`, + bech32PrefixValAddr: `${chain.bech32Prefix}valoper`, + bech32PrefixValPub: `${chain.bech32Prefix}valoperpub`, + bech32PrefixConsAddr: `${chain.bech32Prefix}valcons`, + bech32PrefixConsPub: `${chain.bech32Prefix}valconspub`, + }, + currencies: [ + { + coinDenom: chain.assets[0].symbol, + coinMinimalDenom: chain.assets[0].base, + coinDecimals, + coinGeckoId: chain.assets[0].coingecko_id || 'unknown', + }, + ], + feeCurrencies: [ + { + coinDenom: chain.assets[0].symbol, + coinMinimalDenom: chain.assets[0].base, + coinDecimals, + coinGeckoId: chain.assets[0].coingecko_id || 'unknown', + gasPriceStep, + }, + ], + gasPriceStep, + stakeCurrency: { + coinDenom: chain.assets[0].symbol, + coinMinimalDenom: chain.assets[0].base, + coinDecimals, + coinGeckoId: chain.assets[0].coingecko_id || 'unknown', + }, + features: chain.keplrFeatures || [], + }; +} + +export async function suggestKeplrChain(chain: ChainConfig) { + // @ts-ignore + const keplr = window.keplr; + if (!keplr) throw new Error('Keplr extension not detected'); + const info = await buildKeplrChainInfo(chain); + await keplr.experimentalSuggestChain(info); + return info.chainId; +} diff --git a/src/modules/[chain]/account/[address].vue b/src/modules/[chain]/account/[address].vue index e8c7bc597d..7d13480842 100644 --- a/src/modules/[chain]/account/[address].vue +++ b/src/modules/[chain]/account/[address].vue @@ -179,7 +179,7 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
- {{ format.formatToken(balanceItem) }} + {{ format.formatToken(balanceItem, true, '0,0.[000000]') }}
{{ format.calculatePercent(format.tokenAmountNumber(balanceItem), totalAmount) }} @@ -198,7 +198,7 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
- {{ format.formatToken(delegationItem?.balance) }} + {{ format.formatToken(delegationItem?.balance, true, '0,0.[000000]') }}
{{ format.calculatePercent(format.tokenAmountNumber(delegationItem?.balance), totalAmount) }} @@ -217,7 +217,7 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
- {{ format.formatToken(rewardItem) }} + {{ format.formatToken(rewardItem, true, '0,0.[000000]') }}
{{ format.calculatePercent(format.tokenAmountNumber(rewardItem), totalAmount) }} @@ -238,10 +238,14 @@ function mapAmount(events: { type: string; attributes: { key: string; value: str
{{ - format.formatToken({ - amount: String(unbondingTotal), - denom: stakingStore.params.bond_denom, - }) + format.formatToken( + { + amount: String(unbondingTotal), + denom: stakingStore.params.bond_denom, + }, + true, + '0,0.[000000]' + ) }}
diff --git a/src/modules/[chain]/index.vue b/src/modules/[chain]/index.vue index 5ae0c15f87..f6fcffdbd9 100644 --- a/src/modules/[chain]/index.vue +++ b/src/modules/[chain]/index.vue @@ -355,28 +355,28 @@ const amount = computed({
{{ $t('account.balance') }}
- {{ format.formatToken(walletStore.balanceOfStakingToken) }} + {{ format.formatToken(walletStore.balanceOfStakingToken, true, '0,0.[000000]') }}
${{ format.tokenValue(walletStore.balanceOfStakingToken) }}
{{ $t('module.staking') }}
- {{ format.formatToken(walletStore.stakingAmount) }} + {{ format.formatToken(walletStore.stakingAmount, true, '0,0.[000000]') }}
${{ format.tokenValue(walletStore.stakingAmount) }}
{{ $t('index.reward') }}
- {{ format.formatToken(walletStore.rewardAmount) }} + {{ format.formatToken(walletStore.rewardAmount, true, '0,0.[000000]') }}
${{ format.tokenValue(walletStore.rewardAmount) }}
{{ $t('index.unbonding') }}
- {{ format.formatToken(walletStore.unbondingAmount) }} + {{ format.formatToken(walletStore.unbondingAmount, true, '0,0.[000000]') }}
${{ format.tokenValue(walletStore.unbondingAmount) }}
@@ -405,7 +405,7 @@ const amount = computed({ {{ format.validatorFromBech32(item?.delegation?.validator_address) }} - {{ format.formatToken(item?.balance) }} + {{ format.formatToken(item?.balance, true, '0,0.[000000]') }} {{ format.formatTokens( diff --git a/src/modules/wallet/keplr.vue b/src/modules/wallet/keplr.vue index 319dfd25ce..5fe13007a1 100644 --- a/src/modules/wallet/keplr.vue +++ b/src/modules/wallet/keplr.vue @@ -1,9 +1,8 @@