@exodus/balances
Advanced tools
Comparing version 1.1.1 to 1.1.2
30
index.js
@@ -46,10 +46,8 @@ import { isNumberUnit } from '@exodus/currency' | ||
blockchainMetadata.on('account-state', async (opts) => { | ||
return this.#updateAssetSource(opts) | ||
blockchainMetadata.on('loaded', () => { | ||
this.#recompute() | ||
blockchainMetadata.on('account-state', this.#handleAccountStateUpdate) | ||
blockchainMetadata.on('tx-log', this.#handleTxLogUpdate) | ||
}) | ||
blockchainMetadata.on('tx-log', async (opts) => { | ||
if (this.#isHistoryBasedBalanceAsset(opts.assetName)) return this.#updateAssetSource(opts) | ||
}) | ||
walletAccountsAtom.observe((payload) => | ||
@@ -66,2 +64,22 @@ this.#setWalletAccounts( | ||
#handleAccountStateUpdate = async (opts) => { | ||
if (!this.#ready) { | ||
this._logger.log(`ignore update from account-state event.`, { | ||
isReady: this.#ready, | ||
}) | ||
return | ||
} | ||
return this.#updateAssetSource(opts) | ||
} | ||
#handleTxLogUpdate = (opts) => { | ||
if (!this.#ready) { | ||
this._logger.log(`ignore update from tx-log event.`, { | ||
isReady: this.#ready, | ||
}) | ||
return | ||
} | ||
if (this.#isHistoryBasedBalanceAsset(opts.assetName)) return this.#updateAssetSource(opts) | ||
} | ||
#pushIntoSharedQueue = makeConcurrent((fn) => fn(), { concurrency: 1 }) | ||
@@ -68,0 +86,0 @@ |
{ | ||
"name": "@exodus/balances", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "balances", | ||
@@ -34,3 +34,3 @@ "author": "Exodus Movement Inc", | ||
}, | ||
"gitHead": "cbca7f075af27af557d498dc6dc74f61909434ad" | ||
"gitHead": "d23a92b5962eedd5874f0362a6983b7c4b8a3ce4" | ||
} |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
10511
3
208
0
58