diff --git a/blockchains/ethereum/whitelist.json b/blockchains/ethereum/whitelist.json index 9599dba24..7bf5e53b1 100644 --- a/blockchains/ethereum/whitelist.json +++ b/blockchains/ethereum/whitelist.json @@ -4237,6 +4237,7 @@ "0xc6A18790d4D3988D28cc1E274E2c696602ea4343", "0xc6AbF3C09341741Ac6041B0B08195701bdFD460C", "0xC6D603A9Df53D1542552058c382bf115AACE70C7", + "0xC6D76756Fec88A289B20091846b81C23997BFD00", "0xc6E2970cf8b1943fb58dB5b3c19CFc2ee146f376", "0xc719d010B63E5bbF2C0551872CD5316ED26AcD83", "0xC72ED4445B3fe9f0863106E344E241530d338906", diff --git a/script/action/binance.ts b/script/action/binance.ts index 77cc80932..4079bc986 100644 --- a/script/action/binance.ts +++ b/script/action/binance.ts @@ -18,6 +18,7 @@ const binanceChain = "binance" const binanceUrlTokens2 = config.getConfig("binance_url_tokens2", "https://dex-atlantic.binance.org/api/v1/tokens?limit=1000"); const binanceUrlTokens8 = config.getConfig("binance_url_tokens8", "https://dex-atlantic.binance.org/api/v1/mini/tokens?limit=1000"); const binanceUrlTokenAssets = config.getConfig("binance_url_token_assets", "https://explorer.binance.org/api/v1/assets?page=1&rows=1000"); +var cachedAssets = []; async function retrieveBep2AssetList(): Promise { console.log(` Retrieving token asset infos from: ${binanceUrlTokenAssets}`); @@ -26,13 +27,21 @@ async function retrieveBep2AssetList(): Promise { return assetInfoList } +async function retrieveAssets(): Promise { + // cache results because of rate limit, used more than once + if (cachedAssets.length == 0) { + console.log(` Retrieving token infos (${binanceUrlTokens2}, ${binanceUrlTokens8})`); + const bep2assets = await axios.get(binanceUrlTokens2); + const bep8assets = await axios.get(binanceUrlTokens8); + cachedAssets = bep2assets.data.concat(bep8assets.data); + } + console.log(` Using ${cachedAssets.length} assets`); + return cachedAssets; +} + export async function retrieveAssetSymbols(): Promise { - console.log(` Retrieving token infos (${binanceUrlTokens2}, ${binanceUrlTokens8})`); - const bep2assets = await axios.get(binanceUrlTokens2); - const bep8assets = await axios.get(binanceUrlTokens8); - const symbols = bep2assets.data.map(({ symbol }) => symbol) - .concat(bep8assets.data.map(({ symbol }) => symbol)); - console.log(` Retrieved ${symbols.length} symbols`); + const assets = await retrieveAssets(); + const symbols = assets.map(({ symbol }) => symbol); return symbols; }