@pioneer-platform/uniswap-client 0.0.22 → 0.0.25

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.
Files changed (74) hide show
  1. package/lib/constants/chainInfo.d.ts +19 -22
  2. package/lib/constants/chainInfo.js +134 -117
  3. package/lib/constants/chains.d.ts +36 -47
  4. package/lib/constants/chains.js +118 -83
  5. package/lib/constants/chains.test.js +22 -25
  6. package/lib/constants/governance.d.ts +8 -0
  7. package/lib/constants/governance.js +24 -0
  8. package/lib/constants/lists.d.ts +12 -0
  9. package/lib/constants/lists.js +64 -0
  10. package/lib/constants/localCurrencies.d.ts +6 -0
  11. package/lib/constants/localCurrencies.js +94 -0
  12. package/lib/constants/localCurrencyIcons.d.ts +18 -0
  13. package/lib/constants/localCurrencyIcons.js +298 -0
  14. package/lib/constants/locales.d.ts +1 -1
  15. package/lib/constants/locales.js +0 -3
  16. package/lib/constants/misc.d.ts +2 -7
  17. package/lib/constants/misc.js +17 -23
  18. package/lib/constants/networks.d.ts +21 -0
  19. package/lib/constants/networks.js +170 -0
  20. package/lib/constants/proposals/index.d.ts +5 -0
  21. package/lib/constants/proposals/index.js +8 -0
  22. package/lib/constants/proposals/polygon_proposal_title.d.ts +1 -0
  23. package/lib/constants/proposals/polygon_proposal_title.js +4 -0
  24. package/lib/constants/proposals/uniswap_grants_proposal_description.d.ts +1 -0
  25. package/lib/constants/proposals/uniswap_grants_proposal_description.js +4 -0
  26. package/lib/constants/providers.d.ts +19 -0
  27. package/lib/constants/providers.js +33 -0
  28. package/lib/constants/routing.d.ts +9 -13
  29. package/lib/constants/routing.js +91 -55
  30. package/lib/constants/routing.test.d.ts +1 -0
  31. package/lib/constants/routing.test.js +32 -0
  32. package/lib/constants/supportArticles.d.ts +13 -0
  33. package/lib/constants/supportArticles.js +17 -0
  34. package/lib/constants/tokenLists/broken.tokenlist.json +22 -0
  35. package/lib/constants/tokenLogoLookup.d.ts +8 -0
  36. package/lib/constants/tokenLogoLookup.js +48 -0
  37. package/lib/constants/tokenSafety.js +129 -0
  38. package/lib/constants/tokenSafetyLookup.d.ts +18 -0
  39. package/lib/constants/tokenSafetyLookup.js +66 -0
  40. package/lib/constants/tokenSaftey.test.d.ts +1 -0
  41. package/lib/constants/tokenSaftey.test.js +31 -0
  42. package/lib/constants/tokens.d.ts +34 -42
  43. package/lib/constants/tokens.js +190 -147
  44. package/lib/index.d.ts +1 -40
  45. package/lib/index.js +158 -642
  46. package/lib/routing/clientSideSmartOrderRouter.d.ts +5 -0
  47. package/lib/routing/clientSideSmartOrderRouter.js +136 -0
  48. package/lib/routing/gas.d.ts +5 -0
  49. package/lib/routing/gas.js +158 -0
  50. package/lib/routing/types.d.ts +393 -0
  51. package/lib/routing/types.js +424 -0
  52. package/lib/routing/utils.d.ts +28 -0
  53. package/lib/routing/utils.js +319 -0
  54. package/lib/rpc/AppJsonRpcProvider.d.ts +44 -0
  55. package/lib/rpc/AppJsonRpcProvider.js +183 -0
  56. package/lib/rpc/ConfiguredJsonRpcProvider.d.ts +8 -0
  57. package/lib/rpc/ConfiguredJsonRpcProvider.js +35 -0
  58. package/lib/utils/contracts/getContract.d.ts +3 -0
  59. package/lib/utils/contracts/getContract.js +29 -0
  60. package/lib/utils/transformSwapRouteToGetQuoteResult.d.ts +4 -0
  61. package/lib/utils/transformSwapRouteToGetQuoteResult.js +116 -0
  62. package/lib/utils/uniswapData.d.ts +21 -0
  63. package/lib/utils/uniswapData.js +217 -0
  64. package/package.json +11 -8
  65. package/lib/constants/addresses.d.ts +0 -9
  66. package/lib/constants/addresses.js +0 -41
  67. package/lib/constants/eip1193.d.ts +0 -8
  68. package/lib/constants/eip1193.js +0 -14
  69. package/lib/constants/index.d.ts +0 -9
  70. package/lib/constants/index.js +0 -26
  71. package/lib/constants/jsonRpcEndpoints.d.ts +0 -12
  72. package/lib/constants/jsonRpcEndpoints.js +0 -101
  73. package/lib/constants/utils/constructSameAddressMap.d.ts +0 -4
  74. package/lib/constants/utils/constructSameAddressMap.js +0 -19
@@ -30,102 +30,101 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
30
  };
