@curvefi/api 2.49.7 → 2.50.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.
@@ -11,3 +11,4 @@ export declare const ALIASES_KAVA: import("../interfaces.js").IDict<string>;
11
11
  export declare const ALIASES_CELO: import("../interfaces.js").IDict<string>;
12
12
  export declare const ALIASES_ZKSYNC: import("../interfaces.js").IDict<string>;
13
13
  export declare const ALIASES_BASE: import("../interfaces.js").IDict<string>;
14
+ export declare const ALIASES_BSC: import("../interfaces.js").IDict<string>;
@@ -236,6 +236,24 @@ export var ALIASES_BASE = lowerCaseValues({
236
236
  "factory_admin": "0x0000000000000000000000000000000000000000",
237
237
  "gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f', // <-- NEW
238
238
  });
239
+ export var ALIASES_BSC = lowerCaseValues({
240
+ "crv": "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415",
241
+ "gauge_factory": "0x0000000000000000000000000000000000000000",
242
+ "voting_escrow": "0x0000000000000000000000000000000000000000",
243
+ "fee_distributor": "0x0000000000000000000000000000000000000000",
244
+ "gauge_controller": "0x0000000000000000000000000000000000000000",
245
+ "address_provider": "0x0000000000000000000000000000000000000000",
246
+ "router": "0x0000000000000000000000000000000000000000",
247
+ "deposit_and_stake": "0x0000000000000000000000000000000000000000",
248
+ "stable_calc": "0x0000000000000000000000000000000000000000",
249
+ "crypto_calc": '0x0000000000000000000000000000000000000000',
250
+ "factory": '0xEfDE221f306152971D8e9f181bFe998447975810',
251
+ "crvusd_factory": '0x0000000000000000000000000000000000000000',
252
+ "eywa_factory": '0x0000000000000000000000000000000000000000',
253
+ "crypto_factory": '0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C',
254
+ "tricrypto_factory": '0xc55837710bc500F1E3c7bb9dd1d51F7c5647E657',
255
+ "factory_admin": '0x0000000000000000000000000000000000000000',
256
+ });
239
257
  var registry_exchange_deprecated = {
240
258
  '1': '0x99a58482bd75cbab83b27ec03ca68ff489b5788f',
241
259
  '10': '0x22d710931f01c1681ca1570ff016ed42eb7b7c2a',
@@ -0,0 +1,6 @@
1
+ import { IDict } from "../../interfaces.js";
2
+ export declare const COINS_BSC: IDict<string>;
3
+ export declare const cTokensBsc: never[];
4
+ export declare const yTokensBsc: never[];
5
+ export declare const ycTokensBsc: never[];
6
+ export declare const aTokensBsc: never[];
@@ -0,0 +1,11 @@
1
+ import { lowerCaseValues } from "../utils.js";
2
+ export var COINS_BSC = lowerCaseValues({
3
+ //crv: '0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415', // <--- TODO ADD
4
+ // --- BSC ---
5
+ bnb: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
6
+ wbnb: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
7
+ });
8
+ export var cTokensBsc = []; //.map((a) => a.toLowerCase());
9
+ export var yTokensBsc = []; //.map((a) => a.toLowerCase());
10
+ export var ycTokensBsc = []; //.map((a) => a.toLowerCase());
11
+ export var aTokensBsc = []; //.map((a) => a.toLowerCase());
@@ -0,0 +1,2 @@
1
+ import { IPoolData, IDict } from "../../interfaces.js";
2
+ export declare const POOLS_DATA_BSC: IDict<IPoolData>;
@@ -0,0 +1,2 @@
1
+ import { lowerCasePoolDataAddresses } from "../utils.js";
2
+ export var POOLS_DATA_BSC = lowerCasePoolDataAddresses({});
@@ -12,4 +12,5 @@ import { POOLS_DATA_KAVA } from "./kava.js";
12
12
  import { POOLS_DATA_CELO } from "./celo.js";
13
13
  import { POOLS_DATA_ZKSYNC } from "./zksync.js";
14
14
  import { POOLS_DATA_BASE } from "./base.js";
15
- export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, };
15
+ import { POOLS_DATA_BSC } from "./bsc.js";
16
+ export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, };
@@ -12,4 +12,5 @@ import { POOLS_DATA_KAVA } from "./kava.js";
12
12
  import { POOLS_DATA_CELO } from "./celo.js";
