From b29091b51f65af24f1f1129383e2a32d025f0386 Mon Sep 17 00:00:00 2001 From: readme-bot Date: Wed, 8 Nov 2023 13:50:28 +0800 Subject: [PATCH] tweak --- src/components/historical-data/index.css | 7 ------- src/components/historical-data/index.tsx | 4 ++-- src/middlelayers/datafetch/coins/erc20.ts | 14 +++++++++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/components/historical-data/index.css b/src/components/historical-data/index.css index 5a2f561..cc81be2 100644 --- a/src/components/historical-data/index.css +++ b/src/components/historical-data/index.css @@ -15,9 +15,6 @@ .historical-data-card:hover { box-shadow: 0 0 5px #aaa; - .historical-data-card-bottom .historical-data-card-bottom-operations { - display: flex; - } } .historical-data-card-total { @@ -50,10 +47,6 @@ display: flex; } -.historical-data-card-bottom-operations { - display: none; -} - /* fix bottom right */ .historical-data-card-bottom-changes { position: absolute; diff --git a/src/components/historical-data/index.tsx b/src/components/historical-data/index.tsx index 16db474..d4f6d04 100644 --- a/src/components/historical-data/index.tsx +++ b/src/components/historical-data/index.tsx @@ -155,7 +155,7 @@ const App = ({ return (
onRowClick(d.id)} >
@@ -171,7 +171,7 @@ const App = ({
-
+
onHistoricalDataDeleteClick(d.id)}> - private readonly queries = [new EthERC20Query(), new BscERC20Query()] + // !bsc first, because of this provider has some bug, if call eth first, balance of bsc will be the same as eth + private readonly queries = [new BscERC20Query(), new EthERC20Query()] constructor(config: Pick) { this.config = config @@ -110,9 +111,12 @@ export class ERC20Analyzer implements Analyzer { } private async query(address: string): Promise { - const coins = await bluebird.map(this.queries, async q => q.query(address), { - concurrency: 2 - }) + const coins: Coin[][] = [] + // currency must be 1, because of bug of ethplorer.io + for (const q of this.queries) { + const coin = await q.query(address) + coins.push(coin) + } return _(coins).flatten().map(c => ({ ...c, @@ -133,7 +137,7 @@ export class ERC20Analyzer implements Analyzer { if (max <= 0) { throw new Error("failed to query erc20 assets, with max retry") } - const coinLists = await asyncMap(getAddressList(this.config.erc20), async addr => this.query(addr), 1, 1000) + const coinLists = await asyncMap(getAddressList(this.config.erc20), async addr => this.query(addr), 2, 1000) return _(coinLists).flatten().value() } catch (e) {