evmchains 0.0.12__tar.gz → 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {evmchains-0.0.12 → evmchains-0.1.0}/.github/workflows/test.yaml +4 -8
- {evmchains-0.0.12 → evmchains-0.1.0}/PKG-INFO +2 -3
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains/__init__.py +9 -3
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains/_meta.py +2 -2
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains/chains.py +571 -4
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains/types.py +5 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains.egg-info/PKG-INFO +2 -3
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains.egg-info/requires.txt +1 -2
- {evmchains-0.0.12 → evmchains-0.1.0}/pyproject.toml +24 -18
- {evmchains-0.0.12 → evmchains-0.1.0}/scripts/update.py +59 -9
- {evmchains-0.0.12 → evmchains-0.1.0}/setup.py +2 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/.github/workflows/release.yaml +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/.gitignore +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/CONTRIBUTING.md +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/LICENSE +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/README.md +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains/py.typed +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains.egg-info/SOURCES.txt +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains.egg-info/dependency_links.txt +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/evmchains.egg-info/top_level.txt +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/setup.cfg +0 -0
- {evmchains-0.0.12 → evmchains-0.1.0}/tests/test_func.py +0 -0
|
@@ -26,15 +26,11 @@ jobs:
|
|
|
26
26
|
python -m pip install --upgrade pip
|
|
27
27
|
pip install .[dev]
|
|
28
28
|
|
|
29
|
-
- name: Run
|
|
30
|
-
|
|
31
|
-
run: black --diff .
|
|
29
|
+
- name: Run linter
|
|
30
|
+
run: ruff check
|
|
32
31
|
|
|
33
|
-
- name: Run
|
|
34
|
-
run:
|
|
35
|
-
|
|
36
|
-
- name: Run flake8
|
|
37
|
-
run: flake8 .
|
|
32
|
+
- name: Run format check
|
|
33
|
+
run: ruff format --check --diff
|
|
38
34
|
|
|
39
35
|
type-check:
|
|
40
36
|
runs-on: ubuntu-latest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: evmchains
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: Packaged metadata on Ethereum Virtual Machine (EVM) chains
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -227,11 +227,10 @@ Requires-Dist: pydantic<3,>=2.5.3
|
|
|
227
227
|
Provides-Extra: dev
|
|
228
228
|
Requires-Dist: black~=23.12.1; extra == "dev"
|
|
229
229
|
Requires-Dist: build~=1.0.3; extra == "dev"
|
|
230
|
-
Requires-Dist: flake8~=7.0.0; extra == "dev"
|
|
231
|
-
Requires-Dist: isort~=5.13.2; extra == "dev"
|
|
232
230
|
Requires-Dist: mypy~=1.8.0; extra == "dev"
|
|
233
231
|
Requires-Dist: pytest~=7.4.4; extra == "dev"
|
|
234
232
|
Requires-Dist: requests~=2.31.0; extra == "dev"
|
|
233
|
+
Requires-Dist: ruff~=0.6.8; extra == "dev"
|
|
235
234
|
Requires-Dist: setuptools-scm~=8.0.4; extra == "dev"
|
|
236
235
|
Requires-Dist: types-requests>=2.31.0.20240106; extra == "dev"
|
|
237
236
|
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"""EVM-compatible chains metadata.
|
|
2
|
+
|
|
3
|
+
Chain data is organized by Ape-style ecosystem and network and provided by the
|
|
4
|
+
below utility functions.
|
|
5
|
+
"""
|
|
6
|
+
|
|
1
7
|
import os
|
|
2
8
|
import random
|
|
3
9
|
import re
|
|
@@ -10,7 +16,7 @@ ENV_VAR_REGEX = re.compile(r"\$\{([A-Za-z0-9_]+)\}")
|
|
|
10
16
|
|
|
11
17
|
|
|
12
18
|
def get_chain_meta(ecosystem: str, network: str) -> Chain:
|
|
13
|
-
"""Return a Chain instance with metadata for an EVM chain"""
|
|
19
|
+
"""Return a Chain instance with metadata for an EVM chain."""
|
|
14
20
|
if (
|
|
15
21
|
ecosystem not in PUBLIC_CHAIN_META
|
|
16
22
|
or network not in PUBLIC_CHAIN_META[ecosystem]
|
|
@@ -21,7 +27,7 @@ def get_chain_meta(ecosystem: str, network: str) -> Chain:
|
|
|
21
27
|
|
|
22
28
|
|
|
23
29
|
def get_rpcs(ecosystem: str, network: str) -> List[str]:
|
|
24
|
-
"""Get a list of valid RPC endpoints for an ecosystem:network pair"""
|
|
30
|
+
"""Get a list of valid RPC endpoints for an ecosystem:network pair."""
|
|
25
31
|
rpcs = []
|
|
26
32
|
|
|
27
33
|
chain = get_chain_meta(ecosystem, network)
|
|
@@ -42,7 +48,7 @@ def get_rpcs(ecosystem: str, network: str) -> List[str]:
|
|
|
42
48
|
|
|
43
49
|
|
|
44
50
|
def get_random_rpc(ecosystem: str, network: str) -> str:
|
|
45
|
-
"""Return a random RPC endpoint for an ecosystem:network pair"""
|
|
51
|
+
"""Return a random RPC endpoint for an ecosystem:network pair."""
|
|
46
52
|
rpcs = get_rpcs(ecosystem, network)
|
|
47
53
|
return random.choice(rpcs)
|
|
48
54
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"""Constants containing metadata for EVM-comaptitble chains.
|
|
2
|
+
|
|
3
|
+
!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!
|
|
4
|
+
!!!! DO NOT EDIT THIS FILE DIRECTLY! !!!!
|
|
5
|
+
!!!! This file is auto-generated by scripts/update.py !!!!
|
|
6
|
+
!!!! 2024-10-16 17:21:51.952134+00:00 !!!!
|
|
7
|
+
!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!
|
|
8
|
+
"""
|
|
9
|
+
|
|
4
10
|
from typing import Any, Dict
|
|
5
11
|
|
|
6
12
|
PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
@@ -101,6 +107,38 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
101
107
|
"shortName": "arb-sep",
|
|
102
108
|
"slip44": 1,
|
|
103
109
|
},
|
|
110
|
+
"nova": {
|
|
111
|
+
"chain": "ETH",
|
|
112
|
+
"chainId": 42170,
|
|
113
|
+
"ens": None,
|
|
114
|
+
"explorers": [
|
|
115
|
+
{
|
|
116
|
+
"icon": "blockscout",
|
|
117
|
+
"name": "Arbitrum Nova Chain Explorer",
|
|
118
|
+
"standard": "EIP3091",
|
|
119
|
+
"url": "https://nova-explorer.arbitrum.io",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"icon": "dexguru",
|
|
123
|
+
"name": "dexguru",
|
|
124
|
+
"standard": "EIP3091",
|
|
125
|
+
"url": "https://nova.dex.guru",
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
"faucets": [],
|
|
129
|
+
"features": None,
|
|
130
|
+
"icon": None,
|
|
131
|
+
"infoURL": "https://arbitrum.io",
|
|
132
|
+
"name": "Arbitrum Nova",
|
|
133
|
+
"nativeCurrency": {"decimals": 18, "name": "Ether", "symbol": "ETH"},
|
|
134
|
+
"networkId": 42170,
|
|
135
|
+
"rpc": [
|
|
136
|
+
"https://nova.arbitrum.io/rpc",
|
|
137
|
+
"https://arbitrum-nova.publicnode.com",
|
|
138
|
+
],
|
|
139
|
+
"shortName": "arb-nova",
|
|
140
|
+
"slip44": None,
|
|
141
|
+
},
|
|
104
142
|
},
|
|
105
143
|
"avalanche": {
|
|
106
144
|
"mainnet": {
|
|
@@ -285,6 +323,28 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
285
323
|
"shortName": "blastsepolia",
|
|
286
324
|
"slip44": None,
|
|
287
325
|
},
|
|
326
|
+
"testnet": {
|
|
327
|
+
"chain": "ETH",
|
|
328
|
+
"chainId": 23888,
|
|
329
|
+
"ens": None,
|
|
330
|
+
"explorers": [
|
|
331
|
+
{
|
|
332
|
+
"name": "Blast Testnet",
|
|
333
|
+
"standard": "EIP3091",
|
|
334
|
+
"url": "http://testnet-explorer.blastblockchain.com",
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"faucets": [],
|
|
338
|
+
"features": None,
|
|
339
|
+
"icon": "blastIcon",
|
|
340
|
+
"infoURL": "https://docs.blastblockchain.com",
|
|
341
|
+
"name": "Blast Testnet",
|
|
342
|
+
"nativeCurrency": {"decimals": 18, "name": "Ether", "symbol": "ETH"},
|
|
343
|
+
"networkId": 23888,
|
|
344
|
+
"rpc": ["http://testnet-rpc.blastblockchain.com"],
|
|
345
|
+
"shortName": "blastT",
|
|
346
|
+
"slip44": None,
|
|
347
|
+
},
|
|
288
348
|
},
|
|
289
349
|
"bsc": {
|
|
290
350
|
"mainnet": {
|
|
@@ -367,6 +427,174 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
367
427
|
"shortName": "bnbt",
|
|
368
428
|
"slip44": 1,
|
|
369
429
|
},
|
|
430
|
+
"opbnb": {
|
|
431
|
+
"chain": "opBNB",
|
|
432
|
+
"chainId": 204,
|
|
433
|
+
"ens": None,
|
|
434
|
+
"explorers": [
|
|
435
|
+
{
|
|
436
|
+
"name": "opbnbscan",
|
|
437
|
+
"standard": "EIP3091",
|
|
438
|
+
"url": "https://mainnet.opbnbscan.com",
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"faucets": [],
|
|
442
|
+
"features": None,
|
|
443
|
+
"icon": "bnbchain",
|
|
444
|
+
"infoURL": "https://opbnb.bnbchain.org/en",
|
|
445
|
+
"name": "opBNB Mainnet",
|
|
446
|
+
"nativeCurrency": {
|
|
447
|
+
"decimals": 18,
|
|
448
|
+
"name": "BNB Chain Native Token",
|
|
449
|
+
"symbol": "BNB",
|
|
450
|
+
},
|
|
451
|
+
"networkId": 204,
|
|
452
|
+
"rpc": [
|
|
453
|
+
"https://opbnb-mainnet-rpc.bnbchain.org",
|
|
454
|
+
"https://opbnb-mainnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3",
|
|
455
|
+
"https://opbnb-mainnet.nodereal.io/v1/e9a36765eb8a40b9bd12e680a1fd2bc5",
|
|
456
|
+
"https://opbnb-rpc.publicnode.com",
|
|
457
|
+
"https://opbnb.drpc.org",
|
|
458
|
+
],
|
|
459
|
+
"shortName": "obnb",
|
|
460
|
+
"slip44": 714,
|
|
461
|
+
},
|
|
462
|
+
"opbnb-testnet": {
|
|
463
|
+
"chain": "opBNB",
|
|
464
|
+
"chainId": 5611,
|
|
465
|
+
"ens": None,
|
|
466
|
+
"explorers": [
|
|
467
|
+
{
|
|
468
|
+
"name": "bscscan-opbnb-testnet",
|
|
469
|
+
"standard": "EIP3091",
|
|
470
|
+
"url": "https://opbnb-testnet.bscscan.com",
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "opbnbscan",
|
|
474
|
+
"standard": "EIP3091",
|
|
475
|
+
"url": "https://opbnbscan.com",
|
|
476
|
+
},
|
|
477
|
+
],
|
|
478
|
+
"faucets": ["https://testnet.bnbchain.org/faucet-smart"],
|
|
479
|
+
"features": None,
|
|
480
|
+
"icon": "bnbchain",
|
|
481
|
+
"infoURL": "https://opbnb.bnbchain.org/en",
|
|
482
|
+
"name": "opBNB Testnet",
|
|
483
|
+
"nativeCurrency": {
|
|
484
|
+
"decimals": 18,
|
|
485
|
+
"name": "BNB Chain Native Token",
|
|
486
|
+
"symbol": "tBNB",
|
|
487
|
+
},
|
|
488
|
+
"networkId": 5611,
|
|
489
|
+
"rpc": [
|
|
490
|
+
"https://opbnb-testnet-rpc.bnbchain.org",
|
|
491
|
+
"https://opbnb-testnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3",
|
|
492
|
+
"https://opbnb-testnet.nodereal.io/v1/e9a36765eb8a40b9bd12e680a1fd2bc5",
|
|
493
|
+
"https://opbnb-testnet-rpc.publicnode.com",
|
|
494
|
+
],
|
|
495
|
+
"shortName": "obnbt",
|
|
496
|
+
"slip44": 1,
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
"bttc": {
|
|
500
|
+
"mainnet": {
|
|
501
|
+
"chain": "BTTC",
|
|
502
|
+
"chainId": 199,
|
|
503
|
+
"ens": None,
|
|
504
|
+
"explorers": [
|
|
505
|
+
{
|
|
506
|
+
"name": "BitTorrent Chain Explorer",
|
|
507
|
+
"standard": "EIP3091",
|
|
508
|
+
"url": "https://bttcscan.com",
|
|
509
|
+
}
|
|
510
|
+
],
|
|
511
|
+
"faucets": [],
|
|
512
|
+
"features": None,
|
|
513
|
+
"icon": None,
|
|
514
|
+
"infoURL": "https://bt.io",
|
|
515
|
+
"name": "BitTorrent Chain Mainnet",
|
|
516
|
+
"nativeCurrency": {"decimals": 18, "name": "BitTorrent", "symbol": "BTT"},
|
|
517
|
+
"networkId": 199,
|
|
518
|
+
"rpc": ["https://rpc.bt.io", "https://bittorrent.drpc.org"],
|
|
519
|
+
"shortName": "BTT",
|
|
520
|
+
"slip44": None,
|
|
521
|
+
},
|
|
522
|
+
"donau": {
|
|
523
|
+
"chain": "BTTC",
|
|
524
|
+
"chainId": 1028,
|
|
525
|
+
"ens": None,
|
|
526
|
+
"explorers": [
|
|
527
|
+
{
|
|
528
|
+
"name": "testbttcscan",
|
|
529
|
+
"standard": "none",
|
|
530
|
+
"url": "https://testscan.bittorrentchain.io",
|
|
531
|
+
}
|
|
532
|
+
],
|
|
533
|
+
"faucets": [],
|
|
534
|
+
"features": None,
|
|
535
|
+
"icon": None,
|
|
536
|
+
"infoURL": "https://bittorrentchain.io/",
|
|
537
|
+
"name": "BitTorrent Chain Testnet",
|
|
538
|
+
"nativeCurrency": {"decimals": 18, "name": "BitTorrent", "symbol": "BTT"},
|
|
539
|
+
"networkId": 1028,
|
|
540
|
+
"rpc": ["https://testrpc.bittorrentchain.io/"],
|
|
541
|
+
"shortName": "tbtt",
|
|
542
|
+
"slip44": 1,
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
"celo": {
|
|
546
|
+
"mainnet": {
|
|
547
|
+
"chain": "CELO",
|
|
548
|
+
"chainId": 42220,
|
|
549
|
+
"ens": None,
|
|
550
|
+
"explorers": [
|
|
551
|
+
{
|
|
552
|
+
"name": "Celoscan",
|
|
553
|
+
"standard": "EIP3091",
|
|
554
|
+
"url": "https://celoscan.io",
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"name": "blockscout",
|
|
558
|
+
"standard": "none",
|
|
559
|
+
"url": "https://explorer.celo.org",
|
|
560
|
+
},
|
|
561
|
+
],
|
|
562
|
+
"faucets": [],
|
|
563
|
+
"features": None,
|
|
564
|
+
"icon": None,
|
|
565
|
+
"infoURL": "https://docs.celo.org/",
|
|
566
|
+
"name": "Celo Mainnet",
|
|
567
|
+
"nativeCurrency": {"decimals": 18, "name": "CELO", "symbol": "CELO"},
|
|
568
|
+
"networkId": 42220,
|
|
569
|
+
"rpc": ["https://forno.celo.org"],
|
|
570
|
+
"shortName": "celo",
|
|
571
|
+
"slip44": None,
|
|
572
|
+
},
|
|
573
|
+
"alfajores": {
|
|
574
|
+
"chain": "CELO",
|
|
575
|
+
"chainId": 44787,
|
|
576
|
+
"ens": None,
|
|
577
|
+
"explorers": [
|
|
578
|
+
{
|
|
579
|
+
"name": "Alfajoresscan",
|
|
580
|
+
"standard": "EIP3091",
|
|
581
|
+
"url": "https://alfajores.celoscan.io",
|
|
582
|
+
}
|
|
583
|
+
],
|
|
584
|
+
"faucets": [
|
|
585
|
+
"https://celo.org/developers/faucet",
|
|
586
|
+
"https://cauldron.pretoriaresearchlab.io/alfajores-faucet",
|
|
587
|
+
],
|
|
588
|
+
"features": None,
|
|
589
|
+
"icon": None,
|
|
590
|
+
"infoURL": "https://docs.celo.org/",
|
|
591
|
+
"name": "Celo Alfajores Testnet",
|
|
592
|
+
"nativeCurrency": {"decimals": 18, "name": "CELO", "symbol": "CELO"},
|
|
593
|
+
"networkId": 44787,
|
|
594
|
+
"rpc": ["https://alfajores-forno.celo-testnet.org"],
|
|
595
|
+
"shortName": "ALFA",
|
|
596
|
+
"slip44": 1,
|
|
597
|
+
},
|
|
370
598
|
},
|
|
371
599
|
"ethereum": {
|
|
372
600
|
"mainnet": {
|
|
@@ -600,6 +828,60 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
600
828
|
"slip44": 1,
|
|
601
829
|
},
|
|
602
830
|
},
|
|
831
|
+
"fraxtal": {
|
|
832
|
+
"mainnet": {
|
|
833
|
+
"chain": "FRAX",
|
|
834
|
+
"chainId": 252,
|
|
835
|
+
"ens": None,
|
|
836
|
+
"explorers": [
|
|
837
|
+
{
|
|
838
|
+
"name": "fraxscan",
|
|
839
|
+
"standard": "EIP3091",
|
|
840
|
+
"url": "https://fraxscan.com",
|
|
841
|
+
}
|
|
842
|
+
],
|
|
843
|
+
"faucets": [],
|
|
844
|
+
"features": None,
|
|
845
|
+
"icon": "fraxtal",
|
|
846
|
+
"infoURL": "https://mainnet.frax.com",
|
|
847
|
+
"name": "Fraxtal",
|
|
848
|
+
"nativeCurrency": {
|
|
849
|
+
"decimals": 18,
|
|
850
|
+
"name": "Frax Ether",
|
|
851
|
+
"symbol": "frxETH",
|
|
852
|
+
},
|
|
853
|
+
"networkId": 252,
|
|
854
|
+
"rpc": ["https://rpc.frax.com"],
|
|
855
|
+
"shortName": "fraxtal",
|
|
856
|
+
"slip44": None,
|
|
857
|
+
},
|
|
858
|
+
"holesky": {
|
|
859
|
+
"chain": "FRAX",
|
|
860
|
+
"chainId": 2522,
|
|
861
|
+
"ens": None,
|
|
862
|
+
"explorers": [
|
|
863
|
+
{
|
|
864
|
+
"name": "fraxscan",
|
|
865
|
+
"standard": "EIP3091",
|
|
866
|
+
"url": "https://holesky.fraxscan.com",
|
|
867
|
+
}
|
|
868
|
+
],
|
|
869
|
+
"faucets": [],
|
|
870
|
+
"features": None,
|
|
871
|
+
"icon": "fraxtal",
|
|
872
|
+
"infoURL": "https://testnet.frax.com",
|
|
873
|
+
"name": "Fraxtal Testnet",
|
|
874
|
+
"nativeCurrency": {
|
|
875
|
+
"decimals": 18,
|
|
876
|
+
"name": "Frax Ether",
|
|
877
|
+
"symbol": "frxETH",
|
|
878
|
+
},
|
|
879
|
+
"networkId": 2522,
|
|
880
|
+
"rpc": ["https://rpc.testnet.frax.com"],
|
|
881
|
+
"shortName": "fraxtal-testnet",
|
|
882
|
+
"slip44": 1,
|
|
883
|
+
},
|
|
884
|
+
},
|
|
603
885
|
"gnosis": {
|
|
604
886
|
"mainnet": {
|
|
605
887
|
"chain": "GNO",
|
|
@@ -651,6 +933,58 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
651
933
|
"slip44": 700,
|
|
652
934
|
},
|
|
653
935
|
},
|
|
936
|
+
"kroma": {
|
|
937
|
+
"mainnet": {
|
|
938
|
+
"chain": "ETH",
|
|
939
|
+
"chainId": 255,
|
|
940
|
+
"ens": None,
|
|
941
|
+
"explorers": [
|
|
942
|
+
{
|
|
943
|
+
"icon": "blockscout",
|
|
944
|
+
"name": "blockscout",
|
|
945
|
+
"standard": "EIP3091",
|
|
946
|
+
"url": "https://blockscout.kroma.network",
|
|
947
|
+
}
|
|
948
|
+
],
|
|
949
|
+
"faucets": [],
|
|
950
|
+
"features": None,
|
|
951
|
+
"icon": "kroma",
|
|
952
|
+
"infoURL": "https://kroma.network",
|
|
953
|
+
"name": "Kroma",
|
|
954
|
+
"nativeCurrency": {"decimals": 18, "name": "Ether", "symbol": "ETH"},
|
|
955
|
+
"networkId": 255,
|
|
956
|
+
"rpc": ["https://api.kroma.network", "https://rpc-kroma.rockx.com"],
|
|
957
|
+
"shortName": "kroma",
|
|
958
|
+
"slip44": None,
|
|
959
|
+
},
|
|
960
|
+
"sepolia": {
|
|
961
|
+
"chain": "ETH",
|
|
962
|
+
"chainId": 2358,
|
|
963
|
+
"ens": None,
|
|
964
|
+
"explorers": [
|
|
965
|
+
{
|
|
966
|
+
"icon": "kroma",
|
|
967
|
+
"name": "blockscout",
|
|
968
|
+
"standard": "EIP3091",
|
|
969
|
+
"url": "https://blockscout.sepolia.kroma.network",
|
|
970
|
+
}
|
|
971
|
+
],
|
|
972
|
+
"faucets": [],
|
|
973
|
+
"features": None,
|
|
974
|
+
"icon": "kroma",
|
|
975
|
+
"infoURL": "https://kroma.network",
|
|
976
|
+
"name": "Kroma Sepolia",
|
|
977
|
+
"nativeCurrency": {
|
|
978
|
+
"decimals": 18,
|
|
979
|
+
"name": "Sepolia Ether",
|
|
980
|
+
"symbol": "ETH",
|
|
981
|
+
},
|
|
982
|
+
"networkId": 2358,
|
|
983
|
+
"rpc": ["https://api.sepolia.kroma.network"],
|
|
984
|
+
"shortName": "kroma-sepolia",
|
|
985
|
+
"slip44": 1,
|
|
986
|
+
},
|
|
987
|
+
},
|
|
654
988
|
"linea": {
|
|
655
989
|
"mainnet": {
|
|
656
990
|
"chain": "ETH",
|
|
@@ -686,6 +1020,7 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
686
1020
|
"rpc": [
|
|
687
1021
|
"https://rpc.linea.build",
|
|
688
1022
|
"https://linea-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
|
1023
|
+
"https://linea-rpc.publicnode.com",
|
|
689
1024
|
],
|
|
690
1025
|
"shortName": "linea",
|
|
691
1026
|
"slip44": None,
|
|
@@ -718,11 +1053,103 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
718
1053
|
"rpc": [
|
|
719
1054
|
"https://rpc.sepolia.linea.build",
|
|
720
1055
|
"https://linea-sepolia.infura.io/v3/${INFURA_API_KEY}",
|
|
1056
|
+
"https://linea-sepolia-rpc.publicnode.com",
|
|
721
1057
|
],
|
|
722
1058
|
"shortName": "linea-sepolia",
|
|
723
1059
|
"slip44": 1,
|
|
724
1060
|
},
|
|
725
1061
|
},
|
|
1062
|
+
"moonbeam": {
|
|
1063
|
+
"mainnet": {
|
|
1064
|
+
"chain": "MOON",
|
|
1065
|
+
"chainId": 1284,
|
|
1066
|
+
"ens": None,
|
|
1067
|
+
"explorers": [
|
|
1068
|
+
{
|
|
1069
|
+
"name": "moonscan",
|
|
1070
|
+
"standard": "none",
|
|
1071
|
+
"url": "https://moonbeam.moonscan.io",
|
|
1072
|
+
}
|
|
1073
|
+
],
|
|
1074
|
+
"faucets": [],
|
|
1075
|
+
"features": None,
|
|
1076
|
+
"icon": None,
|
|
1077
|
+
"infoURL": "https://moonbeam.network/networks/moonbeam/",
|
|
1078
|
+
"name": "Moonbeam",
|
|
1079
|
+
"nativeCurrency": {"decimals": 18, "name": "Glimmer", "symbol": "GLMR"},
|
|
1080
|
+
"networkId": 1284,
|
|
1081
|
+
"rpc": [
|
|
1082
|
+
"https://rpc.api.moonbeam.network",
|
|
1083
|
+
"https://moonbeam.public.blastapi.io",
|
|
1084
|
+
"https://moonbeam-rpc.dwellir.com",
|
|
1085
|
+
"https://moonbeam.api.onfinality.io/public",
|
|
1086
|
+
"https://moonbeam.unitedbloc.com",
|
|
1087
|
+
"https://moonbeam-rpc.publicnode.com",
|
|
1088
|
+
"https://moonbeam.drpc.org",
|
|
1089
|
+
],
|
|
1090
|
+
"shortName": "mbeam",
|
|
1091
|
+
"slip44": None,
|
|
1092
|
+
},
|
|
1093
|
+
"moonbase": {
|
|
1094
|
+
"chain": "MOON",
|
|
1095
|
+
"chainId": 1287,
|
|
1096
|
+
"ens": None,
|
|
1097
|
+
"explorers": [
|
|
1098
|
+
{
|
|
1099
|
+
"name": "moonscan",
|
|
1100
|
+
"standard": "none",
|
|
1101
|
+
"url": "https://moonbase.moonscan.io",
|
|
1102
|
+
}
|
|
1103
|
+
],
|
|
1104
|
+
"faucets": [],
|
|
1105
|
+
"features": None,
|
|
1106
|
+
"icon": None,
|
|
1107
|
+
"infoURL": "https://docs.moonbeam.network/learn/platform/networks/moonbase/",
|
|
1108
|
+
"name": "Moonbase Alpha",
|
|
1109
|
+
"nativeCurrency": {"decimals": 18, "name": "Dev", "symbol": "DEV"},
|
|
1110
|
+
"networkId": 1287,
|
|
1111
|
+
"rpc": [
|
|
1112
|
+
"https://rpc.api.moonbase.moonbeam.network",
|
|
1113
|
+
"https://moonbase-alpha.public.blastapi.io",
|
|
1114
|
+
"https://moonbase-rpc.dwellir.com",
|
|
1115
|
+
"https://moonbeam-alpha.api.onfinality.io/public",
|
|
1116
|
+
"https://moonbase.unitedbloc.com",
|
|
1117
|
+
"https://moonbase-alpha.drpc.org",
|
|
1118
|
+
],
|
|
1119
|
+
"shortName": "mbase",
|
|
1120
|
+
"slip44": 1,
|
|
1121
|
+
},
|
|
1122
|
+
"moonriver": {
|
|
1123
|
+
"chain": "MOON",
|
|
1124
|
+
"chainId": 1285,
|
|
1125
|
+
"ens": None,
|
|
1126
|
+
"explorers": [
|
|
1127
|
+
{
|
|
1128
|
+
"name": "moonscan",
|
|
1129
|
+
"standard": "none",
|
|
1130
|
+
"url": "https://moonriver.moonscan.io",
|
|
1131
|
+
}
|
|
1132
|
+
],
|
|
1133
|
+
"faucets": [],
|
|
1134
|
+
"features": None,
|
|
1135
|
+
"icon": None,
|
|
1136
|
+
"infoURL": "https://moonbeam.network/networks/moonriver/",
|
|
1137
|
+
"name": "Moonriver",
|
|
1138
|
+
"nativeCurrency": {"decimals": 18, "name": "Moonriver", "symbol": "MOVR"},
|
|
1139
|
+
"networkId": 1285,
|
|
1140
|
+
"rpc": [
|
|
1141
|
+
"https://rpc.api.moonriver.moonbeam.network",
|
|
1142
|
+
"https://moonriver.public.blastapi.io",
|
|
1143
|
+
"https://moonriver-rpc.dwellir.com",
|
|
1144
|
+
"https://moonriver.api.onfinality.io/public",
|
|
1145
|
+
"https://moonriver.unitedbloc.com",
|
|
1146
|
+
"https://moonriver-rpc.publicnode.com",
|
|
1147
|
+
"https://moonriver.drpc.org",
|
|
1148
|
+
],
|
|
1149
|
+
"shortName": "mriver",
|
|
1150
|
+
"slip44": None,
|
|
1151
|
+
},
|
|
1152
|
+
},
|
|
726
1153
|
"optimism": {
|
|
727
1154
|
"mainnet": {
|
|
728
1155
|
"chain": "ETH",
|
|
@@ -948,7 +1375,7 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
948
1375
|
"icon": "polygon",
|
|
949
1376
|
"infoURL": "https://polygon.technology/",
|
|
950
1377
|
"name": "Amoy",
|
|
951
|
-
"nativeCurrency": {"decimals": 18, "name": "
|
|
1378
|
+
"nativeCurrency": {"decimals": 18, "name": "POL", "symbol": "POL"},
|
|
952
1379
|
"networkId": 80002,
|
|
953
1380
|
"rpc": [
|
|
954
1381
|
"https://rpc-amoy.polygon.technology",
|
|
@@ -1143,4 +1570,144 @@ PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {
|
|
|
1143
1570
|
"slip44": None,
|
|
1144
1571
|
},
|
|
1145
1572
|
},
|
|
1573
|
+
"scroll": {
|
|
1574
|
+
"mainnet": {
|
|
1575
|
+
"chain": "ETH",
|
|
1576
|
+
"chainId": 534352,
|
|
1577
|
+
"ens": None,
|
|
1578
|
+
"explorers": [
|
|
1579
|
+
{
|
|
1580
|
+
"name": "Scrollscan",
|
|
1581
|
+
"standard": "EIP3091",
|
|
1582
|
+
"url": "https://scrollscan.com",
|
|
1583
|
+
}
|
|
1584
|
+
],
|
|
1585
|
+
"faucets": [],
|
|
1586
|
+
"features": None,
|
|
1587
|
+
"icon": None,
|
|
1588
|
+
"infoURL": "https://scroll.io",
|
|
1589
|
+
"name": "Scroll",
|
|
1590
|
+
"nativeCurrency": {"decimals": 18, "name": "Ether", "symbol": "ETH"},
|
|
1591
|
+
"networkId": 534352,
|
|
1592
|
+
"rpc": [
|
|
1593
|
+
"https://rpc.scroll.io",
|
|
1594
|
+
"https://rpc.ankr.com/scroll",
|
|
1595
|
+
"https://scroll-mainnet.chainstacklabs.com",
|
|
1596
|
+
"https://scroll-rpc.publicnode.com",
|
|
1597
|
+
],
|
|
1598
|
+
"shortName": "scr",
|
|
1599
|
+
"slip44": None,
|
|
1600
|
+
},
|
|
1601
|
+
"sepolia": {
|
|
1602
|
+
"chain": "ETH",
|
|
1603
|
+
"chainId": 534351,
|
|
1604
|
+
"ens": None,
|
|
1605
|
+
"explorers": [
|
|
1606
|
+
{
|
|
1607
|
+
"name": "Scroll Sepolia Etherscan",
|
|
1608
|
+
"standard": "EIP3091",
|
|
1609
|
+
"url": "https://sepolia.scrollscan.com",
|
|
1610
|
+
}
|
|
1611
|
+
],
|
|
1612
|
+
"faucets": [],
|
|
1613
|
+
"features": None,
|
|
1614
|
+
"icon": None,
|
|
1615
|
+
"infoURL": "https://scroll.io",
|
|
1616
|
+
"name": "Scroll Sepolia Testnet",
|
|
1617
|
+
"nativeCurrency": {"decimals": 18, "name": "Ether", "symbol": "ETH"},
|
|
1618
|
+
"networkId": 534351,
|
|
1619
|
+
"rpc": [
|
|
1620
|
+
"https://sepolia-rpc.scroll.io",
|
|
1621
|
+
"https://rpc.ankr.com/scroll_sepolia_testnet",
|
|
1622
|
+
"https://scroll-sepolia.chainstacklabs.com",
|
|
1623
|
+
"https://scroll-testnet-public.unifra.io",
|
|
1624
|
+
"https://scroll-sepolia-rpc.publicnode.com",
|
|
1625
|
+
],
|
|
1626
|
+
"shortName": "scr-sepolia",
|
|
1627
|
+
"slip44": 1,
|
|
1628
|
+
},
|
|
1629
|
+
},
|
|
1630
|
+
"unichain": {
|
|
1631
|
+
"sepolia": {
|
|
1632
|
+
"chain": "ETH",
|
|
1633
|
+
"chainId": 1301,
|
|
1634
|
+
"ens": None,
|
|
1635
|
+
"explorers": [
|
|
1636
|
+
{
|
|
1637
|
+
"name": "Unichain Sepolia Testnet Explorer",
|
|
1638
|
+
"standard": "EIP3091",
|
|
1639
|
+
"url": "https://unichain-sepolia.blockscout.com",
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
"name": "Unichain Sepolia Testnet Explorer",
|
|
1643
|
+
"standard": "EIP3091",
|
|
1644
|
+
"url": "https://sepolia.uniscan.xyz",
|
|
1645
|
+
},
|
|
1646
|
+
],
|
|
1647
|
+
"faucets": [],
|
|
1648
|
+
"features": None,
|
|
1649
|
+
"icon": None,
|
|
1650
|
+
"infoURL": "https://unichain.org",
|
|
1651
|
+
"name": "Unichain Sepolia Testnet",
|
|
1652
|
+
"nativeCurrency": {
|
|
1653
|
+
"decimals": 18,
|
|
1654
|
+
"name": "Sepolia Ether",
|
|
1655
|
+
"symbol": "ETH",
|
|
1656
|
+
},
|
|
1657
|
+
"networkId": 1301,
|
|
1658
|
+
"rpc": ["https://sepolia.unichain.org"],
|
|
1659
|
+
"shortName": "unichain-sep",
|
|
1660
|
+
"slip44": None,
|
|
1661
|
+
},
|
|
1662
|
+
},
|
|
1663
|
+
"wemix": {
|
|
1664
|
+
"mainnet": {
|
|
1665
|
+
"chain": "WEMIX",
|
|
1666
|
+
"chainId": 1111,
|
|
1667
|
+
"ens": None,
|
|
1668
|
+
"explorers": [
|
|
1669
|
+
{
|
|
1670
|
+
"name": "WEMIX Block Explorer",
|
|
1671
|
+
"standard": "EIP3091",
|
|
1672
|
+
"url": "https://explorer.wemix.com",
|
|
1673
|
+
}
|
|
1674
|
+
],
|
|
1675
|
+
"faucets": [],
|
|
1676
|
+
"features": None,
|
|
1677
|
+
"icon": None,
|
|
1678
|
+
"infoURL": "https://wemix.com",
|
|
1679
|
+
"name": "WEMIX3.0 Mainnet",
|
|
1680
|
+
"nativeCurrency": {"decimals": 18, "name": "WEMIX", "symbol": "WEMIX"},
|
|
1681
|
+
"networkId": 1111,
|
|
1682
|
+
"rpc": ["https://api.wemix.com"],
|
|
1683
|
+
"shortName": "wemix",
|
|
1684
|
+
"slip44": None,
|
|
1685
|
+
},
|
|
1686
|
+
"testnet": {
|
|
1687
|
+
"chain": "TWEMIX",
|
|
1688
|
+
"chainId": 1112,
|
|
1689
|
+
"ens": None,
|
|
1690
|
+
"explorers": [
|
|
1691
|
+
{
|
|
1692
|
+
"name": "WEMIX Testnet Microscope",
|
|
1693
|
+
"standard": "EIP3091",
|
|
1694
|
+
"url": "https://microscope.test.wemix.com",
|
|
1695
|
+
}
|
|
1696
|
+
],
|
|
1697
|
+
"faucets": ["https://wallet.test.wemix.com/faucet"],
|
|
1698
|
+
"features": None,
|
|
1699
|
+
"icon": None,
|
|
1700
|
+
"infoURL": "https://wemix.com",
|
|
1701
|
+
"name": "WEMIX3.0 Testnet",
|
|
1702
|
+
"nativeCurrency": {
|
|
1703
|
+
"decimals": 18,
|
|
1704
|
+
"name": "TestnetWEMIX",
|
|
1705
|
+
"symbol": "tWEMIX",
|
|
1706
|
+
},
|
|
1707
|
+
"networkId": 1112,
|
|
1708
|
+
"rpc": ["https://api.test.wemix.com"],
|
|
1709
|
+
"shortName": "twemix",
|
|
1710
|
+
"slip44": 1,
|
|
1711
|
+
},
|
|
1712
|
+
},
|
|
1146
1713
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
"""Types used in the evmchains package."""
|
|
2
|
+
|
|
3
|
+
# ruff: noqa: N815
|
|
1
4
|
from typing import Any, Dict, List, Optional
|
|
2
5
|
|
|
3
6
|
from pydantic import BaseModel
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
class Chain(BaseModel):
|
|
10
|
+
"""Chain object format for chain data from ethereum-lists/chains."""
|
|
11
|
+
|
|
7
12
|
chainId: int
|
|
8
13
|
networkId: int
|
|
9
14
|
name: str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: evmchains
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: Packaged metadata on Ethereum Virtual Machine (EVM) chains
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -227,11 +227,10 @@ Requires-Dist: pydantic<3,>=2.5.3
|
|
|
227
227
|
Provides-Extra: dev
|
|
228
228
|
Requires-Dist: black~=23.12.1; extra == "dev"
|
|
229
229
|
Requires-Dist: build~=1.0.3; extra == "dev"
|
|
230
|
-
Requires-Dist: flake8~=7.0.0; extra == "dev"
|
|
231
|
-
Requires-Dist: isort~=5.13.2; extra == "dev"
|
|
232
230
|
Requires-Dist: mypy~=1.8.0; extra == "dev"
|
|
233
231
|
Requires-Dist: pytest~=7.4.4; extra == "dev"
|
|
234
232
|
Requires-Dist: requests~=2.31.0; extra == "dev"
|
|
233
|
+
Requires-Dist: ruff~=0.6.8; extra == "dev"
|
|
235
234
|
Requires-Dist: setuptools-scm~=8.0.4; extra == "dev"
|
|
236
235
|
Requires-Dist: types-requests>=2.31.0.20240106; extra == "dev"
|
|
237
236
|
|
|
@@ -33,13 +33,13 @@ dynamic = ["version"]
|
|
|
33
33
|
|
|
34
34
|
[project.optional-dependencies]
|
|
35
35
|
dev = [
|
|
36
|
+
# NOTE: black still used as a library in update.py
|
|
36
37
|
"black~=23.12.1",
|
|
37
38
|
"build~=1.0.3",
|
|
38
|
-
"flake8~=7.0.0",
|
|
39
|
-
"isort~=5.13.2",
|
|
40
39
|
"mypy~=1.8.0",
|
|
41
40
|
"pytest~=7.4.4",
|
|
42
41
|
"requests~=2.31.0",
|
|
42
|
+
"ruff~=0.6.8",
|
|
43
43
|
"setuptools-scm~=8.0.4",
|
|
44
44
|
"types-requests>=2.31.0.20240106",
|
|
45
45
|
]
|
|
@@ -47,25 +47,31 @@ dev = [
|
|
|
47
47
|
[tool.mypy]
|
|
48
48
|
exclude = "build/"
|
|
49
49
|
|
|
50
|
-
[tool.
|
|
51
|
-
|
|
50
|
+
[tool.ruff]
|
|
51
|
+
# Mimic's black's default line length
|
|
52
|
+
line-length = 88
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
#
|
|
55
|
-
|
|
56
|
-
#
|
|
54
|
+
[tool.ruff.lint]
|
|
55
|
+
# Ref: https://docs.astral.sh/ruff/rules
|
|
56
|
+
extend-select = [
|
|
57
|
+
"D", # pydocstyle
|
|
58
|
+
"E501", # Line length
|
|
59
|
+
"I", # isort
|
|
60
|
+
"N", # PEP8 naming
|
|
61
|
+
"UP", # pyupgrade
|
|
62
|
+
"RUF", # ruf-specific rules
|
|
63
|
+
"W", # warnings
|
|
64
|
+
]
|
|
57
65
|
|
|
58
|
-
[tool.
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
[tool.ruff.lint.per-file-ignores]
|
|
67
|
+
"tests/test_*.py" = ["D"]
|
|
68
|
+
|
|
69
|
+
[tool.ruff.lint.pydocstyle]
|
|
70
|
+
convention = "google"
|
|
71
|
+
|
|
72
|
+
[tool.setuptools_scm]
|
|
73
|
+
write_to = "evmchains/_meta.py"
|
|
61
74
|
|
|
62
75
|
[tool.pytest.ini_options]
|
|
63
76
|
python_files = "test_*.py"
|
|
64
77
|
testpaths = "tests"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[tool.isort]
|
|
68
|
-
force_grid_wrap = 0
|
|
69
|
-
include_trailing_comma = true
|
|
70
|
-
multi_line_output = 3
|
|
71
|
-
use_parentheses = true
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
"""Script updates chains.py constants file with up to date data.
|
|
2
|
+
|
|
3
|
+
To add new chains to this module, update CHAIN_IDS below and re-run the script. See
|
|
4
|
+
README.md for more details.
|
|
5
|
+
"""
|
|
6
|
+
|
|
1
7
|
import logging
|
|
2
|
-
from datetime import datetime
|
|
8
|
+
from datetime import datetime, timezone
|
|
3
9
|
from pathlib import Path
|
|
4
10
|
from pprint import PrettyPrinter
|
|
5
11
|
from typing import Any, Dict
|
|
@@ -22,12 +28,14 @@ BLACKLIST_STRINGS = [
|
|
|
22
28
|
"rpc-sepolia.rockx.com",
|
|
23
29
|
]
|
|
24
30
|
|
|
25
|
-
# Mapping of Ape ecosystem:network to chain IDs. These are the chains that we will be
|
|
31
|
+
# Mapping of Ape ecosystem:network to chain IDs. These are the chains that we will be
|
|
32
|
+
# fetching.
|
|
26
33
|
CHAIN_IDS = {
|
|
27
34
|
"arbitrum": {
|
|
28
35
|
"mainnet": 42161,
|
|
29
36
|
"goerli": 421613,
|
|
30
37
|
"sepolia": 421614,
|
|
38
|
+
"nova": 42170,
|
|
31
39
|
},
|
|
32
40
|
"avalanche": {
|
|
33
41
|
"mainnet": 43114,
|
|
@@ -40,10 +48,21 @@ CHAIN_IDS = {
|
|
|
40
48
|
"blast": {
|
|
41
49
|
"mainnet": 81457,
|
|
42
50
|
"sepolia": 168587773,
|
|
51
|
+
"testnet": 23888,
|
|
43
52
|
},
|
|
44
53
|
"bsc": {
|
|
45
54
|
"mainnet": 56,
|
|
46
55
|
"testnet": 97,
|
|
56
|
+
"opbnb": 204,
|
|
57
|
+
"opbnb-testnet": 5611,
|
|
58
|
+
},
|
|
59
|
+
"bttc": {
|
|
60
|
+
"mainnet": 199,
|
|
61
|
+
"donau": 1028,
|
|
62
|
+
},
|
|
63
|
+
"celo": {
|
|
64
|
+
"mainnet": 42220,
|
|
65
|
+
"alfajores": 44787,
|
|
47
66
|
},
|
|
48
67
|
"ethereum": {
|
|
49
68
|
"mainnet": 1,
|
|
@@ -55,13 +74,26 @@ CHAIN_IDS = {
|
|
|
55
74
|
"mainnet": 250,
|
|
56
75
|
"testnet": 4002,
|
|
57
76
|
},
|
|
77
|
+
"fraxtal": {
|
|
78
|
+
"mainnet": 252,
|
|
79
|
+
"holesky": 2522,
|
|
80
|
+
},
|
|
58
81
|
"gnosis": {
|
|
59
82
|
"mainnet": 100,
|
|
60
83
|
},
|
|
84
|
+
"kroma": {
|
|
85
|
+
"mainnet": 255,
|
|
86
|
+
"sepolia": 2358,
|
|
87
|
+
},
|
|
61
88
|
"linea": {
|
|
62
89
|
"mainnet": 59144,
|
|
63
90
|
"sepolia": 59141,
|
|
64
91
|
},
|
|
92
|
+
"moonbeam": {
|
|
93
|
+
"mainnet": 1284,
|
|
94
|
+
"moonbase": 1287,
|
|
95
|
+
"moonriver": 1285,
|
|
96
|
+
},
|
|
65
97
|
"optimism": {
|
|
66
98
|
"mainnet": 10,
|
|
67
99
|
"goerli": 420,
|
|
@@ -88,7 +120,18 @@ CHAIN_IDS = {
|
|
|
88
120
|
"shibarium": {
|
|
89
121
|
"mainnet": 109,
|
|
90
122
|
"puppynet": 157,
|
|
91
|
-
}
|
|
123
|
+
},
|
|
124
|
+
"scroll": {
|
|
125
|
+
"mainnet": 534352,
|
|
126
|
+
"sepolia": 534351,
|
|
127
|
+
},
|
|
128
|
+
"unichain": {
|
|
129
|
+
"sepolia": 1301,
|
|
130
|
+
},
|
|
131
|
+
"wemix": {
|
|
132
|
+
"mainnet": 1111,
|
|
133
|
+
"testnet": 1112,
|
|
134
|
+
},
|
|
92
135
|
}
|
|
93
136
|
|
|
94
137
|
pp = PrettyPrinter(indent=4)
|
|
@@ -97,11 +140,12 @@ logger.setLevel(logging.DEBUG)
|
|
|
97
140
|
|
|
98
141
|
|
|
99
142
|
def stamp() -> str:
|
|
100
|
-
"""UTC timestamp for file header"""
|
|
101
|
-
return str(datetime.
|
|
143
|
+
"""UTC timestamp for file header."""
|
|
144
|
+
return str(datetime.now(tz=timezone.utc))
|
|
102
145
|
|
|
103
146
|
|
|
104
147
|
def ensure_dict(d: Dict[str, Any], key: str):
|
|
148
|
+
"""Ensures a dict value at key."""
|
|
105
149
|
if key in d and isinstance(d[key], dict):
|
|
106
150
|
return
|
|
107
151
|
d[key] = dict()
|
|
@@ -148,10 +192,15 @@ def fetch_chains() -> Dict[str, Dict[str, Chain]]:
|
|
|
148
192
|
|
|
149
193
|
|
|
150
194
|
def write_chain_const(chains: Dict[str, Dict[str, Chain]]):
|
|
151
|
-
"""Write the file with Python constant"""
|
|
152
|
-
|
|
153
|
-
file_str
|
|
154
|
-
file_str += "
|
|
195
|
+
"""Write the file with Python constant."""
|
|
196
|
+
stamp_str = stamp()
|
|
197
|
+
file_str = '"""Constants containing metadata for EVM-comaptitble chains.\n\n'
|
|
198
|
+
file_str += "!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!\n"
|
|
199
|
+
file_str += "!!!! DO NOT EDIT THIS FILE DIRECTLY! !!!!\n"
|
|
200
|
+
file_str += "!!!! This file is auto-generated by scripts/update.py !!!!\n"
|
|
201
|
+
file_str += f"!!!! {stamp_str}{' ' * (50 - len(stamp_str))}!!!!\n"
|
|
202
|
+
file_str += "!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!\n"
|
|
203
|
+
file_str += '"""\n\n'
|
|
155
204
|
file_str += "from typing import Any, Dict\n\n"
|
|
156
205
|
file_str += "PUBLIC_CHAIN_META: Dict[str, Dict[str, Dict[str, Any]]] = {\n"
|
|
157
206
|
|
|
@@ -171,6 +220,7 @@ def write_chain_const(chains: Dict[str, Dict[str, Chain]]):
|
|
|
171
220
|
|
|
172
221
|
|
|
173
222
|
def main():
|
|
223
|
+
"""Fetch data and update the constants file."""
|
|
174
224
|
logger.info("Fetching chain data...")
|
|
175
225
|
logger.info(f" Source: {SOURCE_URL}")
|
|
176
226
|
logger.info(f" Dest: {CHAIN_CONST_FILE}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|