diff --git a/.github/workflows/build-artifact.yaml b/.github/workflows/build-artifact.yaml new file mode 100644 index 0000000000..a12953f21c --- /dev/null +++ b/.github/workflows/build-artifact.yaml @@ -0,0 +1,242 @@ + +name: Build Artifacts + +on: + push: + branches: [ sge ] + # pull_request: + # branches: [ master ] + workflow_dispatch: + +jobs: + build_packages: + strategy: + matrix: + include: + - env: mainnet + cfg: "chains/mainnet/sge.json" + - env: testnet + cfg: "chains/testnet/sge.json" + - env: staging + cfg: "chains/testnet/sge_stage.json" + runs-on: ubuntu-latest + steps: + - name: Environment + run: export NODE_OPTIONS="--max_old_space_size=4096" + + - name: Git Checkout Latest + uses: actions/checkout@v4 + + - name: Update config + run: | + if [ ${{ matrix.env }} != "mainnet" ]; then cp ${{ matrix.cfg }} chains/mainnet/sge.json; fi + rm chains/testnet/* + cp chains/mainnet/sge.json chains/testnet/sge.json + + - name: Remove Google Analytics + run: | + sed -i '25,40d' index.html + + - name: Install + run: yarn install --ignore-engines + + - name: Build + run: yarn build + + - name: Pack + run: | + mv dist/ pingpub + tar -czf pingpub_${{ matrix.env }}.tar.gz ./pingpub/ + + - uses: actions/upload-artifact@v4 + id: upload + with: + name: pingpub_${{ matrix.env }}.tar.gz + path: pingpub_${{ matrix.env }}.tar.gz + retention-days: 1 + + build_image_staging: + needs: build_packages + runs-on: ubuntu-latest + outputs: + PINGPUB_AMI_STAGING: ${{ steps.extract.outputs.PINGPUB_AMI }} + permissions: + id-token: write + contents: read + steps: + - name: Checkout aws-infra + uses: actions/checkout@v4 + with: + repository: 'saage-tech/aws-infra' + token: ${{ secrets.UPDATE_TGL }} + + - name: Download + uses: actions/download-artifact@v4 + + - name: Assume role + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_STAGING }} + aws-region: ${{ secrets.AWS_REGION_STAGING }} + + - name: Packer Init + run: | + cp pingpub_staging.tar.gz/pingpub_staging.tar.gz ./packer/blockexplorer/files/pingpub.tar.gz + cd packer/blockexplorer + packer init . + + - name: Packer Build + working-directory: packer/blockexplorer + run: | + packer build -var-file=staging.pkvars.hcl blockexplorer.pkr.hcl + + - name: Extract AMI_ID + id: extract + working-directory: packer/blockexplorer + run : | + AMI_ID=$(jq -r '.builds[-1].artifact_id' packer-manifest.json | cut -d ":" -f2) + echo "PINGPUB_AMI=$AMI_ID" >> $GITHUB_OUTPUT + echo $AMI_ID + + build_image_testnet: + needs: build_packages + runs-on: ubuntu-latest + outputs: + PINGPUB_AMI_TESTNET: ${{ steps.extract.outputs.PINGPUB_AMI }} + permissions: + id-token: write + contents: read + steps: + - name: Checkout aws-infra + uses: actions/checkout@v4 + with: + repository: 'saage-tech/aws-infra' + token: ${{ secrets.UPDATE_TGL }} + + - name: Download + uses: actions/download-artifact@v4 + + - name: Assume role + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_TESTNET }} + aws-region: ${{ secrets.AWS_REGION_TESTNET }} + + - name: Packer Init + run: | + cp pingpub_testnet.tar.gz/pingpub_testnet.tar.gz ./packer/blockexplorer/files/pingpub.tar.gz + cd packer/blockexplorer + packer init . + + - name: Packer Build + working-directory: packer/blockexplorer + run: | + packer build -var-file=testnet.pkvars.hcl blockexplorer.pkr.hcl + + - name: Extract AMI_ID + id: extract + working-directory: packer/blockexplorer + run : | + AMI_ID=$(jq -r '.builds[-1].artifact_id' packer-manifest.json | cut -d ":" -f2) + echo "PINGPUB_AMI=$AMI_ID" >> $GITHUB_OUTPUT + echo $AMI_ID + + build_image_mainnet: + needs: build_packages + runs-on: ubuntu-latest + outputs: + PINGPUB_AMI_MAINNET: ${{ steps.extract.outputs.PINGPUB_AMI }} + permissions: + id-token: write + contents: read + steps: + - name: Checkout aws-infra + uses: actions/checkout@v4 + with: + repository: 'saage-tech/aws-infra' + token: ${{ secrets.UPDATE_TGL }} + + - name: Download + uses: actions/download-artifact@v4 + + - name: Assume role + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_MAINNET }} + aws-region: ${{ secrets.AWS_REGION_MAINNET }} + + - name: Packer Init + run: | + cp pingpub_mainnet.tar.gz/pingpub_mainnet.tar.gz ./packer/blockexplorer/files/pingpub.tar.gz + cd packer/blockexplorer + packer init . + + - name: Packer Build + working-directory: packer/blockexplorer + run: | + packer build -var-file=mainnet.pkvars.hcl blockexplorer.pkr.hcl + + - name: Extract AMI_ID + id: extract + working-directory: packer/blockexplorer + run : | + ls -la + AMI_ID=$(jq -r '.builds[-1].artifact_id' packer-manifest.json | cut -d ":" -f2) + echo "PINGPUB_AMI=$AMI_ID" >> $GITHUB_OUTPUT + echo $AMI_ID + + update_ami: + needs: [ build_image_staging, build_image_testnet, build_image_mainnet ] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout terragrunt code + uses: actions/checkout@v4 + with: + repository: 'saage-tech/terragrunt-live-sgenetwork' + token: ${{ secrets.UPDATE_TGL }} + + - name: Replace AMI IDs + env: + MAINNET_AMI: ${{ needs.build_image_mainnet.outputs.PINGPUB_AMI_MAINNET }} + TESTNET_AMI: ${{ needs.build_image_testnet.outputs.PINGPUB_AMI_TESTNET }} + STAGING_AMI: ${{ needs.build_image_staging.outputs.PINGPUB_AMI_STAGING }} + run: | + ls -la $GITHUB_WORKSPACE + cd ${GITHUB_WORKSPACE}/staging/us-east-1/blockchain/pingpub/instance/pingpub-priv + sed -i "s/aws_instance_ami =.*/aws_instance_ami = \"${STAGING_AMI}\"/g" terragrunt.hcl + cd ${GITHUB_WORKSPACE}/testnet/us-east-1/public-testnet-20221028/pingpub/instances/pingpub-priv + sed -i "s/aws_instance_ami =.*/aws_instance_ami = \"${TESTNET_AMI}\"/g" terragrunt.hcl + cd ${GITHUB_WORKSPACE}/mainnet/ap-northeast-2/blockchain/pingpub/instance/pingpub-priv + sed -i "s/aws_instance_ami =.*/aws_instance_ami = \"${MAINNET_AMI}\"/g" terragrunt.hcl + + - name: Check terragrunt HCL mainnet + uses: gruntwork-io/terragrunt-action@v2 + with: + tf_version: v1.3.3 + tg_version: v0.42.3 + tg_dir: mainnet/ap-northeast-2/blockchain/pingpub/instance/pingpub-priv + tg_command: 'hclfmt' + + - name: Check terragrunt HCL testnet + uses: gruntwork-io/terragrunt-action@v2 + with: + tf_version: v1.3.3 + tg_version: v0.42.3 + tg_dir: testnet/us-east-1/public-testnet-20221028/pingpub/instances/pingpub-priv + tg_command: 'hclfmt' + + - name: Check terragrunt HCL staging + uses: gruntwork-io/terragrunt-action@v2 + with: + tf_version: v1.3.3 + tg_version: v0.42.3 + tg_dir: staging/us-east-1/blockchain/pingpub/instance/pingpub-priv + tg_command: 'hclfmt' + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Automated Change - PingPub update + #push_options: --force \ No newline at end of file diff --git a/.github/workflows/config-check.yaml b/.github/workflows/config-check.yaml index a9bad362ac..91dd2c1bf4 100644 --- a/.github/workflows/config-check.yaml +++ b/.github/workflows/config-check.yaml @@ -2,8 +2,8 @@ name: Config Checker on: - # push: - # branches: [ master ] + push: + branches: [ master, sge ] pull_request: # branches: [ master ] paths: diff --git a/.github/workflows/sync_repos.yaml b/.github/workflows/sync_repos.yaml new file mode 100644 index 0000000000..f1151e1abe --- /dev/null +++ b/.github/workflows/sync_repos.yaml @@ -0,0 +1,52 @@ +name: Sync repo + +on: + schedule: + - cron: "0 1 * * 3" + workflow_dispatch: + +jobs: + get_state: + runs-on: ubuntu-latest + outputs: + EXPLORER: ${{ steps.status.outputs.EXPLORER }} + UPDATE: ${{ steps.status.outputs.UPDATE }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get commits + id: status + run: | + echo "EXPLORER=$(git ls-remote -h https://github.com/ping-pub/explorer.git master | cut -f1)" >> $GITHUB_OUTPUT + grep '^${EXPLORER}$' pingpub.commit && echo "UPDATE=0" >> $GITHUB_OUTPUT || export echo "UPDATE=1" >> $GITHUB_OUTPUT + + repo_sync: + needs: get_state + runs-on: ubuntu-latest + if: needs.get_state.outputs.UPDATE == 0 #Should be changed later + steps: + - name: Clone SGE Repo + uses: actions/checkout@v4 + with: + ref: 'sge' + + - name: Clone Original Repo + uses: actions/checkout@v4 + with: + repository: 'ping-pub/explorer' + ref: 'master' + path: 'original' + + - name: Update files + run: | + rm original/chains/mainnet/cosmos.json original/chains/mainnet/neutron.json original/chains/mainnet/nolus.json + rm original/chains/mainnet/osmosis.json original/chains/testnet/crossfi.json + cp -r ./original/* ./ + rm -rf original/ + echo $UPDATE > pingpub.commit + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: 'sge' \ No newline at end of file diff --git a/.github/workflows/testnet-deploy.yaml b/.github/workflows/testnet-deploy.yaml index 55391d0122..02887afacb 100644 --- a/.github/workflows/testnet-deploy.yaml +++ b/.github/workflows/testnet-deploy.yaml @@ -14,6 +14,7 @@ jobs: steps: - name: print run: echo ${GITHUB_REF#refs/heads/} + - name: Git Checkout Latest uses: actions/checkout@v2 diff --git a/README.md b/README.md index 342d5900e3..051bc973d9 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Your donation will help us make better products. Thanks in advance. ## Hire us -You can hire us by submiting an issue and fund the issue on [IssueHunter](https://issuehunt.io/r/ping-pub/explorer) +You can hire us by submitting an issue and fund the issue on [IssueHunter](https://issuehunt.io/r/ping-pub/explorer) ## Contributors diff --git a/chains/mainnet/axelar.json b/chains/mainnet/axelar.json deleted file mode 100644 index 28bd6d986b..0000000000 --- a/chains/mainnet/axelar.json +++ /dev/null @@ -1,74 +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 2bd610640d..0000000000 --- a/chains/mainnet/cosmos.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "chain_name": "cosmos", - "registry_name": "cosmoshub", - "api": [ - {"provider": "notional", "address": "https://api-cosmoshub-ia.cosmosia.notional.ventures"}, - {"provider": "blockapsis", "address": "https://lcd-cosmoshub.blockapsis.com:443"}, - {"provider": "WhisperNode🤐", "address": "https://lcd-cosmoshub.whispernode.com:443"}, - {"provider": "pupmos", "address": "https://api-cosmoshub.pupmos.network"}, - {"provider": "publicnode", "address": "https://cosmos-rest.publicnode.com"}, - {"provider": "staketab", "address": "https://cosmos-rest.staketab.org"}, - {"provider": "nodestake", "address": "https://api.cosmos.nodestake.top"}, - {"provider": "Golden Ratio Staking", "address": "https://rest-cosmoshub.goldenratiostaking.net"} - ], - "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 864e67f10b..0000000000 --- a/chains/mainnet/neutron.json +++ /dev/null @@ -1,30 +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://api-cosmoshub-ia.cosmosia.notional.ventures"] - }, - "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 81bdd48470..0000000000 --- a/chains/mainnet/nolus.json +++ /dev/null @@ -1,27 +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 35669f39a9..0000000000 --- a/chains/mainnet/osmosis.json +++ /dev/null @@ -1,32 +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/sge.json b/chains/mainnet/sge.json new file mode 100644 index 0000000000..e7aa59816c --- /dev/null +++ b/chains/mainnet/sge.json @@ -0,0 +1,35 @@ +{ + "chain_name": "sge", + "alias": "sge", + "api": [ + "https://api.sgenetwork.io/", + "https://rest.cosmos.directory/sge", + "https://sge-api.lavenderfive.com", + "https://sge-api.polkachu.com", + "https://api.sge.nodestake.top", + "https://sge-api.sr20de.xyz" + ], + "rpc": [ + "https://rpc.sgenetwork.io/", + "https://rpc.cosmos.directory/sge", + "https://sge-rpc.lavenderfive.com", + "https://sge-rpc.polkachu.com", + "https://rpc.sge.nodestake.top", + "https://sge-rpc.sr20de.xyz" + ], + "snapshot_provider": "", + "addr_prefix": "sge", + "coin_type": "494", + "min_tx_fee": "8000", + "assets": [ + { + "base": "usge", + "symbol": "SGE", + "exponent": "6", + "coingecko_id": "sge", + "logo": "/logos/sge.png" + } + ], + "logo": "/logos/sge.png", + "sdk_version": "0.45.8" +} diff --git a/chains/testnet/crossfi.json b/chains/testnet/crossfi.json deleted file mode 100644 index 5414f3f202..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" - } \ No newline at end of file diff --git a/chains/testnet/sge.json b/chains/testnet/sge.json new file mode 100644 index 0000000000..0ed609176a --- /dev/null +++ b/chains/testnet/sge.json @@ -0,0 +1,27 @@ +{ + "chain_name": "sge", + "alias": "sge", + "api": [ + { "provider": "sge-network", "address": "https://lcd-1317.testnet.sgenetwork.io"}, + { "provider": "stavr.tech", "address": "https://sge.api.t.stavr.tech" } + ], + "rpc": [ + { "provider": "sge-network", "address": "https://lcd-26657.testnet.sgenetwork.io" }, + { "provider": "stavr.tech", "address": "https://sge.rpc.t.stavr.tech" } + ], + "snapshot_provider": "", + "addr_prefix": "sge", + "coin_type": "494", + "min_tx_fee": "8000", + "assets": [ + { + "base": "usge", + "symbol": "SGE", + "exponent": "6", + "coingecko_id": "sge", + "logo": "/logos/sge.png" + } + ], + "logo": "/logos/sge.png", + "sdk_version": "0.45.8" +} diff --git a/chains/testnet/sge_stage.json b/chains/testnet/sge_stage.json new file mode 100644 index 0000000000..b4005d5a62 --- /dev/null +++ b/chains/testnet/sge_stage.json @@ -0,0 +1,25 @@ +{ + "chain_name": "sge", + "alias": "sge", + "api": [ + { "provider": "sge-network", "address": "https://lcd-1317.staging.sgenetwork.io"} + ], + "rpc": [ + { "provider": "sge-network", "address": "https://lcd-26657.staging.sgenetwork.io"} + ], + "snapshot_provider": "", + "addr_prefix": "sge", + "coin_type": "494", + "min_tx_fee": "8000", + "assets": [ + { + "base": "usge", + "symbol": "SGE", + "exponent": "6", + "coingecko_id": "sge", + "logo": "/logos/sge.png" + } + ], + "logo": "/logos/sge.png", + "sdk_version": "0.45.8" +} diff --git a/index.html b/index.html index 3c1c9f9468..156b08af67 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@ }); gtag('config', 'G-SSBKVF3GMX'); - + diff --git a/pingpub.commit b/pingpub.commit new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/pingpub.commit @@ -0,0 +1 @@ + diff --git a/src/layouts/components/NavBarWallet.vue b/src/layouts/components/NavBarWallet.vue index 2d0c69d535..fc52e61674 100644 --- a/src/layouts/components/NavBarWallet.vue +++ b/src/layouts/components/NavBarWallet.vue @@ -1,8 +1,10 @@ diff --git a/src/modules/[chain]/faucet/index.vue b/src/modules/[chain]/faucet/index.vue index e82d768d7e..cd1e12bc6e 100644 --- a/src/modules/[chain]/faucet/index.vue +++ b/src/modules/[chain]/faucet/index.vue @@ -24,7 +24,7 @@ const checklist = computed(() => { const bs = balances.value.length > 0 && balances.value.findIndex((v:any) => v.amount <= 10) === -1; return [ { title: 'Rest Endpoint', status: endpoint && endpoint[0].address !== '' }, - { title: 'Has Faucet Configured', status: chainStore.current?.faucet !== undefined }, + { title: 'Faucet Configured', status: chainStore.current?.faucet !== undefined }, { title: 'Faucet Account', status: faucet.value !== ''}, { title: 'Faucet Balance', status: bs}, ]; @@ -122,7 +122,7 @@ onMounted(() => {

