@snowbridge/registry 1.0.5 → 1.0.6

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.
Files changed (41) hide show
  1. package/.prettierrc +23 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/README.md +1 -3
  4. package/dist/index.d.ts +7 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +30 -47
  7. package/dist/local_e2e_bridge_info.g.d.ts +158 -0
  8. package/dist/local_e2e_bridge_info.g.d.ts.map +1 -0
  9. package/dist/local_e2e_bridge_info.g.js +159 -0
  10. package/dist/paseo_sepolia_bridge_info.g.d.ts +353 -0
  11. package/dist/paseo_sepolia_bridge_info.g.d.ts.map +1 -0
  12. package/dist/paseo_sepolia_bridge_info.g.js +373 -0
  13. package/dist/polkadot_mainnet_bridge_info.g.d.ts +2249 -0
  14. package/dist/polkadot_mainnet_bridge_info.g.d.ts.map +1 -0
  15. package/dist/polkadot_mainnet_bridge_info.g.js +2573 -0
  16. package/dist/transfers.d.ts +4 -0
  17. package/dist/transfers.d.ts.map +1 -0
  18. package/dist/transfers.js +96 -0
  19. package/dist/westend_sepolia_bridge_info.g.d.ts +469 -0
  20. package/dist/westend_sepolia_bridge_info.g.d.ts.map +1 -0
  21. package/dist/westend_sepolia_bridge_info.g.js +526 -0
  22. package/package.json +21 -15
  23. package/scripts/buildRegistry.ts +1258 -0
  24. package/scripts/friendlyChains.ts +74 -0
  25. package/src/index.ts +22 -57
  26. package/src/local_e2e_bridge_info.g.ts +157 -0
  27. package/src/paseo_sepolia_bridge_info.g.ts +372 -0
  28. package/src/polkadot_mainnet_bridge_info.g.ts +2597 -0
  29. package/src/transfers.ts +97 -0
  30. package/src/westend_sepolia_bridge_info.g.ts +534 -0
  31. package/tsconfig.json +1 -1
  32. package/tsconfig.scripts.json +23 -0
  33. package/build.ts +0 -35
  34. package/dist/local_e2e.registry.json +0 -347
  35. package/dist/paseo_sepolia.registry.json +0 -150
  36. package/dist/polkadot_mainnet.registry.json +0 -1484
  37. package/dist/westend_sepolia.registry.json +0 -227
  38. package/src/local_e2e.registry.json +0 -347
  39. package/src/paseo_sepolia.registry.json +0 -150
  40. package/src/polkadot_mainnet.registry.json +0 -1484
  41. package/src/westend_sepolia.registry.json +0 -227
