@gearbox-protocol/sdk 7.6.0 → 7.6.2

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 (49) hide show
  1. package/dist/cjs/sdk/GearboxSDK.js +16 -13
  2. package/dist/cjs/sdk/sdk-gov-legacy/tokens/aave.js +0 -3
  3. package/dist/cjs/sdk/sdk-gov-legacy/tokens/aura.js +2 -8
  4. package/dist/cjs/sdk/sdk-gov-legacy/tokens/compound.js +2 -5
  5. package/dist/cjs/sdk/sdk-gov-legacy/tokens/convex.js +0 -15
  6. package/dist/cjs/sdk/sdk-gov-legacy/tokens/curveLP.js +2 -5
  7. package/dist/cjs/sdk/sdk-gov-legacy/tokens/erc4626.js +9 -5
  8. package/dist/cjs/sdk/sdk-gov-legacy/tokens/gear.js +12 -14
  9. package/dist/cjs/sdk/sdk-gov-legacy/tokens/index.js +0 -4
  10. package/dist/cjs/sdk/sdk-gov-legacy/tokens/normal.js +10 -0
  11. package/dist/cjs/sdk/sdk-gov-legacy/tokens/token.js +39 -63
  12. package/dist/cjs/sdk/sdk-gov-legacy/tokens/tokenType.js +0 -9
  13. package/dist/cjs/sdk/sdk-gov-legacy/tokens/zircuit.js +0 -11
  14. package/dist/cjs/sdk/sdk-legacy/apy/index.js +2 -1
  15. package/dist/esm/sdk/GearboxSDK.js +16 -13
  16. package/dist/esm/sdk/sdk-gov-legacy/tokens/aave.js +0 -2
  17. package/dist/esm/sdk/sdk-gov-legacy/tokens/aura.js +1 -5
  18. package/dist/esm/sdk/sdk-gov-legacy/tokens/compound.js +1 -3
  19. package/dist/esm/sdk/sdk-gov-legacy/tokens/convex.js +0 -12
  20. package/dist/esm/sdk/sdk-gov-legacy/tokens/curveLP.js +1 -3
  21. package/dist/esm/sdk/sdk-gov-legacy/tokens/erc4626.js +8 -3
  22. package/dist/esm/sdk/sdk-gov-legacy/tokens/gear.js +11 -9
  23. package/dist/esm/sdk/sdk-gov-legacy/tokens/index.js +0 -2
  24. package/dist/esm/sdk/sdk-gov-legacy/tokens/normal.js +10 -0
  25. package/dist/esm/sdk/sdk-gov-legacy/tokens/token.js +39 -58
  26. package/dist/esm/sdk/sdk-gov-legacy/tokens/tokenType.js +0 -8
  27. package/dist/esm/sdk/sdk-gov-legacy/tokens/zircuit.js +0 -9
  28. package/dist/esm/sdk/sdk-legacy/apy/index.js +2 -1
  29. package/dist/types/sdk/GearboxSDK.d.ts +3 -2
  30. package/dist/types/sdk/sdk-gov-legacy/tokens/aave.d.ts +0 -1
  31. package/dist/types/sdk/sdk-gov-legacy/tokens/aura.d.ts +0 -2
  32. package/dist/types/sdk/sdk-gov-legacy/tokens/compound.d.ts +0 -1
  33. package/dist/types/sdk/sdk-gov-legacy/tokens/convex.d.ts +2 -5
  34. package/dist/types/sdk/sdk-gov-legacy/tokens/curveLP.d.ts +0 -1
  35. package/dist/types/sdk/sdk-gov-legacy/tokens/erc4626.d.ts +3 -4
  36. package/dist/types/sdk/sdk-gov-legacy/tokens/gear.d.ts +1 -5
  37. package/dist/types/sdk/sdk-gov-legacy/tokens/index.d.ts +0 -2
  38. package/dist/types/sdk/sdk-gov-legacy/tokens/normal.d.ts +1 -1
  39. package/dist/types/sdk/sdk-gov-legacy/tokens/token.d.ts +0 -5
  40. package/dist/types/sdk/sdk-gov-legacy/tokens/tokenType.d.ts +0 -6
  41. package/dist/types/sdk/sdk-gov-legacy/tokens/zircuit.d.ts +0 -2
  42. package/dist/types/sdk/sdk-legacy/apy/index.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/dist/cjs/sdk/sdk-gov-legacy/tokens/decimals.js +0 -315
  45. package/dist/cjs/sdk/sdk-gov-legacy/tokens/quoted.js +0 -41
  46. package/dist/esm/sdk/sdk-gov-legacy/tokens/decimals.js +0 -291
  47. package/dist/esm/sdk/sdk-gov-legacy/tokens/quoted.js +0 -17
  48. package/dist/types/sdk/sdk-gov-legacy/tokens/decimals.d.ts +0 -2
  49. package/dist/types/sdk/sdk-gov-legacy/tokens/quoted.d.ts +0 -3
