init
This commit is contained in:
commit
44f31f8b9f
402 changed files with 47865 additions and 0 deletions
16
utils/instanceUtils.js
Normal file
16
utils/instanceUtils.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue