diff --git a/data/network-coinlookups.js b/data/network-coinlookups.js new file mode 100644 index 0000000000..c3c2167eb4 --- /dev/null +++ b/data/network-coinlookups.js @@ -0,0 +1,100 @@ +const terraCoinLookup = [ + { + chainDenom: 'uluna', + viewDenom: 'LUNA', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'ukrw', + viewDenom: 'KRT', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'ukrw', + viewDenom: 'KRT', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'umnt', + viewDenom: 'MNT', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'usdr', + viewDenom: 'SDT', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'uusd', + viewDenom: 'UST', + chainToViewConversionFactor: 1e-6 + } + ] +// in the case of e-Money, some tokens only exist in mainnet and viceversa, some tokens only exist in testnet +// still, this will probably soon change with the new testnet +// also it is just more simple to add them all in the same dictionary +const emoneyCoinLookup = [ + { + chainDenom: 'ungm', + viewDenom: 'NGM', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'edkk', + viewDenom: 'eDKK', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'enok', + viewDenom: 'eNOK', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'esek', + viewDenom: 'eSEK', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'echf', + viewDenom: 'eCHF', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'eeur', + viewDenom: 'eEUR', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'eusd', + viewDenom: 'eUSD', + chainToViewConversionFactor: 1e-6 + }, + { + chainDenom: 'ejpy', + viewDenom: 'eJPY', + chainToViewConversionFactor: 1e-6 + } + ] +const coinLookupDictionary = { + "cosmos-hub-mainnet": [{ + chainDenom: 'uatom', + viewDenom: 'ATOM', + chainToViewConversionFactor: 1e-6 + }], + "cosmos-hub-testnet": [{ + chainDenom: 'umuon', + viewDenom: 'MUON', + chainToViewConversionFactor: 1e-6 + }], + "terra-mainnet": terraCoinLookup, + "terra-testnet": terraCoinLookup, + "emoney-mainnet": emoneyCoinLookup, + "emoney-testnet": emoneyCoinLookup, + "polkadot-testnet": [{ + chainDenom: 'Planck', + viewDenom: 'KSM', + chainToViewConversionFactor: 1e-12 + }] +} + +module.exports = {coinLookupDictionary} \ No newline at end of file diff --git a/data/networks.js b/data/networks.js index 8a52a05b0b..adc586ea93 100644 --- a/data/networks.js +++ b/data/networks.js @@ -1,4 +1,5 @@ const { getNetworkCapabilities } = require('./network-capabilities') +const { coinLookupDictionary } = require('./network-coinlookups') module.exports = [ { @@ -19,13 +20,7 @@ module.exports = [ ...getNetworkCapabilities[`cosmos-hub-testnet`], default: false, stakingDenom: 'MUON', - coinLookup: [ - { - chainDenom: 'umuon', - viewDenom: 'MUON', - chainToViewConversionFactor: 1e-6 - } - ], + coinLookup: coinLookupDictionary[`cosmos-hub-testnet`], enabled: true, icon: 'https://app.lunie.io/img/networks/cosmos-hub-mainnet.png', slug: 'cosmos-hub-testnet', @@ -53,13 +48,7 @@ module.exports = [ ...getNetworkCapabilities[`cosmos-hub-mainnet`], default: true, stakingDenom: 'ATOM', - coinLookup: [ - { - chainDenom: 'uatom', - viewDenom: 'ATOM', - chainToViewConversionFactor: 1e-6 - } - ], + coinLookup: coinLookupDictionary[`cosmos-hub-mainnet`], enabled: true, icon: 'https://app.lunie.io/img/networks/cosmos-hub-mainnet.png', slug: 'cosmos-hub', @@ -87,13 +76,7 @@ module.exports = [ ...getNetworkCapabilities[`terra-mainnet`], default: false, stakingDenom: 'LUNA', - coinLookup: [ - { - chainDenom: 'uluna', - viewDenom: 'LUNA', - chainToViewConversionFactor: 1e-6 - } - ], + coinLookup: coinLookupDictionary[`terra-mainnet`], enabled: true, icon: 'https://app.lunie.io/img/networks/terra-mainnet.png', slug: 'terra' @@ -115,13 +98,7 @@ module.exports = [ ...getNetworkCapabilities[`terra-testnet`], default: false, stakingDenom: 'LUNA', - coinLookup: [ - { - chainDenom: 'uluna', - viewDenom: 'LUNA', - chainToViewConversionFactor: 1e-6 - } - ], + coinLookup: coinLookupDictionary[`terra-testnet`], enabled: true, icon: 'https://app.lunie.io/img/networks/terra-testnet.png', slug: 'terra-testnet' @@ -143,13 +120,7 @@ module.exports = [ ...getNetworkCapabilities[`emoney-mainnet`], default: false, stakingDenom: 'NGM', - coinLookup: [ - { - chainDenom: 'ungm', - viewDenom: 'NGM', - chainToViewConversionFactor: 1e-6 - } - ], + coinLookup: coinLookupDictionary[`emoney-mainnet`], enabled: true, icon: 'https://app.lunie.io/img/networks/emoney-mainnet.png', slug: 'emoney' @@ -171,13 +142,7 @@ module.exports = [ ...getNetworkCapabilities[`emoney-testnet`], default: false, stakingDenom: 'NGM', - coinLookup: [ - { - chainDenom: 'ungm', - viewDenom: 'NGM', - chainToViewConversionFactor: 1e-6 - } - ], + coinLookup: coinLookupDictionary[`emoney-testnet`], enabled: true, icon: 'https://app.lunie.io/img/networks/emoney-testnet.png', slug: 'emoney-testnet' @@ -200,13 +165,7 @@ module.exports = [ default: false, stakingDenom: 'KSM', // https://wiki.polkadot.network/docs/en/learn-DOT - coinLookup: [ - { - chainDenom: 'Planck', - viewDenom: 'KSM', - chainToViewConversionFactor: 1e-12 - } - ], + coinLookup: coinLookupDictionary[`polkadot-testnet`], enabled: false, icon: 'https://app.lunie.io/img/networks/polkadot-testnet.png', slug: 'kusama'