validate only selected network contract addresses

This commit is contained in:
smart_ex 2022-04-18 18:40:41 +10:00 committed by Danil Kovtonyuk
parent 7f657c1d7d
commit 76cda01ee1
1 changed files with 11 additions and 12 deletions

View File

@ -11,18 +11,17 @@ const TOKENS = {
} }
const addressMap = new Map() const addressMap = new Map()
for (const [key, value] of Object.entries(instances)) { const instance = instances[`netId${netId}`]
const netId = Number(key.substring(5))
for (const [currency, { instanceAddress, symbol, decimals }] of Object.entries(value)) { for (const [currency, { instanceAddress, symbol, decimals }] of Object.entries(instance)) {
Object.entries(instanceAddress).forEach(([amount, address]) => Object.entries(instanceAddress).forEach(([amount, address]) =>
addressMap.set(`${netId}_${address}`, { addressMap.set(`${netId}_${address}`, {
currency, currency,
amount, amount,
symbol, symbol,
decimals, decimals,
}), }),
) )
}
} }
const sleep = ms => new Promise(res => setTimeout(res, ms)) const sleep = ms => new Promise(res => setTimeout(res, ms))