-
-
-
-
-
- |
-
-
-
- {{ item?.content?.title }}
-
-
- {{ showType(item.content['@type']) }}
-
-
- |
-
-
- |
-
-
-
-
-
- {{
- statusMap?.[item?.status] ||
- item?.status
- }}
-
-
-
- {{ format.toDay(item.voting_end_time, 'from') }}
-
-
- |
-
-
-
-
-
- |
-
-
-
-
-
-
+
+
+
+
+
+ |
+
+
+
+ {{ item?.content?.title }}
+
+
+ {{ showType(item.content['@type']) }}
+
+ |
+
+
+ |
+
+
+
+
+
+ {{ statusMap?.[item?.status] || item?.status }}
+
+
+
+ {{ format.toDay(item.voting_end_time, 'from') }}
+
+
+ |
+
+
+
+
+ {{
+ item?.voterStatus?.replace('VOTE_OPTION_', '')
+ }}
+
+ Vote
+
+
+ |
+
+
+
+
+
+
+
+ {{ item?.content?.title }}
+
+ #{{ item?.proposal_id }}
-
-
-
- ✕
- Description
-
-
-
-
-
-
+
+
+
+ {{ showType(item.content['@type']) }}
+
+
+
+
+
+ {{ statusMap?.[item?.status] || item?.status }}
+
+
+
+ {{ format.toDay(item.voting_end_time, 'from') }}
+
+
+
+
+
+
+
+
+ {{
+ item?.voterStatus?.replace('VOTE_OPTION_', '')
+ }}
+
+ Vote
+
+
+
+
+
+
+
+ ✕
+ Description
+
+
+
+
+
+
+
diff --git a/src/layouts/components/DefaultLayout.vue b/src/layouts/components/DefaultLayout.vue
index c8aba0a6..9b43df7c 100644
--- a/src/layouts/components/DefaultLayout.vue
+++ b/src/layouts/components/DefaultLayout.vue
@@ -5,6 +5,7 @@ import { ref } from 'vue';
// Components
import newFooter from '@/layouts/components/NavFooter.vue';
import NavbarThemeSwitcher from '@/layouts/components/NavbarThemeSwitcher.vue';
+import NavbarSearch from '@/layouts/components/NavbarSearch.vue';
import ChainProfile from '@/layouts/components/ChainProfile.vue';
import { useDashboard } from '@/stores/useDashboard';
@@ -282,7 +283,7 @@ const showDiscord = window.location.host.search('ping.pub') > -1;
-
+
diff --git a/src/layouts/components/NavbarSearch.vue b/src/layouts/components/NavbarSearch.vue
new file mode 100644
index 00000000..9cc1b6f6
--- /dev/null
+++ b/src/layouts/components/NavbarSearch.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
preventClick(event)"
+ >
+
+
+
+ Search
+ Height/Transaction/Account Address
+
+
+
+
+
+
+
+
+
+
+ {{ errorMessage }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/modules/[chain]/account/[address].vue b/src/modules/[chain]/account/[address].vue
index 053b0e1f..cb62204e 100644
--- a/src/modules/[chain]/account/[address].vue
+++ b/src/modules/[chain]/account/[address].vue
@@ -8,6 +8,7 @@ import {
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
import DonutChart from '@/components/charts/DonutChart.vue';
import { computed, ref } from '@vue/reactivity';
+import { onMounted } from 'vue';
import { Icon } from '@iconify/vue';
import 'vue-json-pretty/lib/styles.css';
import type {
@@ -33,7 +34,9 @@ const balances = ref([] as Coin[]);
const unbonding = ref([] as UnbondingResponses[]);
const unbondingTotal = ref(0);
const chart = {};
-
+onMounted(() => {
+ loadAccount(props.address);
+});
const totalAmountByCategory = computed(() => {
let sumDel = 0;
delegations.value?.forEach((x) => {
@@ -88,7 +91,6 @@ function loadAccount(address: string) {
});
}
-
function updateEvent() {
loadAccount(props.address);
}
@@ -141,9 +143,13 @@ function updateEvent() {
for="transfer"
class="btn btn-primary btn-sm"
@click="
- dialog.open('transfer', {
- chain_name: blockchain.current?.prettyName,
- }, updateEvent)
+ dialog.open(
+ 'transfer',
+ {
+ chain_name: blockchain.current?.prettyName,
+ },
+ updateEvent
+ )
"
>transfer
@@ -355,9 +361,13 @@ function updateEvent() {
for="delegate"
class="btn btn-primary btn-xs mr-2"
@click="
- dialog.open('delegate', {
- validator_address: v.delegation.validator_address,
- }, updateEvent)
+ dialog.open(
+ 'delegate',
+ {
+ validator_address: v.delegation.validator_address,
+ },
+ updateEvent
+ )
"
>delegate
@@ -365,9 +375,13 @@ function updateEvent() {
for="redelegate"
class="btn btn-primary btn-xs mr-2"
@click="
- dialog.open('redelegate', {
- validator_address: v.delegation.validator_address,
- }, updateEvent)
+ dialog.open(
+ 'redelegate',
+ {
+ validator_address: v.delegation.validator_address,
+ },
+ updateEvent
+ )
"
>Redelegate
@@ -375,9 +389,13 @@ function updateEvent() {
for="unbond"
class="btn btn-primary btn-xs"
@click="
- dialog.open('unbond', {
- validator_address: v.delegation.validator_address,
- }, updateEvent)
+ dialog.open(
+ 'unbond',
+ {
+ validator_address: v.delegation.validator_address,
+ },
+ updateEvent
+ )
"
>Unbond
diff --git a/src/modules/[chain]/consensus/index.vue b/src/modules/[chain]/consensus/index.vue
new file mode 100644
index 00000000..d03cd097
--- /dev/null
+++ b/src/modules/[chain]/consensus/index.vue
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ httpstatus }}: {{ httpStatusText }}
+
+
+
+
+
+
+
+
{{ rate }}
+ Onboard Rate
+
+
+
+
+
+
+
{{ height }}
+ Height
+
+
+
+
+
+
+
{{ round }}
+ Round
+
+
+
+
+
+
+
{{ step }}
+ Step
+
+
+
+
+
+
+
+
+
+ Updated at {{ newTime || '' }}
+
+
+
Round: {{ item.round }}
+
{{ item.prevotes_bit_array }}
+
+
+
+ {{ showName(i, pre) }}
+
+
+
+
+
+
+
+
+
+ Proposer Signed
+
+
+
+ Proposer Not Signed
+
+
+
+
+ Signed
+
+
+
+
+ Not Signed
+
+
+
+
+
+
+
+
Tips
+
+
+
+ -
+ This tool is useful for validators to monitor who is onboard during
+ an upgrade
+
+ -
+ If you want to change the default rpc endpoint. make sure that
+ "https" and "CORS" are enabled on your server.
+
+
+
+
+
+
+
+
diff --git a/src/plugins/i18n/locales/cn.json b/src/plugins/i18n/locales/cn.json
index c2f010df..e73441e3 100644
--- a/src/plugins/i18n/locales/cn.json
+++ b/src/plugins/i18n/locales/cn.json
@@ -5,7 +5,8 @@
"staking": "质押生息",
"governance": "社区治理",
"parameters": "参数",
- "uptime": "状态"
+ "uptime": "状态",
+ "consensus": "Consensus"
},
"index": {
"slogan": "Ping Dashboard 是一个区块链浏览器,也是一个网页钱包,还有更多 ... 🛠",
diff --git a/src/plugins/i18n/locales/en.json b/src/plugins/i18n/locales/en.json
index fa57d67c..33da7d76 100644
--- a/src/plugins/i18n/locales/en.json
+++ b/src/plugins/i18n/locales/en.json
@@ -9,7 +9,8 @@
"state-sync": "State Sync",
"cosmwasm": "Cosmwasm",
"widget": "Widgets",
- "ibc": "IBC"
+ "ibc": "IBC",
+ "consensus": "Consensus"
},
"index": {
"slogan": "Ping Dashboard is not just an explorer but also a wallet and more ... 🛠",
diff --git a/src/stores/useBlockchain.ts b/src/stores/useBlockchain.ts
index d3063557..9841a9ba 100644
--- a/src/stores/useBlockchain.ts
+++ b/src/stores/useBlockchain.ts
@@ -35,6 +35,7 @@ export const useBlockchain = defineStore('blockchain', {
},
getters: {
current(): ChainConfig | undefined {
+ console.log(this.dashboard.chains[this.chainName], 'jljfkj')
return this.dashboard.chains[this.chainName];
},
logo(): string {
diff --git a/src/stores/useGovStore.ts b/src/stores/useGovStore.ts
index e415153e..48b07fce 100644
--- a/src/stores/useGovStore.ts
+++ b/src/stores/useGovStore.ts
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import { useBlockchain } from './useBlockchain';
import type { PageRequest, PaginatedProposals } from '@/types';
import { LoadingStatus } from './useDashboard';
-import { useWalletStore } from './useWalletStore'
+import { useWalletStore } from './useWalletStore';
import { reactive } from 'vue';
export const useGovStore = defineStore('govStore', {
@@ -23,41 +23,49 @@ export const useGovStore = defineStore('govStore', {
},
walletstore() {
return useWalletStore();
- }
+ },
},
actions: {
initial() {
- this.$reset()
+ this.$reset();
this.fetchParams();
- this.fetchProposals("2");
+ this.fetchProposals('2');
},
async fetchProposals(status: string, pagination?: PageRequest) {
//if (!this.loading[status]) {
- this.loading[status] = LoadingStatus.Loading;
- const proposals = reactive(
- await this.blockchain.rpc?.getGovProposals(status, pagination)
- );
- if (status === '2') {
- proposals?.proposals?.forEach((item) => {
- this.fetchTally(item.proposal_id).then((res) => {
- item.final_tally_result = res?.tally;
- });
- if (this.walletstore.currentAddress) {
- try {
- this.fetchProposalVotesVoter(item.proposal_id, this.walletstore.currentAddress).then((res) => {
- item.voterStatus = res?.vote?.option || 'No With Veto'
- });
- } catch (error) {
- item.voterStatus = 'No With Veto'
- }
- } else {
- item.voterStatus = 'No With Veto'
- }
+ this.loading[status] = LoadingStatus.Loading;
+ const proposals = reactive(
+ await this.blockchain.rpc?.getGovProposals(status, pagination)
+ );
+ if (status === '2') {
+ proposals?.proposals?.forEach((item) => {
+ this.fetchTally(item.proposal_id).then((res) => {
+ item.final_tally_result = res?.tally;
});
- }
+ if (this.walletstore.currentAddress) {
+ try {
+ this.fetchProposalVotesVoter(
+ item.proposal_id,
+ this.walletstore.currentAddress
+ )
+ .then((res) => {
+ item.voterStatus = res?.vote?.option || 'VOTE_OPTION_NO_WITH_VETO'
+ // 'No With Veto';
+ })
+ .catch((reject) => {
+ item.voterStatus = 'VOTE_OPTION_NO_WITH_VETO'
+ });
+ } catch (error) {
+ item.voterStatus = 'VOTE_OPTION_NO_WITH_VETO'
+ }
+ } else {
+ item.voterStatus = 'VOTE_OPTION_NO_WITH_VETO'
+ }
+ });
+ }
- this.loading[status] = LoadingStatus.Loaded;
- this.proposals[status] = proposals;
+ this.loading[status] = LoadingStatus.Loaded;
+ this.proposals[status] = proposals;
//}
return this.proposals[status];
},
diff --git a/src/types/gov.ts b/src/types/gov.ts
index a0261e5f..c09a380f 100644
--- a/src/types/gov.ts
+++ b/src/types/gov.ts
@@ -1,79 +1,83 @@
-
-import type { Coin, PaginatedResponse } from "./common"
+import type { Coin, PaginatedResponse } from './common';
export interface GovParams {
- "voting_params": {
- "voting_period": string,
- "proposal_voting_periods": any[],
- "expedited_voting_period": string
- },
- "deposit_params": {
- "min_deposit": Coin[],
- "max_deposit_period": string,
- "min_expedited_deposit": Coin[],
- "min_initial_deposit_ratio": string
- },
- "tally_params": {
- "quorum": string,
- "threshold": string,
- "veto_threshold": string,
- "expedited_threshold": string
- }
+ voting_params: {
+ voting_period: string;
+ proposal_voting_periods: any[];
+ expedited_voting_period: string;
+ };
+ deposit_params: {
+ min_deposit: Coin[];
+ max_deposit_period: string;
+ min_expedited_deposit: Coin[];
+ min_initial_deposit_ratio: string;
+ };
+ tally_params: {
+ quorum: string;
+ threshold: string;
+ veto_threshold: string;
+ expedited_threshold: string;
+ };
}
export interface GovProposal {
- "proposal_id": string,
- "content": {
- "@type": string,
- "title": string,
- "description": string,
- "plan"?: {
- 'height'?: string | number,
- 'time'?: string | number,
- }
- },
- "status": string,
- "final_tally_result": {
- "yes": string,
- "abstain": string,
- "no": string,
- "no_with_veto": string,
- },
- "submit_time": string,
- "deposit_end_time": string,
- "total_deposit": Coin[],
- "voting_start_time": string,
- "voting_end_time": string,
- "is_expedited": boolean,
- "voterStatus"?: string,
+ proposal_id: string;
+ content: {
+ '@type': string;
+ title: string;
+ description: string;
+ plan?: {
+ height?: string | number;
+ time?: string | number;
+ };
+ };
+ status: string;
+ final_tally_result: {
+ yes: string;
+ abstain: string;
+ no: string;
+ no_with_veto: string;
+ };
+ submit_time: string;
+ deposit_end_time: string;
+ total_deposit: Coin[];
+ voting_start_time: string;
+ voting_end_time: string;
+ is_expedited: boolean;
+ voterStatus?: string
+// VoteOption[];
}
+export interface VoteOption {
+ option: string;
+ weight: string;
+}
export interface Tally {
- yes: string,
- abstain: string,
- no: string,
- no_with_veto: string
+ yes: string;
+ abstain: string;
+ no: string;
+ no_with_veto: string;
}
export interface GovVote {
- proposal_id: string,
- voter: string,
- option: string,
- options: { "option": string, "weight": string }[]
+ proposal_id: string;
+ voter: string;
+ option: string;
+ options: { option: string; weight: string }[];
}
export interface PaginatedProposals extends PaginatedResponse {
- proposals: GovProposal[]
+ proposals: GovProposal[];
}
export interface PaginatedProposalDeposit extends PaginatedResponse {
- deposits: {
- amount: Coin[],
- proposal_id: string,
- depositor: string
- }
+ deposits: {
+ amount: Coin[];
+ proposal_id: string;
+ depositor: string;
+ };
}
export interface PaginatedProposalVotes extends PaginatedResponse {
- votes: GovVote[]
-}
\ No newline at end of file
+ votes: GovVote[];
+}