@uniswap/token-list-bridge-utils 1.0.8 → 1.1.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.
@@ -869,6 +869,7 @@ var ChainId;
869
869
  ChainId[ChainId["OPTIMISTIC_KOVAN"] = 69] = "OPTIMISTIC_KOVAN";
870
870
  ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
871
871
  ChainId[ChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI";
872
+ ChainId[ChainId["CELO"] = 42220] = "CELO";
872
873
  })(ChainId || (ChainId = {}));
873
874
 
874
875
  function compareTokenInfos(t1, t2) {
@@ -1071,7 +1072,8 @@ function getRpcUrl(chainId) {
1071
1072
  return 'https://cloudflare-eth.com/';
1072
1073
 
1073
1074
  case ChainId.OPTIMISM:
1074
- return 'https://mainnet.optimism.io';
1075
+ return 'https://rpc.ankr.com/optimism';
1076
+ // seems to have higher rate limit than https://mainnet.optimism.io/
1075
1077
 
1076
1078
  case ChainId.OPTIMISTIC_KOVAN:
1077
1079
  return 'https://kovan.optimism.io';
@@ -1343,8 +1345,8 @@ var OptimismMappingProvider = /*#__PURE__*/function () {
1343
1345
  return OptimismMappingProvider;
1344
1346
  }();
1345
1347
 
1346
- var url = 'https://tokenmapper.api.matic.today/api/v1/mapping?';
1347
- var params = 'map_type=[%22POS%22]&chain_id=137&limit=200&offset=';
1348
+ var url = 'https://open-api.polygon.technology/api/v1/info/all-mappings';
1349
+ var access_token = '504afd90-3228-4df9-9d88-9b4d70646101';
1348
1350
  /**
1349
1351
  * The Polygon team manually maintains the mapping via user submissions at
1350
1352
  * https://mapper.polygon.technology.
@@ -1359,48 +1361,34 @@ var PolygonMappingProvider = /*#__PURE__*/function () {
1359
1361
 
1360
1362
  _proto.provide = /*#__PURE__*/function () {
1361
1363
  var _provide = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
1362
- var offset, tokens, response, _iterator, _step, token;
1364
+ var response, tokens, _iterator, _step, token;
1363
1365
 
1364
1366
  return _regeneratorRuntime.wrap(function _callee$(_context) {
1365
1367
  while (1) {
1366
1368
  switch (_context.prev = _context.next) {
1367
1369
  case 0:
1368
- offset = 0;
1369
- tokens = {};
1370
+ _context.next = 2;
1371
+ return axios.get(url, {
1372
+ headers: {
1373
+ 'x-access-token': access_token
1374
+ }
1375
+ });
1370
1376
 
1371
1377
  case 2:
1372
-
1373
- _context.next = 5;
1374
- return axios.get("" + url + params + offset);
1375
-
1376
- case 5:
1377
1378
  response = _context.sent;
1379
+ tokens = {};
1378
1380
 
1379
- if (!(response.data.message === 'success')) {
1380
- _context.next = 11;
1381
- break;
1382
- }
1383
-
1384
- for (_iterator = _createForOfIteratorHelperLoose(response.data.data.mapping); !(_step = _iterator()).done;) {
1381
+ for (_iterator = _createForOfIteratorHelperLoose(response.data); !(_step = _iterator()).done;) {
1385
1382
  token = _step.value;
1386
- tokens[token.root_token.toLowerCase()] = token;
1387
- }
1388
1383
 
1389
- if (!(response.data.data.has_next_page === true)) {
1390
- _context.next = 11;
1391
- break;
1384
+ if (token.isPos) {
1385
+ tokens[token.rootToken.toLowerCase()] = token;
1386
+ }
1392
1387
  }
1393
1388
 
1394
- offset += 200;
1395
- return _context.abrupt("continue", 2);
1396
-
1397
- case 11:
1398
- return _context.abrupt("break", 14);
1399
-
1400
- case 14:
1401
1389
  return _context.abrupt("return", tokens);
1402
1390
 
1403
- case 15:
1391
+ case 6:
1404
1392
  case "end":
1405
1393
  return _context.stop();
1406
1394
  }
@@ -1587,103 +1575,139 @@ var abi = [{
1587
1575
  type: 'event'
1588
1576
  }];
1589
1577
 
1590
- var web3 = /*#__PURE__*/new Web3();
1578
+ var web3 = /*#__PURE__*/new Web3(); // chains we support fetching mappings for (can be different than the l2ChainIds arg for buildList)
1579
+
1580
+ var SUPPORTED_L2_CHAINS = [ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.OPTIMISM];
1591
1581
  function buildList(_x, _x2) {
1592
1582
  return _buildList.apply(this, arguments);
1593
1583
  } // using a symbol lookup contract call to check whether the token exists on the L2
1594
1584
 
1595
1585
  function _buildList() {
1596
- _buildList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(chainId, l1TokenList) {
1597
- var tokenAddressMap, mappedTokens, _iterator, _step, rootToken, childToken, childTokenAddress, childTokenValid, _bridgeInfo, _bridgeInfo2, toRootExtensions, toChildExtensions, rootTokenInfo, childTokenInfo, tokenList;
1586
+ _buildList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(l2ChainIds, l1TokenList) {
1587
+ var multiChainedTokens, chainIdToMappingsMap, _loop, _iterator, _step, tokenList;
1598
1588
 
1599
- return _regeneratorRuntime.wrap(function _callee$(_context) {
1589
+ return _regeneratorRuntime.wrap(function _callee2$(_context3) {
1600
1590
  while (1) {
1601
- switch (_context.prev = _context.next) {
1591
+ switch (_context3.prev = _context3.next) {
1602
1592
  case 0:
1603
- web3.setProvider(getRpcUrl(chainId));
1604
- _context.next = 3;
1605
- return getMappingProvider(chainId, l1TokenList).provide();
1593
+ multiChainedTokens = [];
1594
+ _context3.next = 3;
1595
+ return generateTokenMappings(l2ChainIds, l1TokenList);
1606
1596
 
1607
1597
  case 3:
1608
- tokenAddressMap = _context.sent;
1609
- mappedTokens = [];
1598
+ chainIdToMappingsMap = _context3.sent;
1599
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
1600
+ var l1Token, chainIdToChildTokenDetailsMap, l2MappingExtension;
1601
+ return _regeneratorRuntime.wrap(function _loop$(_context2) {
1602
+ while (1) {
1603
+ switch (_context2.prev = _context2.next) {
1604
+ case 0:
1605
+ l1Token = _step.value;
1606
+
1607
+ if (!(l1Token.chainId === ChainId.MAINNET)) {
1608
+ _context2.next = 7;
1609
+ break;
1610
+ }
1611
+
1612
+ chainIdToChildTokenDetailsMap = {};
1613
+ l2MappingExtension = {
1614
+ extensions: {
1615
+ bridgeInfo: {}
1616
+ }
1617
+ }; // build out the extensions.bridgeInfo data containing mappings for each L2 chain
1618
+
1619
+ _context2.next = 6;
1620
+ return Promise.all(l2ChainIds.map( /*#__PURE__*/function () {
1621
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(chainId) {
1622
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1623
+ while (1) {
1624
+ switch (_context.prev = _context.next) {
1625
+ case 0:
1626
+ _context.next = 2;
1627
+ return getChildTokenDetails(l1Token, chainId, chainIdToMappingsMap);
1628
+
1629
+ case 2:
1630
+ chainIdToChildTokenDetailsMap[chainId] = _context.sent;
1631
+
1632
+ if (chainIdToChildTokenDetailsMap[chainId].childTokenValid) {
1633
+ l2MappingExtension.extensions.bridgeInfo[chainId] = {
1634
+ tokenAddress: chainIdToChildTokenDetailsMap[chainId].childTokenAddress
1635
+ };
1636
+ }
1637
+
1638
+ case 4:
1639
+ case "end":
1640
+ return _context.stop();
1641
+ }
1642
+ }
1643
+ }, _callee);
1644
+ }));
1645
+
1646
+ return function (_x10) {
1647
+ return _ref.apply(this, arguments);
1648
+ };
1649
+ }()));
1650
+
1651
+ case 6:
1652
+ // build the TokenInfo objects with bridgeInfo extension
1653
+ l2ChainIds.concat([ChainId.MAINNET]).forEach(function (chainId) {
1654
+ if (chainId === ChainId.MAINNET || chainIdToChildTokenDetailsMap[chainId].childTokenValid) {
1655
+ var _bridgeInfo;
1656
+
1657
+ var tokenInfo = chainId === ChainId.MAINNET ? _extends({}, l1Token, {
1658
+ extensions: Object.keys(l2MappingExtension.extensions.bridgeInfo).length > 0 ? {
1659
+ bridgeInfo: l2MappingExtension.extensions.bridgeInfo
1660
+ } : undefined
1661
+ }) : _extends({}, l1Token, {
1662
+ chainId: chainId,
1663
+ address: chainIdToChildTokenDetailsMap[chainId].childTokenAddress,
1664
+ extensions: {
1665
+ bridgeInfo: (_bridgeInfo = {}, _bridgeInfo[ChainId.MAINNET] = {
1666
+ tokenAddress: ethers.utils.getAddress(l1Token.address)
1667
+ }, _bridgeInfo)
1668
+ }
1669
+ });
1670
+ multiChainedTokens.push(tokenInfo);
1671
+ }
1672
+ });
1673
+
1674
+ case 7:
1675
+ case "end":
1676
+ return _context2.stop();
1677
+ }
1678
+ }
1679
+ }, _loop);
1680
+ });
1610
1681
  _iterator = _createForOfIteratorHelperLoose(l1TokenList.tokens);
1611
1682
 
1612
1683
  case 6:
1613
1684
  if ((_step = _iterator()).done) {
1614
- _context.next = 21;
1685
+ _context3.next = 10;
1615
1686
  break;
1616
1687
  }
1617
1688
 
1618
- rootToken = _step.value;
1619
- childToken = tokenAddressMap[rootToken.address.toLowerCase()];
1620
- childTokenAddress = childToken ? ethers.utils.getAddress(typeof childToken === 'object' ? childToken.child_token : childToken) : undefined;
1621
- _context.t0 = Boolean;
1622
- _context.t1 = childTokenAddress && (typeof childToken === 'object' ? !childToken.deleted : true);
1623
-
1624
- if (!_context.t1) {
1625
- _context.next = 16;
1626
- break;
1627
- }
1628
-
1629
- _context.next = 15;
1630
- return hasExistingTokenContract(childTokenAddress, chainId);
1631
-
1632
- case 15:
1633
- _context.t1 = _context.sent;
1634
-
1635
- case 16:
1636
- _context.t2 = _context.t1;
1637
- childTokenValid = (0, _context.t0)(_context.t2);
1638
-
1639
- if (rootToken.chainId === ChainId.MAINNET) {
1640
- // build extension info if available
1641
- toRootExtensions = childTokenValid ? {
1642
- extensions: {
1643
- bridgeInfo: (_bridgeInfo = {}, _bridgeInfo[rootToken.chainId] = {
1644
- tokenAddress: ethers.utils.getAddress(rootToken.address)
1645
- }, _bridgeInfo)
1646
- }
1647
- } : {};
1648
- toChildExtensions = childTokenValid ? {
1649
- extensions: {
1650
- bridgeInfo: (_bridgeInfo2 = {}, _bridgeInfo2[chainId] = {
1651
- tokenAddress: childTokenAddress
1652
- }, _bridgeInfo2)
1653
- }
1654
- } : {};
1655
- rootTokenInfo = _extends({}, rootToken, toChildExtensions);
1656
-
1657
- if (childTokenValid) {
1658
- childTokenInfo = _extends({}, rootToken, {
1659
- chainId: chainId,
1660
- address: childTokenAddress
1661
- }, toRootExtensions);
1662
- mappedTokens.push(childTokenInfo);
1663
- }
1664
-
1665
- mappedTokens.push(rootTokenInfo);
1666
- }
1689
+ return _context3.delegateYield(_loop(), "t0", 8);
1667
1690
 
1668
- case 19:
1669
- _context.next = 6;
1691
+ case 8:
1692
+ _context3.next = 6;
1670
1693
  break;
1671
1694
 
1672
- case 21:
1695
+ case 10:
1696
+ // build and return final chainified token list
1673
1697
  tokenList = {
1674
- name: "(ChainId: " + chainId + ") " + l1TokenList.name,
1698
+ name: "(ChainIds: " + l2ChainIds + ") " + l1TokenList.name,
1675
1699
  timestamp: new Date().toISOString(),
1676
1700
  version: l1TokenList.version,
1677
- tokens: mappedTokens.sort(compareTokenInfos)
1701
+ tokens: multiChainedTokens.sort(compareTokenInfos)
1678
1702
  };
1679
- return _context.abrupt("return", tokenList);
1703
+ return _context3.abrupt("return", tokenList);
1680
1704
 
1681
- case 23:
1705
+ case 12:
1682
1706
  case "end":
1683
- return _context.stop();
1707
+ return _context3.stop();
1684
1708
  }
1685
1709
  }
1686
- }, _callee);
1710
+ }, _callee2);
1687
1711
  }));
1688
1712
  return _buildList.apply(this, arguments);
1689
1713
  }
@@ -1693,35 +1717,36 @@ function hasExistingTokenContract(_x3, _x4) {
1693
1717
  }
1694
1718
 
1695
1719
  function _hasExistingTokenContract() {
1696
- _hasExistingTokenContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(address, chainId) {
1720
+ _hasExistingTokenContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(address, chainId) {
1697
1721
  var contract;
1698
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1722
+ return _regeneratorRuntime.wrap(function _callee3$(_context4) {
1699
1723
  while (1) {
1700
- switch (_context2.prev = _context2.next) {
1724
+ switch (_context4.prev = _context4.next) {
1701
1725
  case 0:
1702
- _context2.prev = 0;
1726
+ web3.setProvider(getRpcUrl(chainId));
1727
+ _context4.prev = 1;
1703
1728
  contract = new web3.eth.Contract(abi, address);
1704
- _context2.next = 4;
1729
+ _context4.next = 5;
1705
1730
  return getTokenSymbolFromContract(contract);
1706
1731
 
1707
- case 4:
1708
- _context2.next = 9;
1732
+ case 5:
1733
+ _context4.next = 10;
1709
1734
  break;
1710
1735
 
1711
- case 6:
1712
- _context2.prev = 6;
1713
- _context2.t0 = _context2["catch"](0);
1714
- return _context2.abrupt("return", false);
1715
-
1716
- case 9:
1717
- return _context2.abrupt("return", true);
1736
+ case 7:
1737
+ _context4.prev = 7;
1738
+ _context4.t0 = _context4["catch"](1);
1739
+ return _context4.abrupt("return", false);
1718
1740
 
1719
1741
  case 10:
1742
+ return _context4.abrupt("return", true);
1743
+
1744
+ case 11:
1720
1745
  case "end":
1721
- return _context2.stop();
1746
+ return _context4.stop();
1722
1747
  }
1723
1748
  }
1724
- }, _callee2, null, [[0, 6]]);
1749
+ }, _callee3, null, [[1, 7]]);
1725
1750
  }));
1726
1751
  return _hasExistingTokenContract.apply(this, arguments);
1727
1752
  }