31
31
  var _a, _b, _c, _d;
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.MATIC_BNB_CHAIN = exports.ETH_BNB_CHAIN = exports.USDT_BNB_CHAIN = exports.CEUR_CELO_ALFAJORES = exports.CUSD_CELO_ALFAJORES = exports.CELO_CELO_ALFAJORES = exports.CMC02_CELO = exports.PORTAL_ETH_CELO = exports.CEUR_CELO = exports.CUSD_CELO = exports.CELO_CELO = exports.WETH_POLYGON = exports.WETH_POLYGON_MUMBAI = exports.SWISE = exports.rETH2 = exports.sETH2 = exports.ETH2X_FLI = exports.renBTC = exports.FXS = exports.FRAX = exports.TRIBE = exports.FEI = exports.WBTC_OPTIMISM = exports.WBTC_ARBITRUM_ONE = exports.WBTC = exports.USDT_OPTIMISM = exports.USDT_ARBITRUM_ONE = exports.USDT = exports.WBTC_POLYGON = exports.USDT_POLYGON = exports.DAI_POLYGON = exports.USDC = exports.USDC_BASE = exports.USDC_BNB_CHAIN = exports.DAI_OPTIMISM = exports.DAI_ARBITRUM_ONE = exports.DAI = exports.AMPL = exports.USDC_CELO_ALFAJORES = exports.PORTAL_USDC_CELO = exports.USDC_POLYGON_MUMBAI = exports.USDC_POLYGON = exports.USDC_ARBITRUM_RINKEBY = exports.USDC_ARBITRUM = exports.USDC_OPTIMISM = exports.USDC_KOVAN = exports.USDC_GOERLI = exports.USDC_RINKEBY = exports.USDC_ROPSTEN = exports.USDC_MAINNET = void 0;
34
- exports.TOKEN_SHORTHANDS = exports.nativeOnChain = exports.ExtendedEther = exports.isCelo = exports.WRAPPED_NATIVE_CURRENCY = exports.UNI = exports.DAI_BASE = exports.DAI_BNB_CHAIN = exports.BUSD_BNB_CHAIN = exports.CAKE_BNB_CHAIN = exports.BTC_BNB_CHAIN = exports.FRAX_BNB_CHAIN = void 0;
33
+ exports.NMR = exports.LDO = exports.OP = exports.ARB = exports.UNI = exports.DAI_AVALANCHE = exports.WETH_AVALANCHE = exports.USDT_AVALANCHE = exports.USDC_AVALANCHE = exports.USDB_BLAST = exports.DAI_BSC = exports.BUSD_BSC = exports.BTC_BSC = exports.ETH_BSC = exports.USDT_BSC = exports.USDC_BSC = exports.CEUR_CELO_ALFAJORES = exports.CUSD_CELO_ALFAJORES = exports.WBTC_CELO = exports.PORTAL_ETH_CELO = exports.CEUR_CELO = exports.CUSD_CELO = exports.WETH_POLYGON = exports.WETH_POLYGON_MUMBAI = exports.WBTC_OPTIMISM = exports.WBTC_ARBITRUM_ONE = exports.WBTC = exports.USDT_OPTIMISM = exports.USDT_ARBITRUM_ONE = exports.USDT = exports.WBTC_POLYGON = exports.USDT_POLYGON = exports.DAI_POLYGON = exports.MATIC_POLYGON = exports.MATIC_MAINNET = exports.DAI_OPTIMISM = exports.DAI_ARBITRUM_ONE = exports.DAI = exports.USDC_BASE = exports.USDC_CELO = exports.USDC_POLYGON_MUMBAI = exports.USDC_POLYGON = exports.USDC_ARBITRUM_GOERLI = exports.USDC_ARBITRUM = exports.USDC_OPTIMISM_GOERLI = exports.USDC_OPTIMISM = exports.USDC_SEPOLIA = exports.USDC_GOERLI = exports.USDC_MAINNET = exports.NATIVE_CHAIN_ID = void 0;
34
+ exports.UNKNOWN_TOKEN_NAME = exports.UNKNOWN_TOKEN_SYMBOL = exports.isStablecoin = exports.TOKEN_SHORTHANDS = exports.nativeOnChain = exports.isAvalanche = exports.isBsc = exports.isPolygon = exports.isCelo = exports.WRAPPED_NATIVE_CURRENCY = exports.MNW = void 0;
35
35
  var sdk_core_1 = require("@uniswap/sdk-core");
36
36
  var tiny_invariant_1 = __importDefault(require("tiny-invariant"));
