feat(common): load Ethereum networks from upstream

pull/1365/head
matejcik 4 years ago committed by Tomas Susanka
parent e72b6abf47
commit 1bade86792

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

@ -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": []
}
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

@ -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

@ -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)

Loading…
Cancel
Save