@curvefi/llamalend-api 2.0.10 → 2.0.12
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.
- package/docs/SUPPORT_LLv2.md +30 -0
- package/lib/constants/abis/ControllerV2.json +523 -508
- package/lib/constants/aliases.js +1 -1
- package/lib/lendMarkets/fetch/fetchFactoryData.js +2 -4
- package/lib/lendMarkets/fetch/fetchLendMarkets.js +1 -1
- package/lib/lendMarkets/interfaces/common/userPosition.d.ts +2 -0
- package/lib/lendMarkets/modules/common/userPosition.d.ts +2 -0
- package/lib/lendMarkets/modules/common/userPosition.js +3 -1
- package/lib/lendMarkets/modules/v2/loanV2.js +1 -1
- package/lib/mintMarkets/MintMarketTemplate.d.ts +1 -0
- package/lib/mintMarkets/MintMarketTemplate.js +1 -0
- package/package.json +1 -1
- package/src/constants/abis/ControllerV2.json +523 -508
- package/src/constants/aliases.ts +1 -1
- package/src/lendMarkets/fetch/fetchFactoryData.ts +2 -4
- package/src/lendMarkets/fetch/fetchLendMarkets.ts +1 -1
- package/src/lendMarkets/interfaces/common/userPosition.ts +2 -2
- package/src/lendMarkets/modules/common/userPosition.ts +5 -3
- package/src/lendMarkets/modules/v2/loanV2.ts +1 -1
- package/src/mintMarkets/MintMarketTemplate.ts +2 -1
package/docs/SUPPORT_LLv2.md
CHANGED
|
@@ -469,6 +469,36 @@ market.loan.estimateGas.repay({ debt, address?, shrink? }) // params: { debt: T
|
|
|
469
469
|
| forceUpdateUserState() | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
470
470
|
| getCurrentLeverageParams() | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
471
471
|
|
|
472
|
+
### `isSoftLiquidation` field in `userState` / `userStateBigInt`
|
|
473
|
+
|
|
474
|
+
The `userState` and `userStateBigInt` methods now include an `isSoftLiquidation` field in their return value.
|
|
475
|
+
|
|
476
|
+
**Updated return types:**
|
|
477
|
+
|
|
478
|
+
```ts
|
|
479
|
+
// userState
|
|
480
|
+
market.userPosition.userState(address?: string): Promise<{
|
|
481
|
+
collateral: string,
|
|
482
|
+
borrowed: string,
|
|
483
|
+
debt: string,
|
|
484
|
+
N: string,
|
|
485
|
+
isSoftLiquidation: boolean,
|
|
486
|
+
}>
|
|
487
|
+
|
|
488
|
+
// userStateBigInt
|
|
489
|
+
market.userPosition.userStateBigInt(address?: string): Promise<{
|
|
490
|
+
_collateral: bigint,
|
|
491
|
+
_borrowed: bigint,
|
|
492
|
+
_debt: bigint,
|
|
493
|
+
_N: bigint,
|
|
494
|
+
isSoftLiquidation: boolean,
|
|
495
|
+
}>
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**Logic:** `isSoftLiquidation` is `true` when the user has an active loan (`debt > 0`) and the AMM has partially converted collateral into the borrowed token (`borrowed > 0`).
|
|
499
|
+
|
|
500
|
+
**Note:** Also applies to mint markets (`MintMarketTemplate`). In mint markets the field is returned by `userState` and is `true` when `stablecoin > 0` (the stablecoin amount reflects converted collateral in the AMM).
|
|
501
|
+
|
|
472
502
|
---
|
|
473
503
|
|
|
474
504
|
## Leverage Module (`market.leverage`)
|