37
- var addresses_1 = require("./addresses");
38
- var chains_1 = require("./chains");
39
- exports.USDC_MAINNET = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 6, 'USDC', 'USD//C');
40
- exports.USDC_ROPSTEN = new sdk_core_1.Token(chains_1.SupportedChainId.ROPSTEN, '0x07865c6e87b9f70255377e024ace6630c1eaa37f', 6, 'USDC', 'USD//C');
41
- exports.USDC_RINKEBY = new sdk_core_1.Token(chains_1.SupportedChainId.RINKEBY, '0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b', 6, 'tUSDC', 'test USD//C');
42
- exports.USDC_GOERLI = new sdk_core_1.Token(chains_1.SupportedChainId.GOERLI, '0x07865c6e87b9f70255377e024ace6630c1eaa37f', 6, 'USDC', 'USD//C');
43
- exports.USDC_KOVAN = new sdk_core_1.Token(chains_1.SupportedChainId.KOVAN, '0x31eeb2d0f9b6fd8642914ab10f4dd473677d80df', 6, 'USDC', 'USD//C');
44
- exports.USDC_OPTIMISM = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM, '0x7F5c764cBc14f9669B88837ca1490cCa17c31607', 6, 'USDC', 'USD//C');
45
- var USDC_OPTIMISM_GOERLI = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM_GOERLI, '0x7E07E15D2a87A24492740D16f5bdF58c16db0c4E', 6, 'USDC', 'USD//C');
46
- exports.USDC_ARBITRUM = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_ONE, '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', 6, 'USDC', 'USD//C');
47
- exports.USDC_ARBITRUM_RINKEBY = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_RINKEBY, '0x09b98f8b2395d076514037ff7d39a091a536206c', 6, 'USDC', 'USD//C');
48
- exports.USDC_POLYGON = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON, '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', 6, 'USDC', 'USD//C');
49
- exports.USDC_POLYGON_MUMBAI = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON_MUMBAI, '0xe11a86849d99f524cac3e7a0ec1241828e332c62', 6, 'USDC', 'USD//C');
50
- exports.PORTAL_USDC_CELO = new sdk_core_1.Token(chains_1.SupportedChainId.CELO, '0x37f750B7cC259A2f741AF45294f6a16572CF5cAd', 6, 'USDCet', 'USDC (Portal from Ethereum)');
51
- exports.USDC_CELO_ALFAJORES = new sdk_core_1.Token(chains_1.SupportedChainId.CELO_ALFAJORES, '0x41F4a5d2632b019Ae6CE9625bE3c9CaC143AcC7D', 6, 'USDC', 'USD//C');
52
- exports.AMPL = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth');
53
- exports.DAI = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin');
54
- exports.DAI_ARBITRUM_ONE = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_ONE, '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', 18, 'DAI', 'Dai stable coin');
55
- exports.DAI_OPTIMISM = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM, '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', 18, 'DAI', 'Dai stable coin');
56
- exports.USDC_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', 18, 'USDC', 'USDC');
57
- exports.USDC_BASE = new sdk_core_1.Token(chains_1.SupportedChainId.BASE, '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', 6, 'USDC', 'USD Coin');
58
- exports.USDC = (_a = {},
59
- _a[chains_1.SupportedChainId.MAINNET] = exports.USDC_MAINNET,
60
- _a[chains_1.SupportedChainId.ARBITRUM_ONE] = exports.USDC_ARBITRUM,
61
- _a[chains_1.SupportedChainId.OPTIMISM] = exports.USDC_OPTIMISM,
62
- _a[chains_1.SupportedChainId.ARBITRUM_RINKEBY] = exports.USDC_ARBITRUM_RINKEBY,
63
- _a[chains_1.SupportedChainId.OPTIMISM_GOERLI] = USDC_OPTIMISM_GOERLI,
64
- _a[chains_1.SupportedChainId.POLYGON] = exports.USDC_POLYGON,
65
- _a[chains_1.SupportedChainId.POLYGON_MUMBAI] = exports.USDC_POLYGON_MUMBAI,
66
- _a[chains_1.SupportedChainId.CELO] = exports.PORTAL_USDC_CELO,
67
- _a[chains_1.SupportedChainId.CELO_ALFAJORES] = exports.USDC_CELO_ALFAJORES,
68
- _a[chains_1.SupportedChainId.GOERLI] = exports.USDC_GOERLI,
69
- _a[chains_1.SupportedChainId.RINKEBY] = exports.USDC_RINKEBY,
70
- _a[chains_1.SupportedChainId.KOVAN] = exports.USDC_KOVAN,
71
- _a[chains_1.SupportedChainId.ROPSTEN] = exports.USDC_ROPSTEN,
72
- _a[chains_1.SupportedChainId.BNB] = exports.USDC_BNB_CHAIN,
73
- _a[chains_1.SupportedChainId.BASE] = exports.USDC_BASE,
37
+ // eslint-disable-next-line no-restricted-syntax
38
+ exports.NATIVE_CHAIN_ID = 'NATIVE';
39
+ exports.USDC_MAINNET = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 6, 'USDC', 'USD//C');
40
+ exports.USDC_GOERLI = new sdk_core_1.Token(sdk_core_1.ChainId.GOERLI, '0x07865c6e87b9f70255377e024ace6630c1eaa37f', 6, 'USDC', 'USD//C');
41
+ exports.USDC_SEPOLIA = new sdk_core_1.Token(sdk_core_1.ChainId.SEPOLIA, '0x6f14C02Fc1F78322cFd7d707aB90f18baD3B54f5', 6, 'USDC', 'USD//C');
42
+ exports.USDC_OPTIMISM = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM, '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', 6, 'USDC', 'USD//C');
43
+ exports.USDC_OPTIMISM_GOERLI = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM_GOERLI, '0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6', 6, 'USDC', 'USD//C');
44
+ exports.USDC_ARBITRUM = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_ONE, '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', 6, 'USDC', 'USD//C');
45
+ exports.USDC_ARBITRUM_GOERLI = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_GOERLI, '0x8FB1E3fC51F3b789dED7557E680551d93Ea9d892', 6, 'USDC', 'USD//C');
46
+ exports.USDC_POLYGON = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359', 6, 'USDC', 'USD Coin');
47
+ exports.USDC_POLYGON_MUMBAI = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON_MUMBAI, '0x0fa8781a83e46826621b3bc094ea2a0212e71b23', 6, 'USDC', 'USD Coin');
48
+ exports.USDC_CELO = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0xceba9300f2b948710d2653dd7b07f33a8b32118c', 6, 'USDC', 'USD Coin');
49
+ exports.USDC_BASE = new sdk_core_1.Token(sdk_core_1.ChainId.BASE, '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', 6, 'USDC', 'USD Coin');
50
+ exports.DAI = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin');
51
+ exports.DAI_ARBITRUM_ONE = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_ONE, '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', 18, 'DAI', 'Dai stable coin');
52
+ exports.DAI_OPTIMISM = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM, '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', 18, 'DAI', 'Dai stable coin');
53
+ exports.MATIC_MAINNET = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0', 18, 'MATIC', 'Polygon Matic');
54
+ exports.MATIC_POLYGON = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0x0000000000000000000000000000000000001010', 18, 'MATIC', 'Matic');
55
+ exports.DAI_POLYGON = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063', 18, 'DAI', 'Dai Stablecoin');
56
+ exports.USDT_POLYGON = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', 6, 'USDT', 'Tether USD');
57
+ exports.WBTC_POLYGON = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6', 8, 'WBTC', 'Wrapped BTC');
58
+ exports.USDT = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0xdAC17F958D2ee523a2206206994597C13D831ec7', 6, 'USDT', 'Tether USD');
59
+ exports.USDT_ARBITRUM_ONE = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_ONE, '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', 6, 'USDT', 'Tether USD');
60
+ exports.USDT_OPTIMISM = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM, '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', 6, 'USDT', 'Tether USD');
61
+ exports.WBTC = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', 8, 'WBTC', 'Wrapped BTC');
62
+ exports.WBTC_ARBITRUM_ONE = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_ONE, '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', 8, 'WBTC', 'Wrapped BTC');
63
+ exports.WBTC_OPTIMISM = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM, '0x68f180fcCe6836688e9084f035309E29Bf0A2095', 8, 'WBTC', 'Wrapped BTC');
64
+ exports.WETH_POLYGON_MUMBAI = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON_MUMBAI, '0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa', 18, 'WETH', 'Wrapped Ether');
65
+ exports.WETH_POLYGON = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619', 18, 'WETH', 'Wrapped Ether');
66
+ var CELO_CELO = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0x471EcE3750Da237f93B8E339c536989b8978a438', 18, 'CELO', 'Celo');
67
+ exports.CUSD_CELO = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0x765DE816845861e75A25fCA122bb6898B8B1282a', 18, 'cUSD', 'Celo Dollar');
68
+ exports.CEUR_CELO = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73', 18, 'cEUR', 'Celo Euro Stablecoin');
69
+ exports.PORTAL_ETH_CELO = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207', 18, 'ETH', 'Portal Ether');
70
+ exports.WBTC_CELO = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF', 18, 'WBTC', 'Wrapped BTC');
71
+ var CELO_CELO_ALFAJORES = new sdk_core_1.Token(sdk_core_1.ChainId.CELO_ALFAJORES, '0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9', 18, 'CELO', 'Celo');
72
+ exports.CUSD_CELO_ALFAJORES = new sdk_core_1.Token(sdk_core_1.ChainId.CELO_ALFAJORES, '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1', 18, 'CUSD', 'Celo Dollar');
73
+ exports.CEUR_CELO_ALFAJORES = new sdk_core_1.Token(sdk_core_1.ChainId.CELO_ALFAJORES, '0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F', 18, 'CEUR', 'Celo Euro Stablecoin');
74
+ exports.USDC_BSC = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', 18, 'USDC', 'USDC');
75
+ exports.USDT_BSC = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0x55d398326f99059fF775485246999027B3197955', 18, 'USDT', 'USDT');
76
+ exports.ETH_BSC = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0x2170Ed0880ac9A755fd29B2688956BD959F933F8', 18, 'ETH', 'Ethereum');
77
+ exports.BTC_BSC = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c', 18, 'BTCB', 'BTCB');
78
+ exports.BUSD_BSC = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56', 18, 'BUSD', 'BUSD');
79
+ exports.DAI_BSC = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3', 18, 'DAI', 'DAI');
80
+ exports.USDB_BLAST = new sdk_core_1.Token(sdk_core_1.ChainId.BLAST, '0x4300000000000000000000000000000000000003', 18, 'USDB', 'USDB');
81
+ exports.USDC_AVALANCHE = new sdk_core_1.Token(sdk_core_1.ChainId.AVALANCHE, '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', 6, 'USDC', 'USDC Token');
82
+ exports.USDT_AVALANCHE = new sdk_core_1.Token(sdk_core_1.ChainId.AVALANCHE, '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', 6, 'USDT', 'Tether USD');
83
+ exports.WETH_AVALANCHE = new sdk_core_1.Token(sdk_core_1.ChainId.AVALANCHE, '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB', 18, 'WETH', 'Wrapped Ether');
84
+ exports.DAI_AVALANCHE = new sdk_core_1.Token(sdk_core_1.ChainId.AVALANCHE, '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', 18, 'DAI.e', 'Dai.e Token');
85
+ exports.UNI = (_a = {},
86
+ _a[sdk_core_1.ChainId.MAINNET] = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, sdk_core_1.UNI_ADDRESSES[sdk_core_1.ChainId.MAINNET], 18, 'UNI', 'Uniswap'),
87
+ _a[sdk_core_1.ChainId.GOERLI] = new sdk_core_1.Token(sdk_core_1.ChainId.GOERLI, sdk_core_1.UNI_ADDRESSES[sdk_core_1.ChainId.GOERLI], 18, 'UNI', 'Uniswap'),
88
+ _a[sdk_core_1.ChainId.SEPOLIA] = new sdk_core_1.Token(sdk_core_1.ChainId.SEPOLIA, sdk_core_1.UNI_ADDRESSES[sdk_core_1.ChainId.SEPOLIA], 18, 'UNI', 'Uniswap'),
74
89
  _a);
