@gearbox-protocol/sdk 1.5.16 → 1.5.19

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.
@@ -29,6 +29,8 @@ export declare class CreditAccountData {
29
29
  calcBorrowAmountPlusInterestRate(currentCumulativeIndex: BigNumber): BigNumber;
30
30
  updateHealthFactor(creditManager: CreditManagerData, currentCumulativeIndex: BigNumber, priceOracle: PriceOracleData): void;
31
31
  get id(): string;
32
+ hash(): string;
33
+ static hash(creditManager: string, borrower: string): string;
32
34
  }
33
35
  export declare function sortBalances(balances: Record<string, BigNumber>, prices: Record<string, BigNumber>, tokens: Record<string, TokenData>): Array<[string, BigNumber]>;
34
36
  export declare function tokensAbcComparator(t1?: TokenData, t2?: TokenData): 1 | -1;
@@ -91,6 +91,12 @@ var CreditAccountData = /** @class */ (function () {
91
91
  enumerable: false,
92
92
  configurable: true
93
93
  });
94
+ CreditAccountData.prototype.hash = function () {
95
+ return CreditAccountData.hash(this.creditManager, this.borrower);
96
+ };
97
+ CreditAccountData.hash = function (creditManager, borrower) {
98
+ return "".concat(creditManager.toLowerCase(), ":").concat(borrower.toLowerCase());
99
+ };
94
100
  return CreditAccountData;
95
101
  }());
96
102
  exports.CreditAccountData = CreditAccountData;
@@ -161,7 +161,7 @@ var PathFinder = /** @class */ (function () {
161
161
  return __generator(this, function (_a) {
162
162
  switch (_a.label) {
163
163
  case 0:
164
- loopsPerTx = GAS_PER_BLOCK / MAX_GAS_PER_ROUTE;
164
+ loopsPerTx = Math.floor(GAS_PER_BLOCK / MAX_GAS_PER_ROUTE);
165
165
  pathOptions = pathOptions_1.PathOptionFactory.generatePathOptions(creditAccount.allBalances, loopsPerTx);
166
166
  requests = pathOptions.map(function (po) {
167
167
  return _this.pathFinder.callStatic.findBestClosePath(creditAccount.addr, _this._connectors, slippage, po, loopsPerTx, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "1.5.16",
3
+ "version": "1.5.19",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",