@snowbridge/registry 0.3.0 → 0.3.2-alpha.1

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.
@@ -1,3 +1,4 @@
1
+ import "dotenv/config"
1
2
  import {
2
3
  AssetOverrideMap,
3
4
  AssetRegistry,
@@ -8,6 +9,7 @@ import {
8
9
  ERC20MetadataOverrideMap,
9
10
  EthereumChain,
10
11
  KusamaConfig,
12
+ L2ForwardMetadata,
11
13
  Parachain,
12
14
  ParachainMap,
13
15
  PNAMap,
@@ -30,6 +32,7 @@ async function buildRegistry(environment: Environment): Promise<AssetRegistry> {
30
32
  ethChainId,
31
33
  assetHubParaId,
32
34
  bridgeHubParaId,
35
+ v2_parachains,
33
36
  parachains,
34
37
  gatewayContract,
35
38
  assetOverrides,
@@ -37,6 +40,7 @@ async function buildRegistry(environment: Environment): Promise<AssetRegistry> {
37
40
  metadataOverrides,
38
41
  kusama,
39
42
  name,
43
+ l2Bridge,
40
44
  } = environment
41
45
 
42
46
  let relayInfo: ChainProperties
@@ -140,6 +144,7 @@ async function buildRegistry(environment: Environment): Promise<AssetRegistry> {
140
144
  assetHubParaId,
141
145
  pnaAssets,
142
146
  assetOverrides ?? {},
147
+ v2_parachains,
143
148
  )
144
149
  return { parachainId, para }
145
150
  }),
@@ -161,6 +166,7 @@ async function buildRegistry(environment: Environment): Promise<AssetRegistry> {
161
166
  paras,
162
167
  precompiles ?? {},
163
168
  metadataOverrides ?? {},
169
+ l2Bridge?.l2Chains ?? {},
164
170
  )
165
171
  }),