13
13
  import { POOLS_DATA_ZKSYNC } from "./zksync.js";
14
14
  import { POOLS_DATA_BASE } from "./base.js";
15
- export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, };
15
+ import { POOLS_DATA_BSC } from "./bsc.js";
16
+ export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, };
package/lib/curve.js CHANGED
@@ -85,8 +85,8 @@ import factoryAdminABI from './constants/abis/factory-admin.json' assert { type:
85
85
  import cryptoFactoryABI from './constants/abis/factory-crypto.json' assert { type: 'json' };
86
86
  import tricryptoFactoryABI from './constants/abis/factory-tricrypto.json' assert { type: 'json' };
87
87
  import gasOracleABI from './constants/abis/gas_oracle_optimism.json' assert { type: 'json' };
88
- import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, } from './constants/pools/index.js';
89
- import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, ALIASES_BASE, } from "./constants/aliases.js";
88
+ import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, } from './constants/pools/index.js';
89
+ import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, ALIASES_BASE, ALIASES_BSC, } from "./constants/aliases.js";
90
90
  import { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum } from "./constants/coins/ethereum.js";
91
91
  import { COINS_OPTIMISM, cTokensOptimism, yTokensOptimism, ycTokensOptimism, aTokensOptimism } from "./constants/coins/optimism.js";
92
92
  import { COINS_POLYGON, cTokensPolygon, yTokensPolygon, ycTokensPolygon, aTokensPolygon } from "./constants/coins/polygon.js";
@@ -100,6 +100,7 @@ import { COINS_KAVA, cTokensKava, yTokensKava, ycTokensKava, aTokensKava } from
100
100
  import { COINS_CELO, cTokensCelo, yTokensCelo, ycTokensCelo, aTokensCelo } from "./constants/coins/celo.js";
101
101
  import { COINS_ZKSYNC, cTokensZkSync, yTokensZkSync, ycTokensZkSync, aTokensZkSync } from "./constants/coins/zksync.js";
102
102
  import { COINS_BASE, cTokensBase, yTokensBase, ycTokensBase, aTokensBase } from "./constants/coins/base.js";
103
+ import { COINS_BSC, cTokensBsc, yTokensBsc, ycTokensBsc, aTokensBsc } from "./constants/coins/bsc.js";
103
104
  import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./constants/utils.js";
104
105
  import { _getAllGauges, _getHiddenPools } from "./external-api.js";
105
106
  import { L2Networks } from "./constants/L2Networks.js";
@@ -142,6 +143,12 @@ export var NATIVE_TOKENS = {
142
143
  address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
143
144
  wrappedAddress: '0x4200000000000000000000000000000000000006'.toLowerCase(),
144
145
  },
