mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-utils.git
synced 2026-04-22 03:17:59 +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,398 @@
|
||||
{
|
||||
"assetsLocation": {
|
||||
"KAR": {
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"multiLocation": {
|
||||
"parachainId": 2000,
|
||||
"generalKey": "0x0080"
|
||||
}
|
||||
},
|
||||
"KSM": {
|
||||
"chainId": "b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
|
||||
"multiLocation": {}
|
||||
},
|
||||
"MOVR": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"multiLocation": {
|
||||
"parachainId": 2023,
|
||||
"palletInstance": 10
|
||||
}
|
||||
},
|
||||
"BNC": {
|
||||
"chainId": "9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed",
|
||||
"multiLocation": {
|
||||
"parachainId": 2001,
|
||||
"generalKey": "0x0001"
|
||||
},
|
||||
"reserveFee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "6400000000000"
|
||||
},
|
||||
"instructions": "xtokensReserve"
|
||||
}
|
||||
},
|
||||
"ACA": {
|
||||
"chainId": "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
|
||||
"multiLocation": {
|
||||
"parachainId": 2000,
|
||||
"generalKey": "0x0000"
|
||||
}
|
||||
},
|
||||
"DOT": {
|
||||
"chainId": "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
|
||||
"multiLocation": {}
|
||||
},
|
||||
"GLMR": {
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"multiLocation": {
|
||||
"parachainId": 2004,
|
||||
"palletInstance": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"instructions": {
|
||||
"xtokensDest": [
|
||||
"ReserveAssetDeposited",
|
||||
"ClearOrigin",
|
||||
"BuyExecution",
|
||||
"DepositAsset"
|
||||
],
|
||||
"xtokensReserve": [
|
||||
"WithdrawAsset",
|
||||
"ClearOrigin",
|
||||
"BuyExecution",
|
||||
"DepositReserveAsset"
|
||||
],
|
||||
"xcmPalletDest": [
|
||||
"ReserveAssetDeposited",
|
||||
"ClearOrigin",
|
||||
"BuyExecution",
|
||||
"DepositAsset"
|
||||
]
|
||||
},
|
||||
"networkBaseWeight": {
|
||||
"b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe": "1000000000",
|
||||
"baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b": "200000000",
|
||||
"401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b": "200000000",
|
||||
"9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed": "200000000",
|
||||
"91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3": "1000000000",
|
||||
"fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c": "200000000",
|
||||
"fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d": "200000000"
|
||||
},
|
||||
"chains": [
|
||||
{
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 4,
|
||||
"assetLocation": "KAR",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "23176000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 2,
|
||||
"assetLocation": "KSM",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "MOVR",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed",
|
||||
"assetId": 8,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "309393033442258200"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 5,
|
||||
"assetLocation": "BNC",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"assetId": 4,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "37078400000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "KSM",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 2,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "130000000000"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 4,
|
||||
"assetLocation": "BNC",
|
||||
"assetLocationPath": {
|
||||
"type": "concrete",
|
||||
"path": {
|
||||
"parents": 1,
|
||||
"parachainId": 2001,
|
||||
"generalKey": "0x0001"
|
||||
}
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 5,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "35230000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "KAR",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 4,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "12350000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 3,
|
||||
"assetLocation": "ACA",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "23176000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 1,
|
||||
"assetLocation": "DOT",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "DOT",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"assetId": 1,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "11285231116"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "ACA",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"assetId": 3,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "31204285721418"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 8,
|
||||
"assetLocation": "MOVR",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,537 @@
|
||||
{
|
||||
"assetsLocation": {
|
||||
"KAR": {
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"multiLocation": {
|
||||
"parachainId": 2000,
|
||||
"generalKey": "0x0080"
|
||||
}
|
||||
},
|
||||
"KSM": {
|
||||
"chainId": "b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
|
||||
"multiLocation": {}
|
||||
},
|
||||
"KSM-Statemine": {
|
||||
"chainId": "48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a",
|
||||
"multiLocation": {}
|
||||
},
|
||||
"MOVR": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"multiLocation": {
|
||||
"parachainId": 2023,
|
||||
"palletInstance": 10
|
||||
}
|
||||
},
|
||||
"BNC": {
|
||||
"chainId": "9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed",
|
||||
"multiLocation": {
|
||||
"parachainId": 2001,
|
||||
"generalKey": "0x0001"
|
||||
},
|
||||
"reserveFee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "6400000000000"
|
||||
},
|
||||
"instructions": "xtokensReserve"
|
||||
}
|
||||
},
|
||||
"UNIT": {
|
||||
"chainId": "e1ea3ab1d46ba8f4898b6b4b9c54ffc05282d299f89e84bd0fd08067758c9443",
|
||||
"multiLocation": {}
|
||||
},
|
||||
"ACA": {
|
||||
"chainId": "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
|
||||
"multiLocation": {
|
||||
"parachainId": 2000,
|
||||
"generalKey": "0x0000"
|
||||
}
|
||||
},
|
||||
"DOT": {
|
||||
"chainId": "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
|
||||
"multiLocation": {}
|
||||
},
|
||||
"GLMR": {
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"multiLocation": {
|
||||
"parachainId": 2004,
|
||||
"palletInstance": 10
|
||||
}
|
||||
},
|
||||
"RMRK": {
|
||||
"chainId": "48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a",
|
||||
"multiLocation": {
|
||||
"parachainId": 1000,
|
||||
"palletInstance": 50,
|
||||
"generalIndex": "8"
|
||||
}
|
||||
}
|
||||
},
|
||||
"instructions": {
|
||||
"xtokensDest": [
|
||||
"ReserveAssetDeposited",
|
||||
"ClearOrigin",
|
||||
"BuyExecution",
|
||||
"DepositAsset"
|
||||
],
|
||||
"xtokensReserve": [
|
||||
"WithdrawAsset",
|
||||
"ClearOrigin",
|
||||
"BuyExecution",
|
||||
"DepositReserveAsset"
|
||||
],
|
||||
"xcmPalletDest": [
|
||||
"ReserveAssetDeposited",
|
||||
"ClearOrigin",
|
||||
"BuyExecution",
|
||||
"DepositAsset"
|
||||
]
|
||||
},
|
||||
"networkBaseWeight": {
|
||||
"b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe": "1000000000",
|
||||
"baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b": "200000000",
|
||||
"401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b": "200000000",
|
||||
"9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed": "200000000",
|
||||
"91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527": "100000000",
|
||||
"e1ea3ab1d46ba8f4898b6b4b9c54ffc05282d299f89e84bd0fd08067758c9443": "1000000000",
|
||||
"91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3": "1000000000",
|
||||
"fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c": "200000000",
|
||||
"fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d": "200000000",
|
||||
"48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a": "1000000000"
|
||||
},
|
||||
"chains": [
|
||||
{
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 4,
|
||||
"assetLocation": "KAR",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "23176000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 2,
|
||||
"assetLocation": "KSM",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
},
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a",
|
||||
"assetId": 0,
|
||||
"assetLocation": "KSM-Statemine",
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "MOVR",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed",
|
||||
"assetId": 8,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "309393033442258200"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 5,
|
||||
"assetLocation": "BNC",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"assetId": 4,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "37078400000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "KSM",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 2,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "130000000000"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 4,
|
||||
"assetLocation": "BNC",
|
||||
"assetLocationPath": {
|
||||
"type": "concrete",
|
||||
"path": {
|
||||
"parents": 1,
|
||||
"parachainId": 2001,
|
||||
"generalKey": "0x0001"
|
||||
}
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 5,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "35230000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "KAR",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 4,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "12350000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 1,
|
||||
"assetLocation": "UNIT",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "e1ea3ab1d46ba8f4898b6b4b9c54ffc05282d299f89e84bd0fd08067758c9443",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "e1ea3ab1d46ba8f4898b6b4b9c54ffc05282d299f89e84bd0fd08067758c9443",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "UNIT",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "91bc6e169807aaa54802737e1c504b2577d4fafedd5a02c10293b1cd60e39527",
|
||||
"assetId": 1,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "130000000000"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 3,
|
||||
"assetLocation": "ACA",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "23176000000000"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 1,
|
||||
"assetLocation": "DOT",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "DOT",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"assetId": 1,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "11285231116"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "ACA",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "fe58ea77779b7abda7da4ec526d14db9b1e9cd40a217c34892af80a9b332b76d",
|
||||
"assetId": 3,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "31204285721418"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 0,
|
||||
"assetLocation": "KSM-Statemine",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 2,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "130000000000"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"assetId": 1,
|
||||
"assetLocation": "RMRK",
|
||||
"assetLocationPath": {
|
||||
"type": "relative"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 1,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "proportional",
|
||||
"value": "13000000000"
|
||||
},
|
||||
"instructions": "xcmPalletDest"
|
||||
}
|
||||
},
|
||||
"type": "xcmpallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chainId": "9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed",
|
||||
"assets": [
|
||||
{
|
||||
"assetId": 8,
|
||||
"assetLocation": "MOVR",
|
||||
"assetLocationPath": {
|
||||
"type": "absolute"
|
||||
},
|
||||
"xcmTransfers": [
|
||||
{
|
||||
"destination": {
|
||||
"chainId": "401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b",
|
||||
"assetId": 0,
|
||||
"fee": {
|
||||
"mode": {
|
||||
"type": "standard"
|
||||
},
|
||||
"instructions": "xtokensDest"
|
||||
}
|
||||
},
|
||||
"type": "xtokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
"""
|
||||
This script compares the dev and prod transfers.json files, finds the difference and asks which changes to apply, then updates the prod file.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
def ask_to_update():
|
||||
update = input("Would you like to update that data? (y/n)")
|
||||
if update.lower() == 'y':
|
||||
return True
|
||||
return False
|
||||
|
||||
def remove_none_keys(data):
|
||||
if isinstance(data, dict):
|
||||
# Iterate over the dictionary keys
|
||||
for key in list(data.keys()):
|
||||
# Recursively call the function on the corresponding value
|
||||
data[key] = remove_none_keys(data[key])
|
||||
|
||||
# Check if the value is None after recursing, remove it if so
|
||||
if data[key] is None:
|
||||
del data[key]
|
||||
|
||||
elif isinstance(data, list):
|
||||
# Iterate over the list elements
|
||||
data[:] = [remove_none_keys(elem) for elem in data]
|
||||
|
||||
# Remove any empty dictionaries in the list
|
||||
data[:] = [elem for elem in data if isinstance(elem, dict) and len(elem) > 0]
|
||||
|
||||
return data
|
||||
|
||||
def update_networks(dev_chains, prod_chains, meta_dict):
|
||||
for dev_chain_id, dev_chain in dev_chains.items():
|
||||
if dev_chain_id not in prod_chains:
|
||||
print(f"Added new chain - {meta_dict[dev_chain_id]['name']}")
|
||||
if ask_to_update():
|
||||
prod_chains[dev_chain_id] = dev_chain
|
||||
|
||||
return prod_chains
|
||||
|
||||
def update_network_base_weight(dev_file, prod_file, meta_dict):
|
||||
for dev_chain_id, dev_weight in dev_file['networkBaseWeight'].items():
|
||||
if dev_chain_id not in prod_file['networkBaseWeight']:
|
||||
print(f"Added new base weight in chain: {meta_dict[dev_chain_id]['name']}")
|
||||
if ask_to_update():
|
||||
prod_file['networkBaseWeight'][dev_chain_id] = dev_weight
|
||||
|
||||
return prod_file['networkBaseWeight']
|
||||
|
||||
|
||||
def update_reserves(dev_file, prod_file):
|
||||
for dev_asset_location, dev_asset in dev_file['assetsLocation'].items():
|
||||
if dev_asset_location not in prod_file['assetsLocation']:
|
||||
print(f"Added new asset: {dev_asset_location}")
|
||||
if ask_to_update():
|
||||
prod_file['assetsLocation'][dev_asset_location] = dev_asset
|
||||
|
||||
for prod_asset_location, prod_asset in prod_file['assetsLocation'].items():
|
||||
if prod_asset_location not in dev_file['assetsLocation']:
|
||||
print(f"Asset was removed: {prod_asset_location}")
|
||||
if ask_to_update():
|
||||
prod_file['assetsLocation'][prod_asset_location] = None
|
||||
|
||||
return remove_none_keys(prod_file['assetsLocation'])
|
||||
|
||||
|
||||
def update_assets(dev_chains, prod_chains, meta_dict):
|
||||
for prod_chain_id, _ in prod_chains.items():
|
||||
for dev_asset_location, dev_asset in dev_chains[prod_chain_id]['assets'].items():
|
||||
if dev_asset_location not in prod_chains[prod_chain_id]['assets']:
|
||||
print(f"Added new asset {dev_asset_location} in chain: {meta_dict[prod_chain_id]['name']}")
|
||||
if ask_to_update():
|
||||
prod_chains[prod_chain_id]['assets'][dev_asset_location] = dev_asset
|
||||
|
||||
return prod_chains
|
||||
|
||||
|
||||
def update_destinations(dev_chains, prod_chains, meta_dict):
|
||||
for prod_chain_id, prod_chain in prod_chains.items():
|
||||
for prod_asset_location, prod_asset in prod_chain['assets'].items():
|
||||
|
||||
if dev_chains[prod_chain_id]['assets'].get(prod_asset_location) is None:
|
||||
print(f"Destination was removed in {meta_dict[prod_chain_id]['name']} \
|
||||
\nfor asset: {prod_asset_location} \
|
||||
\nto network: {meta_dict[dev_destination_id]['name']} ")
|
||||
if ask_to_update():
|
||||
prod_chains[prod_chain_id]['assets'][prod_asset_location] = None
|
||||
else:
|
||||
for dev_destination_id, dev_destination \
|
||||
in dev_chains[prod_chain_id]['assets'][prod_asset_location]['xcmTransfers'].items():
|
||||
|
||||
if dev_destination_id not in prod_asset['xcmTransfers']:
|
||||
print(f"Added new destination in {meta_dict[prod_chain_id]['name']} \
|
||||
\nfor asset: {prod_asset_location} \
|
||||
\nto network: {meta_dict[dev_destination_id]['name']} ")
|
||||
if ask_to_update():
|
||||
prod_chains[prod_chain_id]['assets'][prod_asset_location]['xcmTransfers'][dev_destination_id] = dev_destination
|
||||
|
||||
|
||||
return remove_none_keys(prod_chains)
|
||||
|
||||
|
||||
def convert_chains_to_dict(chains_obj):
|
||||
chains_dict = {chain['chainId']: chain for chain in chains_obj}
|
||||
for chain_id, chain in chains_dict.items():
|
||||
assets_dict = {}
|
||||
for asset in chain['assets']:
|
||||
destinations_dict = {destination['destination']['chainId']: destination for destination in asset['xcmTransfers']}
|
||||
assets_dict[asset['assetLocation']] = asset
|
||||
assets_dict[asset['assetLocation']]['xcmTransfers'] = destinations_dict
|
||||
chains_dict[chain_id]['assets'] = assets_dict
|
||||
|
||||
return chains_dict
|
||||
|
||||
def convert_chain_dict_to_array_back(chains_dict):
|
||||
temp_chains = []
|
||||
for _, chain in chains_dict.items():
|
||||
temp_assets = []
|
||||
for _, asset in chain['assets'].items():
|
||||
temp_destinations = []
|
||||
for _, destination in asset['xcmTransfers'].items():
|
||||
temp_destinations.append(destination)
|
||||
asset['xcmTransfers'] = temp_destinations
|
||||
temp_assets.append(asset)
|
||||
chain['assets'] = temp_assets
|
||||
temp_chains.append(chain)
|
||||
|
||||
return temp_chains
|
||||
|
||||
|
||||
|
||||
def promote_updates_to_prod(dev_file, prod_file, meta_data):
|
||||
|
||||
# meta_dict is used to get a human-readable network name
|
||||
meta_dict = {chain['chainId']: chain for chain in meta_data}
|
||||
|
||||
dev_chains_dict = convert_chains_to_dict(dev_file['chains'])
|
||||
prod_chains_data = convert_chains_to_dict(prod_file['chains'])
|
||||
|
||||
updated_prod = update_networks(dev_chains_dict, prod_chains_data, meta_dict)
|
||||
updated_prod = update_assets(dev_chains_dict, updated_prod, meta_dict)
|
||||
updated_prod = update_destinations(dev_chains_dict, updated_prod, meta_dict)
|
||||
|
||||
updated_chains = convert_chain_dict_to_array_back(updated_prod)
|
||||
|
||||
updated_base_weight = update_network_base_weight(dev_file, prod_file, meta_dict)
|
||||
|
||||
updated_reserves = update_reserves(dev_file, prod_file)
|
||||
|
||||
prod_file['networkBaseWeight'] = updated_base_weight
|
||||
prod_file['assetsLocation'] = updated_reserves
|
||||
prod_file['chains'] = updated_chains
|
||||
|
||||
return prod_file
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
xcm_dev_file_path = os.getenv('DEV_XCM_JSON_PATH')
|
||||
xcm_file_path = os.getenv('XCM_JSON_PATH')
|
||||
chains_dev_path = os.getenv('DEV_CHAINS_JSON_PATH')
|
||||
print(f"The following files are used:\n{xcm_dev_file_path}\n{xcm_file_path}\n{chains_dev_path}")
|
||||
# Read data from files
|
||||
with open(xcm_dev_file_path) as f:
|
||||
data1 = json.load(f)
|
||||
with open(xcm_file_path) as f:
|
||||
data2 = json.load(f)
|
||||
with open(chains_dev_path) as f:
|
||||
meta_data = json.load(f)
|
||||
|
||||
|
||||
updated_obj = promote_updates_to_prod(dev_file=data1, prod_file=data2, meta_data=meta_data)
|
||||
|
||||
with open(xcm_file_path, 'w') as f:
|
||||
json.dump(updated_obj, f, indent=2)
|
||||
print(f"Data updated in {xcm_file_path}")
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user