166
172
  )) {
@@ -303,6 +309,7 @@ async function indexParachain(
303
309
  assetHubParaId: number,
304
310
  pnaAssets: PNAMap,
305
311
  assetOverrides: AssetOverrideMap,
312
+ v2_parachains?: number[],
306
313
  ): Promise<Parachain> {
307
314
  const info = await parachain.chainProperties()
308
315
 
@@ -390,6 +397,7 @@ async function indexParachain(
390
397
  hasXcmPaymentApi,
391
398
  supportsAliasOrigin,
392
399
  xcmVersion,
400
+ supportsV2: v2_parachains?.includes(parachainId) ?? false,
393
401
  },
394
402
  info,
395
403
  xcDOT,
@@ -409,6 +417,7 @@ async function indexEthChain(
409
417
  parachains: ParachainMap,
410
418
  precompiles: PrecompileMap,
411
419
  metadataOverrides: ERC20MetadataOverrideMap,
420
+ l2Chains: { [l2ChainId: number]: L2ForwardMetadata },
412
421
  ): Promise<EthereumChain> {
413
422
  const id = networkName !== "unknown" ? networkName : undefined
414
423
  if (networkChainId == ethChainId) {
@@ -471,6 +480,29 @@ async function indexEthChain(
471
480
  id: id ?? `chain_${networkChainId}`,
472
481
  baseDeliveryGas: 120_000n,
473
482
  }
483
+ } else if (networkChainId in l2Chains) {
484
+ const assets: ERC20MetadataMap = {}
485
+ for (const route of l2Chains[networkChainId].swapRoutes) {
486
+ let asset = await assetErc20Metadata(provider, route.inputToken)
487
+ assets[route.inputToken] = {
488
+ ...asset,
489
+ swapTokenAddress: route.outputToken,
490
+ swapFee: route.swapFee,
491
+ }
492
+ }
493
+ assets["0x0000000000000000000000000000000000000000"] = {
494
+ token: "0x0000000000000000000000000000000000000000",
495
+ name: "Ether",
496
+ symbol: "Ether",
497
+ decimals: 18,
498
+ swapTokenAddress: "0x0000000000000000000000000000000000000000",
499
+ swapFee: 0,
500
+ }
501
+ return {
502
+ chainId: networkChainId,
503
+ assets,
504
+ id: id ?? `l2_${networkChainId}`,
505
+ }
474
506
  } else {
475
507
  let evmParachainChain: Parachain | undefined
476
508
  for (const paraId in parachains) {
@@ -25,6 +25,7 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
25
25
  beefyContract: "0x83428c7db9815f482a39a1715684dcf755021997",
26
26
  assetHubParaId: 1000,
27
27
  bridgeHubParaId: 1002,
28
+ v2_parachains: [1000],
28
29
  indexerGraphQlUrl: "http://127.0.0.1/does/not/exist",
29
30
  },
30
31
  paseo_sepolia: {
@@ -45,6 +46,7 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
45
46
  beefyContract: "0x2c780945beb1241fE9c645800110cb9C4bBbb639",
46
47
  assetHubParaId: 1000,
47
48
  bridgeHubParaId: 1002,
49
+ v2_parachains: [1000],
48
50
  indexerGraphQlUrl:
49
51
  "https://snowbridge.squids.live/snowbridge-subsquid-paseo@v1/api/graphql",
50
52
  metadataOverrides: {
@@ -62,6 +64,7 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
62
64
  ethereumChains: {
63
65
  "1": "https://ethereum-rpc.publicnode.com",
64
66
  "1284": "https://rpc.api.moonbeam.network",
67
+ "8453": "https://base-rpc.publicnode.com",
65
68
  },
66
69
  relaychainUrl: "https://polkadot-rpc.n.dwellir.com",
67
70
  parachains: {
@@ -80,8 +83,9 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
80
83
  beefyContract: "0x1817874feAb3ce053d0F40AbC23870DB35C2AFfc",
81
84
  assetHubParaId: 1000,
82
85
  bridgeHubParaId: 1002,
86
+ v2_parachains: [1000],
83
87
  indexerGraphQlUrl:
84
- "https://snowbridge.squids.live/snowbridge-subsquid-polkadot:production/api/graphql",
88
+ "https://snowbridge.squids.live/snowbridge-subsquid-polkadot@v2/api/graphql",
85
89
  kusama: {
86
90
  assetHubParaId: 1000,
87
91
  bridgeHubParaId: 1002,
@@ -100,6 +104,34 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
100
104
  name: "OriginTrail TRAC",
101
105
  },
102
106
  },
107
+ l2Bridge: {
108
+ acrossAPIUrl: "https://app.across.to/api",
109
+ l1AdapterAddress: "0x313E8c9Fb47613f2B1A436bE978c2BB75727fcC5",
110
+ l1HandlerAddress: "0x924a9f036260DdD5808007E1AA95f08eD08aA569",
111
+ l1FeeTokenAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
112
+ l1SwapQuoterAddress: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
113
+ l1SwapRouterAddress: "0xE592427A0AEce92De3Edee1F18E0157C05861564",
114
+ l2Chains: {
115
+ "8453": {
116
+ adapterAddress: "0xCd5d2c665E3AC84bF5c67FE7a0C48748dA40db2F",
117
+ feeTokenAddress: "0x4200000000000000000000000000000000000006",
118
+ swapRoutes: [
119
+ // WETH
120
+ {
121
+ inputToken: "0x4200000000000000000000000000000000000006",
122
+ outputToken: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
123
+ swapFee: 0,
124
+ },
125
+ // USDC
126
+ {
127
+ inputToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
128
+ outputToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
129
+ swapFee: 500,
130
+ },
131
+ ],
132
+ },
133
+ },
134
+ },
103
135
  },
104
136
  westend_sepolia: {
105
137
  name: "westend_sepolia",
@@ -107,6 +139,7 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
107
139
  beaconApiUrl: "https://lodestar-sepolia.chainsafe.io",
108
140
  ethereumChains: {
109
141
  "11155111": "https://ethereum-sepolia-rpc.publicnode.com",
142
+ "84532": "https://base-sepolia-rpc.publicnode.com",
110
143
  },
111
144
  relaychainUrl: "wss://westend-rpc.n.dwellir.com",
112
145
  parachains: {
@@ -114,10 +147,39 @@ const SNOWBRIDGE_ENV: { [env: string]: Environment } = {
114
147
  "1002": "wss://bridge-hub-westend-rpc.n.dwellir.com",
115
148
  },
116
149
  gatewayContract: "0x9ed8b47bc3417e3bd0507adc06e56e2fa360a4e9",
117
- beefyContract: "0x6DFaD3D73A28c48E4F4c616ECda80885b415283a",
150
+ beefyContract: "0xA04460B1D8bBef33F54edB2C3115e3E4D41237A6",
118
151
  assetHubParaId: 1000,
119
152
  bridgeHubParaId: 1002,
153
+ v2_parachains: [1000],
120
154
  indexerGraphQlUrl:
121
155
  "https://snowbridge.squids.live/snowbridge-subsquid-westend@v1/api/graphql",
156
+ l2Bridge: {
157
+ acrossAPIUrl: "https://testnet.across.to/api",
158
+ l1AdapterAddress: "0xA5B8589bD534701be49916c4d2e634aB1c765Cbf",
159
+ l1HandlerAddress: "0x924a9f036260DdD5808007E1AA95f08eD08aA569",
160
+ l1FeeTokenAddress: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
161
+ l1SwapRouterAddress: "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E",
162
+ l1SwapQuoterAddress: "0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",
163
+ l2Chains: {
164
+ "84532": {
165
+ adapterAddress: "0xf06939613A3838Af11104c898758220dB9093679",
166
+ feeTokenAddress: "0x4200000000000000000000000000000000000006",
167
+ swapRoutes: [
168
+ // WETH
169
+ {
170
+ inputToken: "0x4200000000000000000000000000000000000006",
171
+ outputToken: "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
172
+ swapFee: 0,
173
+ },
174
+ // USDC
175
+ {
176
+ inputToken: "0x036cbd53842c5426634e7929541ec2318f3dcf7e",
177
+ outputToken: "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
178
+ swapFee: 500,
179
+ },
180
+ ],
181
+ },
182
+ },
183
+ },
122
184
  },
123
185
  }
@@ -79,7 +79,12 @@
79
79
  "hasDryRunApi": true,
80
80
  "hasTxPaymentApi": true,
81
81
  "hasDryRunRpc": true,
82
- "hasDotBalance": true
82
+ "hasDotBalance": true,
83
+ "hasEthBalance": true,
84
+ "hasXcmPaymentApi": true,
85
+ "supportsAliasOrigin": true,
86
+ "xcmVersion": "v5",
87
+ "supportsV2": true
83
88
  },
84
89
  "info": {
85
90
  "tokenSymbols": "WND",
@@ -255,7 +260,12 @@
255
260
  "hasDryRunApi": true,
256
261
  "hasTxPaymentApi": true,
257
262
  "hasDryRunRpc": true,
258
- "hasDotBalance": true
263
+ "hasDotBalance": true,
264
+ "hasEthBalance": false,
265
+ "hasXcmPaymentApi": true,
266
+ "supportsAliasOrigin": false,
267
+ "xcmVersion": "v5",
268
+ "supportsV2": false
259
269
  },
260
270
  "info": {
261
271
  "tokenSymbols": "undefined",
@@ -83,7 +83,12 @@
83
83
  "hasDryRunApi": true,
84
84
  "hasTxPaymentApi": true,
85
85
  "hasDryRunRpc": true,
86
- "hasDotBalance": true
86
+ "hasDotBalance": true,
87
+ "hasEthBalance": true,
88
+ "hasXcmPaymentApi": true,
89
+ "supportsAliasOrigin": true,
90
+ "xcmVersion": "v5",
91
+ "supportsV2": true
87
92
  },
88
93
  "info": {
89
94
  "tokenSymbols": "PAS",
@@ -155,7 +160,12 @@
155
160
  "hasDryRunApi": false,
156
161
  "hasTxPaymentApi": true,
157
162
  "hasDryRunRpc": true,
158
- "hasDotBalance": false
163
+ "hasDotBalance": false,
164
+ "hasEthBalance": false,
165
+ "hasXcmPaymentApi": false,
166
+ "supportsAliasOrigin": false,
167
+ "xcmVersion": "v4",
168
+ "supportsV2": false
159
169
  },
160
170
  "info": {
161
171
  "tokenSymbols": "NEURO",
@@ -187,7 +197,12 @@
187
197
  "hasDryRunApi": true,
188
198
  "hasTxPaymentApi": true,
189
199
  "hasDryRunRpc": true,
190
- "hasDotBalance": false
200
+ "hasDotBalance": false,
201
+ "hasEthBalance": false,
202
+ "hasXcmPaymentApi": false,
203
+ "supportsAliasOrigin": false,
204
+ "xcmVersion": "v4",
205
+ "supportsV2": false
191
206
  },
192
207
  "info": {
193
208
  "tokenSymbols": "MUSE",
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-12-19T00:24:34.223Z",
2
+ "timestamp": "2026-01-19T12:15:32.614Z",
3
3
  "environment": "polkadot_mainnet",
4
4
  "ethChainId": 1,
5
5
  "gatewayAddress": "0x27ca963c279c93801941e1eb8799c23f407d68e7",
@@ -363,6 +363,36 @@
363
363
  "0xdac17f958d2ee523a2206206994597c13d831ec7": "0xffffffff7bc304425217b49e9598415c514ae81b"
364
364
  },
365
365
  "id": "evm_moonbeam"
366
+ },
367
+ "8453": {
368
+ "chainId": 8453,
369
+ "assets": {
370
+ "0x4200000000000000000000000000000000000006": {
371
+ "token": "0x4200000000000000000000000000000000000006",
372
+ "name": "Wrapped Ether",
373
+ "symbol": "WETH",
374
+ "decimals": 18,
375
+ "swapTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
376
+ "swapFee": 0
377
+ },
378
+ "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": {
379
+ "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
380
+ "name": "USD Coin",
381
+ "symbol": "USDC",
382
+ "decimals": 6,
383
+ "swapTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
384
+ "swapFee": 500
385
+ },
386
+ "0x0000000000000000000000000000000000000000": {
387
+ "token": "0x0000000000000000000000000000000000000000",
388
+ "name": "Ether",
389
+ "symbol": "Ether",
390
+ "decimals": 18,
391
+ "swapTokenAddress": "0x0000000000000000000000000000000000000000",
392
+ "swapFee": 0
393
+ }
394
+ },
395
+ "id": "base"
366
396
  }
367
397
  },
368
398
  "parachains": {
@@ -377,7 +407,8 @@
377
407
  "hasEthBalance": true,
378
408
  "hasXcmPaymentApi": true,
379
409
  "supportsAliasOrigin": true,
380
- "xcmVersion": "v5"
410
+ "xcmVersion": "v5",
411
+ "supportsV2": true
381
412
  },
382
413
  "info": {
383
414
  "tokenSymbols": "DOT",
@@ -991,7 +1022,8 @@
991
1022
  "hasEthBalance": true,
992
1023
  "hasXcmPaymentApi": true,
993
1024
  "supportsAliasOrigin": true,
994
- "xcmVersion": "v5"
1025
+ "xcmVersion": "v5",
1026
+ "supportsV2": false
995
1027
  },
996
1028
  "info": {
997
1029
  "tokenSymbols": "ACA",
@@ -1027,7 +1059,8 @@
1027
1059
  "hasEthBalance": false,
1028
1060
  "hasXcmPaymentApi": true,
1029
1061
  "supportsAliasOrigin": false,
1030
- "xcmVersion": "v5"
1062
+ "xcmVersion": "v5",
1063
+ "supportsV2": false
1031
1064
  },
1032
1065
  "info": {
1033
1066
  "tokenSymbols": "GLMR",
@@ -1120,7 +1153,8 @@
1120
1153
  "hasEthBalance": true,
1121
1154
  "hasXcmPaymentApi": true,
1122
1155
  "supportsAliasOrigin": true,
1123
- "xcmVersion": "v5"
1156
+ "xcmVersion": "v5",
1157
+ "supportsV2": false
1124
1158
  },
1125
1159
  "info": {
1126
1160
  "tokenSymbols": "BNC",
@@ -1131,7 +1165,7 @@
1131
1165
  "evmChainId": 996,
1132
1166
  "name": "Bifrost Polkadot",
1133
1167
  "specName": "bifrost_polkadot",
1134
- "specVersion": 22002
1168
+ "specVersion": 23000
1135
1169
  },
1136
1170
  "assets": {
1137
1171
  "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
@@ -1151,7 +1185,7 @@
1151
1185
  "isSufficient": false
1152
1186
  }
1153
1187
  },
1154
- "estimatedExecutionFeeDOT": "bigint:125952027",
1188
+ "estimatedExecutionFeeDOT": "bigint:94936522",
1155
1189
  "estimatedDeliveryFeeDOT": "bigint:307100000"
1156
1190
  },
