diff --git a/common/defs/ethereum/akroma.png b/common/defs/ethereum/akroma.png deleted file mode 100644 index a21f1c641..000000000 Binary files a/common/defs/ethereum/akroma.png and /dev/null differ diff --git a/common/defs/ethereum/aqua.png b/common/defs/ethereum/aqua.png deleted file mode 100644 index 6d23634d3..000000000 Binary files a/common/defs/ethereum/aqua.png and /dev/null differ diff --git a/common/defs/ethereum/artis_sigma1.png b/common/defs/ethereum/artis_sigma1.png deleted file mode 100644 index 6250778d4..000000000 Binary files a/common/defs/ethereum/artis_sigma1.png and /dev/null differ diff --git a/common/defs/ethereum/artis_tau1.png b/common/defs/ethereum/artis_tau1.png deleted file mode 100644 index 929f5c972..000000000 Binary files a/common/defs/ethereum/artis_tau1.png and /dev/null differ diff --git a/common/defs/ethereum/ask.png b/common/defs/ethereum/ask.png deleted file mode 100644 index 61103b2b6..000000000 Binary files a/common/defs/ethereum/ask.png and /dev/null differ diff --git a/common/defs/ethereum/ath.png b/common/defs/ethereum/ath.png deleted file mode 100644 index f4c0fb540..000000000 Binary files a/common/defs/ethereum/ath.png and /dev/null differ diff --git a/common/defs/ethereum/auxi.png b/common/defs/ethereum/auxi.png deleted file mode 100644 index 7b1b1425e..000000000 Binary files a/common/defs/ethereum/auxi.png and /dev/null differ diff --git a/common/defs/ethereum/clo.png b/common/defs/ethereum/clo.png deleted file mode 100644 index b711866b2..000000000 Binary files a/common/defs/ethereum/clo.png and /dev/null differ diff --git a/common/defs/ethereum/dxn.png b/common/defs/ethereum/dxn.png deleted file mode 100644 index 0ab919734..000000000 Binary files a/common/defs/ethereum/dxn.png and /dev/null differ diff --git a/common/defs/ethereum/egem.png b/common/defs/ethereum/egem.png deleted file mode 100644 index 1953bb923..000000000 Binary files a/common/defs/ethereum/egem.png and /dev/null differ diff --git a/common/defs/ethereum/ella.png b/common/defs/ethereum/ella.png deleted file mode 100644 index 3cc159634..000000000 Binary files a/common/defs/ethereum/ella.png and /dev/null differ diff --git a/common/defs/ethereum/eosc.png b/common/defs/ethereum/eosc.png deleted file mode 100644 index 760746344..000000000 Binary files a/common/defs/ethereum/eosc.png and /dev/null differ diff --git a/common/defs/ethereum/ere.png b/common/defs/ethereum/ere.png deleted file mode 100644 index 61bb3c7b8..000000000 Binary files a/common/defs/ethereum/ere.png and /dev/null differ diff --git a/common/defs/ethereum/esn.png b/common/defs/ethereum/esn.png deleted file mode 100644 index 3286f8e17..000000000 Binary files a/common/defs/ethereum/esn.png and /dev/null differ diff --git a/common/defs/ethereum/etc.png b/common/defs/ethereum/etc.png deleted file mode 100644 index fd044a90b..000000000 Binary files a/common/defs/ethereum/etc.png and /dev/null differ diff --git a/common/defs/ethereum/eth.png b/common/defs/ethereum/eth.png deleted file mode 100644 index c5d8de4b6..000000000 Binary files a/common/defs/ethereum/eth.png and /dev/null differ diff --git a/common/defs/ethereum/etho.png b/common/defs/ethereum/etho.png deleted file mode 100644 index 31eea1509..000000000 Binary files a/common/defs/ethereum/etho.png and /dev/null differ diff --git a/common/defs/ethereum/eti.png b/common/defs/ethereum/eti.png deleted file mode 100644 index b448cd237..000000000 Binary files a/common/defs/ethereum/eti.png and /dev/null differ diff --git a/common/defs/ethereum/etsc.png b/common/defs/ethereum/etsc.png deleted file mode 100644 index 880e2c9d7..000000000 Binary files a/common/defs/ethereum/etsc.png and /dev/null differ diff --git a/common/defs/ethereum/exp.png b/common/defs/ethereum/exp.png deleted file mode 100644 index a64fec8aa..000000000 Binary files a/common/defs/ethereum/exp.png and /dev/null differ diff --git a/common/defs/ethereum/go.png b/common/defs/ethereum/go.png deleted file mode 100644 index 2fed4e377..000000000 Binary files a/common/defs/ethereum/go.png and /dev/null differ diff --git a/common/defs/ethereum/gor.png b/common/defs/ethereum/gor.png deleted file mode 100644 index c5d8de4b6..000000000 Binary files a/common/defs/ethereum/gor.png and /dev/null differ diff --git a/common/defs/ethereum/hpb.png b/common/defs/ethereum/hpb.png deleted file mode 100644 index 052099fda..000000000 Binary files a/common/defs/ethereum/hpb.png and /dev/null differ diff --git a/common/defs/ethereum/kov.png b/common/defs/ethereum/kov.png deleted file mode 100644 index c5d8de4b6..000000000 Binary files a/common/defs/ethereum/kov.png and /dev/null differ diff --git a/common/defs/ethereum/meta.png b/common/defs/ethereum/meta.png deleted file mode 100644 index ad8f6d0fa..000000000 Binary files a/common/defs/ethereum/meta.png and /dev/null differ diff --git a/common/defs/ethereum/mix.png b/common/defs/ethereum/mix.png deleted file mode 100644 index b09b74351..000000000 Binary files a/common/defs/ethereum/mix.png and /dev/null differ diff --git a/common/defs/ethereum/music.png b/common/defs/ethereum/music.png deleted file mode 100644 index 86ef16a19..000000000 Binary files a/common/defs/ethereum/music.png and /dev/null differ diff --git a/common/defs/ethereum/networks.json b/common/defs/ethereum/networks.json deleted file mode 100644 index 260661a77..000000000 --- a/common/defs/ethereum/networks.json +++ /dev/null @@ -1,371 +0,0 @@ -[ - { - "chain": "eth", - "chain_id": 1, - "slip44": 60, - "shortcut": "ETH", - "name": "Ethereum", - "rskip60": false, - "url": "https://www.ethereum.org", - "blockbook": [ - "https://eth1.trezor.io", - "https://eth2.trezor.io" - ] - }, - { - "chain": "exp", - "chain_id": 2, - "slip44": 40, - "shortcut": "EXP", - "name": "Expanse", - "rskip60": false, - "url": "https://expanse.tech", - "blockbook": [] - }, - { - "chain": "rop", - "chain_id": 3, - "slip44": 1, - "shortcut": "tROP", - "name": "Ethereum Testnet Ropsten", - "rskip60": false, - "url": "https://www.ethereum.org", - "blockbook": [ - "https://ropsten1.trezor.io", - "https://ropsten2.trezor.io" - ] - }, - { - "chain": "rin", - "chain_id": 4, - "slip44": 1, - "shortcut": "tRIN", - "name": "Ethereum Testnet Rinkeby", - "rskip60": false, - "url": "https://rinkeby.io", - "blockbook": [] - }, - { - "chain": "gor", - "chain_id": 5, - "slip44": 1, - "shortcut": "tGOR", - "name": "Ethereum Testnet Goerli", - "rskip60": false, - "url": "https://www.goerli.net", - "blockbook": [] - }, - { - "chain": "ubq", - "chain_id": 8, - "slip44": 108, - "shortcut": "UBQ", - "name": "Ubiq", - "rskip60": false, - "url": "https://ubiqsmart.com", - "blockbook": [] - }, - { - "chain": "meta", - "chain_id": 11, - "slip44": 916, - "shortcut": "META", - "name": "Metadium", - "rskip60": false, - "url": "https://metadium.com", - "blockbook": [] - }, - { - "chain": "etsc", - "chain_id": 28, - "slip44": 1128, - "shortcut": "ETSC", - "name": "Ethereum Social", - "rskip60": false, - "url": "https://ethereumsocial.kr", - "blockbook": [] - }, - { - "chain": "rsk", - "chain_id": 30, - "slip44": 137, - "shortcut": "RBTC", - "name": "RSK", - "rskip60": true, - "url": "https://www.rsk.co", - "blockbook": [] - }, - { - "chain": "trsk", - "chain_id": 31, - "slip44": 37310, - "shortcut": "tRBTC", - "name": "RSK Testnet", - "rskip60": true, - "url": "https://www.rsk.co", - "blockbook": [] - }, - { - "chain": "kov", - "chain_id": 42, - "slip44": 1, - "shortcut": "tKOV", - "name": "Ethereum Testnet Kovan", - "rskip60": false, - "url": "https://www.ethereum.org", - "blockbook": [] - }, - { - "chain": "go", - "chain_id": 60, - "slip44": 6060, - "shortcut": "GO", - "name": "GoChain", - "rskip60": false, - "url": "https://gochain.io", - "blockbook": [] - }, - { - "chain": "etc", - "chain_id": 61, - "slip44": 61, - "shortcut": "ETC", - "name": "Ethereum Classic", - "rskip60": false, - "url": "https://ethereumclassic.github.io", - "blockbook": [ - "https://etc1.trezor.io", - "https://etc2.trezor.io" - ] - }, - { - "chain": "tetc", - "chain_id": 62, - "slip44": 1, - "shortcut": "tETC", - "name": "Ethereum Classic Testnet", - "rskip60": false, - "url": "https://ethereumclassic.github.io", - "blockbook": [] - }, - { - "chain": "ella", - "chain_id": 64, - "slip44": 163, - "shortcut": "ELLA", - "name": "Ellaism", - "rskip60": false, - "url": "https://ellaism.org", - "blockbook": [] - }, - { - "chain": "mix", - "chain_id": 76, - "slip44": 76, - "shortcut": "MIX", - "name": "Mix", - "rskip60": false, - "url": "https://www.mix-blockchain.org", - "blockbook": [] - }, - { - "chain": "eti", - "chain_id": 101, - "slip44": 464, - "shortcut": "ETI", - "name": "EtherInc", - "rskip60": false, - "url": "https://einc.io", - "blockbook": [] - }, - { - "chain": "ask", - "chain_id": 222, - "slip44": 2221, - "shortcut": "ASK", - "name": "Permission", - "rskip60": false, - "url": "https://permission.io", - "blockbook": [] - }, - { - "chain": "dxn", - "chain_id": 237, - "slip44": 237, - "shortcut": "DXN", - "name": "DEXON", - "rskip60": false, - "url": "https://dexon.org", - "blockbook": [] - }, - { - "chain": "hpb", - "chain_id": 269, - "slip44": 269, - "shortcut": "HPB", - "name": "High Performance Blockchain", - "rskip60": false, - "url": "https://hpb.io", - "blockbook": [] - }, - { - "chain": "ere", - "chain_id": 466, - "slip44": 466, - "shortcut": "ERE", - "name": "EtherCore", - "rskip60": false, - "url": "https://ethercore.org", - "blockbook": [] - }, - { - "chain": "clo", - "chain_id": 820, - "slip44": 820, - "shortcut": "CLO", - "name": "Callisto", - "rskip60": false, - "url": "https://callisto.network", - "blockbook": [] - }, - { - "chain": "ath", - "chain_id": 1620, - "slip44": 1620, - "shortcut": "ATH", - "name": "Atheios", - "rskip60": false, - "url": "https://atheios.com", - "blockbook": [] - }, - { - "chain": "egem", - "chain_id": 1987, - "slip44": 1987, - "shortcut": "EGEM", - "name": "EtherGem", - "rskip60": false, - "url": "https://egem.io", - "blockbook": [] - }, - { - "chain": "eosc", - "chain_id": 2018, - "slip44": 2018, - "shortcut": "EOSC", - "name": "EOS Classic", - "rskip60": false, - "url": "https://eos-classic.io", - "blockbook": [] - }, - { - "chain": "reosc", - "chain_id": 2894, - "slip44": 2894, - "shortcut": "REOSC", - "name": "REOSC Ecosystem", - "rskip60": false, - "url": "https://reosc.io", - "blockbook": [] - }, - { - "chain": "esn", - "chain_id": 31102, - "slip44": 31102, - "shortcut": "ESN", - "name": "Ethersocial Network", - "rskip60": false, - "url": "https://ethersocial.org", - "blockbook": [] - }, - { - "chain": "teo", - "chain_id": 33416, - "slip44": 33416, - "shortcut": "TEO", - "name": "Trust ETH reOrigin", - "rskip60": false, - "url": "https://tao.foundation", - "blockbook": [] - }, - { - "chain": "akroma", - "chain_id": 200625, - "slip44": 200625, - "shortcut": "AKA", - "name": "Akroma", - "rskip60": false, - "url": "https://akroma.io", - "blockbook": [] - }, - { - "chain": "artis_sigma1", - "chain_id": 246529, - "slip44": 246529, - "shortcut": "ATS", - "name": "ARTIS sigma1", - "rskip60": false, - "url": "https://artis.eco", - "blockbook": [] - }, - { - "chain": "artis_tau1", - "chain_id": 246785, - "slip44": 1, - "shortcut": "tATS", - "name": "ARTIS tau1", - "rskip60": false, - "url": "https://artis.eco", - "blockbook": [] - }, - { - "chain": "etho", - "chain_id": 1313114, - "slip44": 1313114, - "shortcut": "ETHO", - "name": "Ether-1", - "rskip60": false, - "url": "https://ether1.org", - "blockbook": [] - }, - { - "chain": "music", - "chain_id": 7762959, - "slip44": 184, - "shortcut": "MUSIC", - "name": "Musicoin", - "rskip60": false, - "url": "https://musicoin.org", - "blockbook": [] - }, - { - "chain": "auxi", - "chain_id": 28945486, - "slip44": 344, - "shortcut": "AUX", - "name": "Auxilium", - "rskip60": false, - "url": "https://auxilium.global", - "blockbook": [] - }, - { - "chain": "aqua", - "chain_id": 61717561, - "slip44": 61717561, - "shortcut": "AQUA", - "name": "Aquachain", - "rskip60": false, - "url": "https://aquachain.github.io", - "blockbook": [] - }, - { - "chain": "pirl", - "chain_id": 3125659152, - "slip44": 164, - "shortcut": "PIRL", - "name": "Pirl", - "rskip60": false, - "url": "https://pirl.io", - "blockbook": [] - } -] diff --git a/common/defs/ethereum/pirl.png b/common/defs/ethereum/pirl.png deleted file mode 100644 index 290a94086..000000000 Binary files a/common/defs/ethereum/pirl.png and /dev/null differ diff --git a/common/defs/ethereum/reosc.png b/common/defs/ethereum/reosc.png deleted file mode 100644 index bf1d87d24..000000000 Binary files a/common/defs/ethereum/reosc.png and /dev/null differ diff --git a/common/defs/ethereum/rin.png b/common/defs/ethereum/rin.png deleted file mode 100644 index c5d8de4b6..000000000 Binary files a/common/defs/ethereum/rin.png and /dev/null differ diff --git a/common/defs/ethereum/rop.png b/common/defs/ethereum/rop.png deleted file mode 100644 index c5d8de4b6..000000000 Binary files a/common/defs/ethereum/rop.png and /dev/null differ diff --git a/common/defs/ethereum/rsk.png b/common/defs/ethereum/rsk.png deleted file mode 100644 index 2f186deaa..000000000 Binary files a/common/defs/ethereum/rsk.png and /dev/null differ diff --git a/common/defs/ethereum/teo.png b/common/defs/ethereum/teo.png deleted file mode 100644 index 585f1006b..000000000 Binary files a/common/defs/ethereum/teo.png and /dev/null differ diff --git a/common/defs/ethereum/tetc.png b/common/defs/ethereum/tetc.png deleted file mode 100644 index f561edb72..000000000 Binary files a/common/defs/ethereum/tetc.png and /dev/null differ diff --git a/common/defs/ethereum/trsk.png b/common/defs/ethereum/trsk.png deleted file mode 100644 index d6dee614a..000000000 Binary files a/common/defs/ethereum/trsk.png and /dev/null differ diff --git a/common/defs/ethereum/ubq.png b/common/defs/ethereum/ubq.png deleted file mode 100644 index b2730bcdd..000000000 Binary files a/common/defs/ethereum/ubq.png and /dev/null differ diff --git a/common/tools/coin_info.py b/common/tools/coin_info.py index 811048224..5f3772e2c 100755 --- a/common/tools/coin_info.py +++ b/common/tools/coin_info.py @@ -223,9 +223,34 @@ def _load_btc_coins(): def _load_ethereum_networks(): """Load ethereum networks from `ethereum/networks.json`""" - networks = load_json("ethereum", "networks.json") - for network in networks: - network.update(key="eth:{}".format(network["shortcut"])) + chains_path = DEFS_DIR / "ethereum" / "chains" / "_data" / "chains" + networks = [] + for chain in sorted(chains_path.glob("*.json"), key=lambda x: int(x.stem)): + chain_data = load_json(chain) + shortcut = chain_data["nativeCurrency"]["symbol"] + is_testnet = "testnet" in chain_data["name"].lower() + if is_testnet: + slip44 = 1 + else: + slip44 = chain_data.get("slip44", 60) + + if is_testnet and not shortcut.lower().startswith("t"): + shortcut = "t" + shortcut + + rskip60 = shortcut in ("RBTC", "TRBTC") + + network = dict( + chain=chain_data["shortName"], + chain_id=chain_data["chainId"], + slip44=slip44, + shortcut=shortcut, + name=chain_data["name"], + rskip60=rskip60, + url=chain_data["infoURL"], + key=f"eth:{shortcut}", + ) + networks.append(network) + return networks @@ -517,6 +542,8 @@ def deduplicate_keys(all_coins): for i, coin in enumerate(coins): if is_token(coin): coin["key"] += ":" + coin["address"][2:6].lower() # first 4 hex chars + elif "chain_id" in coin: + coin["key"] += ":" + str(coin["chain_id"]) else: coin["key"] += ":{}".format(i) coin["dup_key_nontoken"] = True diff --git a/common/tools/cointool.py b/common/tools/cointool.py index a2fe27ac9..2b0dcbcdc 100755 --- a/common/tools/cointool.py +++ b/common/tools/cointool.py @@ -186,18 +186,6 @@ def check_eth(coins): chain_name_str = "colliding chain name " + crayon(None, key, bold=True) + ":" print_log(logging.ERROR, chain_name_str, bucket_str) check_passed = False - for coin in coins: - icon_file = coin["chain"] + ".png" - try: - icon = Image.open(os.path.join(coin_info.DEFS_DIR, "ethereum", icon_file)) - except Exception: - print(coin["key"], ": failed to open icon file", icon_file) - check_passed = False - continue - - if icon.size != (128, 128) or icon.mode != "RGBA": - print(coin["key"], ": bad icon format (must be RGBA 128x128)") - check_passed = False return check_passed @@ -334,7 +322,9 @@ def check_dups(buckets, print_at_level=logging.WARNING): nontokens = [ coin for coin in bucket - if coin.get("duplicate") and not coin_info.is_token(coin) + if not coin["unsupported"] + and coin.get("duplicate") + and not coin_info.is_token(coin) ] # we do not count override-marked coins as duplicates here cleared = not any(coin.get("duplicate") for coin in bucket)