Merge branch 'master' of https://github.com/ping-pub/explorer
This commit is contained in:
commit
5b7cee4df8
@ -47,7 +47,7 @@ Your donation will help us make better products. Thanks in advance.
|
|||||||
|
|
||||||
## Hire us
|
## 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
|
## Contributors
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
# Directory Layout
|
# Directory Layout
|
||||||
|
|
||||||
** if you want to list your blockhain on ping.pub, please submit your configure on https://github.com/ping-pub/ping.pub.git **
|
Note: the host name used in the user's browser (displayed in the address bar) to load the explorer app determines which of the chain configuration directories is used.
|
||||||
|
If the host name contains the substring "testnet" (for example: "https://mytestnetwork.example.com") then chain configuration files in the `testnet` directory (only) are loaded. Conversely if the host name does not contain that substring then chain configuration files in the `mainnet` directory (only) are loaded.
|
||||||
|
Remember to bear this behavior in mind when selecting a DNS host name for self hosting the explorer.
|
||||||
|
|
||||||
|
** if you want to list your blockchain on ping.pub, please submit your configuration on https://github.com/ping-pub/ping.pub.git **
|
||||||
|
|
||||||
- Submit configs for mainnet, go to https://github.com/ping-pub/explorer/tree/master/chains/mainnet
|
- Submit configs for mainnet, go to https://github.com/ping-pub/explorer/tree/master/chains/mainnet
|
||||||
|
|
||||||
- Submit configs for testnet, go to https://github.com/ping-pub/explorer/tree/master/chains/testnet, thess configs will be enabled when you visit the domain starts withs `testnet.*`, for example `https://testnet.ping.pub`
|
- Submit configs for testnet, go to https://github.com/ping-pub/explorer/tree/master/chains/testnet, these configs will be enabled when you visit the domain that starts with `testnet.*`, for example `https://testnet.ping.pub`
|
||||||
|
|
||||||
# Sample of Config
|
# Sample of Config
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ onMounted(() => {
|
|||||||
<div class="bg-base-100 my-5 px-4 pt-3 pb-4 rounded shadow">
|
<div class="bg-base-100 my-5 px-4 pt-3 pb-4 rounded shadow">
|
||||||
<h2 class="card-title">Enable Faucet</h2>
|
<h2 class="card-title">Enable Faucet</h2>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<span class="text-base"> 1. Submit chain configuation</span>
|
<span class="text-base"> 1. Submit chain configuration</span>
|
||||||
<div class="mockup-code bg-base-200 my-2 gap-4">
|
<div class="mockup-code bg-base-200 my-2 gap-4">
|
||||||
<div v-for="it in checklist">
|
<div v-for="it in checklist">
|
||||||
<pre><code class="text-gray-800 dark:invert">{{ it.title }}: </code>{{ it.status ? '✅' : '❌' }} </pre>
|
<pre><code class="text-gray-800 dark:invert">{{ it.title }}: </code>{{ it.status ? '✅' : '❌' }} </pre>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { parseCoins } from '@cosmjs/stargate';
|
import { parseCoins } from '@cosmjs/stargate';
|
||||||
import {
|
import {
|
||||||
|
useBankStore,
|
||||||
useBlockchain,
|
useBlockchain,
|
||||||
|
useDistributionStore,
|
||||||
useFormatter,
|
useFormatter,
|
||||||
useMintStore,
|
useMintStore,
|
||||||
useStakingStore,
|
useStakingStore,
|
||||||
@ -64,12 +66,12 @@ blockchain.rpc.getTxsBySender(addresses.value.account).then((x) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const apr = computed(() => {
|
const apr = computed(() => {
|
||||||
const rate = v.value.commission?.commission_rates.rate || 0;
|
const rate = Number(v.value.commission?.commission_rates.rate || 0);
|
||||||
const inflation = useMintStore().inflation;
|
const inflation = useMintStore().inflation;
|
||||||
if (Number(inflation)) {
|
const communityTax = Number(useDistributionStore().params.community_tax);
|
||||||
return format.percent((1 - Number(rate)) * Number(inflation));
|
const bondedRatio = Number(staking.pool.bonded_tokens) / Number(useBankStore().supply.amount);
|
||||||
}
|
|
||||||
return '-';
|
return format.percent((1 - communityTax) * (1 - rate) * Number(inflation) / bondedRatio);
|
||||||
});
|
});
|
||||||
|
|
||||||
const selfRate = computed(() => {
|
const selfRate = computed(() => {
|
||||||
|
@ -16,10 +16,11 @@ import { CosmosRestClient } from '@/libs/client';
|
|||||||
import {
|
import {
|
||||||
useBankStore,
|
useBankStore,
|
||||||
useBaseStore,
|
useBaseStore,
|
||||||
|
useDistributionStore,
|
||||||
useGovStore,
|
useGovStore,
|
||||||
useMintStore,
|
useMintStore,
|
||||||
useStakingStore,
|
useStakingStore,
|
||||||
useWalletStore,
|
useWalletStore
|
||||||
} from '.';
|
} from '.';
|
||||||
import { useBlockModule } from '@/modules/[chain]/block/block';
|
import { useBlockModule } from '@/modules/[chain]/block/block';
|
||||||
import { DEFAULT } from '@/libs';
|
import { DEFAULT } from '@/libs';
|
||||||
@ -151,6 +152,7 @@ export const useBlockchain = defineStore('blockchain', {
|
|||||||
useGovStore().initial();
|
useGovStore().initial();
|
||||||
useMintStore().initial();
|
useMintStore().initial();
|
||||||
useBlockModule().initial();
|
useBlockModule().initial();
|
||||||
|
useDistributionStore().initial();
|
||||||
},
|
},
|
||||||
|
|
||||||
randomEndpoint(chainName: string) : Endpoint | undefined {
|
randomEndpoint(chainName: string) : Endpoint | undefined {
|
||||||
|
@ -3,7 +3,14 @@ import { useBlockchain } from './useBlockchain';
|
|||||||
|
|
||||||
export const useDistributionStore = defineStore('distributionStore', {
|
export const useDistributionStore = defineStore('distributionStore', {
|
||||||
state: () => {
|
state: () => {
|
||||||
return {};
|
return {
|
||||||
|
params: {} as {
|
||||||
|
community_tax: string;
|
||||||
|
base_proposer_reward: string;
|
||||||
|
bonus_proposer_reward: string;
|
||||||
|
withdraw_addr_enabled: boolean;
|
||||||
|
},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
blockchain() {
|
blockchain() {
|
||||||
@ -11,6 +18,14 @@ export const useDistributionStore = defineStore('distributionStore', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
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() {
|
async fetchCommunityPool() {
|
||||||
return this.blockchain.rpc?.getDistributionCommunityPool();
|
return this.blockchain.rpc?.getDistributionCommunityPool();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user