1157
1191
  "2034": {
@@ -1165,7 +1199,8 @@
1165
1199
  "hasEthBalance": false,
1166
1200
  "hasXcmPaymentApi": true,
1167
1201
  "supportsAliasOrigin": false,
1168
- "xcmVersion": "v4"
1202
+ "xcmVersion": "v4",
1203
+ "supportsV2": false
1169
1204
  },
1170
1205
  "info": {
1171
1206
  "tokenSymbols": "HDX",
@@ -1176,7 +1211,7 @@
1176
1211
  "evmChainId": 222222,
1177
1212
  "name": "Hydration",
1178
1213
  "specName": "hydradx",
1179
- "specVersion": 359
1214
+ "specVersion": 378
1180
1215
  },
1181
1216
  "assets": {
1182
1217
  "0x45804880de22913dafe09f4980848ece6ecbaf78": {
@@ -1332,7 +1367,7 @@
1332
1367
  "isSufficient": true
1333
1368
  }
1334
1369
  },
1335
- "estimatedExecutionFeeDOT": "bigint:1934280",
1370
+ "estimatedExecutionFeeDOT": "bigint:1774411",
1336
1371
  "estimatedDeliveryFeeDOT": "bigint:307100000"
1337
1372
  },
1338
1373
  "2043": {
@@ -1346,7 +1381,8 @@
1346
1381
  "hasEthBalance": false,
1347
1382
  "hasXcmPaymentApi": true,
1348
1383
  "supportsAliasOrigin": false,
1349
- "xcmVersion": "v4"
1384
+ "xcmVersion": "v4",
1385
+ "supportsV2": false
1350
1386
  },