@@ -1738,10 +1763,123 @@ function getMappingProvider(chainId, l1TokenList) {
1738
1763
  return new PolygonMappingProvider();
1739
1764
 
1740
1765
  default:
1741
- throw new Error("Chain " + chainId + " not supported.");
1766
+ throw new Error("Chain " + chainId + " not supported for fetching mappings.");
1742
1767
  }
1743
1768
  }
1744
1769
 
1770
+ function generateTokenMappings(_x5, _x6) {
1771
+ return _generateTokenMappings.apply(this, arguments);
1772
+ } // handles both string and object cases for childToken (Polygon mappings return object)
1773
+
1774
+
1775
+ function _generateTokenMappings() {
1776
+ _generateTokenMappings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(chainIds, l1TokenList) {
1777
+ var chainIdToMappingsMap, _iterator2, _step2, chainId;
1778
+
1779
+ return _regeneratorRuntime.wrap(function _callee4$(_context5) {
1780
+ while (1) {
1781
+ switch (_context5.prev = _context5.next) {
1782
+ case 0:
1783
+ chainIdToMappingsMap = {};
1784
+ _iterator2 = _createForOfIteratorHelperLoose(chainIds);
1785
+
1786
+ case 2:
1787
+ if ((_step2 = _iterator2()).done) {
1788
+ _context5.next = 10;
1789
+ break;
1790
+ }
1791
+
1792
+ chainId = _step2.value;
1793
+
1794
+ if (!SUPPORTED_L2_CHAINS.includes(chainId)) {
1795
+ _context5.next = 8;
1796
+ break;
1797
+ }
1798
+
1799
+ _context5.next = 7;
1800
+ return getMappingProvider(chainId, l1TokenList).provide();
1801
+
1802
+ case 7:
1803
+ chainIdToMappingsMap[chainId] = _context5.sent;
1804
+
1805
+ case 8:
1806
+ _context5.next = 2;
1807
+ break;
1808
+
1809
+ case 10:
1810
+ return _context5.abrupt("return", chainIdToMappingsMap);
1811
+
1812
+ case 11:
1813
+ case "end":
1814
+ return _context5.stop();
1815
+ }
1816
+ }
1817
+ }, _callee4);
1818
+ }));
1819
+ return _generateTokenMappings.apply(this, arguments);
1820
+ }
1821
+
1822
+ function getChildTokenDetails(_x7, _x8, _x9) {
1823
+ return _getChildTokenDetails.apply(this, arguments);
1824
+ }
1825
+
1826
+ function _getChildTokenDetails() {
1827
+ _getChildTokenDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(l1Token, chainId, chainIdToMappingsMap) {
1828
+ var _l1Token$extensions, _l1Token$extensions$b, _l1Token$extensions$b2;
1829
+
1830
+ var existingMapping, childToken, childTokenAddress, childTokenValid;
1831
+ return _regeneratorRuntime.wrap(function _callee5$(_context6) {
1832
+ while (1) {
1833
+ switch (_context6.prev = _context6.next) {
1834
+ case 0:
1835
+ 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
1836
+ // and the given L2 chain is supported for fetching mappings
1837
+
1838
+ if (!(SUPPORTED_L2_CHAINS.includes(chainId) && existingMapping === undefined)) {
1839
+ _context6.next = 13;
1840
+ break;
1841
+ }
1842
+
1843
+ childToken = chainIdToMappingsMap[chainId][l1Token.address.toLowerCase()];
1844
+ childTokenAddress = childToken ? ethers.utils.getAddress(typeof childToken === 'object' ? childToken.childToken : childToken) : undefined;
1845
+ _context6.t0 = Boolean;
1846
+ _context6.t1 = childTokenAddress;
1847
+
1848
+ if (!_context6.t1) {
1849
+ _context6.next = 10;
1850
+ break;
1851
+ }
1852
+
1853
+ _context6.next = 9;
1854
+ return hasExistingTokenContract(childTokenAddress, chainId);
1855
+
1856
+ case 9:
1857
+ _context6.t1 = _context6.sent;
1858
+
1859
+ case 10:
1860
+ _context6.t2 = _context6.t1;
1861
+ childTokenValid = (0, _context6.t0)(_context6.t2);
1862
+ return _context6.abrupt("return", {
1863
+ childTokenValid: childTokenValid,
1864
+ childTokenAddress: childTokenAddress
1865
+ });
1866
+
1867
+ case 13:
1868
+ return _context6.abrupt("return", {
1869
+ childTokenValid: !!existingMapping,
1870
+ childTokenAddress: existingMapping
1871
+ });
1872
+
1873
+ case 14:
1874
+ case "end":
1875
+ return _context6.stop();
1876
+ }
1877
+ }
1878
+ }, _callee5);
1879
+ }));
1880
+ return _getChildTokenDetails.apply(this, arguments);
1881
+ }
1882
+
1745
1883
  /**
1746
1884
  * Verifies that for each token with extensions.bridgeInfo defined, for every
1747
1885
  * chainId there exists a token with that chainId at the root-level of the
@@ -1815,14 +1953,14 @@ function chainify(_x) {
1815
1953
  }
1816
1954
  /**
1817
1955
  * Given a network and a TokenList, returns the TokenList with `extensions` filled.
1818
- * @param chainId chainId to operate on
1956
+ * @param l2ChainIds layer 2 chainIds to operate on
1819
1957
  * @param l1TokenListOrPathOrUrl either an L1 TokenList object or a path/url to a TokenList
1820
1958
  * @returns L1 TokenList with `extensions` filled for the given network
1821
1959
  */
