diff --git a/src/modules/wallet/accounts.vue b/src/modules/wallet/accounts.vue index 867634e1..73ffe9ee 100644 --- a/src/modules/wallet/accounts.vue +++ b/src/modules/wallet/accounts.vue @@ -24,11 +24,11 @@ const delegations = ref({} as Record) // load balances Object.values(conf.value).forEach(imported => { let promise = Promise.resolve() - for(let i = 0;i < imported.length; i++) { + for (let i = 0; i < imported.length; i++) { promise = promise.then(() => new Promise((resolve) => { // continue only if the page is living - if(imported[i].endpoint) { - loadBalances(imported[i].endpoint || "", imported[i].address).finally(()=> resolve()) + if (imported[i].endpoint) { + loadBalances(imported[i].endpoint || "", imported[i].address).finally(() => resolve()) } else { resolve() } @@ -50,7 +50,7 @@ const accounts = computed(() => { denom = b.balance.denom }) entry.delegation = { amount: String(amount), denom } - }else{ + } else { entry.delegation = undefined } entry.balances = balances.value[entry.address] @@ -130,7 +130,7 @@ async function addAddress(acc: AccountEntry) { } // also add chain to favorite - if(!dashboard?.favoriteMap?.[acc.chainName]) { + if (!dashboard?.favoriteMap?.[acc.chainName]) { dashboard.favoriteMap[acc.chainName] = true window.localStorage.setItem( 'favoriteMap', @@ -145,14 +145,14 @@ async function addAddress(acc: AccountEntry) { localStorage.setItem("imported-addresses", JSON.stringify(conf.value)) } -async function loadBalances(endpoint:string, address: string) { +async function loadBalances(endpoint: string, address: string) { const client = CosmosRestClient.newDefault(endpoint) await client.getBankBalances(address).then(res => { - balances.value[address] = res.balances.filter(x => x.denom.length < 10) - }) + balances.value[address] = res.balances.filter(x => x.denom.length < 10) + }) await client.getStakingDelegations(address).then(res => { - delegations.value[address] = res.delegation_responses - }) + delegations.value[address] = res.delegation_responses + }) } @@ -177,33 +177,7 @@ async function loadBalances(endpoint:string, address: string) {
- -
@@ -262,7 +236,33 @@ async function loadBalances(endpoint:string, address: string) { - Add chain to Keplr +
+ + Add chain to Keplr +
@@ -271,22 +271,21 @@ async function loadBalances(endpoint:string, address: string) { +