1351
1387
  "info": {
1352
1388
  "tokenSymbols": "NEURO",
@@ -1382,7 +1418,8 @@
1382
1418
  "hasEthBalance": false,
1383
1419
  "hasXcmPaymentApi": false,
1384
1420
  "supportsAliasOrigin": false,
1385
- "xcmVersion": "v4"
1421
+ "xcmVersion": "v4",
1422
+ "supportsV2": false
1386
1423
  },
1387
1424
  "info": {
1388
1425
  "tokenSymbols": "MYTH",
@@ -1421,7 +1458,8 @@
1421
1458
  "hasEthBalance": false,
1422
1459
  "hasXcmPaymentApi": true,
1423
1460
  "supportsAliasOrigin": true,
1424
- "xcmVersion": "v5"
1461
+ "xcmVersion": "v5",
1462
+ "supportsV2": false
1425
1463
  },
1426
1464
  "info": {
1427
1465
  "tokenSymbols": "KSM",
@@ -1431,7 +1469,7 @@
1431
1469
  "accountType": "AccountId32",
1432
1470
  "name": "Kusama Asset Hub",
1433
1471
  "specName": "statemine",
1434
- "specVersion": 2000003
1472
+ "specVersion": 2000004
1435
1473
  },
1436
1474
  "assets": {
1437
1475
  "0x9d39a5de30e57443bff2a8307a4256c8797a3497": {
@@ -1764,4 +1802,4 @@
1764
1802
  "assetHubParaId": 1000,
1765
1803
  "bridgeHubParaId": 1002
1766
1804
  }
1767
- }
1805
+ }