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 (
|
|
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
|
-
|
|
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
|
}
|