forked from LaconicNetwork/cosmos-explorer
@@ -8,6 +8,7 @@ const store = useTxDialog();
|
||||
:sender="store.sender"
|
||||
:endpoint="store.endpoint"
|
||||
:params='store.params'
|
||||
:hd-path="store.hdPaths"
|
||||
@view="store.view"
|
||||
@confirmed="store.confirmed"
|
||||
></ping-tx-dialog>
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ const chains = computed(() => {
|
||||
</script>
|
||||
<template>
|
||||
<div class="">
|
||||
<div class="flex flex-col md:flex-row items-center justify-center mb-6 mt-14 gap-3">
|
||||
<div class="flex md:!flex-row flex-col items-center justify-center mb-6 mt-14 gap-2">
|
||||
<div class="w-16 rounded-full">
|
||||
<img src="/logo.svg" />
|
||||
</div>
|
||||
@@ -53,7 +53,7 @@ const chains = computed(() => {
|
||||
<div class="flex items-center rounded-lg bg-base-100 border border-gray-200 dark:border-gray-700 mt-10">
|
||||
<Icon icon="mdi:magnify" class="text-2xl text-gray-400 ml-3"/>
|
||||
<input :placeholder="$t('index.search_placeholder')" class="px-4 h-10 bg-transparent flex-1 outline-none text-base" v-model="keywords" />
|
||||
<div class="px-4 text-base hidden md:block">{{ chains.length }}/{{ dashboard.length }}</div>
|
||||
<div class="px-4 text-base hidden md:!block">{{ chains.length }}/{{ dashboard.length }}</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
||||
@@ -48,11 +48,7 @@ export const useBlockchain = defineStore('blockchain', {
|
||||
},
|
||||
defaultHDPath(): string {
|
||||
const cointype = this.current?.coinType || '118';
|
||||
// if(cointype === "60") {
|
||||
// return `m/44'/${cointype}`
|
||||
// }
|
||||
return `m/44'/${cointype}/0'/0/0`;
|
||||
//return "connected-wallet"
|
||||
},
|
||||
dashboard() {
|
||||
return useDashboard();
|
||||
|
||||
@@ -23,7 +23,10 @@ export const useTxDialog = defineStore('txDialogStore', {
|
||||
},
|
||||
blockchain() {
|
||||
return useBlockchain()
|
||||
}
|
||||
},
|
||||
hdPaths() {
|
||||
return useBlockchain().defaultHDPath
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setParams(param: any) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export const useWalletStore = defineStore('walletStore', {
|
||||
delegations: [] as Delegation[],
|
||||
unbonding: [] as UnbondingResponses[],
|
||||
rewards: {total: [], rewards: []} as DelegatorRewards,
|
||||
walletIsConnected: {} as WalletConnected
|
||||
wallet: {} as WalletConnected
|
||||
};
|
||||
},
|
||||
getters: {
|
||||
@@ -26,12 +26,13 @@ export const useWalletStore = defineStore('walletStore', {
|
||||
return useBlockchain();
|
||||
},
|
||||
connectedWallet() {
|
||||
// @ts-ignore
|
||||
if(this.wallet.cosmosAddress) return this.wallet
|
||||
console.log("orrect", this.wallet)
|
||||
const chainStore = useBlockchain();
|
||||
const key = chainStore.defaultHDPath;
|
||||
let connected = {} as WalletConnected
|
||||
if (!this.walletIsConnected?.cosmosAddress){
|
||||
connected = JSON.parse(localStorage.getItem(key) || '{}');
|
||||
}
|
||||
const connected = JSON.parse(localStorage.getItem(key) || '{}');
|
||||
console.log("connected:", connected)
|
||||
return connected
|
||||
},
|
||||
balanceOfStakingToken(): Coin {
|
||||
@@ -62,7 +63,6 @@ export const useWalletStore = defineStore('walletStore', {
|
||||
},
|
||||
unbondingAmount() {
|
||||
let amt = 0;
|
||||
let denom = '';
|
||||
this.unbonding.forEach((i) => {
|
||||
i.entries.forEach((e) => {
|
||||
amt += Number(e.balance);
|
||||
@@ -126,12 +126,8 @@ export const useWalletStore = defineStore('walletStore', {
|
||||
localStorage.removeItem(key);
|
||||
this.$reset()
|
||||
},
|
||||
setConnectedWallet(value: any) {
|
||||
const chainStore = useBlockchain();
|
||||
const key = chainStore.defaultHDPath;
|
||||
this.walletIsConnected = value || {}
|
||||
// JSON.parse(localStorage.getItem(key) || '{}');
|
||||
return this.walletIsConnected
|
||||
setConnectedWallet(value: WalletConnected) {
|
||||
if(value) this.wallet = value
|
||||
},
|
||||
suggestChain() {
|
||||
// const router = useRouter()
|
||||
|
||||
Reference in New Issue
Block a user