diff --git a/.env.example b/.env.example index 3e4e505112..4921ff88f8 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,22 @@ # rename to .env.local or .env. -VITE_REFRESH_INTERVAL=2000 -VITE_FETCH_ALL_BLOCKS=true -VITE_RECENT_BLOCK_LIMIT=100 + +# Refresh interval for the app to query api for new blocks +VITE_REFRESH_INTERVAL=6000 + +# Enable fetching all blocks (this can increase api calls to public nodes resulting in rate limiting) +VITE_FETCH_ALL_BLOCKS=false + +# Limit for recent blocks and associated transactions displayed in the UI +VITE_RECENT_BLOCK_LIMIT=50 + +# URL for CoinGecko API or custom proxy +VITE_COINGECKO_URL=https://api.coingecko.com + +# GITHUB_API_URL default +VITE_GITHUB_API_URL=https://api.github.com/repos/cosmos/chain-registry/contents + +# PINGPUB_API_URL default +VITE_PINGPUB_API_URL=https://registry.ping.pub + +# IBC use PINGPUB_API_URL by Default (false) or GITHUB_API_URL (true) +VITE_IBC_USE_GITHUB_API=false diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..8d337d8a94 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,34 @@ +# # Specify a default Code Owner for all files with a wildcard: +# * @default-owner + +# # Specify multiple Code Owners to a specific file: +# README.md @doc-team @tech-lead + +# # Specify a Code Owner to all files with a specific extension: +# *.rb @ruby-owner + +# # Specify Code Owners with usernames or email addresses: +# LICENSE @legal janedoe@gitlab.com + +# # Use group names to match groups and nested groups: +# README @group @group/with-nested/subgroup + +# # Specify a Code Owner to a directory and all its contents: +# /docs/ @all-docs +# /docs/* @root-docs +# /docs/**/*.md @markdown-docs # Match specific file types in any subdirectory +# /db/**/index.md @index-docs # Match a specific file name in any subdirectory + +# # Use a section to group related rules: +# [Documentation] +# ee/docs @docs +# docs @docs + +# # Assign a role as a Code Owner: +# /config/ @@maintainer + +* @burnt-labs/Burnt_Engineering/Burnt_Frontend + +.github/ @burnt-labs/Burnt_Engineering/Burnt_DevOps +.goreleaser @burnt-labs/Burnt_Engineering/Burnt_DevOps +Dockerfile @burnt-labs/Burnt_Engineering/Burnt_DevOps \ No newline at end of file diff --git a/.gitignore b/.gitignore index e4a00ae8c0..bdb6814dde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,36 @@ -node_modules/ -**/.vscode -yarn-error.log +# node_modules and build directories +node_modules +.DS_Store dist +dist-ssr +coverage + +# Editor directories and files +.vscode/* +!.vscode/extensions.json .idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo +# wrangler files +.wrangler + +# environment files .env* !.env.example +.dev.vars* +*.local + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* diff --git a/.prettierrc.json b/.prettierrc.json index ef7e9a5394..35ff4599e7 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,12 +1,12 @@ { - "tabWidth": 2, - "singleQuote": true, - "semi": true, - "endOfLine": "auto", - "bracketSpacing": true, - "trailingComma": "es5", "arrowParens": "always", + "bracketSpacing": true, + "endOfLine": "auto", + "printWidth": 80, + "semi": true, "singleAttributePerLine": false, - "printWidth": 120, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", "useTabs": false } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..a7cea0b067 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..bc7d7e789a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +# ---- Base Node ---- +FROM node:lts AS build + +ARG VITE_DEPLOYMENT_ENV=mainnet +ARG VITE_REFRESH_INTERVAL=1500 +ARG VITE_FETCH_ALL_BLOCKS=true +ARG VITE_RECENT_BLOCK_LIMIT=100 +ARG VITE_COINGECKO_URL=https://api.coingecko.com +ARG VITE_GITHUB_API_URL=https://api.github.com/repos/cosmos/chain-registry/contents +ARG VITE_PINGPUB_API_URL=https://registry.ping.pub +ARG VITE_IBC_USE_GITHUB_API=true + +ENV VITE_DEPLOYMENT_ENV=${VITE_DEPLOYMENT_ENV} \ + VITE_REFRESH_INTERVAL=${VITE_REFRESH_INTERVAL} \ + VITE_FETCH_ALL_BLOCKS=${VITE_FETCH_ALL_BLOCKS} \ + VITE_RECENT_BLOCK_LIMIT=${VITE_RECENT_BLOCK_LIMIT} \ + VITE_COINGECKO_URL=${VITE_COINGECKO_URL} \ + VITE_GITHUB_API_URL=${VITE_GITHUB_API_URL} \ + VITE_PINGPUB_API_URL=${VITE_PINGPUB_API_URL} \ + VITE_IBC_USE_GITHUB_API=${VITE_IBC_USE_GITHUB_API} + +WORKDIR /app + +COPY package.json yarn.lock ./ + +RUN set -eux \ + && yarn install + +COPY . . +RUN set -eux; \ + if [ "${VITE_DEPLOYMENT_ENV}" = "devnet" ]; then \ + cp chains/xion-devnet-1.json chains/xion; \ + fi \ + && yarn vite build + +FROM node:lts AS runner + +COPY --from=build /app/dist /app +COPY --from=build /app/wrangler.jsonc /app + +RUN set -eux \ + && npm install -g wrangler@latest \ + && groupadd -g 1001 burnt \ + && useradd -m -u 1001 -g 1001 burnt \ + && chown -R burnt:burnt /app + +WORKDIR /app +USER burnt + +EXPOSE 3000 + +CMD [ "wrangler", "dev", "--assets=/app", "--show-interactive-dev-session", "false", "--ip", "0.0.0.0", "--port", "5173" ] diff --git a/chains/mainnet/xion.json b/chains/mainnet/xion.json index 5e82d72df9..49dafec078 100644 --- a/chains/mainnet/xion.json +++ b/chains/mainnet/xion.json @@ -1,5 +1,6 @@ { "chain_name": "xion", + "chain_id": "xion-mainnet-1", "registry_name": "xion", "coingecko": "xion", "network_type": "mainnet", @@ -32,7 +33,7 @@ } ], "snapshot_provider": "", - "sdk_version": "0.50.13", + "sdk_version": "0.53.3", "coin_type": "118", "min_tx_fee": "100", "addr_prefix": "xion", diff --git a/chains/xion-devnet-1.json b/chains/xion-devnet-1.json new file mode 100644 index 0000000000..f14f98ba8f --- /dev/null +++ b/chains/xion-devnet-1.json @@ -0,0 +1,48 @@ +{ + "chain_name": "xion-devnet-1", + "registry_name": "xiondevnet", + "coingecko": "xion", + "network_type": "devnet", + "rpc": [ + { + "address": "http://localhost:26657", + "provider": "localhost" + } + ], + "api": [ + { + "address": "http://localhost:1317", + "provider": "localhost" + } + ], + "snapshot_provider": "", + "sdk_version": "0.53.3", + "coin_type": "118", + "min_tx_fee": "100", + "addr_prefix": "xion", + "theme_color": "#aa4aff", + "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" + } + ], + "features": [ + "dashboard", + "governance", + "staking", + "blocks", + "tx", + "uptime", + "ibc", + "supply", + "parameters", + "consensus", + "cosmwasm" + ], + "keplr_features": ["ibc-go", "ibc-transfer", "no-legacy-stdTx"] +} diff --git a/chains/xion/xion-mainnet-1.json b/chains/xion/xion-mainnet-1.json new file mode 100644 index 0000000000..921df007ef --- /dev/null +++ b/chains/xion/xion-mainnet-1.json @@ -0,0 +1,150 @@ +{ + "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", + "staking", + "governance", + "tx", + "blocks", + "ibc", + "supply", + "uptime", + "consensus", + "cosmwasm", + "parameters", + "account" + ], + "keplr_features": ["ibc-go", "ibc-transfer", "no-legacy-stdTx"] +} diff --git a/chains/xion/xion-testnet-2.json b/chains/xion/xion-testnet-2.json new file mode 100644 index 0000000000..42e301d6d5 --- /dev/null +++ b/chains/xion/xion-testnet-2.json @@ -0,0 +1,87 @@ +{ + "chain_name": "xiontestnet2", + "chain_id": "xion-testnet-2", + "registry_name": "xion", + "coingecko": "xion", + "network_type": "testnet", + "rpc": [ + { + "address": "https://rpc.xion-testnet-2.burnt.com", + "provider": "🔥BurntLabs🔥" + }, + { + "address": "https://xion-testnet-rpc.polkachu.com", + "provider": "Polkachu" + }, + { + "address": "https://burnt-testnet-rpc.itrocket.net", + "provider": "ITRocket" + } + ], + "api": [ + { + "address": "https://api.xion-testnet-2.burnt.com", + "provider": "🔥BurntLabs🔥" + }, + { + "address": "https://xion-testnet-api.polkachu.com", + "provider": "Polkachu" + }, + { + "address": "https://burnt-testnet-api.itrocket.net", + "provider": "ITRocket" + } + ], + "snapshot_provider": "", + "sdk_version": "0.53.3", + "coin_type": "118", + "min_tx_fee": "100", + "addr_prefix": "xion", + "theme_color": "#ffaa4a", + "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/13B2C536BB057AC79D5616B8EA1B9540EC1F2170718CAFF6F0083C966FFFED0B", + "symbol": "OSMO", + "exponent": "6", + "coingecko_id": "osmosis", + "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.png" + }, + { + "base": "ibc/6490A7EAB61059BFC1CDDEB05917DD70BDF3A611654162A1A47DB930D40D8AF4", + "symbol": "USDC", + "exponent": "6", + "coingecko_id": "usd-coin", + "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/USDCoin.png" + }, + { + "base": "ibc/2DD421C34C750BA522D4C8A6657DE220ED7874EF32B56C0791660149B8A51ED4", + "symbol": "USDC", + "exponent": "6", + "coingecko_id": "usd-coin", + "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/USDCoin.png" + } + ], + "features": [ + "dashboard", + "staking", + "governance", + "tx", + "blocks", + "ibc", + "supply", + "uptime", + "consensus", + "cosmwasm", + "parameters", + "account" + ], + "keplr_features": ["ibc-go", "ibc-transfer", "no-legacy-stdTx"] +} diff --git a/env.d.ts b/env.d.ts index 33f49a00af..68dc2b9756 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1,3 +1,16 @@ /// declare module '@personaxyz/ad-sdk'; +interface ImportMetaEnv { + readonly VITE_REFRESH_INTERVAL?: number, + readonly VITE_FETCH_ALL_BLOCKS?: boolean, + readonly VITE_RECENT_BLOCK_LIMIT?: number, + readonly VITE_COINGECKO_URL?: string, + readonly VITE_GITHUB_API_URL?: string, + readonly VITE_PINGPUB_API_URL?: string, + readonly VITE_IBC_USE_GITHUB_API?: string, +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/index.html b/index.html index d183515a61..c08d81e14f 100644 --- a/index.html +++ b/index.html @@ -2,15 +2,13 @@ - + - Ping Dashboard - Cosmos Blockchain Explorer And Web Wallet - + Xion Explorer + +
@@ -26,10 +24,7 @@
- +