146
+ 56: {
147
+ symbol: 'BNB',
148
+ wrappedSymbol: 'WBNB',
149
+ address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
150
+ wrappedAddress: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'.toLowerCase(),
151
+ },
145
152
  100: {
146
153
  symbol: 'XDAi',
147
154
  wrappedSymbol: 'WXDAI',
@@ -231,6 +238,16 @@ export var NETWORK_CONSTANTS = {
231
238
  ycTokens: ycTokensOptimism,
232
239
  aTokens: aTokensOptimism,
233
240
  },
241
+ 56: {
242
+ NAME: 'bsc',
243
+ ALIASES: ALIASES_BSC,
244
+ POOLS_DATA: POOLS_DATA_BSC,
245
+ COINS: COINS_BSC,
246
+ cTokens: cTokensBsc,
247
+ yTokens: yTokensBsc,
248
+ ycTokens: ycTokensBsc,
249
+ aTokens: aTokensBsc,
250
+ },
234
251
  100: {
235
252
  NAME: 'xdai',
236
253
  ALIASES: ALIASES_XDAI,
@@ -97,8 +97,8 @@ export var _getLegacyAPYsAndVolumes = memoize(function (network) { return __awai
97
97
  return __generator(this, function (_a) {
98
98
  switch (_a.label) {
99
99
  case 0:
100
- if (["kava", "celo", "zksync", "base"].includes(network))
101
- return [2 /*return*/, {}]; // Exclude Kava, Celo, ZkSync and Base
100
+ if (["kava", "celo", "zksync", "base", "bsc"].includes(network))
101
+ return [2 /*return*/, {}]; // Exclude Kava, Celo, ZkSync, Base and Bsc
102
102
  url = "https://api.curve.fi/api/getMainPoolsAPYs/" + network;
103
103
  return [4 /*yield*/, axios.get(url, { validateStatus: function () { return true; } })];
104
104
  case 1:
@@ -117,7 +117,7 @@ export var _getLegacyAPYsAndVolumes = memoize(function (network) { return __awai
117
117
  promise: true,
118
118
  maxAge: 5 * 60 * 1000, // 5m
119
119
  });
120
- // Base, ZkSync, Moonbeam, Kava and Celo only
120
+ // Base, Bsc, ZkSync, Moonbeam, Kava and Celo only
121
121
  export var _getFactoryAPYsAndVolumes = memoize(function (network) { return __awaiter(void 0, void 0, void 0, function () {
122
122
  var url, response;
123
123
  var _a;
@@ -11,6 +11,7 @@ export declare const lpTokenBasePoolIdDictKava: IDict<string>;
11
11
  export declare const lpTokenBasePoolIdDictCelo: IDict<string>;
12
12
  export declare const lpTokenBasePoolIdDictZkSync: IDict<string>;
13
13
  export declare const lpTokenBasePoolIdDictBase: IDict<string>;
14
+ export declare const lpTokenBasePoolIdDictBsc: IDict<string>;
14
15
  export declare const basePoolIdZapDictEthereum: IDict<{
15
16
  address: string;
16
17
  ABI: any;
@@ -59,6 +60,10 @@ export declare const basePoolIdZapDictBase: IDict<{
59
60
  address: string;
60
61
  ABI: any;
61
62
  }>;
63
+ export declare const basePoolIdZapDictBsc: IDict<{
64
+ address: string;
65
+ ABI: any;
66
+ }>;
62
67
  export declare const CRYPTO_FACTORY_CONSTANTS: {
63
68
  [index: number]: {
64
69
  lpTokenBasePoolIdDict: IDict<string>;
@@ -20,6 +20,7 @@ export var lpTokenBasePoolIdDictKava = lowerCaseKeys({});
20
20
  export var lpTokenBasePoolIdDictCelo = lowerCaseKeys({});
21
21
  export var lpTokenBasePoolIdDictZkSync = lowerCaseKeys({});
22
22
  export var lpTokenBasePoolIdDictBase = lowerCaseKeys({});
23
+ export var lpTokenBasePoolIdDictBsc = lowerCaseKeys({});
23
24
  export var basePoolIdZapDictEthereum = {
24
25
  '3pool': {
25
26
  address: "0x97aDC08FA1D849D2C48C5dcC1DaB568B169b0267".toLowerCase(),
@@ -46,6 +47,7 @@ export var basePoolIdZapDictKava = {};
46
47
  export var basePoolIdZapDictCelo = {};
47
48
  export var basePoolIdZapDictZkSync = {};
48
49
  export var basePoolIdZapDictBase = {};
50
+ export var basePoolIdZapDictBsc = {};
49
51
  export var CRYPTO_FACTORY_CONSTANTS = {
50
52
  1: {
51
53
  lpTokenBasePoolIdDict: lpTokenBasePoolIdDictEthereum,
@@ -55,6 +57,10 @@ export var CRYPTO_FACTORY_CONSTANTS = {
55
57
  lpTokenBasePoolIdDict: lpTokenBasePoolIdDictOptimism,
56
58
  basePoolIdZapDict: basePoolIdZapDictOptimism,
57
59
  },
60
+ 56: {
61
+ lpTokenBasePoolIdDict: lpTokenBasePoolIdDictBsc,
62
+ basePoolIdZapDict: basePoolIdZapDictBsc,
63
+ },
58
64
  100: {
59
65
  lpTokenBasePoolIdDict: lpTokenBasePoolIdDictXDai,
60
66
  basePoolIdZapDict: basePoolIdZapDictXDai,
@@ -11,6 +11,7 @@ export declare const implementationABIDictKava: IDict<any>;
11
11
  export declare const implementationABIDictCelo: IDict<any>;
12
12
  export declare const implementationABIDictZkSync: IDict<any>;
13
13
  export declare const implementationABIDictBase: IDict<any>;
14
+ export declare const implementationABIDictBsc: IDict<any>;
14
15
  export declare const implementationBasePoolIdDictEthereum: IDict<string>;
15
16
  export declare const implementationBasePoolIdDictPolygon: IDict<string>;
16
17
  export declare const implementationBasePoolIdDictFantom: IDict<string>;
@@ -23,6 +24,7 @@ export declare const implementationBasePoolIdDictKava: IDict<string>;
23
24
  export declare const implementationBasePoolIdDictCelo: IDict<string>;
24
25
  export declare const implementationBasePoolIdDictZkSync: IDict<string>;
25
26
  export declare const implementationBasePoolIdDictBase: IDict<string>;
27
+ export declare const implementationBasePoolIdDictBsc: IDict<string>;
26
28
  export declare const basePoolIdZapDictEthereum: IDict<{
27
29
  address: string;
28
30
  ABI: any;
@@ -71,6 +73,10 @@ export declare const basePoolIdZapDictBase: IDict<{
71
73
  address: string;
72
74
  ABI: any;
73
75
  }>;
76
+ export declare const basePoolIdZapDictBsc: IDict<{
77
+ address: string;
78
+ ABI: any;
79
+ }>;
74
80
  export declare const FACTORY_CONSTANTS: {
75
81
  [index: number]: {
76
82
  implementationABIDict: IDict<any>;
@@ -261,6 +261,20 @@ export var implementationABIDictBase = lowerCaseKeys({
261
261
  "0x50E09Ee7080b32aef3e92346891dD2DD389B5fAf": Plain4ETHABI,
262
262
  "0x44d9B3f4EE15AC81FEb918501fca0ddc9d83C976": Plain4OptimizedABI,
263
263
  });
264
+ export var implementationABIDictBsc = lowerCaseKeys({
265
+ "0xB90B9B1F91a01Ea22A182CD84C1E22222e39B415": Plain2BasicABI,
266
+ "0x7CDE88e96E9445D986537074B1bFD32c5623c71f": Plain2BalancesABI,
267
+ "0x5BD917879e04Cf18EC79285a1C960C5fbA7f5EA3": Plain2ETHABI,
268
+ "0x630C7Ad3998f397df0c0A8FfDB7a65B61ec5539E": Plain2OptimizedABI,
269
+ "0xD166EEdf272B860E991d331B71041799379185D5": Plain3BasicABI,
270
+ "0x5C627d6925e448Ae418BC8a45d56B31fe5009Bea": Plain3BalancesABI,
271
+ "0x22D710931F01c1681Ca1570Ff016eD42EB7b7c2a": Plain3ETHABI,
272
+ "0xA50d9a424A14aF0b9e7e9243dc1597d977f6cB09": Plain3OptimizedABI,
273
+ "0xeD49979026DC44DC7E83b1471794ec9b2a365Ea2": Plain4BasicABI,
274
+ "0x0Cc51c9786f3777a6d50961CEBb2BB6E69ec5e07": Plain4BalancesABI,
275
+ "0x0a31527a8dE2Ee97BBD8cCE14Db8E8826a0b6C4f": Plain4ETHABI,
276
+ "0x1086F023146f9026A9Bb22983CE866813C59518A": Plain4OptimizedABI,
277
+ });
264
278
  export var implementationBasePoolIdDictEthereum = lowerCaseKeys({
265
279
  "0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
266
280
  "0x213be373FDff327658139C7df330817DAD2d5bBE": "3pool",
@@ -319,6 +333,7 @@ export var implementationBasePoolIdDictKava = lowerCaseKeys({});
319
333
  export var implementationBasePoolIdDictCelo = lowerCaseKeys({});
320
334
  export var implementationBasePoolIdDictZkSync = lowerCaseKeys({});
321
335
  export var implementationBasePoolIdDictBase = lowerCaseKeys({});
336
+ export var implementationBasePoolIdDictBsc = lowerCaseKeys({});
322
337
  export var basePoolIdZapDictEthereum = {
323
338
  '3pool': {
324
339
  address: "0xA79828DF1850E8a3A3064576f380D90aECDD3359".toLowerCase(),
@@ -414,6 +429,7 @@ export var basePoolIdZapDictKava = {};
414
429
  export var basePoolIdZapDictCelo = {};
415
430
  export var basePoolIdZapDictZkSync = {};
416
431
  export var basePoolIdZapDictBase = {};
432
+ export var basePoolIdZapDictBsc = {};
417
433
  export var FACTORY_CONSTANTS = {
418
434
  1: {
419
435
  implementationABIDict: implementationABIDictEthereum,
@@ -425,6 +441,11 @@ export var FACTORY_CONSTANTS = {
425
441
  implementationBasePoolIdDict: implementationBasePoolIdDictOptimism,
426
442
  basePoolIdZapDict: basePoolIdZapDictOptimism,
427
443
  },
444
+ 56: {
445
+ implementationABIDict: implementationABIDictBsc,
446
+ implementationBasePoolIdDict: implementationBasePoolIdDictBsc,
447
+ basePoolIdZapDict: basePoolIdZapDictBsc,
448
+ },
428
449
  100: {
429
450
  implementationABIDict: implementationABIDictXDai,
430
451
  implementationBasePoolIdDict: implementationBasePoolIdDictXDai,
@@ -72,8 +72,8 @@ export var BLACK_LIST = {
72
72
  "0x88c4d6534165510b2e2caf0a130d4f70aa4b6d71",
73
73
  ],
74
74
  42161: [
75
- "0xd7bb79aee866672419999a0496d99c54741d67b5"
76
- ]
75
+ "0xd7bb79aee866672419999a0496d99c54741d67b5",
76
+ ],
77
77
  };
78
78
  var deepFlatten = function (arr) { return [].concat.apply([], arr.map(function (v) { return (Array.isArray(v) ? deepFlatten(v) : v); })); };
79
79
  function getRecentlyCreatedPoolId(swapAddress) {
@@ -3,8 +3,8 @@ import { Contract as MulticallContract, Provider as MulticallProvider } from "et
3
3
  export interface IDict<T> {
4
4
  [index: string]: T;
5
5
  }
6
- export type INetworkName = "ethereum" | "optimism" | "xdai" | "polygon" | "fantom" | "zksync" | "moonbeam" | "kava" | "base" | "arbitrum" | "celo" | "avalanche" | "aurora";
7
- export type IChainId = 1 | 10 | 100 | 137 | 250 | 324 | 1284 | 2222 | 8453 | 42161 | 42220 | 43114 | 1313161554;
6
+ export type INetworkName = "ethereum" | "bsc" | "optimism" | "xdai" | "polygon" | "fantom" | "zksync" | "moonbeam" | "kava" | "base" | "arbitrum" | "celo" | "avalanche" | "aurora";
7
+ export type IChainId = 1 | 10 | 56 | 100 | 137 | 250 | 324 | 1284 | 2222 | 8453 | 42161 | 42220 | 43114 | 1313161554;
8
8
  export type IFactoryPoolType = "factory" | "factory-crvusd" | "factory-eywa" | "factory-crypto" | "factory-tricrypto";
9
9
  export type IPoolType = "main" | "crypto" | IFactoryPoolType;
10
10
  export type ISwapType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
@@ -225,7 +225,7 @@ var PoolTemplate = /** @class */ (function () {
225
225
  return __generator(this, function (_e) {
226
226
  switch (_e.label) {
227
227
  case 0:
228
- if (![324, 1284, 2222, 8453, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 3];
228
+ if (![56, 324, 1284, 2222, 8453, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 3];
229
229
  return [4 /*yield*/, Promise.all([
230
230
  _getLegacyAPYsAndVolumes(curve.constants.NETWORK_NAME),
231
231
  _getFactoryAPYsAndVolumes(curve.constants.NETWORK_NAME),
@@ -260,7 +260,7 @@ var PoolTemplate = /** @class */ (function () {
260
260
  return __generator(this, function (_d) {
261
261
  switch (_d.label) {
262
262
  case 0:
263
- if (![324, 1284, 2222, 8453, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 2];
263
+ if (![56, 324, 1284, 2222, 8453, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 2];
264
264
  return [4 /*yield*/, Promise.all([
265
265
  _getLegacyAPYsAndVolumes(curve.constants.NETWORK_NAME),
266
266
  _getFactoryAPYsAndVolumes(curve.constants.NETWORK_NAME),
package/lib/router.js CHANGED
@@ -307,6 +307,8 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
307
307
  for (l = 0; l < coins.length; l++) {
308
308
  if (k > 0 && l > 0)
309
309
  continue;
310
+ if (k == 0 && l == 0)
311
+ continue;
310
312
  i = Math.max(k - 1, 0);
311
313
  j = Math.max(l - 1, 0);
312
314
  swapType = k == 0 ? 6 : 4;
@@ -331,12 +333,14 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
331
333
  }
332
334
  }
333
335
  // Underlying coin <-> LP "swaps" (actually add_liquidity/remove_liquidity_one_coin)
334
- if ((poolData.is_fake || isAaveLikeLending) && underlyingCoinAddresses.length < 6) {
336
+ if ((poolData.is_fake || isAaveLikeLending) && (poolId !== 'aave' || curve.chainId !== 1) && underlyingCoinAddresses.length < 6) {
335
337
  coins = __spreadArray([tokenAddress], underlyingCoinAddresses, true);
336
338
  for (k = 0; k < coins.length; k++) {
337
339
  for (l = 0; l < coins.length; l++) {
338
340
  if (k > 0 && l > 0)
339
341
  continue;
342
+ if (k == 0 && l == 0)
343
+ continue;
340
344
  i = Math.max(k - 1, 0);
341
345
  j = Math.max(l - 1, 0);
342
346
  swapType = isAaveLikeLending ? 7 : 6;
@@ -392,7 +396,7 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
392
396
  swapAddress = (poolData.is_crypto && poolData.is_meta) || ((basePool === null || basePool === void 0 ? void 0 : basePool.is_lending) && poolData.is_factory) ?
393
397
  poolData.deposit_address : poolData.swap_address;
394
398
  // Underlying swaps
395
- if (!poolData.is_plain) {
399
+ if (!poolData.is_plain && (poolId !== 'aave' || curve.chainId !== 1)) {
396
400
  for (i = 0; i < underlyingCoinAddresses.length; i++) {
397
401
  for (j = 0; j < underlyingCoinAddresses.length; j++) {
398
402
  if (i === j)
package/lib/utils.js CHANGED
@@ -606,6 +606,7 @@ export var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, v
606
606
  chainName = {
607
607
  1: 'ethereum',
608
608
  10: 'optimistic-ethereum',
609
+ 56: "bsc",
609
610
  100: 'xdai',
610
611
  137: 'polygon-pos',
611
612
  250: 'fantom',
@@ -621,6 +622,7 @@ export var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, v
621
622
  nativeTokenName = {
622
623
  1: 'ethereum',
623
624
  10: 'ethereum',
625
+ 56: 'bnb',
624
626
  100: 'xdai',
625
627
  137: 'matic-network',
626
628
  250: 'fantom',
@@ -769,10 +771,10 @@ export var getVolume = function (network) {
769
771
  switch (_e.label) {
770
772
  case 0:
771
773
  network = _getNetworkName(network);
772
- if (!["zksync", "moonbeam", "kava", "base", "celo", "aurora"].includes(network)) return [3 /*break*/, 8];
774
+ if (!["zksync", "moonbeam", "kava", "base", "celo", "aurora", "bsc"].includes(network)) return [3 /*break*/, 8];
773
775
  chainId = _getChainId(network);
774
776
  if (curve.chainId !== chainId)
775
- throw Error("To get volume for ZkSync, Moonbeam, Kava, Base, Celo or Aurora connect to the network first");
777
+ throw Error("To get volume for ZkSync, Moonbeam, Kava, Base, Celo, Aurora or Bsc connect to the network first");
776
778
  return [4 /*yield*/, Promise.all([
777
779
  _getLegacyAPYsAndVolumes(network),
778
780
  _getFactoryAPYsAndVolumes(network),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.49.7",
3
+ "version": "2.50.1",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",