75
- exports.DAI_POLYGON = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON, '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063', 18, 'DAI', 'Dai Stablecoin');
76
- exports.USDT_POLYGON = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON, '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', 6, 'USDT', 'Tether USD');
77
- exports.WBTC_POLYGON = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON, '0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6', 8, 'WBTC', 'Wrapped BTC');
78
- exports.USDT = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xdAC17F958D2ee523a2206206994597C13D831ec7', 6, 'USDT', 'Tether USD');
79
- exports.USDT_ARBITRUM_ONE = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_ONE, '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', 6, 'USDT', 'Tether USD');
80
- exports.USDT_OPTIMISM = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM, '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', 6, 'USDT', 'Tether USD');
81
- exports.WBTC = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', 8, 'WBTC', 'Wrapped BTC');
82
- exports.WBTC_ARBITRUM_ONE = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_ONE, '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', 8, 'WBTC', 'Wrapped BTC');
83
- exports.WBTC_OPTIMISM = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM, '0x68f180fcCe6836688e9084f035309E29Bf0A2095', 8, 'WBTC', 'Wrapped BTC');
84
- exports.FEI = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x956F47F50A910163D8BF957Cf5846D573E7f87CA', 18, 'FEI', 'Fei USD');
85
- exports.TRIBE = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xc7283b66Eb1EB5FB86327f08e1B5816b0720212B', 18, 'TRIBE', 'Tribe');
86
- exports.FRAX = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x853d955aCEf822Db058eb8505911ED77F175b99e', 18, 'FRAX', 'Frax');
87
- exports.FXS = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0', 18, 'FXS', 'Frax Share');
88
- exports.renBTC = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D', 8, 'renBTC', 'renBTC');
89
- exports.ETH2X_FLI = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xAa6E8127831c9DE45ae56bB1b0d4D4Da6e5665BD', 18, 'ETH2x-FLI', 'ETH 2x Flexible Leverage Index');
90
- exports.sETH2 = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0xFe2e637202056d30016725477c5da089Ab0A043A', 18, 'sETH2', 'StakeWise Staked ETH2');
91
- exports.rETH2 = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x20BC832ca081b91433ff6c17f85701B6e92486c5', 18, 'rETH2', 'StakeWise Reward ETH2');
92
- exports.SWISE = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, '0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2', 18, 'SWISE', 'StakeWise');
93
- exports.WETH_POLYGON_MUMBAI = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON_MUMBAI, '0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa', 18, 'WETH', 'Wrapped Ether');
94
- exports.WETH_POLYGON = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON, '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619', 18, 'WETH', 'Wrapped Ether');
95
- exports.CELO_CELO = new sdk_core_1.Token(chains_1.SupportedChainId.CELO, '0x471EcE3750Da237f93B8E339c536989b8978a438', 18, 'CELO', 'Celo');
96
- exports.CUSD_CELO = new sdk_core_1.Token(chains_1.SupportedChainId.CELO, '0x765DE816845861e75A25fCA122bb6898B8B1282a', 18, 'cUSD', 'Celo Dollar');
97
- exports.CEUR_CELO = new sdk_core_1.Token(chains_1.SupportedChainId.CELO, '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73', 18, 'cEUR', 'Celo Euro Stablecoin');
98
- exports.PORTAL_ETH_CELO = new sdk_core_1.Token(chains_1.SupportedChainId.CELO, '0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207', 18, 'ETH', 'Portal Ether');
99
- exports.CMC02_CELO = new sdk_core_1.Token(chains_1.SupportedChainId.CELO, '0x32A9FE697a32135BFd313a6Ac28792DaE4D9979d', 18, 'cMCO2', 'Celo Moss Carbon Credit');
100
- exports.CELO_CELO_ALFAJORES = new sdk_core_1.Token(chains_1.SupportedChainId.CELO_ALFAJORES, '0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9', 18, 'CELO', 'Celo');
101
- exports.CUSD_CELO_ALFAJORES = new sdk_core_1.Token(chains_1.SupportedChainId.CELO_ALFAJORES, '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1', 18, 'CUSD', 'Celo Dollar');
102
- exports.CEUR_CELO_ALFAJORES = new sdk_core_1.Token(chains_1.SupportedChainId.CELO_ALFAJORES, '0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F', 18, 'CEUR', 'Celo Euro Stablecoin');
103
- exports.USDT_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x55d398326f99059fF775485246999027B3197955', 18, 'USDT', 'USDT');
104
- exports.ETH_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x2170Ed0880ac9A755fd29B2688956BD959F933F8', 18, 'ETH', 'Ethereum');
105
- exports.MATIC_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0xCC42724C6683B7E57334c4E856f4c9965ED682bD', 18, 'MATIC', 'Matic');
106
- exports.FRAX_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x90C97F71E18723b0Cf0dfa30ee176Ab653E89F40', 18, 'FRAX', 'FRAX');
107
- exports.BTC_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c', 18, 'BTCB', 'BTCB');
108
- exports.CAKE_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82', 18, 'CAKE', 'Cake');
109
- exports.BUSD_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56', 18, 'BUSD', 'BUSD');
110
- exports.DAI_BNB_CHAIN = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3', 18, 'DAI', 'DAI');
111
- exports.DAI_BASE = new sdk_core_1.Token(chains_1.SupportedChainId.BASE, '0x50c5725949a6f0c72e6c4a641f24049a917db0cb', 18, 'DAI', 'Dai Stablecoin');
112
- function isBnbChain(chainId) {
113
- return chainId === chains_1.SupportedChainId.BNB;
90
+ exports.ARB = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_ONE, '0x912CE59144191C1204E64559FE8253a0e49E6548', 18, 'ARB', 'Arbitrum');
91
+ exports.OP = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM, '0x4200000000000000000000000000000000000042', 18, 'OP', 'Optimism');
92
+ exports.LDO = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32', 18, 'LDO', 'Lido DAO Token');
93
+ exports.NMR = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671', 18, 'NMR', 'Numeraire');
94
+ exports.MNW = new sdk_core_1.Token(sdk_core_1.ChainId.MAINNET, '0xd3E4Ba569045546D09CF021ECC5dFe42b1d7f6E4', 18, 'MNW', 'Morpheus.Network');
95
+ exports.WRAPPED_NATIVE_CURRENCY = __assign(__assign({}, sdk_core_1.WETH9), (_b = {}, _b[sdk_core_1.ChainId.OPTIMISM] = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'), _b[sdk_core_1.ChainId.OPTIMISM_GOERLI] = new sdk_core_1.Token(sdk_core_1.ChainId.OPTIMISM_GOERLI, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'), _b[sdk_core_1.ChainId.BASE] = new sdk_core_1.Token(sdk_core_1.ChainId.BASE, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'), _b[sdk_core_1.ChainId.ARBITRUM_ONE] = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_ONE, '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', 18, 'WETH', 'Wrapped Ether'), _b[sdk_core_1.ChainId.ARBITRUM_GOERLI] = new sdk_core_1.Token(sdk_core_1.ChainId.ARBITRUM_GOERLI, '0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3', 18, 'WETH', 'Wrapped Ether'), _b[sdk_core_1.ChainId.SEPOLIA] = new sdk_core_1.Token(sdk_core_1.ChainId.SEPOLIA, '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14', 18, 'WETH', 'Wrapped Ether'), _b[sdk_core_1.ChainId.POLYGON] = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON, '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', 18, 'WMATIC', 'Wrapped MATIC'), _b[sdk_core_1.ChainId.POLYGON_MUMBAI] = new sdk_core_1.Token(sdk_core_1.ChainId.POLYGON_MUMBAI, '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889', 18, 'WMATIC', 'Wrapped MATIC'), _b[sdk_core_1.ChainId.CELO] = new sdk_core_1.Token(sdk_core_1.ChainId.CELO, '0x471ece3750da237f93b8e339c536989b8978a438', 18, 'CELO', 'Celo native asset'), _b[sdk_core_1.ChainId.CELO_ALFAJORES] = new sdk_core_1.Token(sdk_core_1.ChainId.CELO_ALFAJORES, '0xf194afdf50b03e69bd7d057c1aa9e10c9954e4c9', 18, 'CELO', 'Celo native asset'), _b[sdk_core_1.ChainId.BNB] = new sdk_core_1.Token(sdk_core_1.ChainId.BNB, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB'), _b[sdk_core_1.ChainId.AVALANCHE] = new sdk_core_1.Token(sdk_core_1.ChainId.AVALANCHE, '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', 18, 'WAVAX', 'Wrapped AVAX'), _b[sdk_core_1.ChainId.BLAST] = new sdk_core_1.Token(sdk_core_1.ChainId.BLAST, '0x4300000000000000000000000000000000000004', 18, 'WETH', 'Wrapped Ether'), _b));
96
+ function isCelo(chainId) {
97
+ return chainId === sdk_core_1.ChainId.CELO_ALFAJORES || chainId === sdk_core_1.ChainId.CELO;
114
98
  }