1822
1960
 
1823
1961
  function _chainify() {
1824
1962
  _chainify = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(l1TokenListOrPathOrUrl) {
1825
- var l1TokenList, optimisimed, polygoned, arbified;
1963
+ var l1TokenList, l2Chains, chainified;
1826
1964
  return _regeneratorRuntime.wrap(function _callee$(_context) {
1827
1965
  while (1) {
1828
1966
  switch (_context.prev = _context.next) {
@@ -1832,25 +1970,16 @@ function _chainify() {
1832
1970
 
1833
1971
  case 2:
1834
1972
  l1TokenList = _context.sent;
1835
- _context.next = 5;
1836
- return chainifyTokenList(ChainId.OPTIMISM, l1TokenListOrPathOrUrl);
1837
-
1838
- case 5:
1839
- optimisimed = _context.sent;
1840
- _context.next = 8;
1841
- return chainifyTokenList(ChainId.POLYGON, l1TokenListOrPathOrUrl);
1842
-
1843
- case 8:
1844
- polygoned = _context.sent;
1845
- _context.next = 11;
1846
- return chainifyTokenList(ChainId.ARBITRUM_ONE, l1TokenListOrPathOrUrl);
1973
+ l2Chains = [ChainId.POLYGON, ChainId.ARBITRUM_ONE, ChainId.OPTIMISM, ChainId.CELO];
1974
+ _context.next = 6;
1975
+ return chainifyTokenList(l2Chains, l1TokenListOrPathOrUrl);
1847
1976
 
1848
- case 11:
1849
- arbified = _context.sent;
1977
+ case 6:
1978
+ chainified = _context.sent;
1850
1979
  return _context.abrupt("return", mergeTokenLists(l1TokenList, // providing l1 first to make sure duplicated tokens resolve to this list
1851
- mergeTokenLists(mergeTokenLists(arbified, optimisimed), polygoned)));
1980
+ chainified));
1852
1981
 
1853
- case 13:
1982
+ case 8:
1854
1983
  case "end":
1855
1984
  return _context.stop();
1856
1985
  }
@@ -1866,7 +1995,7 @@ function chainifyTokenList(_x2, _x3) {
1866
1995
  /** Merges two token lists, resolving conflicts to primary list. */
1867
1996
 
1868
1997
  function _chainifyTokenList() {
1869
- _chainifyTokenList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(chainId, l1TokenListOrPathOrUrl) {
1998
+ _chainifyTokenList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(l2ChainIds, l1TokenListOrPathOrUrl) {
1870
1999
  var l1TokenList, tokenList;
1871
2000
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1872
2001
  while (1) {
@@ -1879,7 +2008,7 @@ function _chainifyTokenList() {
1879
2008
  case 3:
1880
2009
  l1TokenList = _context2.sent;
1881
2010
  _context2.next = 6;
1882
- return buildList(chainId, l1TokenList);
2011
+ return buildList(l2ChainIds, l1TokenList);
1883
2012
 
1884
2013
  case 6:
1885
2014
  tokenList = _context2.sent;