@uniswap/token-list-bridge-utils 2.2.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,6 +8,7 @@ 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,
13
14
  BASE = 8453,
@@ -14,3 +14,4 @@ export declare const DAI_BASE: Token;
14
14
  export declare const DAI_BASE_GOERLI: Token;
15
15
  export declare const USDT: Token;
16
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[];
@@ -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,6 +897,7 @@ 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";
902
903
  ChainId[ChainId["BASE"] = 8453] = "BASE";
@@ -1127,6 +1128,12 @@ function getRpcUrl(chainId) {
1127
1128
  case ChainId.AVALANCHE:
1128
1129
  return 'https://api.avax.network/ext/bc/C/rpc';
1129
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
+
1130
1137
  case ChainId.BASE:
1131
1138
  return 'https://mainnet.base.org';
1132
1139
 
@@ -1401,7 +1408,7 @@ var OptimismMappingProvider = /*#__PURE__*/function () {
1401
1408
  return OptimismMappingProvider;
1402
1409
  }();
1403
1410
 
1404
- 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';
1405
1412
  var access_token = '504afd90-3228-4df9-9d88-9b4d70646101';
1406
1413
  /**
1407
1414
  * The Polygon team manually maintains the mapping via user submissions at
@@ -5833,9 +5840,59 @@ var BaseMappingProvider = /*#__PURE__*/function () {
5833
5840
  return BaseMappingProvider;
5834
5841
  }();
5835
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
+
5836
5893
  var web3 = /*#__PURE__*/new Web3__default["default"](); // chains we support fetching mappings for (can be different than the l2ChainIds arg for buildList)
5837
5894
 
5838
- var CHAINS_WITH_MAPPING_PROVIDERS = [ChainId.ARBITRUM_ONE, ChainId.POLYGON, ChainId.OPTIMISM, ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE, 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];
5839
5896
  function buildList(_x, _x2) {
5840
5897
  return _buildList.apply(this, arguments);
5841
5898
  } // using a symbol lookup contract call to check whether the token exists on the L2
@@ -6027,6 +6084,9 @@ function getMappingProvider(chainId, l1TokenList) {
6027
6084
  case ChainId.AVALANCHE:
6028
6085
  return new AvalancheMappingProvider();
6029
6086
 
6087
+ case ChainId.CELO:
6088
+ return new CeloMappingProvider();
6089
+
6030
6090
  case ChainId.BASE:
6031
6091
  return new BaseMappingProvider();
6032
6092
 
@@ -6139,7 +6199,7 @@ function _getChildTokenDetails() {
6139
6199
  case 11:
6140
6200
  _context6.t2 = _context6.t1;
6141
6201
  childTokenValid = (0, _context6.t0)(_context6.t2);
6142
- 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;
6143
6203
  return _context6.abrupt("return", {
6144
6204
  childTokenValid: childTokenValid,
6145
6205
  childTokenAddress: childTokenAddress,