@uniswap/token-list-bridge-utils 2.1.0 → 2.3.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.
@@ -8,7 +8,9 @@ export declare enum ChainId {
8
8
  POLYGON = 137,
9
9
  POLYGON_MUMBAI = 80001,
10
10
  CELO = 42220,
11
+ CELO_ALFAJORES = 44787,
11
12
  BNB = 56,
12
13
  AVALANCHE = 43114,
14
+ BASE = 8453,
13
15
  BASE_GOERLI = 84531
14
16
  }
@@ -1,12 +1,17 @@
1
1
  import { Token } from '@uniswap/sdk-core';
2
2
  export declare const COINBASE_WRAPPED_STAKED_ETH: Token;
3
3
  export declare const COINBASE_WRAPPED_STAKED_ETH_BASE_GOERLI: Token;
4
+ export declare const COINBASE_WRAPPED_STAKED_ETH_BASE: Token;
4
5
  export declare const COINBASE_WRAPPED_STAKED_ETH_ARBITRUM_ONE: Token;
6
+ export declare const COINBASE_WRAPPED_STAKED_ETH_OPTIMISM: Token;
5
7
  export declare const DAI: Token;
6
8
  export declare const DAI_ARBITRUM_ONE: Token;
7
9
  export declare const DAI_OPTIMISM: Token;
8
10
  export declare const DAI_POLYGON: Token;
9
11
  export declare const DAI_BNB: Token;
10
12
  export declare const DAI_AVALANCHE: Token;
13
+ export declare const DAI_BASE: Token;
14
+ export declare const DAI_BASE_GOERLI: Token;
11
15
  export declare const USDT: Token;
12
16
  export declare const USDT_BNB: Token;
17
+ export declare const USDT_CELO: Token;
@@ -66,6 +66,18 @@ export declare const bnbedSampleTokenList_2: {
66
66
  tags?: import("@uniswap/token-lists").Tags | undefined;
67
67
  logoURI?: string | undefined;
68
68
  };