package/.prettierrc ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "overrides": [
3
+ {
4
+ "files": "*.sol",
5
+ "options": {
6
+ "printWidth": 100,
7
+ "tabWidth": 4,
8
+ "singleQuote": false,
9
+ "bracketSpacing": true,
10
+ "explicitTypes": "always"
11
+ }
12
+ },
13
+ {
14
+ "files": "*.ts",
15
+ "options": {
16
+ "semi": false,
17
+ "printWidth": 100,
18
+ "tabWidth": 4,
19
+ "singleQuote": false
20
+ }
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,4 @@
1
+
2
+ > @snowbridge/registry@1.0.0 build /home/runner/work/snowbridge/snowbridge/web/packages/registry
3
+ > tsc --build --force && tsc -p tsconfig.scripts.json
4
+
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
 
2
2
  # Updating the asset list
3
3
 
4
- Set the api key and run the `build.ts` script.
5
-
6
4
  ```shell
7
- ETHEREUM_API_KEY=.... npx ts-node build.ts
5
+ ETHEREUM_API_KEY=.... npx ts-node scripts/buildRegistry.ts
8
6
  ```
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
- import { AssetRegistry } from "@snowbridge/base-types";
2
- export declare function assetRegistryFor(env: "polkadot_mainnet" | "westend_sepolia" | "paseo_sepolia" | (string & {})): AssetRegistry;
1
+ export * from "./transfers";
2
+ import polkadot_mainnet from "./polkadot_mainnet_bridge_info.g";
3
+ import westend_sepolia from "./westend_sepolia_bridge_info.g";
4
+ import paseo_sepolia from "./paseo_sepolia_bridge_info.g";
5
+ export { paseo_sepolia, westend_sepolia, polkadot_mainnet };
6
+ import { BridgeInfo } from "@snowbridge/base-types";
7
+ export declare function bridgeInfoFor(env: "polkadot_mainnet" | "westend_sepolia" | "paseo_sepolia" | "local_e2e" | (string & {})): Readonly<BridgeInfo>;
3
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAqCvD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAC5E,aAAa,CAuBf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAE3B,OAAO,gBAAgB,MAAM,kCAAkC,CAAA;AAC/D,OAAO,eAAe,MAAM,iCAAiC,CAAA;AAC7D,OAAO,aAAa,MAAM,+BAA+B,CAAA;AAGzD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,wBAAgB,aAAa,CACzB,GAAG,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,eAAe,GAAG,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAC5F,QAAQ,CAAC,UAAU,CAAC,CActB"}
package/dist/index.js CHANGED
@@ -1,61 +1,44 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
18
  };
5
19
  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
- const local_e2e_registry_json_1 = __importDefault(require("./local_e2e.registry.json"));
11
- function transformBigInt(obj) {
12
- // Regex to match strings like "bigint:123"
13
- const bigintPattern = /^bigint:(\d+)$/;
14
- // Handle null or non-object/non-array values
15
- if (obj === null || typeof obj !== "object") {
16
- if (typeof obj === "string") {
17
- const match = obj.match(bigintPattern);
18
- if (match) {
19
- return Object.freeze(BigInt(match[1]));
20
- }
21
- }
22
- return Object.freeze(obj);
23
- }
24
- // Handle arrays
25
- if (Array.isArray(obj)) {
26
- return Object.freeze(obj.map((item) => transformBigInt(item)));
27
- }
28
- // Handle objects
29
- const result = {};
30
- for (const key in obj) {
31
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
32
- result[key] = transformBigInt(obj[key]);
33
- }
34
- }
35
- return Object.freeze(result);
36
- }
37
- const cache = {};
38
- function assetRegistryFor(env) {
39
- if (env in cache) {
40
- return cache[env];
41
- }
42
- let json;
20
+ exports.polkadot_mainnet = exports.westend_sepolia = exports.paseo_sepolia = void 0;
21
+ exports.bridgeInfoFor = bridgeInfoFor;
22
+ __exportStar(require("./transfers"), exports);
23
+ const polkadot_mainnet_bridge_info_g_1 = __importDefault(require("./polkadot_mainnet_bridge_info.g"));
24
+ exports.polkadot_mainnet = polkadot_mainnet_bridge_info_g_1.default;
25
+ const westend_sepolia_bridge_info_g_1 = __importDefault(require("./westend_sepolia_bridge_info.g"));
26
+ exports.westend_sepolia = westend_sepolia_bridge_info_g_1.default;
27
+ const paseo_sepolia_bridge_info_g_1 = __importDefault(require("./paseo_sepolia_bridge_info.g"));
28
+ exports.paseo_sepolia = paseo_sepolia_bridge_info_g_1.default;
29
+ const local_e2e_bridge_info_g_1 = __importDefault(require("./local_e2e_bridge_info.g"));
30
+ function bridgeInfoFor(env) {
43
31
  switch (env) {
44
32
  case "polkadot_mainnet":
45
- json = polkadot_mainnet_registry_json_1.default;
33
+ return polkadot_mainnet_bridge_info_g_1.default;
46
34
  break;
47
35
  case "westend_sepolia":
48
- json = westend_sepolia_registry_json_1.default;
49
- break;
36
+ return westend_sepolia_bridge_info_g_1.default;
50
37
  case "paseo_sepolia":
51
- json = paseo_sepolia_registry_json_1.default;
52
- break;
38
+ return paseo_sepolia_bridge_info_g_1.default;
53
39
  case "local_e2e":
54
- json = local_e2e_registry_json_1.default;
55
- break;
40
+ return local_e2e_bridge_info_g_1.default;
56
41
  default:
57
- throw Error(`Unkown env '${env}'`);
42
+ throw Error(`Unknown env '${env}'`);
58
43
  }
59
- cache[env] = transformBigInt(json);
60
- return cache[env];
61
44
  }
@@ -0,0 +1,158 @@
1
+ declare const registry: {
2
+ readonly environment: {
3
+ readonly name: "local_e2e";
4
+ readonly ethChainId: 11155111;
5
+ readonly beaconApiUrl: "http://127.0.0.1:9596";
6
+ readonly ethereumChains: {
7
+ readonly "11155111": "ws://127.0.0.1:8546";
8
+ };
9
+ readonly relaychainUrl: "ws://127.0.0.1:9944";
10
+ readonly parachains: {
11
+ readonly "1000": "ws://127.0.0.1:12144";
12
+ readonly "1002": "ws://127.0.0.1:11144";
13
+ readonly "2000": "ws://127.0.0.1:13144";
14
+ };
15
+ readonly gatewayContract: "0xb1185ede04202fe62d38f5db72f71e38ff3e8305";
16
+ readonly beefyContract: "0x83428c7db9815f482a39a1715684dcf755021997";
17
+ readonly assetHubParaId: 1000;
18
+ readonly bridgeHubParaId: 1002;
19
+ readonly v2_parachains: readonly [1000];
20
+ readonly indexerGraphQlUrl: "http://127.0.0.1/does/not/exist";
21
+ };
22
+ readonly routes: readonly [];
23
+ readonly registry: {
24
+ readonly timestamp: "2026-03-03T03:46:58.680Z";
25
+ readonly environment: "local_e2e";
26
+ readonly ethChainId: 11155111;
27
+ readonly gatewayAddress: "0xb1185ede04202fe62d38f5db72f71e38ff3e8305";
28
+ readonly assetHubParaId: 1000;
29
+ readonly bridgeHubParaId: 1002;
30
+ readonly relaychain: {
31
+ readonly tokenSymbols: "WND";
32
+ readonly tokenDecimals: 12;
33
+ readonly ss58Format: 42;
34
+ readonly isEthereum: false;
35
+ readonly accountType: "AccountId32";
36
+ readonly name: "Westend Local Testnet";
37
+ readonly specName: "westend";
38
+ readonly specVersion: 1021002;
39
+ };
40
+ readonly bridgeHub: {
41
+ readonly tokenSymbols: "WND";
42
+ readonly tokenDecimals: 12;
43
+ readonly ss58Format: 42;
44
+ readonly isEthereum: false;
45
+ readonly accountType: "AccountId32";
46
+ readonly name: "Westend BridgeHub Local";
47
+ readonly specName: "bridge-hub-westend";
48
+ readonly specVersion: 1021002;
49
+ };
50
+ readonly ethereumChains: {
51
+ readonly ethereum_11155111: {
52
+ readonly kind: "ethereum";
53
+ readonly id: 11155111;
54
+ readonly name: "sepolia";
55
+ readonly assets: {
56
+ readonly "0x0000000000000000000000000000000000000000": {
57
+ readonly token: "0x0000000000000000000000000000000000000000";
58
+ readonly name: "Ether";
59
+ readonly symbol: "ETH";
60
+ readonly decimals: 18;
61
+ };
62
+ };
63
+ readonly key: "ethereum_11155111";
64
+ readonly baseDeliveryGas: 120000n;
65
+ };
66
+ };
67
+ readonly parachains: {
68
+ readonly polkadot_1000: {
69
+ readonly id: 1000;
70
+ readonly kind: "polkadot";
71
+ readonly key: "polkadot_1000";
72
+ readonly features: {
73
+ readonly hasPalletXcm: true;
74
+ readonly hasDryRunApi: true;
75
+ readonly hasTxPaymentApi: true;
76
+ readonly hasDryRunRpc: true;
77
+ readonly hasDotBalance: true;
78
+ readonly hasEthBalance: false;
79
+ readonly hasXcmPaymentApi: true;
80
+ readonly supportsAliasOrigin: true;
81
+ readonly xcmVersion: "v5";
82
+ readonly supportsV2: true;
83
+ };
84
+ readonly info: {
85
+ readonly tokenSymbols: "WND";
86
+ readonly tokenDecimals: 12;
87
+ readonly ss58Format: 42;
88
+ readonly isEthereum: false;
89
+ readonly accountType: "AccountId32";
90
+ readonly name: "Westend Asset Hub Local";
91
+ readonly specName: "westmint";
92
+ readonly specVersion: 1021004;
93
+ };
94
+ readonly assets: {
95
+ readonly "0x0000000000000000000000000000000000000000": {
96
+ readonly token: "0x0000000000000000000000000000000000000000";
97
+ readonly name: "Ether";
98
+ readonly minimumBalance: 15000000000000n;
99
+ readonly symbol: "ETH";
100
+ readonly decimals: 18;
101
+ readonly isSufficient: true;
102
+ };
103
+ };
104
+ readonly estimatedExecutionFeeDOT: 0n;
105
+ readonly estimatedDeliveryFeeDOT: 0n;
106
+ };
107
+ readonly polkadot_2000: {
108
+ readonly id: 2000;
109
+ readonly kind: "polkadot";
110
+ readonly key: "polkadot_2000";
111
+ readonly features: {
112
+ readonly hasPalletXcm: true;
113
+ readonly hasDryRunApi: true;
114
+ readonly hasTxPaymentApi: true;
115
+ readonly hasDryRunRpc: true;
116
+ readonly hasDotBalance: true;
117
+ readonly hasEthBalance: false;
118
+ readonly hasXcmPaymentApi: true;
119
+ readonly supportsAliasOrigin: true;
120
+ readonly xcmVersion: "v5";
121
+ readonly supportsV2: false;
122
+ };
123
+ readonly info: {
124
+ readonly tokenSymbols: "undefined";
125
+ readonly tokenDecimals: number;
126
+ readonly ss58Format: 42;
127
+ readonly isEthereum: false;
128
+ readonly accountType: "AccountId32";
129
+ readonly name: "Penpal Parachain";
130
+ readonly specName: "penpal-parachain";
131
+ readonly specVersion: 1;
132
+ };
133
+ readonly assets: {};
134
+ readonly estimatedExecutionFeeDOT: 3276800000n;
135
+ readonly estimatedDeliveryFeeDOT: 31450000000n;
136
+ };
137
+ };
138
+ };
139
+ readonly chains: {
140
+ readonly sepolia: {
141
+ readonly key: "ethereum_11155111";
142
+ readonly kind: "ethereum";
143
+ readonly id: 11155111;
144
+ };
145
+ readonly assetHub: {
146
+ readonly key: "polkadot_1000";
147
+ readonly kind: "polkadot";
148
+ readonly id: 1000;
149
+ };
150
+ readonly penpalParachain: {
151
+ readonly key: "polkadot_2000";
152
+ readonly kind: "polkadot";
153
+ readonly id: 2000;
154
+ };
155
+ };
156
+ };
157
+ export default registry;
158
+ //# sourceMappingURL=local_e2e_bridge_info.g.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local_e2e_bridge_info.g.d.ts","sourceRoot":"","sources":["../src/local_e2e_bridge_info.g.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2JJ,CAAA;AACV,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const registry = {
4
+ environment: {
5
+ name: "local_e2e",
6
+ ethChainId: 11155111,
7
+ beaconApiUrl: "http://127.0.0.1:9596",
8
+ ethereumChains: {
9
+ "11155111": "ws://127.0.0.1:8546",
10
+ },
11
+ relaychainUrl: "ws://127.0.0.1:9944",
12
+ parachains: {
13
+ "1000": "ws://127.0.0.1:12144",
14
+ "1002": "ws://127.0.0.1:11144",
15
+ "2000": "ws://127.0.0.1:13144",
16
+ },
17
+ gatewayContract: "0xb1185ede04202fe62d38f5db72f71e38ff3e8305",
18
+ beefyContract: "0x83428c7db9815f482a39a1715684dcf755021997",
19
+ assetHubParaId: 1000,
20
+ bridgeHubParaId: 1002,
21
+ v2_parachains: [1000],
22
+ indexerGraphQlUrl: "http://127.0.0.1/does/not/exist",
23
+ },
24
+ routes: [],
25
+ registry: {
26
+ timestamp: "2026-03-03T03:46:58.680Z",
27
+ environment: "local_e2e",
28
+ ethChainId: 11155111,
29
+ gatewayAddress: "0xb1185ede04202fe62d38f5db72f71e38ff3e8305",
30
+ assetHubParaId: 1000,
31
+ bridgeHubParaId: 1002,
32
+ relaychain: {
33
+ tokenSymbols: "WND",
34
+ tokenDecimals: 12,
35
+ ss58Format: 42,
36
+ isEthereum: false,
37
+ accountType: "AccountId32",
38
+ name: "Westend Local Testnet",
39
+ specName: "westend",
40
+ specVersion: 1021002,
41
+ },
42
+ bridgeHub: {
43
+ tokenSymbols: "WND",
44
+ tokenDecimals: 12,
45
+ ss58Format: 42,
46
+ isEthereum: false,
47
+ accountType: "AccountId32",
48
+ name: "Westend BridgeHub Local",
49
+ specName: "bridge-hub-westend",
50
+ specVersion: 1021002,
51
+ },
52
+ ethereumChains: {
53
+ ethereum_11155111: {
54
+ kind: "ethereum",
55
+ id: 11155111,
56
+ name: "sepolia",
57
+ assets: {
58
+ "0x0000000000000000000000000000000000000000": {
59
+ token: "0x0000000000000000000000000000000000000000",
60
+ name: "Ether",
61
+ symbol: "ETH",
62
+ decimals: 18,
63
+ },
64
+ },
65
+ key: "ethereum_11155111",
66
+ baseDeliveryGas: 120000n,
67
+ },
68
+ },
69
+ parachains: {
70
+ polkadot_1000: {
71
+ id: 1000,
72
+ kind: "polkadot",
73
+ key: "polkadot_1000",
74
+ features: {
75
+ hasPalletXcm: true,
76
+ hasDryRunApi: true,
77
+ hasTxPaymentApi: true,
78
+ hasDryRunRpc: true,
79
+ hasDotBalance: true,
80
+ hasEthBalance: false,
81
+ hasXcmPaymentApi: true,
82
+ supportsAliasOrigin: true,
83
+ xcmVersion: "v5",
84
+ supportsV2: true,
85
+ },
86
+ info: {
87
+ tokenSymbols: "WND",
88
+ tokenDecimals: 12,
89
+ ss58Format: 42,
90
+ isEthereum: false,
91
+ accountType: "AccountId32",
92
+ name: "Westend Asset Hub Local",
93
+ specName: "westmint",
94
+ specVersion: 1021004,
95
+ },
96
+ assets: {
97
+ "0x0000000000000000000000000000000000000000": {
98
+ token: "0x0000000000000000000000000000000000000000",
99
+ name: "Ether",
100
+ minimumBalance: 15000000000000n,
101
+ symbol: "ETH",
102
+ decimals: 18,
103
+ isSufficient: true,
104
+ },
105
+ },
106
+ estimatedExecutionFeeDOT: 0n,
107
+ estimatedDeliveryFeeDOT: 0n,
108
+ },
109
+ polkadot_2000: {
110
+ id: 2000,
111
+ kind: "polkadot",
112
+ key: "polkadot_2000",
113
+ features: {
114
+ hasPalletXcm: true,
115
+ hasDryRunApi: true,
116
+ hasTxPaymentApi: true,
117
+ hasDryRunRpc: true,
118
+ hasDotBalance: true,
119
+ hasEthBalance: false,
120
+ hasXcmPaymentApi: true,
121
+ supportsAliasOrigin: true,
122
+ xcmVersion: "v5",
123
+ supportsV2: false,
124
+ },
125
+ info: {
126
+ tokenSymbols: "undefined",
127
+ tokenDecimals: NaN,
128
+ ss58Format: 42,
129
+ isEthereum: false,
130
+ accountType: "AccountId32",
131
+ name: "Penpal Parachain",
132
+ specName: "penpal-parachain",
133
+ specVersion: 1,
134
+ },
135
+ assets: {},
136
+ estimatedExecutionFeeDOT: 3276800000n,
137
+ estimatedDeliveryFeeDOT: 31450000000n,
138
+ },
139
+ },
140
+ },
141
+ chains: {
142
+ sepolia: {
143
+ key: "ethereum_11155111",
144
+ kind: "ethereum",
145
+ id: 11155111,
146
+ },
147
+ assetHub: {
148
+ key: "polkadot_1000",
149
+ kind: "polkadot",
150
+ id: 1000,
151
+ },
152
+ penpalParachain: {
153
+ key: "polkadot_2000",
154
+ kind: "polkadot",
155
+ id: 2000,
156
+ },
157
+ },
158
+ };
159
+ exports.default = registry;