115
- var BnbChainNativeCurrency = /** @class */ (function (_super) {
116
- __extends(BnbChainNativeCurrency, _super);
117
- function BnbChainNativeCurrency(chainId) {
118
- if (!isBnbChain(chainId))
119
- throw new Error('Not BNB Chain');
120
- return _super.call(this, chainId, 18, 'BNB', 'BNB') || this;
99
+ exports.isCelo = isCelo;
100
+ function getCeloNativeCurrency(chainId) {
101
+ switch (chainId) {
102
+ case sdk_core_1.ChainId.CELO_ALFAJORES:
103
+ return CELO_CELO_ALFAJORES;
104
+ case sdk_core_1.ChainId.CELO:
105
+ return CELO_CELO;
106
+ default:
107
+ throw new Error('Not celo');
121
108
  }
122
- BnbChainNativeCurrency.prototype.equals = function (other) {
109
+ }
110
+ function isPolygon(chainId) {
111
+ return chainId === sdk_core_1.ChainId.POLYGON_MUMBAI || chainId === sdk_core_1.ChainId.POLYGON;
112
+ }
113
+ exports.isPolygon = isPolygon;
114
+ var PolygonNativeCurrency = /** @class */ (function (_super) {
115
+ __extends(PolygonNativeCurrency, _super);
116
+ function PolygonNativeCurrency(chainId) {
117
+ if (!isPolygon(chainId))
118
+ throw new Error('Not Polygon');
119
+ return _super.call(this, chainId, 18, 'MATIC', 'Matic') || this;
120
+ }
121
+ PolygonNativeCurrency.prototype.equals = function (other) {
123
122
  return other.isNative && other.chainId === this.chainId;
124
123
  };
125
- Object.defineProperty(BnbChainNativeCurrency.prototype, "wrapped", {
124
+ Object.defineProperty(PolygonNativeCurrency.prototype, "wrapped", {
126
125
  get: function () {
127
- if (!isBnbChain(this.chainId))
128
- throw new Error('Not BNB Chain');
126
+ if (!isPolygon(this.chainId))
127
+ throw new Error('Not Polygon');
129
128
  var wrapped = exports.WRAPPED_NATIVE_CURRENCY[this.chainId];
130
129
  (0, tiny_invariant_1.default)(wrapped instanceof sdk_core_1.Token);
131
130
  return wrapped;
@@ -133,47 +132,53 @@ var BnbChainNativeCurrency = /** @class */ (function (_super) {
133
132
  enumerable: false,
134
133
  configurable: true
135
134
  });
136
- return BnbChainNativeCurrency;
135
+ return PolygonNativeCurrency;
137
136
  }(sdk_core_1.NativeCurrency));
138
- exports.UNI = (_b = {},
139
- _b[chains_1.SupportedChainId.MAINNET] = new sdk_core_1.Token(chains_1.SupportedChainId.MAINNET, addresses_1.UNI_ADDRESS[1], 18, 'UNI', 'Uniswap'),
140
- _b[chains_1.SupportedChainId.RINKEBY] = new sdk_core_1.Token(chains_1.SupportedChainId.RINKEBY, addresses_1.UNI_ADDRESS[4], 18, 'UNI', 'Uniswap'),
141
- _b[chains_1.SupportedChainId.ROPSTEN] = new sdk_core_1.Token(chains_1.SupportedChainId.ROPSTEN, addresses_1.UNI_ADDRESS[3], 18, 'UNI', 'Uniswap'),
142
- _b[chains_1.SupportedChainId.GOERLI] = new sdk_core_1.Token(chains_1.SupportedChainId.GOERLI, addresses_1.UNI_ADDRESS[5], 18, 'UNI', 'Uniswap'),
143
- _b[chains_1.SupportedChainId.KOVAN] = new sdk_core_1.Token(chains_1.SupportedChainId.KOVAN, addresses_1.UNI_ADDRESS[42], 18, 'UNI', 'Uniswap'),
144
- _b);
145
- exports.WRAPPED_NATIVE_CURRENCY = __assign(__assign({}, sdk_core_1.WETH9), (_c = {}, _c[chains_1.SupportedChainId.CELO] = exports.CELO_CELO, _c[chains_1.SupportedChainId.CELO_ALFAJORES] = exports.CELO_CELO_ALFAJORES, _c[chains_1.SupportedChainId.OPTIMISM] = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'), _c[chains_1.SupportedChainId.OPTIMISM_GOERLI] = new sdk_core_1.Token(chains_1.SupportedChainId.OPTIMISM_GOERLI, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'), _c[chains_1.SupportedChainId.ARBITRUM_ONE] = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_ONE, '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', 18, 'WETH', 'Wrapped Ether'), _c[chains_1.SupportedChainId.ARBITRUM_RINKEBY] = new sdk_core_1.Token(chains_1.SupportedChainId.ARBITRUM_RINKEBY, '0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681', 18, 'WETH', 'Wrapped Ether'), _c[chains_1.SupportedChainId.POLYGON] = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON, '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', 18, 'WMATIC', 'Wrapped MATIC'), _c[chains_1.SupportedChainId.POLYGON_MUMBAI] = new sdk_core_1.Token(chains_1.SupportedChainId.POLYGON_MUMBAI, '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889', 18, 'WMATIC', 'Wrapped MATIC'), _c[chains_1.SupportedChainId.BNB] = new sdk_core_1.Token(chains_1.SupportedChainId.BNB, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB'), _c[chains_1.SupportedChainId.BASE] = new sdk_core_1.Token(chains_1.SupportedChainId.BASE, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether'), _c));
146
- function isCelo(chainId) {
147
- return chainId === chains_1.SupportedChainId.CELO_ALFAJORES || chainId === chains_1.SupportedChainId.CELO;
137
+ function isBsc(chainId) {
138
+ return chainId === sdk_core_1.ChainId.BNB;
148
139
  }
149
- exports.isCelo = isCelo;
150
- function getCeloNativeCurrency(chainId) {
151
- switch (chainId) {
152
- case chains_1.SupportedChainId.CELO_ALFAJORES:
153
- return exports.CELO_CELO_ALFAJORES;
154
- case chains_1.SupportedChainId.CELO:
155
- return exports.CELO_CELO;
156
- default:
157
- throw new Error('Not celo');
140
+ exports.isBsc = isBsc;
141
+ var BscNativeCurrency = /** @class */ (function (_super) {
142
+ __extends(BscNativeCurrency, _super);
143
+ function BscNativeCurrency(chainId) {
144
+ if (!isBsc(chainId))
145
+ throw new Error('Not bnb');
146
+ return _super.call(this, chainId, 18, 'BNB', 'BNB') || this;
158
147
  }
148
+ BscNativeCurrency.prototype.equals = function (other) {
149
+ return other.isNative && other.chainId === this.chainId;
150
+ };
151
+ Object.defineProperty(BscNativeCurrency.prototype, "wrapped", {
152
+ get: function () {
153
+ if (!isBsc(this.chainId))
154
+ throw new Error('Not bnb');
155
+ var wrapped = exports.WRAPPED_NATIVE_CURRENCY[this.chainId];
156
+ (0, tiny_invariant_1.default)(wrapped instanceof sdk_core_1.Token);
157
+ return wrapped;
158
+ },
159
+ enumerable: false,
160
+ configurable: true
161
+ });
162
+ return BscNativeCurrency;
163
+ }(sdk_core_1.NativeCurrency));
164
+ function isAvalanche(chainId) {
165
+ return chainId === sdk_core_1.ChainId.AVALANCHE;
159
166
  }
160
- function isMatic(chainId) {
161
- return chainId === chains_1.SupportedChainId.POLYGON_MUMBAI || chainId === chains_1.SupportedChainId.POLYGON;
162
- }
163
- var MaticNativeCurrency = /** @class */ (function (_super) {
164
- __extends(MaticNativeCurrency, _super);
165
- function MaticNativeCurrency(chainId) {
166
- if (!isMatic(chainId))
167
- throw new Error('Not matic');
168
- return _super.call(this, chainId, 18, 'MATIC', 'Polygon Matic') || this;
167
+ exports.isAvalanche = isAvalanche;
168
+ var AvaxNativeCurrency = /** @class */ (function (_super) {
169
+ __extends(AvaxNativeCurrency, _super);
170
+ function AvaxNativeCurrency(chainId) {
171
+ if (!isAvalanche(chainId))
172
+ throw new Error('Not avalanche');
173
+ return _super.call(this, chainId, 18, 'AVAX', 'AVAX') || this;
169
174
  }
170
- MaticNativeCurrency.prototype.equals = function (other) {
175
+ AvaxNativeCurrency.prototype.equals = function (other) {
171
176
  return other.isNative && other.chainId === this.chainId;
172
177
  };
173
- Object.defineProperty(MaticNativeCurrency.prototype, "wrapped", {
178
+ Object.defineProperty(AvaxNativeCurrency.prototype, "wrapped", {
174
179
  get: function () {
175
- if (!isMatic(this.chainId))
176
- throw new Error('Not matic');
180
+ if (!isAvalanche(this.chainId))
181
+ throw new Error('Not avalanche');
177
182
  var wrapped = exports.WRAPPED_NATIVE_CURRENCY[this.chainId];
178
183
  (0, tiny_invariant_1.default)(wrapped instanceof sdk_core_1.Token);
179
184
  return wrapped;
@@ -181,19 +186,19 @@ var MaticNativeCurrency = /** @class */ (function (_super) {
181
186
  enumerable: false,
182
187
  configurable: true
183
188
  });
184
- return MaticNativeCurrency;
189
+ return AvaxNativeCurrency;
185
190
  }(sdk_core_1.NativeCurrency));
186
191
  var ExtendedEther = /** @class */ (function (_super) {
187
192
  __extends(ExtendedEther, _super);
188
- function ExtendedEther() {
189
- return _super !== null && _super.apply(this, arguments) || this;
193
+ function ExtendedEther(chainId) {
194
+ return _super.call(this, chainId, 18, 'ETH', 'Ethereum') || this;
190
195
  }
191
196
  Object.defineProperty(ExtendedEther.prototype, "wrapped", {
192
197
  get: function () {
193
198
  var wrapped = exports.WRAPPED_NATIVE_CURRENCY[this.chainId];
194
199
  if (wrapped)
195
200
  return wrapped;
196
- throw new Error('Unsupported chain ID');
201
+ throw new Error("Unsupported chain ID: ".concat(this.chainId));
197
202
  },
198
203
  enumerable: false,
199
204
  configurable: true
@@ -202,23 +207,28 @@ var ExtendedEther = /** @class */ (function (_super) {
202
207
  var _a;
203
208
  return (_a = this._cachedExtendedEther[chainId]) !== null && _a !== void 0 ? _a : (this._cachedExtendedEther[chainId] = new ExtendedEther(chainId));
204
209
  };
210
+ ExtendedEther.prototype.equals = function (other) {
211
+ return other.isNative && other.chainId === this.chainId;
212
+ };
205
213
  ExtendedEther._cachedExtendedEther = {};
206
214
  return ExtendedEther;
207
- }(sdk_core_1.Ether));
208
- exports.ExtendedEther = ExtendedEther;
215
+ }(sdk_core_1.NativeCurrency));
209
216
  var cachedNativeCurrency = {};
210
217
  function nativeOnChain(chainId) {
211
218
  if (cachedNativeCurrency[chainId])
212
219
  return cachedNativeCurrency[chainId];
213
220
  var nativeCurrency;
214
- if (isMatic(chainId)) {
215
- nativeCurrency = new MaticNativeCurrency(chainId);
221
+ if (isPolygon(chainId)) {
222
+ nativeCurrency = new PolygonNativeCurrency(chainId);
216
223
  }
217
224
  else if (isCelo(chainId)) {
218
225
  nativeCurrency = getCeloNativeCurrency(chainId);
219
226
  }
220
- else if (isBnbChain(chainId)) {
221
- nativeCurrency = new BnbChainNativeCurrency(chainId);
227
+ else if (isBsc(chainId)) {
228
+ nativeCurrency = new BscNativeCurrency(chainId);
229
+ }
230
+ else if (isAvalanche(chainId)) {
231
+ nativeCurrency = new AvaxNativeCurrency(chainId);
222
232
  }
223
233
  else {
224
234
  nativeCurrency = ExtendedEther.onChain(chainId);
@@ -227,20 +237,53 @@ function nativeOnChain(chainId) {
227
237
  }
228
238
  exports.nativeOnChain = nativeOnChain;
229
239
  exports.TOKEN_SHORTHANDS = {
230
- USDC: (_d = {},
231
- _d[chains_1.SupportedChainId.MAINNET] = exports.USDC_MAINNET.address,
232
- _d[chains_1.SupportedChainId.ARBITRUM_ONE] = exports.USDC_ARBITRUM.address,
233
- _d[chains_1.SupportedChainId.OPTIMISM] = exports.USDC_OPTIMISM.address,
234
- _d[chains_1.SupportedChainId.ARBITRUM_RINKEBY] = exports.USDC_ARBITRUM_RINKEBY.address,
235
- _d[chains_1.SupportedChainId.OPTIMISM_GOERLI] = USDC_OPTIMISM_GOERLI.address,
236
- _d[chains_1.SupportedChainId.POLYGON] = exports.USDC_POLYGON.address,
237
- _d[chains_1.SupportedChainId.POLYGON_MUMBAI] = exports.USDC_POLYGON_MUMBAI.address,
238
- _d[chains_1.SupportedChainId.GOERLI] = exports.USDC_GOERLI.address,
239
- _d[chains_1.SupportedChainId.RINKEBY] = exports.USDC_RINKEBY.address,
240
- _d[chains_1.SupportedChainId.KOVAN] = exports.USDC_KOVAN.address,
241
- _d[chains_1.SupportedChainId.ROPSTEN] = exports.USDC_ROPSTEN.address,
242
- _d[chains_1.SupportedChainId.CELO] = exports.PORTAL_USDC_CELO.address,
243
- _d[chains_1.SupportedChainId.CELO_ALFAJORES] = exports.USDC_CELO_ALFAJORES.address,
244
- _d[chains_1.SupportedChainId.BASE] = exports.USDC_BASE.address,
245
- _d),
240
+ USDC: (_c = {},
241
+ _c[sdk_core_1.ChainId.MAINNET] = exports.USDC_MAINNET.address,
242
+ _c[sdk_core_1.ChainId.ARBITRUM_ONE] = exports.USDC_ARBITRUM.address,
243
+ _c[sdk_core_1.ChainId.ARBITRUM_GOERLI] = exports.USDC_ARBITRUM_GOERLI.address,
244
+ _c[sdk_core_1.ChainId.OPTIMISM] = exports.USDC_OPTIMISM.address,
245
+ _c[sdk_core_1.ChainId.OPTIMISM_GOERLI] = exports.USDC_OPTIMISM_GOERLI.address,
246
+ _c[sdk_core_1.ChainId.POLYGON] = exports.USDC_POLYGON.address,
247
+ _c[sdk_core_1.ChainId.POLYGON_MUMBAI] = exports.USDC_POLYGON_MUMBAI.address,
248
+ _c[sdk_core_1.ChainId.BNB] = exports.USDC_BSC.address,
249
+ _c[sdk_core_1.ChainId.BASE] = exports.USDC_BASE.address,
250
+ _c[sdk_core_1.ChainId.CELO] = exports.USDC_CELO.address,
251
+ _c[sdk_core_1.ChainId.CELO_ALFAJORES] = exports.USDC_CELO.address,
252
+ _c[sdk_core_1.ChainId.GOERLI] = exports.USDC_GOERLI.address,
253
+ _c[sdk_core_1.ChainId.SEPOLIA] = exports.USDC_SEPOLIA.address,
254
+ _c[sdk_core_1.ChainId.AVALANCHE] = exports.USDC_AVALANCHE.address,
255
+ _c),
246
256
  };
257
+ var STABLECOINS = (_d = {},
258
+ _d[sdk_core_1.ChainId.MAINNET] = [exports.USDC_MAINNET, exports.DAI, exports.USDT],
259
+ _d[sdk_core_1.ChainId.ARBITRUM_ONE] = [exports.USDC_ARBITRUM, exports.DAI_ARBITRUM_ONE],
260
+ _d[sdk_core_1.ChainId.ARBITRUM_GOERLI] = [exports.USDC_ARBITRUM_GOERLI],
261
+ _d[sdk_core_1.ChainId.OPTIMISM] = [exports.USDC_OPTIMISM, exports.DAI_OPTIMISM],
262
+ _d[sdk_core_1.ChainId.OPTIMISM_GOERLI] = [exports.USDC_OPTIMISM_GOERLI],
263
+ _d[sdk_core_1.ChainId.POLYGON] = [exports.USDC_POLYGON, exports.DAI_POLYGON],
264
+ _d[sdk_core_1.ChainId.POLYGON_MUMBAI] = [exports.USDC_POLYGON_MUMBAI],
265
+ _d[sdk_core_1.ChainId.BNB] = [exports.USDC_BSC],
266
+ _d[sdk_core_1.ChainId.BASE] = [exports.USDC_BASE],
267
+ _d[sdk_core_1.ChainId.CELO] = [exports.USDC_CELO],
268
+ _d[sdk_core_1.ChainId.CELO_ALFAJORES] = [exports.USDC_CELO],
269
+ _d[sdk_core_1.ChainId.GOERLI] = [exports.USDC_GOERLI],
270
+ _d[sdk_core_1.ChainId.SEPOLIA] = [exports.USDC_SEPOLIA],
271
+ _d[sdk_core_1.ChainId.AVALANCHE] = [exports.USDC_AVALANCHE],
272
+ _d[sdk_core_1.ChainId.GNOSIS] = [],
273
+ _d[sdk_core_1.ChainId.MOONBEAM] = [],
274
+ _d[sdk_core_1.ChainId.BASE_GOERLI] = [],
275
+ _d[sdk_core_1.ChainId.OPTIMISM_SEPOLIA] = [exports.USDC_SEPOLIA],
276
+ _d[sdk_core_1.ChainId.ARBITRUM_SEPOLIA] = [],
277
+ _d[sdk_core_1.ChainId.ZORA_SEPOLIA] = [],
278
+ _d[sdk_core_1.ChainId.ZORA] = [],
279
+ _d[sdk_core_1.ChainId.ROOTSTOCK] = [],
280
+ _d[sdk_core_1.ChainId.BLAST] = [exports.USDB_BLAST],
281
+ _d);
282
+ function isStablecoin(currency) {
283
+ if (!currency)
284
+ return false;
285
+ return STABLECOINS[currency.chainId].some(function (stablecoin) { return stablecoin.equals(currency); });
286
+ }
287
+ exports.isStablecoin = isStablecoin;
288
+ exports.UNKNOWN_TOKEN_SYMBOL = 'UNKNOWN';
289
+ exports.UNKNOWN_TOKEN_NAME = 'Unknown Token';
package/lib/index.d.ts CHANGED
@@ -1,40 +1 @@
1
- export declare const MAX_UINT = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
2
- export declare const MAX_UINT160 = "0xffffffffffffffffffffffffffffffffffffffff";
3
- export declare const DEADLINE = 2000000000;
4
- export declare const CONTRACT_BALANCE = "0x8000000000000000000000000000000000000000000000000000000000000000";
5
- export declare const ALREADY_PAID = 0;
6
- export declare const ALICE_ADDRESS = "0x28c6c06298d514db089934071355e5743bf21d60";
7
- export declare const ETH_ADDRESS: any;
8
- export declare const ZERO_ADDRESS: any;
9
- export declare const ONE_PERCENT_BIPS = 100;
10
- export declare const MSG_SENDER: string;
11
- export declare const ADDRESS_THIS: string;
12
- export declare const SOURCE_MSG_SENDER: boolean;
13
- export declare const SOURCE_ROUTER: boolean;
14
- export declare const OPENSEA_CONDUIT = "0x1E0049783F008A0085193E00003D00cd54003c71";
15
- export declare const OPENSEA_CONDUIT_KEY = "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000";
16
- export declare const COVEN_ADDRESS = "0x5180db8f5c931aae63c74266b211f580155ecac8";
17
- export declare const DECENTRA_DRAGON_ADDRESS = "0xAA107cCFe230a29C345Fd97bc6eb9Bd2fccD0750";
18
- export declare const TOWNSTAR_ADDRESS = "0xc36cF0cFcb5d905B8B513860dB0CFE63F6Cf9F5c";
19
- export declare const TWERKY_ADDRESS = "0xf4680c917a873e2dd6ead72f9f433e74eb9c623c";
20
- export declare const MILADY_ADDRESS = "0x5af0d9827e0c53e4799bb226655a1de152a425a5";
21
- export declare const ALPHABETTIES_ADDRESS = "0x6d05064fe99e40f1c3464e7310a23ffaded56e20";
22
- export declare const MENTAL_WORLDS_ADDRESS = "0xEf96021Af16BD04918b0d87cE045d7984ad6c38c";
23
- export declare const CAMEO_ADDRESS = "0x93317E87a3a47821803CAADC54Ae418Af80603DA";
24
- export declare const ENS_NFT_ADDRESS = "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85";
25
- export declare const CRYPTOPUNKS_MARKET_ADDRESS = "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB";
26
- export declare const NFTX_COVEN_VAULT = "0xd89b16331f39ab3878daf395052851d3ac8cf3cd";
27
- export declare const NFTX_COVEN_VAULT_ID = "333";
28
- export declare const NFTX_MILADY_VAULT = "0x227c7df69d3ed1ae7574a1a7685fded90292eb48";
29
- export declare const NFTX_MILADY_VAULT_ID = "392";
30
- export declare const NFTX_ERC_1155_VAULT = "0x78e09c5ec42d505742a52fd10078a57ea186002a";
31
- export declare const NFTX_ERC_1155_VAULT_ID = "61";
32
- export declare const V2_FACTORY_MAINNET = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f";
33
- export declare const V3_FACTORY_MAINNET = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
34
- export declare const V3_INIT_CODE_HASH_MAINNET = "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";
35
- export declare const V2_INIT_CODE_HASH_MAINNET = "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f";
36
- export declare const ROUTER_REWARDS_DISTRIBUTOR = "0x0000000000000000000000000000000000000000";
37
- export declare const LOOKSRARE_REWARDS_DISTRIBUTOR = "0x0554f068365eD43dcC98dcd7Fd7A8208a5638C72";
38
- export declare const LOOKSRARE_TOKEN = "0xf4d2888d29D722226FafA5d9B24F9164c092421E";
39
- /** Returns the default transaction TTL for the chain, in minutes. */
40
- export declare function getDefaultTransactionTtl(chainId: any): number;
1
+ export {};