Apply automatic changes
This commit is contained in:
parent
1318cf24f2
commit
cbbb6e7a79
@ -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
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
# 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 **
|
||||
** 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 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
|
||||
|
||||
|
||||
74
chains/mainnet/axelar.json
Normal file
74
chains/mainnet/axelar.json
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -38,7 +38,7 @@
|
||||
});
|
||||
gtag('config', 'G-SSBKVF3GMX');
|
||||
</script>
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/ping-widget@latest/dist/ping-widget.min.js"></script>
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/ping-widget@v0.3.8/dist/ping-widget.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1 +1 @@
|
||||
a6691efb017acd4fe9b90431b7573043ce8b509b
|
||||
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useBaseStore, useBlockchain, useWalletStore } from '@/stores';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { ref, computed } from 'vue';
|
||||
|
||||
const route = useRoute();
|
||||
const walletStore = useWalletStore();
|
||||
const chainStore = useBlockchain();
|
||||
const baseStore = useBaseStore();
|
||||
@ -32,6 +34,16 @@ const tipMsg = computed(() => {
|
||||
? { class: 'error', msg: 'Copy Error!' }
|
||||
: { class: 'success', msg: 'Copy Success!' };
|
||||
});
|
||||
|
||||
const params = computed(() => {
|
||||
if (chainStore.chainName == 'side') {
|
||||
return JSON.stringify({
|
||||
wallet: ['okex', 'unisat'],
|
||||
});
|
||||
}
|
||||
return "";
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -83,9 +95,9 @@ const tipMsg = computed(() => {
|
||||
</div>
|
||||
</div>
|
||||
<Teleport to="body">
|
||||
<ping-connect-wallet :chain-id="baseStore.currentChainId" :hd-path="chainStore.defaultHDPath"
|
||||
<ping-connect-wallet :chain-id="baseStore.currentChainId || 'cosmoshub-4'" :hd-path="chainStore.defaultHDPath"
|
||||
:addr-prefix="chainStore.current?.bech32Prefix || 'cosmos'" @connect="walletStateChange"
|
||||
@keplr-config="walletStore.suggestChain()" />
|
||||
@keplr-config="walletStore.suggestChain()" :params="params" />
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
|
||||
@ -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},
|
||||
];
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { parseCoins } from '@cosmjs/stargate';
|
||||
import {
|
||||
useBankStore,
|
||||
useBlockchain,
|
||||
useDistributionStore,
|
||||
useFormatter,
|
||||
useMintStore,
|
||||
useStakingStore,
|
||||
@ -64,12 +66,12 @@ blockchain.rpc.getTxsBySender(addresses.value.account).then((x) => {
|
||||
});
|
||||
|
||||
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;
|
||||
if (Number(inflation)) {
|
||||
return format.percent((1 - Number(rate)) * Number(inflation));
|
||||
}
|
||||
return '-';
|
||||
const communityTax = Number(useDistributionStore().params.community_tax);
|
||||
const bondedRatio = Number(staking.pool.bonded_tokens) / Number(useBankStore().supply.amount);
|
||||
|
||||
return format.percent((1 - communityTax) * (1 - rate) * Number(inflation) / bondedRatio);
|
||||
});
|
||||
|
||||
const selfRate = computed(() => {
|
||||
|
||||
@ -13,6 +13,7 @@ const selected = ref({} as ChainConfig)
|
||||
onMounted(() => {
|
||||
const chainStore = useBlockchain()
|
||||
selected.value = chainStore.current || Object.values(dashboard.chains)[0]
|
||||
debugger;
|
||||
initParamsForKeplr()
|
||||
})
|
||||
async function initParamsForKeplr() {
|
||||
|
||||
104
src/modules/wallet/unisat.vue
Normal file
104
src/modules/wallet/unisat.vue
Normal file
@ -0,0 +1,104 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useDashboard, type ChainConfig, useBlockchain } from '@/stores';
|
||||
import { CosmosRestClient } from '@/libs/client';
|
||||
import { onMounted } from 'vue';
|
||||
import AdBanner from '@/components/ad/AdBanner.vue';
|
||||
|
||||
const error = ref("")
|
||||
const conf = ref("")
|
||||
const dashboard = useDashboard()
|
||||
const selected = ref({} as ChainConfig)
|
||||
|
||||
onMounted(() => {
|
||||
const chainStore = useBlockchain()
|
||||
selected.value = chainStore.current || Object.values(dashboard.chains)[0];
|
||||
})
|
||||
async function initParamsForKeplr() {
|
||||
const chain = selected.value
|
||||
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 = chain.assets[0].denom_units.find(x => x.denom === chain.assets[0].symbol.toLowerCase())?.exponent || 6
|
||||
conf.value = JSON.stringify({
|
||||
chainId: 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 || [],
|
||||
}, null, '\t')
|
||||
}
|
||||
|
||||
function suggest() {
|
||||
// @ts-ignore
|
||||
if (window.unisat) {
|
||||
// @ts-ignore
|
||||
window.unisat.experimentalSuggestChain(JSON.parse(conf.value)).catch(e => {
|
||||
error.value = e
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bg-base-100 p-4 rounded text-center">
|
||||
<AdBanner id="keplr-banner-ad" unit="banner" width="970px" height="90px" />
|
||||
<div class="flex">
|
||||
<select v-model="selected" class="select select-bordered mx-5" @change="initParamsForKeplr">
|
||||
<option v-for="c in dashboard.chains" :value="c">
|
||||
{{ c.chainName }}
|
||||
</option>
|
||||
</select>
|
||||
<button class="btn !bg-yes !border-yes text-white px-10" @click="suggest">Add {{ selected.chainName }} TO Unisat Wallet</button>
|
||||
</div>
|
||||
<div class="text-main mt-5">
|
||||
<textarea v-model="conf" class="textarea textarea-bordered w-full" rows="15"></textarea>
|
||||
</div>
|
||||
<div class="mt-4 mb-4">
|
||||
If the chain is not offically support on Keplr, you can submit these parameters to enable Keplr.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -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())
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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();
|
||||
},
|
||||
|
||||
@ -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'})
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user