mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-utils.git
synced 2026-04-22 21:47:59 +00:00
46297339b1
- Chain configurations for Polkadot, Kusama and all major parachains - Pezkuwichain ecosystem (Relay Chain, Asset Hub, People Chain) - Staking metadata and validator lists - DApp configurations - XCM cross-chain messaging configs - Governance dApp listings - Promotional banners - Chain migration configurations - Asset metadata and icons Based on Nova Utils with Pezkuwichain extensions
26 lines
588 B
Python
26 lines
588 B
Python
import json
|
|
|
|
with open("chains.json") as fin:
|
|
prod_chains = json.load(fin)
|
|
|
|
with open("chains_dev.json") as fin:
|
|
dev_chains = json.load(fin)
|
|
|
|
|
|
def get_ids(chains):
|
|
return list(map(lambda x: x["chainId"], chains))
|
|
|
|
|
|
prod_ids = get_ids(prod_chains)
|
|
dev_ids = get_ids(dev_chains)
|
|
|
|
prod_indices_by_id = dict(zip(prod_ids, range(0, len(prod_chains))))
|
|
|
|
for dev_index, dev_id in enumerate(dev_ids):
|
|
if dev_id in prod_ids:
|
|
prod_chains[prod_indices_by_id[dev_id]] = dev_chains[dev_index]
|
|
|
|
|
|
with open("chains.json", "w") as fout:
|
|
json.dump(prod_chains, fout, indent=4)
|