@gearbox-protocol/sdk 1.20.17 → 1.20.18

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.
@@ -4,6 +4,7 @@ export declare const GOERLI_NETWORK = 5;
4
4
  export declare const OPTIMISM_NETWORK = 10;
5
5
  export declare const POLYGON_NETWORK = 137;
6
6
  export declare const LOCAL_NETWORK = 1337;
7
+ export declare const TENDERLY_NETWORK = 123456;
7
8
  export declare const HARDHAT_NETWORK = 31337;
8
9
  export declare const ARBITRUM_NETWORK = 42161;
9
10
  export declare const CHAINS: {
@@ -11,6 +12,7 @@ export declare const CHAINS: {
11
12
  readonly Goerli: 5;
12
13
  readonly Local: 1337;
13
14
  readonly Hardhat: 31337;
15
+ readonly Tenderly: 123456;
14
16
  readonly Optimism: 10;
15
17
  readonly Polygon: 137;
16
18
  readonly Arbiturum: 42161;
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  var _a;
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.detectNetwork = exports.isSupportedNetwork = exports.getNetworkType = exports.CHAINS = exports.ARBITRUM_NETWORK = exports.HARDHAT_NETWORK = exports.LOCAL_NETWORK = exports.POLYGON_NETWORK = exports.OPTIMISM_NETWORK = exports.GOERLI_NETWORK = exports.MAINNET_NETWORK = void 0;
40
+ exports.detectNetwork = exports.isSupportedNetwork = exports.getNetworkType = exports.CHAINS = exports.ARBITRUM_NETWORK = exports.HARDHAT_NETWORK = exports.TENDERLY_NETWORK = exports.LOCAL_NETWORK = exports.POLYGON_NETWORK = exports.OPTIMISM_NETWORK = exports.GOERLI_NETWORK = exports.MAINNET_NETWORK = void 0;
41
41
  var token_1 = require("../tokens/token");
42
42
  var types_1 = require("../types");
43
43
  var constants_1 = require("./constants");
@@ -46,6 +46,7 @@ exports.GOERLI_NETWORK = 5;
46
46
  exports.OPTIMISM_NETWORK = 10;
47
47
  exports.POLYGON_NETWORK = 137;
48
48
  exports.LOCAL_NETWORK = 1337;
49
+ exports.TENDERLY_NETWORK = 123456;
49
50
  exports.HARDHAT_NETWORK = 31337;
50
51
  exports.ARBITRUM_NETWORK = 42161;
51
52
  exports.CHAINS = {
@@ -53,6 +54,7 @@ exports.CHAINS = {
53
54
  Goerli: exports.GOERLI_NETWORK,
54
55
  Local: exports.LOCAL_NETWORK,
55
56
  Hardhat: exports.HARDHAT_NETWORK,
57
+ Tenderly: exports.TENDERLY_NETWORK,
56
58
  Optimism: exports.OPTIMISM_NETWORK,
57
59
  Polygon: exports.POLYGON_NETWORK,
58
60
  Arbiturum: exports.ARBITRUM_NETWORK,
@@ -61,6 +63,7 @@ var SUPPORTED_CHAINS = (_a = {},
61
63
  _a[exports.CHAINS.Mainnet] = "Mainnet",
62
64
  _a[exports.CHAINS.Goerli] = "Goerli",
63
65
  _a[exports.CHAINS.Local] = "Mainnet",
66
+ _a[exports.CHAINS.Tenderly] = "Mainnet",
64
67
  _a);
65
68
  var getNetworkType = function (chainId, localAs) {
66
69
  if (localAs === void 0) { localAs = "Mainnet"; }
@@ -137,7 +137,11 @@ function amountAbcComparator(t1, t2) {
137
137
  exports.amountAbcComparator = amountAbcComparator;
138
138
  function calcOverallAPY(_a) {
139
139
  var caAssets = _a.caAssets, lpAPY = _a.lpAPY, prices = _a.prices, totalValue = _a.totalValue, debt = _a.debt, borrowRate = _a.borrowRate, underlyingToken = _a.underlyingToken;
140
- if (!lpAPY || !totalValue || totalValue.lte(0) || !debt)
140
+ if (!lpAPY ||
141
+ !totalValue ||
142
+ totalValue.lte(0) ||
143
+ !debt ||
144
+ totalValue.lte(debt))
141
145
  return undefined;
142
146
  var assetAPYMoney = caAssets.reduce(function (acc, _a) {
143
147
  var tokenAddress = _a.token, amount = _a.balance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "1.20.17",
3
+ "version": "1.20.18",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",