Enable Faucet

- 1. Submit chain configuation + 1. Submit chain configuration
{{ it.title }}: {{ it.status ? '✅' : '❌' }} 
diff --git a/src/modules/[chain]/staking/[validator].vue b/src/modules/[chain]/staking/[validator].vue index d253d092f9..a4f883c8ee 100644 --- a/src/modules/[chain]/staking/[validator].vue +++ b/src/modules/[chain]/staking/[validator].vue @@ -1,7 +1,9 @@ + + diff --git a/src/router/index.ts b/src/router/index.ts index 7dc4a6d0ab..7030ae872b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -14,7 +14,7 @@ const router = createRouter({ router.beforeEach((to) => { const { chain } = to.params if(chain){ - const blockchain = useBlockchain() + const blockchain= useBlockchain() if(chain !== blockchain.chainName) { blockchain.setCurrent(chain.toString()) } diff --git a/src/stores/useBlockchain.ts b/src/stores/useBlockchain.ts index ac1ae2ccb7..e6a15c55fe 100644 --- a/src/stores/useBlockchain.ts +++ b/src/stores/useBlockchain.ts @@ -16,10 +16,11 @@ import { CosmosRestClient } from '@/libs/client'; import { useBankStore, useBaseStore, + useDistributionStore, useGovStore, useMintStore, useStakingStore, - useWalletStore, + useWalletStore } from '.'; import { useBlockModule } from '@/modules/[chain]/block/block'; import { DEFAULT } from '@/libs'; @@ -151,6 +152,7 @@ export const useBlockchain = defineStore('blockchain', { useGovStore().initial(); useMintStore().initial(); useBlockModule().initial(); + useDistributionStore().initial(); }, randomEndpoint(chainName: string) : Endpoint | undefined { diff --git a/src/stores/useDistributionStore.ts b/src/stores/useDistributionStore.ts index d2dc0a8fa1..8e3984176f 100644 --- a/src/stores/useDistributionStore.ts +++ b/src/stores/useDistributionStore.ts @@ -3,7 +3,14 @@ import { useBlockchain } from './useBlockchain'; export const useDistributionStore = defineStore('distributionStore', { state: () => { - return {}; + return { + params: {} as { + community_tax: string; + base_proposer_reward: string; + bonus_proposer_reward: string; + withdraw_addr_enabled: boolean; + }, + }; }, getters: { blockchain() { @@ -11,6 +18,14 @@ export const useDistributionStore = defineStore('distributionStore', { }, }, actions: { + initial() { + this.fetchParams(); + }, + async fetchParams() { + const response = await this.blockchain.rpc?.getDistributionParams(); + if (response?.params) this.params = response.params; + return this.params; + }, async fetchCommunityPool() { return this.blockchain.rpc?.getDistributionCommunityPool(); }, diff --git a/src/stores/useWalletStore.ts b/src/stores/useWalletStore.ts index 5962287cce..2843e72e30 100644 --- a/src/stores/useWalletStore.ts +++ b/src/stores/useWalletStore.ts @@ -128,8 +128,11 @@ export const useWalletStore = defineStore('walletStore', { if(value) this.wallet = value }, suggestChain() { - // const router = useRouter() - router.push({path: '/wallet/keplr'}) + if (window.location.pathname === '/SIDE-Testnet') { + router.push({path: '/wallet/unisat'}) + } else { + router.push({path: '/wallet/keplr'}) + } } }, }); \ No newline at end of file