classic-ui/utils/instanceUtils.js
Danil Kovtonyuk 44f31f8b9f
init
2022-04-22 13:14:19 +10:00

17 lines
421 B
JavaScript

import networkConfig from '@/networkConfig'
export function getInstanceByAddress({ netId, address }) {
const { tokens } = networkConfig[`netId${netId}`]
for (const [currency, { instanceAddress }] of Object.entries(tokens)) {
for (const [amount, instance] of Object.entries(instanceAddress)) {
if (instance === address) {
return {
amount,
currency
}
}
}
}
}