@mento-protocol/mento-sdk 3.2.0-beta.0 → 3.2.0
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/README.md +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -155,6 +155,16 @@ const openTx = await mento.borrow.buildOpenTroveTransaction('USDm', {
|
|
|
155
155
|
// Get trove data
|
|
156
156
|
const trove = await mento.borrow.getTroveData('USDm', troveId)
|
|
157
157
|
|
|
158
|
+
// Get troves currently owned by an address via the Trove NFT
|
|
159
|
+
const troves = await mento.borrow.getUserTroves('USDm', ownerAddress)
|
|
160
|
+
|
|
161
|
+
// Zombie troves are still-open troves whose debt fell below the branch minimum debt,
|
|
162
|
+
// typically after redemption. They can still hold collateral, and may even have 0 debt.
|
|
163
|
+
if (trove.status === 'zombie') {
|
|
164
|
+
// Reactivate by adjusting the zombie trove, or close it to withdraw remaining collateral.
|
|
165
|
+
const closeTx = await mento.borrow.buildCloseTroveTransaction('USDm', trove.troveId)
|
|
166
|
+
}
|
|
167
|
+
|
|
158
168
|
// Get system parameters
|
|
159
169
|
const params = await mento.borrow.getSystemParams('USDm')
|
|
160
170
|
|
|
@@ -166,6 +176,12 @@ const fee = await mento.borrow.predictOpenTroveUpfrontFee(
|
|
|
166
176
|
)
|
|
167
177
|
```
|
|
168
178
|
|
|
179
|
+
Notes:
|
|
180
|
+
|
|
181
|
+
- `getUserTroves()` reflects current Trove NFT ownership. It includes zombie troves still owned by the address, even though zombie troves are removed from `SortedTroves`.
|
|
182
|
+
- `status === 'zombie'` does not mean liquidated. Zombie troves can still exist with collateral remaining on-chain, including the case where `debt === 0`.
|
|
183
|
+
- Use `buildClaimCollateralTransaction()` for collateral surplus after liquidation. For zombie troves with remaining collateral, use `buildCloseTroveTransaction()` to withdraw it, or `buildAdjustZombieTroveTransaction()` to reactivate the trove.
|
|
184
|
+
|
|
169
185
|
## Supported Chains
|
|
170
186
|
|
|
171
187
|
| Chain | Chain ID | Constant |
|