support: add ETH and ETC as supported in webwallet

also use this information when generating coins_details.json
pull/41/head
matejcik 6 years ago
parent 88fa3c7381
commit a1265b48d1

@ -72,8 +72,8 @@
"bitcoin:GRS": "1.6.2",
"bitcoin:KOTO": "1.7.1",
"bitcoin:LTC": "1.5.2",
"bitcoin:MONA": "1.6.0",
"bitcoin:MEC": "1.7.2",
"bitcoin:MONA": "1.6.0",
"bitcoin:MUE": "1.7.1",
"bitcoin:NMC": "1.5.2",
"bitcoin:PTC": "1.7.1",
@ -995,8 +995,8 @@
"bitcoin:GRS": "2.0.8",
"bitcoin:KOTO": "2.0.8",
"bitcoin:LTC": "2.0.5",
"bitcoin:MONA": "2.0.5",
"bitcoin:MEC": "2.0.10",
"bitcoin:MONA": "2.0.5",
"bitcoin:MUE": "2.0.8",
"bitcoin:NMC": "2.0.5",
"bitcoin:PTC": "2.0.8",
@ -1921,7 +1921,9 @@
"bitcoin:VTC": true,
"bitcoin:XZC": true,
"bitcoin:ZEC": true,
"bitcoin:tGRS": true
"bitcoin:tGRS": true,
"eth:ETC": true,
"eth:ETH": true
},
"unsupported": {}
}

@ -43,9 +43,6 @@ TREZORIO_KNOWN_URLS = (
"https://trezor.io/stellar/",
)
# TODO: we should read this from support.json
TREZOR_NEXT_ETH_NETWORKS = ("eth", "etc")
def coinmarketcap_call(endpoint, api_key, params=None):
url = COINMARKETCAP_API_BASE + endpoint
@ -223,13 +220,14 @@ def update_bitcoin(coins, support_info):
return res
def update_erc20(coins, support_info):
def update_erc20(coins, networks, support_info):
# TODO skip disabled networks?
network_support = {n["chain"]: support_info.get(n["key"]) for n in networks}
res = update_simple(coins, support_info, "erc20")
for coin in coins:
key = coin["key"]
chain = coin["chain"]
if chain in TREZOR_NEXT_ETH_NETWORKS:
if network_support.get(chain, {}).get("webwallet"):
wallets = WALLETS_ETH_NATIVE
else:
wallets = WALLETS_ETH_3RDPARTY
@ -255,7 +253,7 @@ def update_ethereum_networks(coins, support_info):
res = update_simple(coins, support_info, "coin")
for coin in coins:
key = coin["key"]
if coin["chain"] in TREZOR_NEXT_ETH_NETWORKS:
if support_info[key].get("webwallet"):
wallets = WALLETS_ETH_NATIVE
else:
wallets = WALLETS_ETH_3RDPARTY
@ -377,7 +375,7 @@ def main(refresh, api_key, verbose):
coins = {}
coins.update(update_bitcoin(defs.bitcoin, support_info))
coins.update(update_erc20(defs.erc20, support_info))
coins.update(update_erc20(defs.erc20, defs.eth, support_info))
coins.update(update_ethereum_networks(defs.eth, support_info))
coins.update(update_nem_mosaics(defs.nem, support_info))
coins.update(update_simple(defs.misc, support_info, "coin"))

Loading…
Cancel
Save