impermax-sdk 2.1.546 → 2.1.547

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.
@@ -296,7 +296,7 @@ class OffchainBorrowable extends offchainPoolToken_1.default {
296
296
  bestAmount = amount;
297
297
  }
298
298
  }
299
- if (!bestVault)
299
+ if (bestVault === null)
300
300
  return null;
301
301
  return {
302
302
  vault: bestVault,
@@ -306,13 +306,15 @@ class OffchainBorrowable extends offchainPoolToken_1.default {
306
306
  async getAvailableToBorrow() {
307
307
  const totalBalance = await this.getTotalBalance();
308
308
  const maxFlashAllocate = await this.getMaxFlashAllocate();
309
- if (maxFlashAllocate)
309
+ console.log("totalBalance, maxFlashAllocate", totalBalance, maxFlashAllocate);
310
+ if (maxFlashAllocate !== null)
310
311
  return totalBalance + maxFlashAllocate.amount;
311
312
  return totalBalance;
312
313
  }
313
314
  async getAvailableToBorrowUSD() {
314
315
  const availableToBorrow = await this.getAvailableToBorrow();
315
316
  const tokenPrice = await this.getTokenPriceFast();
317
+ console.log("availableToBorrow, tokenPrice", availableToBorrow, tokenPrice);
316
318
  return availableToBorrow * tokenPrice;
317
319
  }
318
320
  }
@@ -131,5 +131,5 @@ export default class Offchain {
131
131
  getNetworkTokens(): Promise<NetworkTokenData[]>;
132
132
  getVaultList(): Promise<OffchainVault[]>;
133
133
  private _getVaultsLinkedToBorrowable;
134
- getVaultsLinkedToBorrowable(borrowable: OffchainBorrowable): Promise<OffchainLendingVault[]>;
134
+ getVaultsLinkedToBorrowable(borrowable: OffchainBorrowable): Promise<Array<OffchainLendingVault>>;
135
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.546",
3
+ "version": "2.1.547",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",