@snowbridge/registry 0.1.65
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.
- package/.turbo/turbo-format.log +9 -0
- package/README.md +8 -0
- package/build.ts +35 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/paseo_sepolia.registry.json +150 -0
- package/dist/polkadot_mainnet.registry.json +1462 -0
- package/dist/westend_sepolia.registry.json +227 -0
- package/package.json +32 -0
- package/src/index.ts +59 -0
- package/src/paseo_sepolia.registry.json +150 -0
- package/src/polkadot_mainnet.registry.json +1462 -0
- package/src/westend_sepolia.registry.json +227 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[43m[30m WARN [39m[49m Issue while reading "/Users/alistairsingh/c/snowbridge/web/.npmrc". Failed to replace env in config: ${NPM_AUTH_TOKEN}
|
|
2
|
+
|
|
3
|
+
> @snowbridge/registry@0.1.64 format /Users/alistairsingh/c/snowbridge/web/packages/registry
|
|
4
|
+
> prettier src --write
|
|
5
|
+
|
|
6
|
+
src/index.ts[2K[1G[90msrc/index.ts[39m 286ms
|
|
7
|
+
src/paseo_sepolia.registry.json[2K[1Gsrc/paseo_sepolia.registry.json 48ms
|
|
8
|
+
src/polkadot_mainnet.registry.json[2K[1Gsrc/polkadot_mainnet.registry.json 49ms
|
|
9
|
+
src/westend_sepolia.registry.json[2K[1Gsrc/westend_sepolia.registry.json 8ms
|
package/README.md
ADDED
package/build.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { assetsV2, environment } from "@snowbridge/api"
|
|
2
|
+
import { writeFile } from "fs/promises"
|
|
3
|
+
|
|
4
|
+
async function buildRegistry(env: string, options: assetsV2.RegistryOptions) {
|
|
5
|
+
const registry = await assetsV2.buildRegistry(options)
|
|
6
|
+
const json = JSON.stringify(
|
|
7
|
+
registry,
|
|
8
|
+
(key, value) => {
|
|
9
|
+
if (typeof value === "bigint") {
|
|
10
|
+
return `bigint:${value.toString()}`
|
|
11
|
+
}
|
|
12
|
+
return value
|
|
13
|
+
},
|
|
14
|
+
2
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
const filepath = `src/${env}.registry.json`
|
|
18
|
+
await writeFile(filepath, json)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
(async () => {
|
|
22
|
+
const envs = [
|
|
23
|
+
"polkadot_mainnet",
|
|
24
|
+
"westend_sepolia",
|
|
25
|
+
"paseo_sepolia",
|
|
26
|
+
]
|
|
27
|
+
const apiKey = process.env.ETHEREUM_API_KEY
|
|
28
|
+
if(!apiKey || apiKey.trim().length === 0) {
|
|
29
|
+
throw Error(`ETHEREUM_API_KEY env variable not set.`)
|
|
30
|
+
}
|
|
31
|
+
for (const env of envs) {
|
|
32
|
+
const options = assetsV2.fromEnvironment(environment.SNOWBRIDGE_ENV[env], process.env.ETHEREUM_API_KEY)
|
|
33
|
+
await buildRegistry(env, options)
|
|
34
|
+
}
|
|
35
|
+
})()
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAoCvD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAC5E,aAAa,CAoBf"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.assetRegistryFor = assetRegistryFor;
|
|
7
|
+
const polkadot_mainnet_registry_json_1 = __importDefault(require("./polkadot_mainnet.registry.json"));
|
|
8
|
+
const westend_sepolia_registry_json_1 = __importDefault(require("./westend_sepolia.registry.json"));
|
|
9
|
+
const paseo_sepolia_registry_json_1 = __importDefault(require("./paseo_sepolia.registry.json"));
|
|
10
|
+
function transformBigInt(obj) {
|
|
11
|
+
// Regex to match strings like "bigint:123"
|
|
12
|
+
const bigintPattern = /^bigint:(\d+)$/;
|
|
13
|
+
// Handle null or non-object/non-array values
|
|
14
|
+
if (obj === null || typeof obj !== "object") {
|
|
15
|
+
if (typeof obj === "string") {
|
|
16
|
+
const match = obj.match(bigintPattern);
|
|
17
|
+
if (match) {
|
|
18
|
+
return Object.freeze(BigInt(match[1]));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return Object.freeze(obj);
|
|
22
|
+
}
|
|
23
|
+
// Handle arrays
|
|
24
|
+
if (Array.isArray(obj)) {
|
|
25
|
+
return Object.freeze(obj.map((item) => transformBigInt(item)));
|
|
26
|
+
}
|
|
27
|
+
// Handle objects
|
|
28
|
+
const result = {};
|
|
29
|
+
for (const key in obj) {
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
31
|
+
result[key] = transformBigInt(obj[key]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return Object.freeze(result);
|
|
35
|
+
}
|
|
36
|
+
const cache = {};
|
|
37
|
+
function assetRegistryFor(env) {
|
|
38
|
+
if (env in cache) {
|
|
39
|
+
return cache[env];
|
|
40
|
+
}
|
|
41
|
+
let json;
|
|
42
|
+
switch (env) {
|
|
43
|
+
case "polkadot_mainnet":
|
|
44
|
+
json = polkadot_mainnet_registry_json_1.default;
|
|
45
|
+
break;
|
|
46
|
+
case "westend_sepolia":
|
|
47
|
+
json = westend_sepolia_registry_json_1.default;
|
|
48
|
+
break;
|
|
49
|
+
case "paseo_sepolia":
|
|
50
|
+
json = paseo_sepolia_registry_json_1.default;
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
throw Error(`Unkown env '${env}'`);
|
|
54
|
+
}
|
|
55
|
+
cache[env] = transformBigInt(json);
|
|
56
|
+
return cache[env];
|
|
57
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timestamp": "2025-06-25T21:17:34.839Z",
|
|
3
|
+
"environment": "paseo_sepolia",
|
|
4
|
+
"ethChainId": 11155111,
|
|
5
|
+
"gatewayAddress": "0x1607C1368bc943130258318c91bBd8cFf3D063E6",
|
|
6
|
+
"assetHubParaId": 1000,
|
|
7
|
+
"bridgeHubParaId": 1002,
|
|
8
|
+
"relaychain": {
|
|
9
|
+
"tokenSymbols": "PAS",
|
|
10
|
+
"tokenDecimals": 10,
|
|
11
|
+
"ss58Format": 0,
|
|
12
|
+
"isEthereum": false,
|
|
13
|
+
"accountType": "AccountId32",
|
|
14
|
+
"name": "Paseo Testnet",
|
|
15
|
+
"specName": "paseo",
|
|
16
|
+
"specVersion": 1005001
|
|
17
|
+
},
|
|
18
|
+
"bridgeHub": {
|
|
19
|
+
"tokenSymbols": "PAS",
|
|
20
|
+
"tokenDecimals": 10,
|
|
21
|
+
"ss58Format": 0,
|
|
22
|
+
"isEthereum": false,
|
|
23
|
+
"accountType": "AccountId32",
|
|
24
|
+
"name": "Paseo Bridge Hub",
|
|
25
|
+
"specName": "bridge-hub-paseo",
|
|
26
|
+
"specVersion": 1005001
|
|
27
|
+
},
|
|
28
|
+
"ethereumChains": {
|
|
29
|
+
"11155111": {
|
|
30
|
+
"chainId": 11155111,
|
|
31
|
+
"assets": {
|
|
32
|
+
"0x0000000000000000000000000000000000000000": {
|
|
33
|
+
"token": "0x0000000000000000000000000000000000000000",
|
|
34
|
+
"name": "Ether",
|
|
35
|
+
"symbol": "ETH",
|
|
36
|
+
"decimals": 18
|
|
37
|
+
},
|
|
38
|
+
"0x22e12ed4e6bcde652a73552dde340fcb972eef89": {
|
|
39
|
+
"token": "0x22e12ed4e6bcde652a73552dde340fcb972eef89",
|
|
40
|
+
"name": "Wrapped PILT",
|
|
41
|
+
"symbol": "wPILT",
|
|
42
|
+
"decimals": 15
|
|
43
|
+
},
|
|
44
|
+
"0x99e743964c036bc28931fb564817db428aa7f752": {
|
|
45
|
+
"token": "0x99e743964c036bc28931fb564817db428aa7f752",
|
|
46
|
+
"name": "KILT",
|
|
47
|
+
"symbol": "KILT",
|
|
48
|
+
"decimals": 15
|
|
49
|
+
},
|
|
50
|
+
"0xfff9976782d46cc05630d1f6ebab18b2324d6b14": {
|
|
51
|
+
"token": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
|
|
52
|
+
"name": "Wrapped Ether",
|
|
53
|
+
"symbol": "WETH",
|
|
54
|
+
"decimals": 18
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"id": "sepolia"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"parachains": {
|
|
61
|
+
"1000": {
|
|
62
|
+
"parachainId": 1000,
|
|
63
|
+
"features": {
|
|
64
|
+
"hasPalletXcm": true,
|
|
65
|
+
"hasDryRunApi": true,
|
|
66
|
+
"hasTxPaymentApi": true,
|
|
67
|
+
"hasDryRunRpc": true,
|
|
68
|
+
"hasDotBalance": true
|
|
69
|
+
},
|
|
70
|
+
"info": {
|
|
71
|
+
"tokenSymbols": "PAS",
|
|
72
|
+
"tokenDecimals": 10,
|
|
73
|
+
"ss58Format": 0,
|
|
74
|
+
"isEthereum": false,
|
|
75
|
+
"accountType": "AccountId32",
|
|
76
|
+
"name": "Paseo Asset Hub",
|
|
77
|
+
"specName": "asset-hub-paseo",
|
|
78
|
+
"specVersion": 1005001
|
|
79
|
+
},
|
|
80
|
+
"assets": {
|
|
81
|
+
"0x0000000000000000000000000000000000000000": {
|
|
82
|
+
"token": "0x0000000000000000000000000000000000000000",
|
|
83
|
+
"name": "Ether",
|
|
84
|
+
"minimumBalance": "bigint:15000000000000",
|
|
85
|
+
"symbol": "ETH",
|
|
86
|
+
"decimals": 18,
|
|
87
|
+
"isSufficient": true
|
|
88
|
+
},
|
|
89
|
+
"0x22e12ed4e6bcde652a73552dde340fcb972eef89": {
|
|
90
|
+
"token": "0x22e12ed4e6bcde652a73552dde340fcb972eef89",
|
|
91
|
+
"name": "",
|
|
92
|
+
"minimumBalance": "bigint:1",
|
|
93
|
+
"symbol": "",
|
|
94
|
+
"decimals": 0,
|
|
95
|
+
"isSufficient": false
|
|
96
|
+
},
|
|
97
|
+
"0x99e743964c036bc28931fb564817db428aa7f752": {
|
|
98
|
+
"token": "0x99e743964c036bc28931fb564817db428aa7f752",
|
|
99
|
+
"name": "",
|
|
100
|
+
"minimumBalance": "bigint:1",
|
|
101
|
+
"symbol": "",
|
|
102
|
+
"decimals": 0,
|
|
103
|
+
"isSufficient": false
|
|
104
|
+
},
|
|
105
|
+
"0xfff9976782d46cc05630d1f6ebab18b2324d6b14": {
|
|
106
|
+
"token": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
|
|
107
|
+
"name": "Wrapped Ether",
|
|
108
|
+
"minimumBalance": "bigint:15000000000000",
|
|
109
|
+
"symbol": "WETH",
|
|
110
|
+
"decimals": 18,
|
|
111
|
+
"isSufficient": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"estimatedExecutionFeeDOT": "bigint:0",
|
|
115
|
+
"estimatedDeliveryFeeDOT": "bigint:0"
|
|
116
|
+
},
|
|
117
|
+
"3369": {
|
|
118
|
+
"parachainId": 3369,
|
|
119
|
+
"features": {
|
|
120
|
+
"hasPalletXcm": true,
|
|
121
|
+
"hasDryRunApi": true,
|
|
122
|
+
"hasTxPaymentApi": true,
|
|
123
|
+
"hasDryRunRpc": true,
|
|
124
|
+
"hasDotBalance": false
|
|
125
|
+
},
|
|
126
|
+
"info": {
|
|
127
|
+
"tokenSymbols": "MUSE",
|
|
128
|
+
"tokenDecimals": 18,
|
|
129
|
+
"ss58Format": 29972,
|
|
130
|
+
"isEthereum": true,
|
|
131
|
+
"accountType": "AccountId20",
|
|
132
|
+
"name": "Muse Testnet",
|
|
133
|
+
"specName": "muse",
|
|
134
|
+
"specVersion": 1027
|
|
135
|
+
},
|
|
136
|
+
"assets": {
|
|
137
|
+
"0xb34a6924a02100ba6ef12af1c798285e8f7a16ee": {
|
|
138
|
+
"token": "0xb34a6924a02100ba6ef12af1c798285e8f7a16ee",
|
|
139
|
+
"name": "Muse",
|
|
140
|
+
"minimumBalance": "bigint:10000000000000000",
|
|
141
|
+
"symbol": "MUSE",
|
|
142
|
+
"decimals": 18,
|
|
143
|
+
"isSufficient": true
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"estimatedExecutionFeeDOT": "bigint:200000000000",
|
|
147
|
+
"estimatedDeliveryFeeDOT": "bigint:306650000"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|