69
+ export declare const celoedSampleTokenList: {
70
+ name: string;
71
+ tokens: TokenInfo[];
72
+ timestamp: string;
73
+ version: import("@uniswap/token-lists").Version;
74
+ tokenMap?: {
75
+ readonly [key: string]: TokenInfo;
76
+ } | undefined;
77
+ keywords?: string[] | undefined;
78
+ tags?: import("@uniswap/token-lists").Tags | undefined;
79
+ logoURI?: string | undefined;
80
+ };
69
81
  export declare const baseGoerliSampleTokenList_3: {
70
82
  name: string;
71
83
  tokens: TokenInfo[];
@@ -78,6 +90,18 @@ export declare const baseGoerliSampleTokenList_3: {
78
90
  tags?: import("@uniswap/token-lists").Tags | undefined;
79
91
  logoURI?: string | undefined;
80
92
  };
93
+ export declare const baseSampleTokenList_3: {
94
+ name: string;
95
+ tokens: TokenInfo[];
96
+ timestamp: string;
97
+ version: import("@uniswap/token-lists").Version;
98
+ tokenMap?: {
99
+ readonly [key: string]: TokenInfo;
100
+ } | undefined;
101
+ keywords?: string[] | undefined;
102
+ tags?: import("@uniswap/token-lists").Tags | undefined;
103
+ logoURI?: string | undefined;
104
+ };
81
105
  export declare const optimizedSampleTokenList: {
82
106
  name: string;
83
107
  tokens: TokenInfo[];
@@ -0,0 +1,9 @@
1
+ import { MappingProvider } from './MappingProvider';
2
+ import { GenericMappedTokenData } from '../constants/types';
3
+ /**
4
+ * The Base mapping (linked above) is manually maintained by the Coinbase team
5
+ * in this repository: https://github.com/ethereum-optimism/ethereum-optimism.github.io.
6
+ */
7
+ export declare class BaseMappingProvider implements MappingProvider {
8
+ provide(): Promise<GenericMappedTokenData>;
9
+ }
@@ -0,0 +1,5 @@
1
+ import { MappingProvider } from './MappingProvider';
2
+ import { MappedTokenData } from '../constants/types';
3
+ export declare class CeloMappingProvider implements MappingProvider {
4
+ provide(): Promise<MappedTokenData>;
5
+ }
@@ -897,8 +897,10 @@ var ChainId;
897
897
  ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
898
898
  ChainId[ChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI";
899
899
  ChainId[ChainId["CELO"] = 42220] = "CELO";
900
+ ChainId[ChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES";
900
901
  ChainId[ChainId["BNB"] = 56] = "BNB";
901
902
  ChainId[ChainId["AVALANCHE"] = 43114] = "AVALANCHE";
903
+ ChainId[ChainId["BASE"] = 8453] = "BASE";
902
904
  ChainId[ChainId["BASE_GOERLI"] = 84531] = "BASE_GOERLI";
903
905
  })(ChainId || (ChainId = {}));
904
906
 
@@ -1126,6 +1128,15 @@ function getRpcUrl(chainId) {
1126
1128
  case ChainId.AVALANCHE:
1127
1129
  return 'https://api.avax.network/ext/bc/C/rpc';
1128
1130
 
1131
+ case ChainId.CELO:
1132
+ return 'https://forno.celo.org/';
1133
+
1134
+ case ChainId.CELO_ALFAJORES:
1135
+ return 'https://alfajores-forno.celo-testnet.org/';
1136
+
1137
+ case ChainId.BASE:
1138
+ return 'https://mainnet.base.org';
1139
+
1129
1140
  case ChainId.BASE_GOERLI:
1130
1141
  return 'https://goerli.base.org';
1131
1142
  }
@@ -1165,7 +1176,13 @@ var _process$env, _process$env$MAINNET_;
1165
1176
  dotenv.config();
1166
1177
  (_process$env$MAINNET_ = (_process$env = process.env).MAINNET_RPC) != null ? _process$env$MAINNET_ : _process$env.MAINNET_RPC = /*#__PURE__*/getRpcUrl(ChainId.MAINNET);
1167
1178
 
1168
- var networkID = 42161; // ref: https://github.com/OffchainLabs/arb-token-lists/blob/master/src/lib/instantiate_bridge.ts
1179
+ var networkID = 42161;
1180
+
1181
+ var l2Rpc = function l2Rpc(chainId) {
1182
+ if (chainId === 42161) return 'https://arb1.arbitrum.io/rpc';else if (chainId === 421611) return 'https://rinkeby.arbitrum.io/rpc';else if (chainId === 42170) return 'https://nova.arbitrum.io/rpc';else if (chainId === 421613) return 'https://goerli-rollup.arbitrum.io/rpc';
1183
+ throw new Error('No L2 RPC detected');
1184
+ }; // ref: https://github.com/OffchainLabs/arb-token-lists/blob/master/src/lib/instantiate_bridge.ts
1185
+
1169
1186
 
1170
1187
  var getNetworkConfig = /*#__PURE__*/function () {
1171
1188
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -1193,8 +1210,8 @@ var getNetworkConfig = /*#__PURE__*/function () {
1193
1210
 
1194
1211
  case 11:
1195
1212
  l1Network = _context.sent;
1196
- arbProvider = new ethers.providers.JsonRpcProvider(l2Network.rpcURL);
1197
- ethProvider = new ethers.providers.JsonRpcProvider(l1Network.rpcURL);
1213
+ arbProvider = new ethers.providers.JsonRpcProvider(l2Rpc(l2Network.chainID));
1214
+ ethProvider = new ethers.providers.JsonRpcProvider(process.env.MAINNET_RPC);
1198
1215
  _context.next = 16;
1199
1216
  return MultiCaller.fromProvider(ethProvider);
1200
1217
 
@@ -1329,7 +1346,7 @@ var ArbitrumMappingProvider = /*#__PURE__*/function () {
1329
1346
  return ArbitrumMappingProvider;
1330
1347
  }();
1331
1348
 
1332
- var optimismTokenListURL = 'https://raw.githubusercontent.com/' + 'ethereum-optimism/ethereum-optimism.github.io/2138386277e4156d159615d1840882cecc398437/optimism.tokenlist.json';
1349
+ var optimismTokenListURL = 'https://raw.githubusercontent.com/' + 'ethereum-optimism/ethereum-optimism.github.io/master/optimism.tokenlist.json';
1333
1350
  /**
1334
1351
  * The Optimism L2 mapping (linked above) is manually maintained by the Optimism team.
1335
1352
  *
@@ -1343,8 +1360,7 @@ var OptimismMappingProvider = /*#__PURE__*/function () {
1343
1360
 
1344
1361
  _proto.provide = /*#__PURE__*/function () {
1345
1362
  var _provide = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
1346
- var tokens, optimismTokens, _iterator, _step, token, _token$extensions;
1347
-
1363
+ var tokens, allTokens, opTokenId_baseAddressMap;
1348
1364
  return _regeneratorRuntime.wrap(function _callee$(_context) {
1349
1365
  while (1) {
1350
1366
  switch (_context.prev = _context.next) {
@@ -1354,19 +1370,27 @@ var OptimismMappingProvider = /*#__PURE__*/function () {
1354
1370
  return getTokenList(optimismTokenListURL);
1355
1371
 
1356
1372
  case 3:
1357
- optimismTokens = _context.sent;
1358
-
1359
- for (_iterator = _createForOfIteratorHelperLoose(optimismTokens.tokens); !(_step = _iterator()).done;) {
1360
- token = _step.value;
1373
+ allTokens = _context.sent;
1374
+ opTokenId_baseAddressMap = {};
1375
+ allTokens.tokens.forEach(function (token) {
1376
+ if (token.chainId === ChainId.OPTIMISM) {
1377
+ var _token$extensions;
1361
1378
 
1362
- if (token.chainId === ChainId.MAINNET) {
1363
- tokens[token.address.toLowerCase()] = token == null ? void 0 : (_token$extensions = token.extensions) == null ? void 0 : _token$extensions.bridgeInfo[ChainId.OPTIMISM].tokenAddress;
1379
+ if (typeof ((_token$extensions = token.extensions) == null ? void 0 : _token$extensions.opTokenId) === 'string') {
1380
+ opTokenId_baseAddressMap[token.extensions.opTokenId] = token.address;
1381
+ }
1364
1382
  }
1365
- }
1383
+ });
1384
+ allTokens.tokens.forEach(function (token) {
1385
+ var _token$extensions2;
1366
1386
 
1387
+ if (token.chainId === ChainId.MAINNET && typeof ((_token$extensions2 = token.extensions) == null ? void 0 : _token$extensions2.opTokenId) === 'string' && token.extensions.opTokenId in opTokenId_baseAddressMap) {
1388
+ tokens[token.address.toLowerCase()] = opTokenId_baseAddressMap[token.extensions.opTokenId];
1389
+ }
1390
+ });
1367
1391
  return _context.abrupt("return", tokens);
1368
1392
 
1369
- case 6:
1393
+ case 8:
1370
1394
  case "end":
1371
1395
  return _context.stop();
1372
1396
  }
@@ -1384,7 +1408,7 @@ var OptimismMappingProvider = /*#__PURE__*/function () {
1384
1408
  return OptimismMappingProvider;
1385
1409
  }();
1386
1410
 
1387
- var url = 'https://open-api.polygon.technology/api/v1/info/all-mappings';
1411
+ var url = 'https://api-polygon-tokens.polygon.technology/api/v1/info/all-mappings';
1388
1412
  var access_token = '504afd90-3228-4df9-9d88-9b4d70646101';
1389
1413
  /**
1390
1414
  * The Polygon team manually maintains the mapping via user submissions at
@@ -5694,7 +5718,7 @@ var AvalancheMappingProvider = /*#__PURE__*/function () {
5694
5718
  return AvalancheMappingProvider;
5695
5719
  }();
5696
5720
 
5697
- var baseGoerliTokenListURL = 'https://raw.githubusercontent.com/' + 'ethereum-optimism/ethereum-optimism.github.io/master/optimism.tokenlist.json';
5721
+ var baseGoerliTokenListURL$1 = 'https://raw.githubusercontent.com/' + 'ethereum-optimism/ethereum-optimism.github.io/master/optimism.tokenlist.json';
5698
5722
  /**
5699
5723
  * The Base Goerli mapping (linked above) is manually maintained by the Coinbase team
5700
5724
  * in this repository: https://github.com/ethereum-optimism/ethereum-optimism.github.io.
@@ -5714,7 +5738,7 @@ var BaseGoerliMappingProvider = /*#__PURE__*/function () {
5714
5738
  case 0:
5715
5739
  tokens = {};
5716
5740
  _context.next = 3;
5717
- return getTokenList(baseGoerliTokenListURL);
5741
+ return getTokenList(baseGoerliTokenListURL$1);
5718
5742
 
5719
5743
  case 3:
5720
5744
  allTokens = _context.sent;
@@ -5755,9 +5779,120 @@ var BaseGoerliMappingProvider = /*#__PURE__*/function () {
5755
5779
  return BaseGoerliMappingProvider;
5756
5780
  }();
5757
5781
 
5782
+ var baseGoerliTokenListURL = 'https://raw.githubusercontent.com/' + 'ethereum-optimism/ethereum-optimism.github.io/master/optimism.tokenlist.json';
5783
+ /**
5784
+ * The Base mapping (linked above) is manually maintained by the Coinbase team
5785
+ * in this repository: https://github.com/ethereum-optimism/ethereum-optimism.github.io.
5786
+ */
5787
+
5788
+ var BaseMappingProvider = /*#__PURE__*/function () {
5789
+ function BaseMappingProvider() {}
5790
+
5791
+ var _proto = BaseMappingProvider.prototype;
5792
+
5793
+ _proto.provide = /*#__PURE__*/function () {
5794
+ var _provide = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
5795
+ var tokens, allTokens, opTokenId_baseAddressMap;
5796
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
5797
+ while (1) {
5798
+ switch (_context.prev = _context.next) {
5799
+ case 0:
5800
+ tokens = {};
5801
+ _context.next = 3;
5802
+ return getTokenList(baseGoerliTokenListURL);
5803
+
5804
+ case 3:
5805
+ allTokens = _context.sent;
5806
+ opTokenId_baseAddressMap = {};
5807
+ allTokens.tokens.forEach(function (token) {
5808
+ if (token.chainId === ChainId.BASE) {
5809
+ var _token$extensions;
5810
+
5811
+ if (typeof ((_token$extensions = token.extensions) == null ? void 0 : _token$extensions.opTokenId) === 'string') {
5812
+ opTokenId_baseAddressMap[token.extensions.opTokenId] = token.address;
5813
+ }
5814
+ }
5815
+ });
5816
+ allTokens.tokens.forEach(function (token) {
5817
+ var _token$extensions2;
5818
+
5819
+ if (token.chainId === ChainId.MAINNET && typeof ((_token$extensions2 = token.extensions) == null ? void 0 : _token$extensions2.opTokenId) === 'string' && token.extensions.opTokenId in opTokenId_baseAddressMap) {
5820
+ tokens[token.address.toLowerCase()] = opTokenId_baseAddressMap[token.extensions.opTokenId];
5821
+ }
5822
+ });
5823
+ return _context.abrupt("return", tokens);
5824
+
5825
+ case 8:
5826
+ case "end":
5827
+ return _context.stop();
5828
+ }
5829
+ }
5830
+ }, _callee);
5831
+ }));
5832
+
5833
+ function provide() {
5834
+ return _provide.apply(this, arguments);
5835
+ }
5836
+
5837
+ return provide;
5838
+ }();
5839
+
5840
+ return BaseMappingProvider;
5841
+ }();
5842
+
5843
+ var celoMappings = {
5844
+ "0xdac17f958d2ee523a2206206994597c13d831ec7": {
5845
+ childToken: "0x617f3112bf5397D0467D315cC709EF968D9ba546",
5846
+ decimals: 18
5847
+ },
5848
+ "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599": {
5849
+ childToken: "0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF",
5850
+ decimals: 18
5851
+ },
5852
+ "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
5853
+ childToken: "0xb829b68f57CC546dA7E5806A929e53bE32a4625D",
5854
+ decimals: 18
5855
+ },
5856
+ "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": {
5857
+ childToken: "0x37f750B7cC259A2f741AF45294f6a16572CF5cAd",
5858
+ decimals: 6
5859
+ }
5860
+ };
5861
+
5862
+ var CeloMappingProvider = /*#__PURE__*/function () {
5863
+ function CeloMappingProvider() {}
5864
+
5865
+ var _proto = CeloMappingProvider.prototype;
5866
+
5867
+ _proto.provide = /*#__PURE__*/function () {
5868
+ var _provide = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
5869
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
5870
+ while (1) {
5871
+ switch (_context.prev = _context.next) {
5872
+ case 0:
5873
+ return _context.abrupt("return", celoMappings);
5874
+
5875
+ case 1:
5876
+ case "end":
5877
+ return _context.stop();
5878
+ }
5879
+ }
5880
+ }, _callee);
5881
+ }));
5882
+
5883
+ function provide() {
5884
+ return _provide.apply(this, arguments);
5885
+ }
5886
+
5887
+ return provide;
5888
+ }();
5889
+
5890
+ return CeloMappingProvider;
5891
+ }();
5892
+
5758
5893
  var web3 = /*#__PURE__*/new Web3__default["default"](); // chains we support fetching mappings for (can be different than the l2ChainIds arg for buildList)
5759
5894
 
5760
- var CHAINS_WITH_MAPPING_PROVIDERS = [ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.OPTIMISM, ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE_GOERLI];
5895
+ var CHAINS_WITH_MAPPING_PROVIDERS = [ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.OPTIMISM, ChainId.BNB, ChainId.AVALANCHE, ChainId.CELO, ChainId.BASE, ChainId.BASE_GOERLI];
5761
5896
  function buildList(_x, _x2) {
5762
5897
  return _buildList.apply(this, arguments);
5763
5898
  } // using a symbol lookup contract call to check whether the token exists on the L2
@@ -5949,6 +6084,12 @@ function getMappingProvider(chainId, l1TokenList) {
5949
6084
  case ChainId.AVALANCHE:
5950
6085
  return new AvalancheMappingProvider();
5951
6086
 
6087
+ case ChainId.CELO:
6088
+ return new CeloMappingProvider();
6089
+
6090
+ case ChainId.BASE:
6091
+ return new BaseMappingProvider();
6092
+
5952
6093
  case ChainId.BASE_GOERLI:
5953
6094
  return new BaseGoerliMappingProvider();
5954
6095
 
@@ -6015,18 +6156,27 @@ function getChildTokenDetails(_x7, _x8, _x9) {
6015
6156
 
6016
6157
  function _getChildTokenDetails() {
6017
6158
  _getChildTokenDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(l1Token, chainId, chainIdToMappingsMap) {
6018
- var _l1Token$extensions, _l1Token$extensions$b, _l1Token$extensions$b2;
6159
+ var _l1Token$extensions;
6019
6160
 
6020
- var existingMapping, childToken, childTokenAddress, childTokenValid, decimals;
6161
+ var bridgeInfo, existingMapping, bridgeInfoForChain, childToken, childTokenAddress, childTokenValid, decimals;
6021
6162
  return _regeneratorRuntime.wrap(function _callee5$(_context6) {
6022
6163
  while (1) {
6023
6164
  switch (_context6.prev = _context6.next) {
6024
6165
  case 0:
6025
- existingMapping = l1Token == null ? void 0 : (_l1Token$extensions = l1Token.extensions) == null ? void 0 : (_l1Token$extensions$b = _l1Token$extensions.bridgeInfo) == null ? void 0 : (_l1Token$extensions$b2 = _l1Token$extensions$b[chainId]) == null ? void 0 : _l1Token$extensions$b2.tokenAddress; // use the externally fetched mappings if manual entry doesn't exist for the token/chain mapping
6166
+ bridgeInfo = l1Token == null ? void 0 : (_l1Token$extensions = l1Token.extensions) == null ? void 0 : _l1Token$extensions.bridgeInfo;
6167
+
6168
+ if (bridgeInfo && typeof bridgeInfo === 'object') {
6169
+ bridgeInfoForChain = bridgeInfo[chainId];
6170
+
6171
+ if (bridgeInfoForChain && typeof bridgeInfoForChain === 'object') {
6172
+ existingMapping = bridgeInfoForChain.tokenAddress;
6173
+ }
6174
+ } // use the externally fetched mappings if manual entry doesn't exist for the token/chain mapping
6026
6175
  // and the given chain is supported for fetching mappings
6027
6176
 
6177
+
6028
6178
  if (!(CHAINS_WITH_MAPPING_PROVIDERS.includes(chainId) && existingMapping === undefined)) {
6029
- _context6.next = 14;
6179
+ _context6.next = 15;
6030
6180
  break;
6031
6181
  }
6032
6182
 
@@ -6036,33 +6186,33 @@ function _getChildTokenDetails() {
6036
6186
  _context6.t1 = childTokenAddress;
6037
6187
 
6038
6188
  if (!_context6.t1) {
6039
- _context6.next = 10;
6189
+ _context6.next = 11;
6040
6190
  break;
6041
6191
  }
6042
6192
 
6043
- _context6.next = 9;
6193
+ _context6.next = 10;
6044
6194
  return hasExistingTokenContract(childTokenAddress, chainId);
6045
6195
 
6046
- case 9:
6196
+ case 10:
6047
6197
  _context6.t1 = _context6.sent;
6048
6198
 
6049
- case 10:
6199
+ case 11:
6050
6200
  _context6.t2 = _context6.t1;
6051
6201
  childTokenValid = (0, _context6.t0)(_context6.t2);
6052
- decimals = childToken && (chainId === ChainId.BNB || chainId === ChainId.AVALANCHE) ? childToken.decimals : undefined;
6202
+ decimals = childToken && (chainId === ChainId.BNB || chainId === ChainId.AVALANCHE || chainId === ChainId.CELO) ? childToken.decimals : undefined;
6053
6203
  return _context6.abrupt("return", {
6054
6204
  childTokenValid: childTokenValid,
6055
6205
  childTokenAddress: childTokenAddress,
6056
6206
  decimals: decimals
6057
6207
  });
6058
6208
 
6059
- case 14:
6209
+ case 15:
6060
6210
  return _context6.abrupt("return", {
6061
6211
  childTokenValid: !!existingMapping,
6062
6212
  childTokenAddress: existingMapping
6063
6213
  });
6064
6214
 
6065
- case 15:
6215
+ case 16:
6066
6216
  case "end":
6067
6217
  return _context6.stop();
6068
6218
  }
@@ -6152,7 +6302,7 @@ function chainify(_x) {
6152
6302
 
6153
6303
  function _chainify() {
6154
6304
  _chainify = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(l1TokenListOrPathOrUrl) {
6155
- var l1TokenList, l2Chains, chainified, merged, tokenMap;
6305
+ var l1TokenList, l2Chains, chainified, merged;
6156
6306
  return _regeneratorRuntime.wrap(function _callee$(_context) {
6157
6307
  while (1) {
6158
6308
  switch (_context.prev = _context.next) {
@@ -6162,7 +6312,7 @@ function _chainify() {
6162
6312
 
6163
6313
  case 2:
6164
6314
  l1TokenList = _context.sent;
6165
- l2Chains = [ChainId.POLYGON, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.CELO, ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE_GOERLI];
6315
+ l2Chains = [ChainId.POLYGON, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.CELO, ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE, ChainId.BASE_GOERLI];
6166
6316
  _context.next = 6;
6167
6317
  return chainifyTokenList(l2Chains, l1TokenListOrPathOrUrl);
6168
6318
 
@@ -6170,19 +6320,9 @@ function _chainify() {
6170
6320
  chainified = _context.sent;
6171
6321
  merged = mergeTokenLists(l1TokenList, // providing l1 first to make sure duplicated tokens resolve to this list
6172
6322
  chainified);
6173
- tokenMap = {};
6174
-
6175
- if (merged.tokens && merged.tokens.length > 0) {
6176
- merged.tokens.forEach(function (token) {
6177
- tokenMap[token.chainId + "_" + token.address] = token;
6178
- });
6179
- }
6323
+ return _context.abrupt("return", merged);
6180
6324
 
6181
- return _context.abrupt("return", _extends({}, merged, {
6182
- tokenMap: tokenMap
6183
- }));
6184
-
6185
- case 11:
6325
+ case 9:
6186
6326
  case "end":
6187
6327
  return _context.stop();
6188
6328
  }
@@ -6247,7 +6387,7 @@ function mergeTokenLists(primary, secondary) {
6247
6387
 
6248
6388
  var merged = lodash.merge(group[0], group[1]);
6249
6389
 
6250
- if ((_merged$extensions = merged.extensions) != null && _merged$extensions.bridgeInfo) {
6390
+ if ((_merged$extensions = merged.extensions) != null && _merged$extensions.bridgeInfo && typeof merged.extensions.bridgeInfo === 'object') {
6251
6391
  // remove reference to self-chain from merge
6252
6392
  delete merged.extensions.bridgeInfo[merged.chainId];
6253
6393
  }