@uniswap/token-list-bridge-utils 2.8.0 → 2.10.0

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.
@@ -12,5 +12,6 @@ export declare enum ChainId {
12
12
  BNB = 56,
13
13
  AVALANCHE = 43114,
14
14
  BASE = 8453,
15
- UNICHAIN = 130
15
+ UNICHAIN = 130,
16
+ SONEIUM = 1868
16
17
  }
@@ -0,0 +1,5 @@
1
+ import { MappingProvider } from './MappingProvider';
2
+ import { MappedTokenData } from '../constants/types';
3
+ export declare class SoneiumMappingProvider implements MappingProvider {
4
+ provide(): Promise<MappedTokenData>;
5
+ }
@@ -902,6 +902,7 @@ var ChainId;
902
902
  ChainId[ChainId["AVALANCHE"] = 43114] = "AVALANCHE";
903
903
  ChainId[ChainId["BASE"] = 8453] = "BASE";
904
904
  ChainId[ChainId["UNICHAIN"] = 130] = "UNICHAIN";
905
+ ChainId[ChainId["SONEIUM"] = 1868] = "SONEIUM";
905
906
  })(ChainId || (ChainId = {}));
906
907
 
907
908
  function compareTokenInfos(t1, t2) {
@@ -1136,6 +1137,9 @@ function getRpcUrl(chainId) {
1136
1137
 
1137
1138
  case ChainId.BASE:
1138
1139
  return 'https://mainnet.base.org';
1140
+
1141
+ case ChainId.SONEIUM:
1142
+ return 'https://soneium.drpc.org';
1139
1143
  }
1140
1144
 
1141
1145
  throw new Error('Unsupported ChainId');
@@ -6150,6 +6154,10 @@ var unichainMappings = {
6150
6154
  "0x72e4f9f808c49a2a61de9c5896298920dc4eeea9": {
6151
6155
  childToken: "0x41f6e69166e81a9583dbc96604b01d2e9b3d706f",
6152
6156
  decimals: 8
6157
+ },
6158
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
6159
+ childToken: "0x4200000000000000000000000000000000000006",
6160
+ decimals: 18
6153
6161
  }
6154
6162
  };
6155
6163
 
@@ -7074,9 +7082,57 @@ var CeloMappingProvider = /*#__PURE__*/function () {
7074
7082
  return CeloMappingProvider;
7075
7083
  }();
7076
7084
 
7085
+ var soneiumMappings = {
7086
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": {
7087
+ childToken: "0xba9986d2381edf1da03b0b9c1f8b00dc4aacc369",
7088
+ decimals: 6
7089
+ },
7090
+ "0xdac17f958d2ee523a2206206994597c13d831ec7": {
7091
+ childToken: "0x3a337a6ada9d885b6ad95ec48f9b75f197b5ae35",
7092
+ decimals: 6
7093
+ },
7094
+ "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
7095
+ childToken: "0x4200000000000000000000000000000000000006",
7096
+ decimals: 18
7097
+ }
7098
+ };
7099
+
7100
+ var SoneiumMappingProvider = /*#__PURE__*/function () {
7101
+ function SoneiumMappingProvider() {}
7102
+
7103
+ var _proto = SoneiumMappingProvider.prototype;
7104
+
7105
+ _proto.provide = /*#__PURE__*/function () {
7106
+ var _provide = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
7107
+ var tokens;
7108
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
7109
+ while (1) {
7110
+ switch (_context.prev = _context.next) {
7111
+ case 0:
7112
+ tokens = soneiumMappings;
7113
+ return _context.abrupt("return", tokens);
7114
+
7115
+ case 2:
7116
+ case "end":
7117
+ return _context.stop();
7118
+ }
7119
+ }
7120
+ }, _callee);
7121
+ }));
7122
+
7123
+ function provide() {
7124
+ return _provide.apply(this, arguments);
7125
+ }
7126
+
7127
+ return provide;
7128
+ }();
7129
+
7130
+ return SoneiumMappingProvider;
7131
+ }();
7132
+
7077
7133
  var web3 = /*#__PURE__*/new Web3__default["default"](); // chains we support fetching mappings for (can be different than the l2ChainIds arg for buildList)
7078
7134
 
7079
- var CHAINS_WITH_MAPPING_PROVIDERS = [ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.OPTIMISM, ChainId.BNB, ChainId.AVALANCHE, ChainId.CELO, ChainId.BASE, ChainId.UNICHAIN];
7135
+ var CHAINS_WITH_MAPPING_PROVIDERS = [ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.OPTIMISM, ChainId.BNB, ChainId.AVALANCHE, ChainId.CELO, ChainId.BASE, ChainId.UNICHAIN, ChainId.SONEIUM];
7080
7136
  function buildList(_x, _x2) {
7081
7137
  return _buildList.apply(this, arguments);
7082
7138
  } // using a symbol lookup contract call to check whether the token exists on the L2
@@ -7277,6 +7333,9 @@ function getMappingProvider(chainId, l1TokenList) {
7277
7333
  case ChainId.UNICHAIN:
7278
7334
  return new UnichainMappingProvider();
7279
7335
 
7336
+ case ChainId.SONEIUM:
7337
+ return new SoneiumMappingProvider();
7338
+
7280
7339
  default:
7281
7340
  throw new Error("Chain " + chainId + " not supported for fetching mappings.");
7282
7341
  }
@@ -7510,7 +7569,7 @@ function _chainify() {
7510
7569
 
7511
7570
  case 2:
7512
7571
  l1TokenList = _context.sent;
7513
- l2Chains = [ChainId.POLYGON, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.CELO, ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE, ChainId.UNICHAIN];
7572
+ l2Chains = [ChainId.POLYGON, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.CELO, ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE, ChainId.UNICHAIN, ChainId.SONEIUM];
7514
7573
  _context.next = 6;
7515
7574
  return chainifyTokenList(l2Chains, l1TokenListOrPathOrUrl);
7516
7575