@snowbridge/registry 0.4.0 → 0.4.1-beta.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.
@@ -5,13 +5,15 @@ const registry = {
5
5
  beaconApiUrl: "https://lodestar-mainnet.chainsafe.io",
6
6
  ethereumChains: {
7
7
  "1": "https://ethereum-rpc.publicnode.com",
8
+ "10": "https://optimism-rpc.publicnode.com",
8
9
  "1284": "https://rpc.api.moonbeam.network",
9
10
  "8453": "https://base-rpc.publicnode.com",
11
+ "42161": "https://arbitrum-one-rpc.publicnode.com",
10
12
  },
11
13
  relaychainUrl: "https://polkadot-rpc.n.dwellir.com",
12
14
  parachains: {
13
- "1000": "wss://asset-hub-polkadot-rpc.n.dwellir.com",
14
- "1002": "https://bridge-hub-polkadot-rpc.n.dwellir.com",
15
+ "1000": "wss://polkadot-asset-hub-rpc.polkadot.io",
16
+ "1002": "wss://polkadot-bridge-hub-rpc.polkadot.io",
15
17
  "2000": "wss://acala-rpc-0.aca-api.network",
16
18
  "2004": "wss://moonbeam.ibp.network",
17
19
  "2030": "wss://bifrost-polkadot.ibp.network",
@@ -20,12 +22,12 @@ const registry = {
20
22
  "3369": "wss://polkadot-mythos-rpc.polkadot.io",
21
23
  },
22
24
  gatewayContract: "0x27ca963c279c93801941e1eb8799c23f407d68e7",
23
- beefyContract: "0x1817874feAb3ce053d0F40AbC23870DB35C2AFfc",
25
+ beefyContract: "0x1817874feab3ce053d0f40abc23870db35c2affc",
24
26
  assetHubParaId: 1000,
25
27
  bridgeHubParaId: 1002,
26
28
  v2_parachains: [1000],
27
29
  indexerGraphQlUrl:
28
- "https://snowbridge.squids.live/snowbridge-subsquid-polkadot@v2/api/graphql",
30
+ "https://subsquid.snowbridge.network/graphql",
29
31
  kusama: {
30
32
  assetHubParaId: 1000,
31
33
  bridgeHubParaId: 1002,
@@ -44,14 +46,30 @@ const registry = {
44
46
  },
45
47
  l2Bridge: {
46
48
  acrossAPIUrl: "https://app.across.to/api",
47
- l1AdapterAddress: "0x313E8c9Fb47613f2B1A436bE978c2BB75727fcC5",
48
- l1HandlerAddress: "0x924a9f036260DdD5808007E1AA95f08eD08aA569",
49
+ l1AdapterAddress: "0xd3b11c36404b092645522b682832fcdee07d2668",
50
+ l1HandlerAddress: "0x924a9f036260ddd5808007e1aa95f08ed08aa569",
49
51
  l1FeeTokenAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
50
- l1SwapQuoterAddress: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
51
- l1SwapRouterAddress: "0xE592427A0AEce92De3Edee1F18E0157C05861564",
52
+ l1SwapQuoterAddress: "0x61ffe014ba17989e743c5f6cb21bf9697530b21e",
53
+ l1SwapRouterAddress: "0xe592427a0aece92de3edee1f18e0157c05861564",
52
54
  l2Chains: {
55
+ "10": {
56
+ adapterAddress: "0x836895ad176235dfe9c59b3df56c7579d90ea338",
57
+ feeTokenAddress: "0x4200000000000000000000000000000000000006",
58
+ swapRoutes: [
59
+ {
60
+ inputToken: "0x4200000000000000000000000000000000000006",
61
+ outputToken: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
62
+ swapFee: 0,
63
+ },
64
+ {
65
+ inputToken: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
66
+ outputToken: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
67
+ swapFee: 500,
68
+ },
69
+ ],
70
+ },
53
71
  "8453": {
54
- adapterAddress: "0xCd5d2c665E3AC84bF5c67FE7a0C48748dA40db2F",
72
+ adapterAddress: "0x07fe4e7340976fc873b74bafe3c3e5b0e01f3665",
55
73
  feeTokenAddress: "0x4200000000000000000000000000000000000006",
56
74
  swapRoutes: [
57
75
  {
@@ -60,8 +78,24 @@ const registry = {
60
78
  swapFee: 0,
61
79
  },
62
80
  {
63
- inputToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
64
- outputToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
81
+ inputToken: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
82
+ outputToken: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
83
+ swapFee: 500,
84
+ },
85
+ ],
86
+ },
87
+ "42161": {
88
+ adapterAddress: "0x836895ad176235dfe9c59b3df56c7579d90ea338",
89
+ feeTokenAddress: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
90
+ swapRoutes: [
91
+ {
92
+ inputToken: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
93
+ outputToken: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
94
+ swapFee: 0,
95
+ },
96
+ {
97
+ inputToken: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
98
+ outputToken: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
65
99
  swapFee: 500,
66
100
  },
67
101
  ],
@@ -434,9 +468,99 @@ const registry = {
434
468
  "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
435
469
  ],
436
470
  },
471
+ {
472
+ from: {
473
+ kind: "polkadot",
474
+ id: 1000,
475
+ },
476
+ to: {
477
+ kind: "ethereum_l2",
478
+ id: 10,
479
+ },
480
+ assets: [
481
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
482
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
483
+ "0x0000000000000000000000000000000000000000",
484
+ ],
485
+ },
486
+ {
487
+ from: {
488
+ kind: "ethereum_l2",
489
+ id: 10,
490
+ },
491
+ to: {
492
+ kind: "polkadot",
493
+ id: 1000,
494
+ },
495
+ assets: [
496
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
497
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
498
+ "0x0000000000000000000000000000000000000000",
499
+ ],
500
+ },
501
+ {
502
+ from: {
503
+ kind: "polkadot",
504
+ id: 1000,
505
+ },
506
+ to: {
507
+ kind: "ethereum_l2",
508
+ id: 8453,
509
+ },
510
+ assets: [
511
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
512
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
513
+ "0x0000000000000000000000000000000000000000",
514
+ ],
515
+ },
516
+ {
517
+ from: {
518
+ kind: "ethereum_l2",
519
+ id: 8453,
520
+ },
521
+ to: {
522
+ kind: "polkadot",
523
+ id: 1000,
524
+ },
525
+ assets: [
526
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
527
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
528
+ "0x0000000000000000000000000000000000000000",
529
+ ],
530
+ },
531
+ {
532
+ from: {
533
+ kind: "polkadot",
534
+ id: 1000,
535
+ },
536
+ to: {
537
+ kind: "ethereum_l2",
538
+ id: 42161,
539
+ },
540
+ assets: [
541
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
542
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
543
+ "0x0000000000000000000000000000000000000000",
544
+ ],
545
+ },
546
+ {
547
+ from: {
548
+ kind: "ethereum_l2",
549
+ id: 42161,
550
+ },
551
+ to: {
552
+ kind: "polkadot",
553
+ id: 1000,
554
+ },
555
+ assets: [
556
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
557
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
558
+ "0x0000000000000000000000000000000000000000",
559
+ ],
560
+ },
437
561
  ],
438
562
  registry: {
439
- timestamp: "2026-02-03T21:35:14.732Z",
563
+ timestamp: "2026-03-27T09:55:18.302Z",
440
564
  environment: "polkadot_mainnet",
441
565
  ethChainId: 1,
442
566
  gatewayAddress: "0x27ca963c279c93801941e1eb8799c23f407d68e7",
@@ -450,7 +574,7 @@ const registry = {
450
574
  accountType: "AccountId32",
451
575
  name: "Polkadot",
452
576
  specName: "polkadot",
453
- specVersion: 2000005,
577
+ specVersion: 2001001,
454
578
  },
455
579
  bridgeHub: {
456
580
  tokenSymbols: "DOT",
@@ -460,12 +584,13 @@ const registry = {
460
584
  accountType: "AccountId32",
461
585
  name: "Polkadot BridgeHub",
462
586
  specName: "bridge-hub-polkadot",
463
- specVersion: 2000005,
587
+ specVersion: 2001001,
464
588
  },
465
589
  ethereumChains: {
466
590
  ethereum_1: {
467
591
  kind: "ethereum",
468
592
  id: 1,
593
+ name: "mainnet",
469
594
  assets: {
470
595
  "0x9d39a5de30e57443bff2a8307a4256c8797a3497": {
471
596
  token: "0x9d39a5de30e57443bff2a8307a4256c8797a3497",
@@ -743,6 +868,38 @@ const registry = {
743
868
  key: "ethereum_1",
744
869
  baseDeliveryGas: 120000n,
745
870
  },
871
+ ethereum_l2_10: {
872
+ kind: "ethereum_l2",
873
+ id: 10,
874
+ name: "optimism",
875
+ assets: {
876
+ "0x4200000000000000000000000000000000000006": {
877
+ token: "0x4200000000000000000000000000000000000006",
878
+ name: "Wrapped Ether",
879
+ symbol: "WETH",
880
+ decimals: 18,
881
+ swapTokenAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
882
+ swapFee: 0,
883
+ },
884
+ "0x0b2c639c533813f4aa9d7837caf62653d097ff85": {
885
+ token: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
886
+ name: "USD Coin",
887
+ symbol: "USDC",
888
+ decimals: 6,
889
+ swapTokenAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
890
+ swapFee: 500,
891
+ },
892
+ "0x0000000000000000000000000000000000000000": {
893
+ token: "0x0000000000000000000000000000000000000000",
894
+ name: "Ether",
895
+ symbol: "Ether",
896
+ decimals: 18,
897
+ swapTokenAddress: "0x0000000000000000000000000000000000000000",
898
+ swapFee: 0,
899
+ },
900
+ },
901
+ key: "ethereum_l2_10",
902
+ },
746
903
  ethereum_1284: {
747
904
  kind: "ethereum",
748
905
  id: 1284,
@@ -820,6 +977,7 @@ const registry = {
820
977
  ethereum_l2_8453: {
821
978
  kind: "ethereum_l2",
822
979
  id: 8453,
980
+ name: "base",
823
981
  assets: {
824
982
  "0x4200000000000000000000000000000000000006": {
825
983
  token: "0x4200000000000000000000000000000000000006",
@@ -829,12 +987,12 @@ const registry = {
829
987
  swapTokenAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
830
988
  swapFee: 0,
831
989
  },
832
- "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": {
833
- token: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
990
+ "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913": {
991
+ token: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
834
992
  name: "USD Coin",
835
993
  symbol: "USDC",
836
994
  decimals: 6,
837
- swapTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
995
+ swapTokenAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
838
996
  swapFee: 500,
839
997
  },
840
998
  "0x0000000000000000000000000000000000000000": {
@@ -848,6 +1006,38 @@ const registry = {
848
1006
  },
849
1007
  key: "ethereum_l2_8453",
850
1008
  },
1009
+ ethereum_l2_42161: {
1010
+ kind: "ethereum_l2",
1011
+ id: 42161,
1012
+ name: "arbitrum",
1013
+ assets: {
1014
+ "0x82af49447d8a07e3bd95bd0d56f35241523fbab1": {
1015
+ token: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
1016
+ name: "Wrapped Ether",
1017
+ symbol: "WETH",
1018
+ decimals: 18,
1019
+ swapTokenAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
1020
+ swapFee: 0,
1021
+ },
1022
+ "0xaf88d065e77c8cc2239327c5edb3a432268e5831": {
1023
+ token: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
1024
+ name: "USD Coin",
1025
+ symbol: "USDC",
1026
+ decimals: 6,
1027
+ swapTokenAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
1028
+ swapFee: 500,
1029
+ },
1030
+ "0x0000000000000000000000000000000000000000": {
1031
+ token: "0x0000000000000000000000000000000000000000",
1032
+ name: "Ether",
1033
+ symbol: "Ether",
1034
+ decimals: 18,
1035
+ swapTokenAddress: "0x0000000000000000000000000000000000000000",
1036
+ swapFee: 0,
1037
+ },
1038
+ },
1039
+ key: "ethereum_l2_42161",
1040
+ },
851
1041
  },
852
1042
  parachains: {
853
1043
  polkadot_1000: {
@@ -874,7 +1064,7 @@ const registry = {
874
1064
  accountType: "AccountId32",
875
1065
  name: "Polkadot Asset Hub",
876
1066
  specName: "statemint",
877
- specVersion: 2000005,
1067
+ specVersion: 2001001,
878
1068
  },
879
1069
  assets: {
880
1070
  "0x9d39a5de30e57443bff2a8307a4256c8797a3497": {
@@ -1498,7 +1688,7 @@ const registry = {
1498
1688
  accountType: "AccountId32",
1499
1689
  name: "Acala",
1500
1690
  specName: "acala",
1501
- specVersion: 2330,
1691
+ specVersion: 2350,
1502
1692
  },
1503
1693
  assets: {
1504
1694
  "0x0000000000000000000000000000000000000000": {
@@ -1510,7 +1700,7 @@ const registry = {
1510
1700
  isSufficient: false,
1511
1701
  },
1512
1702
  },
1513
- estimatedExecutionFeeDOT: 300000000n,
1703
+ estimatedExecutionFeeDOT: 484934n,
1514
1704
  estimatedDeliveryFeeDOT: 307100000n,
1515
1705
  },
1516
1706
  polkadot_2004: {
@@ -1538,7 +1728,7 @@ const registry = {
1538
1728
  evmChainId: 1284,
1539
1729
  name: "Moonbeam",
1540
1730
  specName: "moonbeam",
1541
- specVersion: 4102,
1731
+ specVersion: 4103,
1542
1732
  },
1543
1733
  xcDOT: "0xffffffff1fcacbd218edc0eba20fc2308c778080",
1544
1734
  assets: {
@@ -1634,7 +1824,7 @@ const registry = {
1634
1824
  evmChainId: 996,
1635
1825
  name: "Bifrost Polkadot",
1636
1826
  specName: "bifrost_polkadot",
1637
- specVersion: 23001,
1827
+ specVersion: 23003,
1638
1828
  },
1639
1829
  assets: {
1640
1830
  "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
@@ -1654,7 +1844,7 @@ const registry = {
1654
1844
  isSufficient: false,
1655
1845
  },
1656
1846
  },
1657
- estimatedExecutionFeeDOT: 82505857n,
1847
+ estimatedExecutionFeeDOT: 54689726n,
1658
1848
  estimatedDeliveryFeeDOT: 307100000n,
1659
1849
  },
1660
1850
  polkadot_2034: {
@@ -1667,10 +1857,10 @@ const registry = {
1667
1857
  hasTxPaymentApi: true,
1668
1858
  hasDryRunRpc: true,
1669
1859
  hasDotBalance: true,
1670
- hasEthBalance: false,
1860
+ hasEthBalance: true,
1671
1861
  hasXcmPaymentApi: true,
1672
- supportsAliasOrigin: false,
1673
- xcmVersion: "v4",
1862
+ supportsAliasOrigin: true,
1863
+ xcmVersion: "v5",
1674
1864
  supportsV2: false,
1675
1865
  },
1676
1866
  info: {
@@ -1682,7 +1872,7 @@ const registry = {
1682
1872
  evmChainId: 222222,
1683
1873
  name: "Hydration",
1684
1874
  specName: "hydradx",
1685
- specVersion: 379,
1875
+ specVersion: 398,
1686
1876
  },
1687
1877
  assets: {
1688
1878
  "0x45804880de22913dafe09f4980848ece6ecbaf78": {
@@ -1838,7 +2028,7 @@ const registry = {
1838
2028
  isSufficient: true,
1839
2029
  },
1840
2030
  },
1841
- estimatedExecutionFeeDOT: 1478898n,
2031
+ estimatedExecutionFeeDOT: 1169428n,
1842
2032
  estimatedDeliveryFeeDOT: 307100000n,
1843
2033
  },
1844
2034
  polkadot_2043: {
@@ -1891,9 +2081,9 @@ const registry = {
1891
2081
  hasDryRunRpc: true,
1892
2082
  hasDotBalance: false,
1893
2083
  hasEthBalance: false,
1894
- hasXcmPaymentApi: false,
1895
- supportsAliasOrigin: false,
1896
- xcmVersion: "v4",
2084
+ hasXcmPaymentApi: true,
2085
+ supportsAliasOrigin: true,
2086
+ xcmVersion: "v5",
1897
2087
  supportsV2: false,
1898
2088
  },
1899
2089
  info: {
@@ -1904,7 +2094,7 @@ const registry = {
1904
2094
  accountType: "AccountId20",
1905
2095
  name: "Mythos",
1906
2096
  specName: "mythos",
1907
- specVersion: 1016,
2097
+ specVersion: 1021,
1908
2098
  },
1909
2099
  assets: {
1910
2100
  "0xba41ddf06b7ffd89d1267b5a93bfef2424eb2003": {
@@ -1946,7 +2136,7 @@ const registry = {
1946
2136
  accountType: "AccountId32",
1947
2137
  name: "Kusama Asset Hub",
1948
2138
  specName: "statemine",
1949
- specVersion: 2000004,
2139
+ specVersion: 2001000,
1950
2140
  },
1951
2141
  assets: {
1952
2142
  "0x9d39a5de30e57443bff2a8307a4256c8797a3497": {
package/src/transfers.ts CHANGED
@@ -9,51 +9,66 @@ import {
9
9
  } from "@snowbridge/base-types"
10
10
 
11
11
  export function getTransferLocation(registry: AssetRegistry, chain: ChainId): TransferLocation {
12
- let location: TransferLocation | null = null
13
- if (chain.kind === "kusama" && registry.kusama) {
14
- const parachain = registry.kusama.parachains[`${chain.kind}_${chain.id}`]
15
- location = {
16
- id: parachain.id,
17
- kind: parachain.kind,
18
- name: parachain.info.name,
19
- key: parachain.key,
20
- parachain,
12
+ switch (chain.kind) {
13
+ case "kusama": {
14
+ if (!registry.kusama) throw Error(`Kusama not configured.`)
15
+ const key = `${chain.kind}_${chain.id}` as const
16
+ const parachain = registry.kusama.parachains[key]
17
+ if (!parachain) throw Error(`Cannot find chain ${key}`)
18
+ return {
19
+ id: parachain.id,
20
+ kind: parachain.kind,
21
+ key: parachain.key,
22
+ parachain,
23
+ }
21
24
  }
22
- } else if (chain.kind === "polkadot") {
23
- const parachain = registry.parachains[`${chain.kind}_${chain.id}`]
24
- location = {
25
- id: parachain.id,
26
- kind: parachain.kind,
27
- name: parachain.info.name,
28
- key: parachain.key,
29
- parachain,
25
+ case "polkadot": {
26
+ const key = `${chain.kind}_${chain.id}` as const
27
+ const parachain = registry.parachains[key]
28
+ if (!parachain) throw Error(`Cannot find chain ${key}`)
29
+ return {
30
+ id: parachain.id,
31
+ kind: parachain.kind,
32
+ key: parachain.key,
33
+ parachain,
34
+ }
30
35
  }
31
- } else if (chain.kind === "ethereum") {
32
- const ethChain = registry.ethereumChains[`${chain.kind}_${chain.id}`]
33
- if (!ethChain.evmParachainId) {
34
- location = {
35
- kind: ethChain.kind,
36
- id: ethChain.id,
37
- key: ethChain.key,
38
- name: "Ethereum",
39
- ethChain,
36
+ case "ethereum": {
37
+ const key = `${chain.kind}_${chain.id}` as const
38
+ const ethChain = registry.ethereumChains[key]
39
+ if (!ethChain) throw Error(`Cannot find chain ${key}`)
40
+ if (!ethChain.evmParachainId) {
41
+ return {
42
+ kind: ethChain.kind,
43
+ id: ethChain.id,
44
+ key: ethChain.key,
45
+ ethChain,
46
+ }
47
+ } else {
48
+ const evmChain = registry.parachains[`polkadot_${ethChain.evmParachainId}`]
49
+ return {
50
+ kind: ethChain.kind,
51
+ id: ethChain.id,
52
+ key: ethChain.key,
53
+ ethChain,
54
+ parachain: evmChain,
55
+ }
40
56
  }
41
- } else {
42
- const evmChain = registry.parachains[`polkadot_${ethChain.evmParachainId}`]
43
- location = {
57
+ }
58
+ case "ethereum_l2": {
59
+ const key = `${chain.kind}_${chain.id}` as const
60
+ const ethChain = registry.ethereumChains[key]
61
+ if (!ethChain) throw Error(`Cannot find chain ${key}`)
62
+ return {
44
63
  kind: ethChain.kind,
45
64
  id: ethChain.id,
46
65
  key: ethChain.key,
47
- name: `${evmChain.info.name} (EVM)`,
48
66
  ethChain,
49
- parachain: evmChain,
50
67
  }
51
68
  }
69
+ default:
70
+ throw Error(`Unknown ${chain.kind} chain ${chain.id}.`)
52
71
  }
53
-
54
- if (location === null) throw Error(`Unknown ${chain.kind} chain ${chain.id}.`)
55
-
56
- return location
57
72
  }
58
73
 
59
74
  export function getTransferLocations(routes: readonly TransferRoute[]): Source[] {