@@ -474,27 +474,30 @@ class GearboxSDK {
474
474
  return this.#marketRegister;
475
475
  }
476
476
  /**
477
- * Returns router contract that will work for given credit manager or credit facade
477
+ * Returns router contract that will work for given credit manager or credit facade, or simply version range
478
478
  * @param params
479
479
  * @returns
480
480
  */
481
481
  routerFor(params) {
482
- let facadeAddr;
483
- if ("creditFacade" in params) {
484
- facadeAddr = (0, import_utils.toAddress)(params.creditFacade);
482
+ let routerRange;
483
+ if (Array.isArray(params)) {
484
+ routerRange = params;
485
485
  } else {
486
- const cm = this.marketRegister.findCreditManager(
487
- (0, import_utils.toAddress)(params.creditManager)
488
- );
489
- facadeAddr = cm.creditFacade.address;
486
+ let facadeAddr;
487
+ if ("creditFacade" in params) {
488
+ facadeAddr = (0, import_utils.toAddress)(params.creditFacade);
489
+ } else {
490
+ const cm = this.marketRegister.findCreditManager(
491
+ (0, import_utils.toAddress)(params.creditManager)
492
+ );
493
+ facadeAddr = cm.creditFacade.address;
494
+ }
495
+ const facadeV = this.contracts.mustGet(facadeAddr).version;
496
+ routerRange = (0, import_constants.isV310)(facadeV) ? import_constants.VERSION_RANGE_310 : import_constants.VERSION_RANGE_300;
490
497
  }
491
- const facadeV = this.contracts.mustGet(facadeAddr).version;
492
- const routerRange = (0, import_constants.isV310)(facadeV) ? import_constants.VERSION_RANGE_310 : import_constants.VERSION_RANGE_300;
493
498
  const routerEntry = this.addressProvider.getLatest(import_constants.AP_ROUTER, routerRange);
494
499
  if (!routerEntry) {
495
- throw new Error(
496
- `router not found for facade v ${facadeV} at ${facadeAddr}`
497
- );
500
+ throw new Error(`router not found in version range ${routerRange}`);
498
501
  }
499
502
  const [routerAddr, routerV] = routerEntry;
500
503
  if (!this.contracts.has(routerAddr)) {
@@ -19,7 +19,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var aave_exports = {};
20
20
  __export(aave_exports, {
21
21
  aaveV2Tokens: () => aaveV2Tokens,
22
- isAaveV2LPToken: () => isAaveV2LPToken,
23
22
  wrappedAaveV2Tokens: () => wrappedAaveV2Tokens
24
23
  });
25
24
  module.exports = __toCommonJS(aave_exports);
@@ -92,10 +91,8 @@ const wrappedAaveV2Tokens = {
92
91
  underlying: "aWETH"
93
92
  }
94
93
  };
95
- const isAaveV2LPToken = (t) => typeof t === "string" && !!aaveV2Tokens[t];
96
94
  // Annotate the CommonJS export names for ESM import in node:
97
95
  0 && (module.exports = {
98
96
  aaveV2Tokens,
99
- isAaveV2LPToken,
100
97
  wrappedAaveV2Tokens
101
98
  });
@@ -21,9 +21,7 @@ __export(aura_exports, {
21
21
  auraLpTokens: () => auraLpTokens,
22
22
  auraStakedTokens: () => auraStakedTokens,
23
23
  auraTokens: () => auraTokens,
24
- isAuraLPToken: () => isAuraLPToken,
25
- isAuraStakedToken: () => isAuraStakedToken,
26
- isAuraToken: () => isAuraToken
24
+ isAuraStakedToken: () => isAuraStakedToken
27
25
  });
28
26
  module.exports = __toCommonJS(aura_exports);
29
27
  var import_tokenType = require("./tokenType.js");
@@ -233,15 +231,11 @@ const auraTokens = {
233
231
  ...auraLpTokens,
234
232
  ...auraStakedTokens
235
233
  };
236
- const isAuraToken = (t) => typeof t === "string" && !!auraTokens[t];
237
- const isAuraLPToken = (t) => typeof t === "string" && !!auraLpTokens[t];
238
234
  const isAuraStakedToken = (t) => typeof t === "string" && !!auraStakedTokens[t];
239
235
  // Annotate the CommonJS export names for ESM import in node:
240
236
  0 && (module.exports = {
241
237
  auraLpTokens,
242
238
  auraStakedTokens,
243
239
  auraTokens,
244
- isAuraLPToken,
245
- isAuraStakedToken,
246
- isAuraToken
240
+ isAuraStakedToken
247
241
  });
@@ -18,8 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var compound_exports = {};
20
20
  __export(compound_exports, {
21
- compoundV2Tokens: () => compoundV2Tokens,
22
- isCompoundV2LPToken: () => isCompoundV2LPToken
21
+ compoundV2Tokens: () => compoundV2Tokens
23
22
  });
24
23
  module.exports = __toCommonJS(compound_exports);
25
24
  var import_tokenType = require("./tokenType.js");
@@ -73,9 +72,7 @@ const compoundV2Tokens = {
73
72
  underlying: "USDC"
74
73
  }
75
74
  };
76
- const isCompoundV2LPToken = (t) => typeof t === "string" && !!compoundV2Tokens[t];
77
75
  // Annotate the CommonJS export names for ESM import in node:
78
76
  0 && (module.exports = {
79
- compoundV2Tokens,
80
- isCompoundV2LPToken
77
+ compoundV2Tokens
81
78
  });
@@ -19,12 +19,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var convex_exports = {};
20
20
  __export(convex_exports, {
21
21
  convexL2StakedTokens: () => convexL2StakedTokens,
22
- convexLpTokenByPid: () => convexLpTokenByPid,
23
22
  convexLpTokens: () => convexLpTokens,
24
- convexPoolByPid: () => convexPoolByPid,
25
23
  convexStakedPhantomTokens: () => convexStakedPhantomTokens,
26
24
  convexTokens: () => convexTokens,
27
- isConvexL2StakedToken: () => isConvexL2StakedToken,
28
25
  isConvexLPToken: () => isConvexLPToken,
29
26
  isConvexStakedPhantomToken: () => isConvexStakedPhantomToken,
30
27
  isConvexToken: () => isConvexToken
@@ -451,24 +448,12 @@ const convexTokens = {
451
448
  const isConvexToken = (t) => typeof t === "string" && !!convexTokens[t];
452
449
  const isConvexLPToken = (t) => typeof t === "string" && !!convexLpTokens[t];
453
450
  const isConvexStakedPhantomToken = (t) => typeof t === "string" && !!convexStakedPhantomTokens[t];
454
- const isConvexL2StakedToken = (t) => typeof t === "string" && !!convexL2StakedTokens[t];
455
- const convexPoolByPid = Object.values(convexLpTokens).reduce((acc, value) => {
456
- acc[value.pid] = value.pool;
457
- return acc;
458
- }, {});
459
- const convexLpTokenByPid = Object.entries(convexLpTokens).reduce((acc, [token, data]) => {
460
- acc[data.pid] = token;
461
- return acc;
462
- }, {});
463
451
  // Annotate the CommonJS export names for ESM import in node:
464
452
  0 && (module.exports = {
465
453
  convexL2StakedTokens,
466
- convexLpTokenByPid,
467
454
  convexLpTokens,
468
- convexPoolByPid,
469
455
  convexStakedPhantomTokens,
470
456
  convexTokens,
471
- isConvexL2StakedToken,
472
457
  isConvexLPToken,
473
458
  isConvexStakedPhantomToken,
474
459
  isConvexToken
@@ -21,8 +21,7 @@ __export(curveLP_exports, {
21
21
  Curve3CrvUnderlyingTokenIndex: () => Curve3CrvUnderlyingTokenIndex,
22
22
  curveMetaTokens: () => curveMetaTokens,
23
23
  curveTokens: () => curveTokens,
24
- isCurveLPToken: () => isCurveLPToken,
25
- isCurveMetaToken: () => isCurveMetaToken
24
+ isCurveLPToken: () => isCurveLPToken
26
25
  });
27
26
  module.exports = __toCommonJS(curveLP_exports);
28
27
  var import_tokenType = require("./tokenType.js");
@@ -390,12 +389,10 @@ const curveTokens = {
390
389
  ...curveMetaTokens
391
390
  };
392
391
  const isCurveLPToken = (t) => typeof t === "string" && !!curveTokens[t];
393
- const isCurveMetaToken = (t) => typeof t === "string" && !!curveMetaTokens[t];
394
392
  // Annotate the CommonJS export names for ESM import in node:
395
393
  0 && (module.exports = {
396
394
  Curve3CrvUnderlyingTokenIndex,
397
395
  curveMetaTokens,
398
396
  curveTokens,
399
- isCurveLPToken,
400
- isCurveMetaToken
397
+ isCurveLPToken
401
398
  });
@@ -18,8 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var erc4626_exports = {};
20
20
  __export(erc4626_exports, {
21
- erc4626Tokens: () => erc4626Tokens,
22
- isERC4626LPToken: () => isERC4626LPToken
21
+ erc4626Tokens: () => erc4626Tokens
23
22
  });
24
23
  module.exports = __toCommonJS(erc4626_exports);
25
24
  var import_tokenType = require("./tokenType.js");
@@ -59,11 +58,16 @@ const erc4626Tokens = {
59
58
  type: { AllNetworks: import_tokenType.TokenType.ERC4626_VAULT_TOKEN },
60
59
  underlying: "crvUSD",
61
60
  vault: "SAVINGS_CRVUSD_VAULT"
61
+ },
62
+ ynBNBx: {
63
+ name: "Savings crvUSD",
64
+ symbol: "scrvUSD",
65
+ type: { AllNetworks: import_tokenType.TokenType.ERC4626_VAULT_TOKEN },
66
+ underlying: "WBNB",
67
+ vault: void 0
62
68
  }
63
69
  };
64
- const isERC4626LPToken = (t) => typeof t === "string" && !!erc4626Tokens[t];
65
70
  // Annotate the CommonJS export names for ESM import in node:
66
71
  0 && (module.exports = {
67
- erc4626Tokens,
68
- isERC4626LPToken
72
+ erc4626Tokens
69
73
  });
@@ -18,11 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var gear_exports = {};
20
20
  __export(gear_exports, {
21
- gearTokens: () => gearTokens,
22
- isDieselSimpleToken: () => isDieselSimpleToken,
23
- isDieselStakedToken: () => isDieselStakedToken,
24
- isDieselToken: () => isDieselToken,
25
- isDieselWithStkToken: () => isDieselWithStkToken
21
+ gearTokens: () => gearTokens
26
22
  });
27
23
  module.exports = __toCommonJS(gear_exports);
28
24
  var import_tokenType = require("./tokenType.js");
@@ -76,6 +72,16 @@ const dieselSimpleTokens = {
76
72
  name: "dwSV3",
77
73
  symbol: "dwSV3",
78
74
  type: { AllNetworks: import_tokenType.TokenType.DIESEL_LP_TOKEN }
75
+ },
76
+ dUSDTv310: {
77
+ name: "dUSDTv310",
78
+ symbol: "dUSDTv310",
79
+ type: { AllNetworks: import_tokenType.TokenType.DIESEL_LP_TOKEN }
80
+ },
81
+ dWBNBv3: {
82
+ name: "dWBNBv3",
83
+ symbol: "dWBNBv3",
84
+ type: { AllNetworks: import_tokenType.TokenType.DIESEL_LP_TOKEN }
79
85
  }
80
86
  };
81
87
  const dieselWithStkTokens = {
@@ -195,15 +201,7 @@ const gearTokens = {
195
201
  type: { AllNetworks: import_tokenType.TokenType.GEAR_TOKEN }
196
202
  }
197
203
  };
198
- const isDieselToken = (t) => typeof t === "string" && !!dieselTokens[t];
199
- const isDieselSimpleToken = (t) => typeof t === "string" && !!dieselSimpleTokens[t];
200
- const isDieselWithStkToken = (t) => typeof t === "string" && !!dieselWithStkTokens[t];
201
- const isDieselStakedToken = (t) => typeof t === "string" && !!dieselStakedTokens[t];
202
204
  // Annotate the CommonJS export names for ESM import in node:
203
205
  0 && (module.exports = {
204
- gearTokens,
205
- isDieselSimpleToken,
206
- isDieselStakedToken,
207
- isDieselToken,
208
- isDieselWithStkToken
206
+ gearTokens
209
207
  });
@@ -21,11 +21,9 @@ __reExport(tokens_exports, require("./balancer.js"), module.exports);
21
21
  __reExport(tokens_exports, require("./compound.js"), module.exports);
22
22
  __reExport(tokens_exports, require("./convex.js"), module.exports);
23
23
  __reExport(tokens_exports, require("./curveLP.js"), module.exports);
24
- __reExport(tokens_exports, require("./decimals.js"), module.exports);
25
24
  __reExport(tokens_exports, require("./erc4626.js"), module.exports);
26
25
  __reExport(tokens_exports, require("./gear.js"), module.exports);
27
26
  __reExport(tokens_exports, require("./normal.js"), module.exports);
28
- __reExport(tokens_exports, require("./quoted.js"), module.exports);
29
27
  __reExport(tokens_exports, require("./stakingRewards.js"), module.exports);
30
28
  __reExport(tokens_exports, require("./token.js"), module.exports);
31
29
  __reExport(tokens_exports, require("./tokenData.js"), module.exports);
@@ -41,11 +39,9 @@ __reExport(tokens_exports, require("./zircuit.js"), module.exports);
41
39
  ...require("./compound.js"),
42
40
  ...require("./convex.js"),
43
41
  ...require("./curveLP.js"),
44
- ...require("./decimals.js"),
45
42
  ...require("./erc4626.js"),
46
43
  ...require("./gear.js"),
47
44
  ...require("./normal.js"),
48
- ...require("./quoted.js"),
49
45
  ...require("./stakingRewards.js"),
50
46
  ...require("./token.js"),
51
47
  ...require("./tokenData.js"),
@@ -465,6 +465,16 @@ const normalTokens = {
465
465
  name: "Balancer V3 DVstETH-Prime wstETH",
466
466
  symbol: "DVstETH_Prime_wstETH",
467
467
  type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
468
+ },
469
+ WBNB: {
470
+ name: "WBNB",
471
+ symbol: "WBNB",
472
+ type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
473
+ },
474
+ BTCB: {
475
+ name: "BTCB",
476
+ symbol: "BTCB",
477
+ type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
468
478
  }
469
479
  };
470
480
  const isNormalToken = (t) => typeof t === "string" && !!normalTokens[t];
@@ -19,15 +19,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var token_exports = {};
20
20
  __export(token_exports, {
21
21
  ETH_ADDRESS: () => ETH_ADDRESS,
22
- getDecimals: () => getDecimals,
23
22
  getTokenSymbol: () => getTokenSymbol,
24
- getTokenSymbolOrTicker: () => getTokenSymbolOrTicker,
25
23
  isLPToken: () => isLPToken,
26
24
  lpTokens: () => lpTokens,
27
- supportedTokens: () => supportedTokens,
28
25
  tickerInfoTokensByNetwork: () => tickerInfoTokensByNetwork,
29
- tickerSymbolByAddress: () => tickerSymbolByAddress,
30
- tickerTokensByNetwork: () => tickerTokensByNetwork,
31
26
  tokenDataByNetwork: () => tokenDataByNetwork,
32
27
  tokenSymbolByAddress: () => tokenSymbolByAddress
33
28
  });
@@ -39,12 +34,8 @@ var import_balancer = require("./balancer.js");
39
34
  var import_compound = require("./compound.js");
40
35
  var import_convex = require("./convex.js");
41
36
  var import_curveLP = require("./curveLP.js");
42
- var import_decimals = require("./decimals.js");
43
37
  var import_erc4626 = require("./erc4626.js");
44
- var import_gear = require("./gear.js");
45
- var import_normal = require("./normal.js");
46
38
  var import_stakingRewards = require("./stakingRewards.js");
47
- var import_wrapped = require("./wrapped.js");
48
39
  var import_yearn = require("./yearn.js");
49
40
  var import_zircuit = require("./zircuit.js");
50
41
  const lpTokens = {
@@ -61,12 +52,6 @@ const lpTokens = {
61
52
  ...import_zircuit.zircuitStakedPhantomTokens,
62
53
  ...import_stakingRewards.stakingRewardsPhantomTokens
63
54
  };
64
- const supportedTokens = {
65
- ...import_normal.normalTokens,
66
- ...import_wrapped.wrappedTokens,
67
- ...lpTokens,
68
- ...import_gear.gearTokens
69
- };
70
55
  const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
71
56
  const tokenDataByNetwork = {
72
57
  //
@@ -373,7 +358,12 @@ const tokenDataByNetwork = {
373
358
  rstETH: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
374
359
  pzETH: "0x8c9532a60E0E7C6BbD2B2c1303F63aCE1c3E9811",
375
360
  DVstETH: "0x5E362eb2c0706Bd1d134689eC75176018385430B",
376
- waEthLidowstETH: "0x775F661b0bD1739349b9A2A3EF60be277c5d2D29"
361
+ waEthLidowstETH: "0x775F661b0bD1739349b9A2A3EF60be277c5d2D29",
362
+ BTCB: import_constants.NOT_DEPLOYED,
363
+ WBNB: import_constants.NOT_DEPLOYED,
364
+ dUSDTv310: import_constants.NOT_DEPLOYED,
365
+ dWBNBv3: import_constants.NOT_DEPLOYED,
366
+ ynBNBx: import_constants.NOT_DEPLOYED
377
367
  },
378
368
  ///
379
369
  ///
@@ -681,7 +671,12 @@ const tokenDataByNetwork = {
681
671
  rstETH: import_constants.NOT_DEPLOYED,
682
672
  pzETH: import_constants.NOT_DEPLOYED,
683
673
  DVstETH: import_constants.NOT_DEPLOYED,
684
- waEthLidowstETH: import_constants.NOT_DEPLOYED
674
+ waEthLidowstETH: import_constants.NOT_DEPLOYED,
675
+ BTCB: import_constants.NOT_DEPLOYED,
676
+ WBNB: import_constants.NOT_DEPLOYED,
677
+ dUSDTv310: import_constants.NOT_DEPLOYED,
678
+ dWBNBv3: import_constants.NOT_DEPLOYED,
679
+ ynBNBx: import_constants.NOT_DEPLOYED
685
680
  },
686
681
  ///
687
682
  ///
@@ -989,7 +984,12 @@ const tokenDataByNetwork = {
989
984
  rstETH: import_constants.NOT_DEPLOYED,
990
985
  pzETH: import_constants.NOT_DEPLOYED,
991
986
  DVstETH: import_constants.NOT_DEPLOYED,
992
- waEthLidowstETH: import_constants.NOT_DEPLOYED
987
+ waEthLidowstETH: import_constants.NOT_DEPLOYED,
988
+ BTCB: import_constants.NOT_DEPLOYED,
989
+ WBNB: import_constants.NOT_DEPLOYED,
990
+ dUSDTv310: import_constants.NOT_DEPLOYED,
991
+ dWBNBv3: import_constants.NOT_DEPLOYED,
992
+ ynBNBx: import_constants.NOT_DEPLOYED
993
993
  },
994
994
  //
995
995
  //
@@ -1296,7 +1296,12 @@ const tokenDataByNetwork = {
1296
1296
  rstETH: import_constants.NOT_DEPLOYED,
1297
1297
  pzETH: import_constants.NOT_DEPLOYED,
1298
1298
  DVstETH: import_constants.NOT_DEPLOYED,
1299
- waEthLidowstETH: import_constants.NOT_DEPLOYED
1299
+ waEthLidowstETH: import_constants.NOT_DEPLOYED,
1300
+ BTCB: import_constants.NOT_DEPLOYED,
1301
+ WBNB: import_constants.NOT_DEPLOYED,
1302
+ dUSDTv310: import_constants.NOT_DEPLOYED,
1303
+ dWBNBv3: import_constants.NOT_DEPLOYED,
1304
+ ynBNBx: import_constants.NOT_DEPLOYED
1300
1305
  },
1301
1306
  //
1302
1307
  //
@@ -1603,14 +1608,27 @@ const tokenDataByNetwork = {
1603
1608
  rstETH: import_constants.NOT_DEPLOYED,
1604
1609
  pzETH: import_constants.NOT_DEPLOYED,
1605
1610
  DVstETH: import_constants.NOT_DEPLOYED,
1606
- waEthLidowstETH: import_constants.NOT_DEPLOYED
1611
+ waEthLidowstETH: import_constants.NOT_DEPLOYED,
1612
+ BTCB: import_constants.NOT_DEPLOYED,
1613
+ WBNB: import_constants.NOT_DEPLOYED,
1614
+ dUSDTv310: import_constants.NOT_DEPLOYED,
1615
+ dWBNBv3: import_constants.NOT_DEPLOYED,
1616
+ ynBNBx: import_constants.NOT_DEPLOYED
1607
1617
  },
1608
1618
  // New networks
1609
1619
  MegaETH: {},
1610
1620
  Monad: {},
1611
1621
  Berachain: {},
1612
1622
  Avalanche: {},
1613
- BNB: {},
1623
+ BNB: {
1624
+ BTCB: "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",
1625
+ WETH: "0x2170ed0880ac9a755fd29b2688956bd959f933f8",
1626
+ USDT: "0x55d398326f99059ff775485246999027b3197955",
1627
+ WBNB: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
1628
+ dUSDTv310: "0xe773eb1c9c26e79deb8e20be24629953ce20597d",
1629
+ dWBNBv3: "0xef7d781825350d2bacb64ef7be927fd400dcdf4f",
1630
+ ynBNBx: "0x32c830f5c34122c6afb8ae87aba541b7900a2c5f"
1631
+ },
1614
1632
  WorldChain: {}
1615
1633
  };
1616
1634
  const tickerInfoTokensByNetwork = {
@@ -2011,24 +2029,6 @@ const tickerInfoTokensByNetwork = {
2011
2029
  BNB: {},
2012
2030
  WorldChain: {}
2013
2031
  };
2014
- const tickerTokensByNetwork = Object.fromEntries(
2015
- Object.entries(tickerInfoTokensByNetwork).map(([network, data]) => {
2016
- if (Object.values(data).length === 0) return [network, {}];
2017
- const addrs = {};
2018
- Object.values(data).forEach(
2019
- (d) => d.forEach((val) => {
2020
- if (Object.keys(addrs).includes(val.symbol)) {
2021
- if (!addrs[val.symbol]?.includes(val.address)) {
2022
- addrs[val.symbol]?.push(val.address);
2023
- }
2024
- } else {
2025
- addrs[val.symbol] = [val.address];
2026
- }
2027
- })
2028
- );
2029
- return [network, addrs];
2030
- })
2031
- );
2032
2032
  const tokenSymbolByAddress = Object.entries(tokenDataByNetwork).reduce(
2033
2033
  (acc, [, tokens]) => ({
2034
2034
  ...acc,
@@ -2038,41 +2038,17 @@ const tokenSymbolByAddress = Object.entries(tokenDataByNetwork).reduce(
2038
2038
  }),
2039
2039
  {}
2040
2040
  );
2041
- const tickerSymbolByAddress = Object.fromEntries(
2042
- Object.values(tickerTokensByNetwork).map(
2043
- (en) => Object.entries(en).map(
2044
- ([symbol, addresses]) => addresses.map((addr) => [addr.toLowerCase(), symbol])
2045
- ).flat()
2046
- ).flat()
2047
- );
2048
2041
  function getTokenSymbol(address) {
2049
2042
  return tokenSymbolByAddress[address.toLowerCase()];
2050
2043
  }
2051
- function getTokenSymbolOrTicker(address) {
2052
- return tokenSymbolByAddress[address.toLowerCase()] || tickerSymbolByAddress[address.toLowerCase()];
2053
- }
2054
2044
  const isLPToken = (t) => typeof t === "string" && !!lpTokens[t];
2055
- function getDecimals(token) {
2056
- let dec = import_decimals.decimals[token];
2057
- if (dec) return dec;
2058
- dec = import_decimals.decimals[tokenSymbolByAddress[token.toLowerCase()]];
2059
- if (!dec) {
2060
- throw new Error(`Decimals for ${token} not found`);
2061
- }
2062
- return dec;
2063
- }
2064
2045
  // Annotate the CommonJS export names for ESM import in node:
2065
2046
  0 && (module.exports = {
2066
2047
  ETH_ADDRESS,
2067
- getDecimals,
2068
2048
  getTokenSymbol,
2069
- getTokenSymbolOrTicker,
2070
2049
  isLPToken,
2071
2050
  lpTokens,
2072
- supportedTokens,
2073
2051
  tickerInfoTokensByNetwork,
2074
- tickerSymbolByAddress,
2075
- tickerTokensByNetwork,
2076
2052
  tokenDataByNetwork,
2077
2053
  tokenSymbolByAddress
2078
2054
  });
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var tokenType_exports = {};
20
20
  __export(tokenType_exports, {
21
- PhantomTokenType: () => PhantomTokenType,
22
21
  TokenType: () => TokenType
23
22
  });
24
23
  module.exports = __toCommonJS(tokenType_exports);
@@ -45,15 +44,7 @@ var TokenType = /* @__PURE__ */ ((TokenType2) => {
45
44
  TokenType2[TokenType2["STAKING_REWARDS_PHANTOM_TOKEN"] = 19] = "STAKING_REWARDS_PHANTOM_TOKEN";
46
45
  return TokenType2;
47
46
  })(TokenType || {});
48
- var PhantomTokenType = /* @__PURE__ */ ((PhantomTokenType2) => {
49
- PhantomTokenType2[PhantomTokenType2["NO_TOKEN"] = 0] = "NO_TOKEN";
50
- PhantomTokenType2[PhantomTokenType2["CONVEX_PHANTOM_TOKEN"] = 1] = "CONVEX_PHANTOM_TOKEN";
51
- PhantomTokenType2[PhantomTokenType2["ZIRCUIT_PHANTOM_TOKEN"] = 2] = "ZIRCUIT_PHANTOM_TOKEN";
52
- PhantomTokenType2[PhantomTokenType2["STAKING_REWARDS_PHANTOM_TOKEN"] = 3] = "STAKING_REWARDS_PHANTOM_TOKEN";
53
- return PhantomTokenType2;
54
- })(PhantomTokenType || {});
55
47
  // Annotate the CommonJS export names for ESM import in node:
56
48
  0 && (module.exports = {
57
- PhantomTokenType,
58
49
  TokenType
59
50
  });
@@ -18,9 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var zircuit_exports = {};
20
20
  __export(zircuit_exports, {
21
- isZircuitStakedPhantomToken: () => isZircuitStakedPhantomToken,
22
21
  zircuitStakedPhantomTokens: () => zircuitStakedPhantomTokens,
23
- zircuitStakedTokenByToken: () => zircuitStakedTokenByToken,
24
22
  zircuitTokens: () => zircuitTokens
25
23
  });
26
24
  module.exports = __toCommonJS(zircuit_exports);
@@ -38,17 +36,8 @@ const zircuitStakedPhantomTokens = {
38
36
  const zircuitTokens = {
39
37
  ...zircuitStakedPhantomTokens
40
38
  };
41
- const isZircuitStakedPhantomToken = (t) => typeof t === "string" && !!zircuitTokens[t];
42
- const zircuitStakedTokenByToken = Object.values(
43
- zircuitStakedPhantomTokens
44
- ).reduce((acc, value) => {
45
- acc[value.underlying] = value.symbol;
46
- return acc;
47
- }, {});
48
39
  // Annotate the CommonJS export names for ESM import in node:
49
40
  0 && (module.exports = {
50
- isZircuitStakedPhantomToken,
51
41
  zircuitStakedPhantomTokens,
52
- zircuitStakedTokenByToken,
53
42
  zircuitTokens
54
43
  });
@@ -61,7 +61,8 @@ const EXTRA_FARM_TOKENS = {
61
61
  PT_beraSTONE_10APR2025: true,
62
62
  stS: true,
63
63
  csUSDL: true,
64
- scUSD: true
64
+ scUSD: true,
65
+ ynBNBx: true
65
66
  };
66
67
  const isExtraFarmToken = (t) => {
67
68
  if (typeof t !== "string") return false;
@@ -472,27 +472,30 @@ class GearboxSDK {
472
472
  return this.#marketRegister;
473
473
  }
474
474
  /**
475
- * Returns router contract that will work for given credit manager or credit facade
475
+ * Returns router contract that will work for given credit manager or credit facade, or simply version range
476
476
  * @param params
477
477
  * @returns
478
478
  */
479
479
  routerFor(params) {
480
- let facadeAddr;
481
- if ("creditFacade" in params) {
482
- facadeAddr = toAddress(params.creditFacade);
480
+ let routerRange;
481
+ if (Array.isArray(params)) {
482
+ routerRange = params;
483
483
  } else {
484
- const cm = this.marketRegister.findCreditManager(
485
- toAddress(params.creditManager)
486
- );
487
- facadeAddr = cm.creditFacade.address;
484
+ let facadeAddr;
485
+ if ("creditFacade" in params) {
486
+ facadeAddr = toAddress(params.creditFacade);
487
+ } else {
488
+ const cm = this.marketRegister.findCreditManager(
489
+ toAddress(params.creditManager)
490
+ );
491
+ facadeAddr = cm.creditFacade.address;
492
+ }
493
+ const facadeV = this.contracts.mustGet(facadeAddr).version;
494
+ routerRange = isV310(facadeV) ? VERSION_RANGE_310 : VERSION_RANGE_300;
488
495
  }
489
- const facadeV = this.contracts.mustGet(facadeAddr).version;
490
- const routerRange = isV310(facadeV) ? VERSION_RANGE_310 : VERSION_RANGE_300;
491
496
  const routerEntry = this.addressProvider.getLatest(AP_ROUTER, routerRange);
492
497
  if (!routerEntry) {
493
- throw new Error(
494
- `router not found for facade v ${facadeV} at ${facadeAddr}`
495
- );
498
+ throw new Error(`router not found in version range ${routerRange}`);
496
499
  }
497
500
  const [routerAddr, routerV] = routerEntry;
498
501
  if (!this.contracts.has(routerAddr)) {
@@ -67,9 +67,7 @@ const wrappedAaveV2Tokens = {
67
67
  underlying: "aWETH"
68
68
  }
69
69
  };
70
- const isAaveV2LPToken = (t) => typeof t === "string" && !!aaveV2Tokens[t];
71
70
  export {
72
71
  aaveV2Tokens,
73
- isAaveV2LPToken,
74
72
  wrappedAaveV2Tokens
75
73
  };
@@ -205,14 +205,10 @@ const auraTokens = {
205
205
  ...auraLpTokens,
206
206
  ...auraStakedTokens
207
207
  };
208
- const isAuraToken = (t) => typeof t === "string" && !!auraTokens[t];
209
- const isAuraLPToken = (t) => typeof t === "string" && !!auraLpTokens[t];
210
208
  const isAuraStakedToken = (t) => typeof t === "string" && !!auraStakedTokens[t];
211
209
  export {
212
210
  auraLpTokens,
213
211
  auraStakedTokens,
214
212
  auraTokens,
215
- isAuraLPToken,
216
- isAuraStakedToken,
217
- isAuraToken
213
+ isAuraStakedToken
218
214
  };
@@ -49,8 +49,6 @@ const compoundV2Tokens = {
49
49
  underlying: "USDC"
50
50
  }
51
51
  };
52
- const isCompoundV2LPToken = (t) => typeof t === "string" && !!compoundV2Tokens[t];
53
52
  export {
54
- compoundV2Tokens,
55
- isCompoundV2LPToken
53
+ compoundV2Tokens
56
54
  };
@@ -419,23 +419,11 @@ const convexTokens = {
419
419
  const isConvexToken = (t) => typeof t === "string" && !!convexTokens[t];
420
420
  const isConvexLPToken = (t) => typeof t === "string" && !!convexLpTokens[t];
421
421
  const isConvexStakedPhantomToken = (t) => typeof t === "string" && !!convexStakedPhantomTokens[t];
422
- const isConvexL2StakedToken = (t) => typeof t === "string" && !!convexL2StakedTokens[t];
423
- const convexPoolByPid = Object.values(convexLpTokens).reduce((acc, value) => {
424
- acc[value.pid] = value.pool;
425
- return acc;
426
- }, {});
427
- const convexLpTokenByPid = Object.entries(convexLpTokens).reduce((acc, [token, data]) => {
428
- acc[data.pid] = token;
429
- return acc;
430
- }, {});
431
422
  export {
432
423
  convexL2StakedTokens,
433
- convexLpTokenByPid,
434
424
  convexLpTokens,
435
- convexPoolByPid,
436
425
  convexStakedPhantomTokens,
437
426
  convexTokens,
438
- isConvexL2StakedToken,
439
427
  isConvexLPToken,
440
428
  isConvexStakedPhantomToken,
441
429
  isConvexToken