Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions chains/testnet/bfhevm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"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": ""
}]
}
29 changes: 1 addition & 28 deletions src/components/ad/AdBanner.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import { getClient, getUnit } from './ad';

const props = defineProps({
id: { type: String, required: true},
unit: { type: String, required: true},
width: { type: String },
height: { type: String },
});

const show = ref(false)
onMounted(() => {
const adClient = getClient();
const adUnitId = getUnit(props.unit);
show.value = adClient !== undefined && adUnitId !== undefined;

if(show.value) {
adClient.showBannerAd({
adUnitId,
containerId: props.id,
});
}
});

</script>
<template>
<div v-show="show" :id="id" :unit="unit" class="grid justify-items-center overflow-auto pt-4">
</div>
<div></div>
</template>
2 changes: 1 addition & 1 deletion src/components/charts/PriceMarketChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const kind = ref('price');
const series = computed(() => {
return [
{
name: 'Price',
name: kind.value === 'price' ? 'Price' : 'Volume',
data:
kind.value === 'price'
? store.marketData.prices.map((item: any) => item[1])
Expand Down
68 changes: 68 additions & 0 deletions src/libs/api/customization/atomone.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type{ RequestRegistry } from '@/libs/api/registry'
// import dayjs from 'dayjs'
import { adapter } from '@/libs/api/registry'
import type { GovProposal, PaginatedProposals } from '@/types'

// which registry is store
export const store = 'name' // name or version
// Blockchain Name
export const name = 'atomone'

function proposalAdapter(p: any): GovProposal {
if(p) {
if(p.messages && p.messages.length >= 1) p.content = p.messages[0].content || p.messages[0]
//p.proposal_id = p.id
p.final_tally_result = {
yes: p.final_tally_result?.yes_count,
no: p.final_tally_result?.no_count,
no_with_veto: p.final_tally_result?.no_with_veto_count,
abstain: p.final_tally_result?.abstain_count,
}
}
return p
}

// osmosis custom request
export const requests: Partial<RequestRegistry> = {
// mint_inflation: {
// url: `https://public-osmosis-api.numia.xyz/apr?start_date=${new Date(new Date().getTime() - 186400*1000).toISOString().split('T')[0]}&end_date=${new Date().toISOString().split('T')[0]}`,
// adapter: async (data: any) => {
// const [first] = data
// return {inflation: String(Number(first?.apr|| "0")/100.0)}
// }
// },
gov_params_voting: { url: '/atomone/gov/v1beta1/params/voting', adapter },
gov_params_tally: { url: '/atomone/gov/v1beta1/params/tallying', adapter },
gov_params_deposit: { url: '/atomone/gov/v1beta1/params/deposit', adapter },
gov_proposals: { url: '/atomone/gov/v1beta1/proposals', adapter: async (source: any): Promise<PaginatedProposals> => {
const proposals = source.proposals.map((p:any) => proposalAdapter(p))
return {
proposals,
pagination: source.pagination
}
}},
gov_proposals_proposal_id: {
url: '/atomone/gov/v1beta1/proposals/{proposal_id}',
adapter: async (source: any): Promise<{proposal: GovProposal}> => {
return {
proposal: proposalAdapter(source.proposal)
}
},
},
gov_proposals_deposits: {
url: '/atomone/gov/v1beta1/proposals/{proposal_id}/deposits',
adapter,
},
gov_proposals_tally: {
url: '/atomone/gov/v1beta1/proposals/{proposal_id}/tally',
adapter,
},
gov_proposals_votes: {
url: '/atomone/gov/v1beta1/proposals/{proposal_id}/votes',
adapter,
},
gov_proposals_votes_voter: {
url: '/atomone/gov/v1beta1/proposals/{proposal_id}/votes/{voter}',
adapter,
},
}
2 changes: 1 addition & 1 deletion src/modules/[chain]/block/[height].vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const remainingBlocks = computed(() => {
})

const estimateTime = computed(() => {
const seconds = remainingBlocks.value * Number((store.blocktime / 1000).toFixed()) * 1000
const seconds = Number((remainingBlocks.value * store.blocktime).toFixed(2))
return seconds
})

Expand Down
18 changes: 11 additions & 7 deletions src/modules/[chain]/gov/[proposal_id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,16 @@ const processList = computed(() => {
});

function showValidatorName(voter: string) {
const { data } = fromBech32(voter);
const hex = toHex(data);
const v = stakingStore.validators.find(
(x) => toHex(fromBech32(x.operator_address).data) === hex
);
return v ? v.description.moniker : voter;
try {
const { data } = fromBech32(voter);
const hex = toHex(data);
const v = stakingStore.validators.find(
(x) => toHex(fromBech32(x.operator_address).data) === hex
);
return v ? v.description.moniker : voter;
} catch(e){
return voter;
}
}

function pageload(p: number) {
Expand Down Expand Up @@ -396,7 +400,7 @@ function metaItem(metadata: string|undefined): { title: string; summary: string
<tr v-for="(item, index) of votes" :key="index">
<td class="py-2 text-sm">{{ showValidatorName(item.voter) }}</td>
<td
v-if="item.option"
v-if="item.option && item.option !== 'VOTE_OPTION_UNSPECIFIED'"
class="py-2 text-sm"
:class="{
'text-yes': item.option === 'VOTE_OPTION_YES',
Expand Down
4 changes: 3 additions & 1 deletion src/stores/useStakingStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ export const useStakingStore = defineStore('stakingStore', {
if(this.blockchain.current?.providerChain?.api && this.blockchain.current.providerChain.api.length > 0) {
const client = CosmosRestClient.newDefault(this.blockchain.current.providerChain.api[0].address)
await client.getStakingValidators('BOND_STATUS_BONDED', 500).then((res) => { this.validators = res.validators });
return client.getInterchainSecurityConsumerValidators(chain_id)
const id_map = {"neutron": "0", "stride": "1"} as Record<string, string>;
const consumer_id = Object.keys(id_map).find((k) => chain_id.startsWith(k)) || 0;
return client.getInterchainSecurityConsumerValidators(id_map[consumer_id])
} else {
return { validators: [] }
}
Expand Down