mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-utils.git
synced 2026-06-24 02:01:08 +00:00
Initial commit: Pezkuwi Wallet Utils
- 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
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user