@suilend/sdk 15.0.0 → 16.0.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/_generated/_dependencies/pyth-2/price-identifier/structs.d.ts +5 -1
- package/_generated/_dependencies/std/ascii/structs.d.ts +8 -2
- package/_generated/_dependencies/std/option/structs.d.ts +6 -1
- package/_generated/_dependencies/std/type-name/structs.d.ts +7 -1
- package/_generated/_dependencies/sui/bag/structs.d.ts +8 -1
- package/_generated/_dependencies/sui/balance/structs.d.ts +6 -2
- package/_generated/_dependencies/sui/object/structs.d.ts +8 -2
- package/_generated/_dependencies/sui/object-table/structs.d.ts +8 -1
- package/_generated/_envs/mainnet.js +39 -3
- package/_generated/suilend/cell/structs.d.ts +8 -1
- package/_generated/suilend/decimal/structs.d.ts +3 -1
- package/_generated/suilend/lending-market/functions.d.ts +185 -64
- package/_generated/suilend/lending-market/functions.js +227 -65
- package/_generated/suilend/lending-market/structs.d.ts +764 -25
- package/_generated/suilend/lending-market/structs.js +491 -3
- package/_generated/suilend/liquidity-mining/structs.d.ts +169 -5
- package/_generated/suilend/obligation/structs.d.ts +338 -7
- package/_generated/suilend/rate-limiter/functions.d.ts +6 -0
- package/_generated/suilend/rate-limiter/functions.js +12 -0
- package/_generated/suilend/rate-limiter/structs.d.ts +17 -2
- package/_generated/suilend/reserve/structs.d.ts +664 -17
- package/_generated/suilend/reserve/structs.js +623 -4
- package/_generated/suilend/reserve-config/functions.d.ts +64 -9
- package/_generated/suilend/reserve-config/functions.js +88 -11
- package/_generated/suilend/reserve-config/structs.d.ts +45 -3
- package/package.json +1 -1
|
@@ -247,6 +247,9 @@ export interface BorrowArgs {
|
|
|
247
247
|
* This function will panic if:
|
|
248
248
|
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
249
249
|
* * The borrow amount is zero (ETooSmall).
|
|
250
|
+
* * The market is paused (EMarketPaused).
|
|
251
|
+
* * The reserve is paused (EReservePaused).
|
|
252
|
+
* * Borrow is held by `hold_operation_until` (EOperationHeld).
|
|
250
253
|
* * The `coin_type` of the reserve does not match the type of the asset being borrowed (EWrongType).
|
|
251
254
|
* * The reserve's price is stale (`EPriceStale` from the `reserve` module).
|
|
252
255
|
* * The borrow would exceed the reserve's borrow limit (`EBorrowLimitExceeded` from the `reserve` module).
|
|
@@ -306,6 +309,9 @@ export interface BorrowRequestArgs {
|
|
|
306
309
|
* This function will panic if:
|
|
307
310
|
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
308
311
|
* * The borrow amount is zero (ETooSmall).
|
|
312
|
+
* * The market is paused (EMarketPaused).
|
|
313
|
+
* * The reserve is paused (EReservePaused).
|
|
314
|
+
* * Borrow is held by `hold_operation_until` (EOperationHeld).
|
|
309
315
|
* * The `coin_type` of the reserve does not match the type of the asset being borrowed (EWrongType).
|
|
310
316
|
* * The reserve's price is stale (`EPriceStale` from the `reserve` module).
|
|
311
317
|
* * The borrow would exceed the reserve's borrow limit (`EBorrowLimitExceeded` from the `reserve` module).
|
|
@@ -381,6 +387,10 @@ export interface WithdrawCtokensArgs {
|
|
|
381
387
|
* This function will panic if:
|
|
382
388
|
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
383
389
|
* * The withdraw amount is zero (ETooSmall).
|
|
390
|
+
* * The market is paused (EMarketPaused).
|
|
391
|
+
* * The reserve is paused (EReservePaused).
|
|
392
|
+
* * Withdraw is held by `hold_operation_until` and the obligation is not exempted by
|
|
393
|
+
* `set_withdraw_hold_exempt` (EOperationHeld).
|
|
384
394
|
* * The `coin_type` of the reserve does not match the type of the cTokens being withdrawn (EWrongType).
|
|
385
395
|
* * The obligation has stale oracle prices.
|
|
386
396
|
* * The withdrawal would leave the obligation in an unhealthy state.
|
|
@@ -423,6 +433,9 @@ export interface LiquidateArgs {
|
|
|
423
433
|
* This function will panic if:
|
|
424
434
|
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
425
435
|
* * The repay amount is zero (ETooSmall).
|
|
436
|
+
* * The market is paused (EMarketPaused).
|
|
437
|
+
* * The repay or withdraw reserve is paused (EReservePaused).
|
|
438
|
+
* * Liquidate is held by `hold_operation_until` (EOperationHeld).
|
|
426
439
|
* * The obligation is not unhealthy.
|
|
427
440
|
* * The obligation has stale oracle prices.
|
|
428
441
|
* * The `coin_type` of the repay reserve does not match the type of the repay coin.
|
|
@@ -594,13 +607,6 @@ export interface InitStakerArgs {
|
|
|
594
607
|
* to participate in staking and earn rewards. It can only be called by the owner of the
|
|
595
608
|
* lending market.
|
|
596
609
|
*
|
|
597
|
-
* # Arguments
|
|
598
|
-
*
|
|
599
|
-
* * `lending_market` - A mutable reference to the `LendingMarket`.
|
|
600
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
601
|
-
* * `sui_reserve_array_index` - The index of the SUI reserve to initialize the staker for.
|
|
602
|
-
* * `treasury_cap` - The `TreasuryCap` for the staker.
|
|
603
|
-
*
|
|
604
610
|
* # Panics
|
|
605
611
|
*
|
|
606
612
|
* This function will panic if:
|
|
@@ -639,6 +645,16 @@ export interface RebalanceStakerArgs {
|
|
|
639
645
|
export declare function rebalanceStaker(tx: Transaction, typeArg: string, args: RebalanceStakerArgs, options?: {
|
|
640
646
|
env?: EnvConfig;
|
|
641
647
|
}): TransactionResult;
|
|
648
|
+
export interface SetStakerValidatorArgs {
|
|
649
|
+
lendingMarket: TransactionObjectInput;
|
|
650
|
+
lendingMarketOwnerCap: TransactionObjectInput;
|
|
651
|
+
suiReserveArrayIndex: bigint | TransactionArgument;
|
|
652
|
+
validator: string | TransactionArgument;
|
|
653
|
+
systemState: TransactionObjectInput;
|
|
654
|
+
}
|
|
655
|
+
export declare function setStakerValidator(tx: Transaction, typeArg: string, args: SetStakerValidatorArgs, options?: {
|
|
656
|
+
env?: EnvConfig;
|
|
657
|
+
}): TransactionResult;
|
|
642
658
|
export interface UnstakeSuiFromStakerArgs {
|
|
643
659
|
lendingMarket: TransactionObjectInput;
|
|
644
660
|
suiReserveArrayIndex: bigint | TransactionArgument;
|
|
@@ -681,6 +697,9 @@ export interface MaxBorrowAmountArgs {
|
|
|
681
697
|
export declare function maxBorrowAmount(tx: Transaction, typeArg: string, args: MaxBorrowAmountArgs, options?: {
|
|
682
698
|
env?: EnvConfig;
|
|
683
699
|
}): TransactionResult;
|
|
700
|
+
export declare function chargesRateLimiter(tx: Transaction, typeArg: string, reserve: TransactionObjectInput, options?: {
|
|
701
|
+
env?: EnvConfig;
|
|
702
|
+
}): TransactionResult;
|
|
684
703
|
export interface MaxWithdrawAmountArgs {
|
|
685
704
|
rateLimiter: TransactionObjectInput;
|
|
686
705
|
obligation: TransactionObjectInput;
|
|
@@ -810,14 +829,30 @@ export interface UpdateReserveConfigArgs {
|
|
|
810
829
|
* Updates the configuration of a reserve.
|
|
811
830
|
*
|
|
812
831
|
* This function allows the owner of the lending market to update the configuration of a specific reserve.
|
|
813
|
-
* It can only be called by the owner of the lending market.
|
|
832
|
+
* It can only be called by the owner of the lending market. Un-retiring a reserve clears its
|
|
833
|
+
* rate-limiter exemption and emits `ReserveRateLimiterExemptEvent`; retiring it again leaves it charged.
|
|
814
834
|
*
|
|
815
|
-
* #
|
|
835
|
+
* # Panics
|
|
816
836
|
*
|
|
817
|
-
*
|
|
818
|
-
* * `lending_market`
|
|
819
|
-
* * `reserve_array_index`
|
|
820
|
-
* * `
|
|
837
|
+
* This function will panic if:
|
|
838
|
+
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
839
|
+
* * `reserve_array_index` is out of bounds.
|
|
840
|
+
* * The `coin_type` of the reserve does not match the type `T` (EWrongType).
|
|
841
|
+
*/
|
|
842
|
+
export declare function updateReserveConfig(tx: Transaction, typeArgs: [string, string], args: UpdateReserveConfigArgs, options?: {
|
|
843
|
+
env?: EnvConfig;
|
|
844
|
+
}): TransactionResult;
|
|
845
|
+
export interface SetReserveRateLimiterExemptArgs {
|
|
846
|
+
lendingMarketOwnerCap: TransactionObjectInput;
|
|
847
|
+
lendingMarket: TransactionObjectInput;
|
|
848
|
+
reserveArrayIndex: bigint | TransactionArgument;
|
|
849
|
+
exempt: boolean | TransactionArgument;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Exempts a retired reserve's redeems from the market's rate limiter, or charges them
|
|
853
|
+
* again. An exempt reserve's max withdraw is not capped by the remaining outflow. A
|
|
854
|
+
* config update that gives the reserve any open or close LTV, deposit limit or borrow
|
|
855
|
+
* limit clears the exemption, so it never outlives the reserve's retirement.
|
|
821
856
|
*
|
|
822
857
|
* # Panics
|
|
823
858
|
*
|
|
@@ -825,8 +860,9 @@ export interface UpdateReserveConfigArgs {
|
|
|
825
860
|
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
826
861
|
* * `reserve_array_index` is out of bounds.
|
|
827
862
|
* * The `coin_type` of the reserve does not match the type `T` (EWrongType).
|
|
863
|
+
* * `exempt` is true and the reserve is not retired (EReserveNotRetired).
|
|
828
864
|
*/
|
|
829
|
-
export declare function
|
|
865
|
+
export declare function setReserveRateLimiterExempt(tx: Transaction, typeArgs: [string, string], args: SetReserveRateLimiterExemptArgs, options?: {
|
|
830
866
|
env?: EnvConfig;
|
|
831
867
|
}): TransactionResult;
|
|
832
868
|
export interface SetReservePriceGuardArgs {
|
|
@@ -900,17 +936,6 @@ export interface AddPoolRewardArgs {
|
|
|
900
936
|
* This function allows the owner of the lending market to incentivize users by adding rewards
|
|
901
937
|
* to a specific reserve. The rewards are distributed over a specified time period.
|
|
902
938
|
*
|
|
903
|
-
* # Arguments
|
|
904
|
-
*
|
|
905
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
906
|
-
* * `lending_market` - A mutable reference to the `LendingMarket`.
|
|
907
|
-
* * `reserve_array_index` - The index of the reserve to add the reward pool to.
|
|
908
|
-
* * `is_deposit_reward` - A boolean indicating whether the reward is for deposits (`true`) or borrows (`false`).
|
|
909
|
-
* * `rewards` - The `Coin` containing the total amount of rewards to be distributed.
|
|
910
|
-
* * `start_time_ms` - The timestamp in milliseconds when the reward distribution starts.
|
|
911
|
-
* * `end_time_ms` - The timestamp in milliseconds when the reward distribution ends.
|
|
912
|
-
* * `clock` - A reference to the `Clock`.
|
|
913
|
-
*
|
|
914
939
|
* # Panics
|
|
915
940
|
*
|
|
916
941
|
* This function will panic if:
|
|
@@ -936,15 +961,6 @@ export interface CancelPoolRewardArgs {
|
|
|
936
961
|
* that is currently active. When a reward pool is cancelled, any unallocated rewards are
|
|
937
962
|
* returned to the owner.
|
|
938
963
|
*
|
|
939
|
-
* # Arguments
|
|
940
|
-
*
|
|
941
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
942
|
-
* * `lending_market` - A mutable reference to the `LendingMarket`.
|
|
943
|
-
* * `reserve_array_index` - The index of the reserve to cancel the reward pool from.
|
|
944
|
-
* * `is_deposit_reward` - A boolean indicating whether the reward is for deposits (`true`) or borrows (`false`).
|
|
945
|
-
* * `reward_index` - The index of the reward pool to cancel.
|
|
946
|
-
* * `clock` - A reference to the `Clock`.
|
|
947
|
-
*
|
|
948
964
|
* # Returns
|
|
949
965
|
*
|
|
950
966
|
* * `Coin<RewardType>` - A `Coin` containing the unallocated rewards from the cancelled pool.
|
|
@@ -975,15 +991,6 @@ export interface ClosePoolRewardArgs {
|
|
|
975
991
|
* due to rounding or other factors are returned to the owner. This function can only be called
|
|
976
992
|
* after the pool's `end_time_ms` has passed.
|
|
977
993
|
*
|
|
978
|
-
* # Arguments
|
|
979
|
-
*
|
|
980
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
981
|
-
* * `lending_market` - A mutable reference to the `LendingMarket`.
|
|
982
|
-
* * `reserve_array_index` - The index of the reserve to close the reward pool from.
|
|
983
|
-
* * `is_deposit_reward` - A boolean indicating whether the reward is for deposits (`true`) or borrows (`false`).
|
|
984
|
-
* * `reward_index` - The index of the reward pool to close.
|
|
985
|
-
* * `clock` - A reference to the `Clock`.
|
|
986
|
-
*
|
|
987
994
|
* # Returns
|
|
988
995
|
*
|
|
989
996
|
* * `Coin<RewardType>` - A `Coin` containing the unallocated rewards from the closed pool.
|
|
@@ -1026,13 +1033,6 @@ export interface UpdateRateLimiterConfigArgs {
|
|
|
1026
1033
|
* This is an admin-only function that allows the lending market owner to update the rate
|
|
1027
1034
|
* limiter configuration. The new configuration will replace the existing one.
|
|
1028
1035
|
*
|
|
1029
|
-
* # Arguments
|
|
1030
|
-
*
|
|
1031
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
1032
|
-
* * `lending_market` - A mutable reference to the `LendingMarket`.
|
|
1033
|
-
* * `clock` - A reference to the `Clock` to get the current timestamp.
|
|
1034
|
-
* * `config` - The new `RateLimiterConfig` to apply.
|
|
1035
|
-
*
|
|
1036
1036
|
* # Panics
|
|
1037
1037
|
*
|
|
1038
1038
|
* This function will panic if:
|
|
@@ -1054,13 +1054,6 @@ export interface SetFeeReceiversArgs {
|
|
|
1054
1054
|
* and their respective weights for distributing protocol fees. The fees are distributed
|
|
1055
1055
|
* proportionally based on these weights.
|
|
1056
1056
|
*
|
|
1057
|
-
* # Arguments
|
|
1058
|
-
*
|
|
1059
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
1060
|
-
* * `lending_market` - A mutable reference to the `LendingMarket`.
|
|
1061
|
-
* * `receivers` - A vector of addresses that will receive the fees.
|
|
1062
|
-
* * `weights` - A vector of weights corresponding to each receiver.
|
|
1063
|
-
*
|
|
1064
1057
|
* # Panics
|
|
1065
1058
|
*
|
|
1066
1059
|
* This function will panic if:
|
|
@@ -1114,12 +1107,6 @@ export interface NewObligationOwnerCapArgs {
|
|
|
1114
1107
|
* `ObligationOwnerCap` for an obligation that already exists. This can be useful for
|
|
1115
1108
|
* recovery purposes or administrative actions where a new capability object is needed.
|
|
1116
1109
|
*
|
|
1117
|
-
* # Arguments
|
|
1118
|
-
*
|
|
1119
|
-
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
|
|
1120
|
-
* * `lending_market` - A reference to the `LendingMarket`.
|
|
1121
|
-
* * `obligation_id` - The ID of the obligation to create a new owner cap for.
|
|
1122
|
-
*
|
|
1123
1110
|
* # Returns
|
|
1124
1111
|
*
|
|
1125
1112
|
* * `ObligationOwnerCap<P>` - The newly created ownership capability for the specified obligation.
|
|
@@ -1134,7 +1121,7 @@ export declare function newObligationOwnerCap(tx: Transaction, typeArg: string,
|
|
|
1134
1121
|
env?: EnvConfig;
|
|
1135
1122
|
}): TransactionResult;
|
|
1136
1123
|
export interface NewPauseCapArgs {
|
|
1137
|
-
|
|
1124
|
+
ownerCap: TransactionObjectInput;
|
|
1138
1125
|
lendingMarket: TransactionObjectInput;
|
|
1139
1126
|
recipient: string | TransactionArgument;
|
|
1140
1127
|
}
|
|
@@ -1146,6 +1133,7 @@ export interface NewPauseCapArgs {
|
|
|
1146
1133
|
*
|
|
1147
1134
|
* This function will panic if:
|
|
1148
1135
|
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
1136
|
+
* * `owner_cap` was not minted for this `lending_market` (EWrongLendingMarket).
|
|
1149
1137
|
*/
|
|
1150
1138
|
export declare function newPauseCap(tx: Transaction, typeArg: string, args: NewPauseCapArgs, options?: {
|
|
1151
1139
|
env?: EnvConfig;
|
|
@@ -1190,6 +1178,139 @@ export interface SetReservePausedArgs {
|
|
|
1190
1178
|
export declare function setReservePaused(tx: Transaction, typeArg: string, args: SetReservePausedArgs, options?: {
|
|
1191
1179
|
env?: EnvConfig;
|
|
1192
1180
|
}): TransactionResult;
|
|
1181
|
+
export interface LowerProtocolLiquidationFeeArgs {
|
|
1182
|
+
cap: TransactionObjectInput;
|
|
1183
|
+
lendingMarket: TransactionObjectInput;
|
|
1184
|
+
reserveArrayIndex: bigint | TransactionArgument;
|
|
1185
|
+
protocolLiquidationFeeBps: bigint | TransactionArgument;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Lowers one reserve's protocol liquidation fee, so liquidators keep more of a capped
|
|
1189
|
+
* bonus and stay paid deeper into a drawdown. Gated on the current-generation
|
|
1190
|
+
* `EmergencyPauseCap` rather than the owner cap so it is reachable within the hour;
|
|
1191
|
+
* it can only lower the fee, so raising it back stays with the owner cap. Only the fee
|
|
1192
|
+
* field changes: the rest of the config is not rebuilt or re-validated against live
|
|
1193
|
+
* oracle state, so the cut still works when confidence has widened. A cut emits
|
|
1194
|
+
* `ProtocolLiquidationFeeLoweredEvent`; passing the current fee changes nothing and emits
|
|
1195
|
+
* nothing.
|
|
1196
|
+
*
|
|
1197
|
+
* # Panics
|
|
1198
|
+
*
|
|
1199
|
+
* This function will panic if:
|
|
1200
|
+
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
1201
|
+
* * `cap` was not minted for this `lending_market` (EWrongLendingMarket).
|
|
1202
|
+
* * `cap`'s generation has been superseded by a later `new_pause_cap` call (EStalePauseCap).
|
|
1203
|
+
* * `reserve_array_index` is out of bounds.
|
|
1204
|
+
* * The `coin_type` of the reserve does not match the type `T` (EWrongType).
|
|
1205
|
+
* * `protocol_liquidation_fee_bps` is above the reserve's current fee
|
|
1206
|
+
* (EProtocolLiquidationFeeNotLowered).
|
|
1207
|
+
*/
|
|
1208
|
+
export declare function lowerProtocolLiquidationFee(tx: Transaction, typeArgs: [string, string], args: LowerProtocolLiquidationFeeArgs, options?: {
|
|
1209
|
+
env?: EnvConfig;
|
|
1210
|
+
}): TransactionResult;
|
|
1211
|
+
export interface HoldOperationUntilArgs {
|
|
1212
|
+
cap: TransactionObjectInput;
|
|
1213
|
+
lendingMarket: TransactionObjectInput;
|
|
1214
|
+
operation: number | TransactionArgument;
|
|
1215
|
+
untilMs: bigint | TransactionArgument;
|
|
1216
|
+
clock: TransactionObjectInput;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Holds one operation across the whole market until `until_ms`, independently of the
|
|
1220
|
+
* market and reserve pauses. The hold lapses by itself once the clock reaches `until_ms`;
|
|
1221
|
+
* a later call replaces it, and `until_ms = 0` lifts it at once. Every call starts a new
|
|
1222
|
+
* hold generation for the operation, which ends withdraw exemptions granted under an
|
|
1223
|
+
* earlier call. Holding borrow and liquidate while the market itself is unpaused reopens
|
|
1224
|
+
* repay, deposit, withdraw and redeem first, so positions can be topped up before they can
|
|
1225
|
+
* be liquidated.
|
|
1226
|
+
*
|
|
1227
|
+
* # Panics
|
|
1228
|
+
*
|
|
1229
|
+
* This function will panic if:
|
|
1230
|
+
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
1231
|
+
* * `cap` was not minted for this `lending_market` (EWrongLendingMarket).
|
|
1232
|
+
* * `cap`'s generation has been superseded by a later `new_pause_cap` call (EStalePauseCap).
|
|
1233
|
+
* * `operation` is not 0 (borrow), 1 (liquidate) or 2 (withdraw) (EInvalidOperation).
|
|
1234
|
+
* * `until_ms` is more than `MAX_OPERATION_HOLD_MS` past the clock (EHoldTooLong).
|
|
1235
|
+
* * `until_ms` is not 0 and is at or before the clock (EHoldInPast).
|
|
1236
|
+
*/
|
|
1237
|
+
export declare function holdOperationUntil(tx: Transaction, typeArg: string, args: HoldOperationUntilArgs, options?: {
|
|
1238
|
+
env?: EnvConfig;
|
|
1239
|
+
}): TransactionResult;
|
|
1240
|
+
export interface SetWithdrawHoldExemptArgs {
|
|
1241
|
+
cap: TransactionObjectInput;
|
|
1242
|
+
lendingMarket: TransactionObjectInput;
|
|
1243
|
+
obligationId: string | TransactionArgument;
|
|
1244
|
+
exempt: boolean | TransactionArgument;
|
|
1245
|
+
clock: TransactionObjectInput;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Exempts one obligation from the current withdraw hold, or removes its exemption. An
|
|
1249
|
+
* exempt obligation can still `withdraw_ctokens` while that hold lasts. The
|
|
1250
|
+
* exemption records the hold's generation and lapses with it: once the hold ends, or any
|
|
1251
|
+
* later `hold_operation_until` call replaces or lifts it, the obligation is held again
|
|
1252
|
+
* until it is exempted anew, even under a new hold with the same `until_ms`. Setting the
|
|
1253
|
+
* state the obligation already has emits nothing, and removing a lapsed exemption clears
|
|
1254
|
+
* it without an event.
|
|
1255
|
+
*
|
|
1256
|
+
* # Panics
|
|
1257
|
+
*
|
|
1258
|
+
* This function will panic if:
|
|
1259
|
+
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
|
|
1260
|
+
* * `cap` was not minted for this `lending_market` (EWrongLendingMarket).
|
|
1261
|
+
* * `cap`'s generation has been superseded by a later `new_pause_cap` call (EStalePauseCap).
|
|
1262
|
+
* * The `obligation_id` is not found in the lending market's obligations (EInvalidObligationId).
|
|
1263
|
+
* * `exempt` is true and withdraw is not held (EWithdrawNotHeld).
|
|
1264
|
+
*/
|
|
1265
|
+
export declare function setWithdrawHoldExempt(tx: Transaction, typeArg: string, args: SetWithdrawHoldExemptArgs, options?: {
|
|
1266
|
+
env?: EnvConfig;
|
|
1267
|
+
}): TransactionResult;
|
|
1268
|
+
export interface AssertWithdrawNotHeldArgs {
|
|
1269
|
+
lendingMarket: TransactionObjectInput;
|
|
1270
|
+
obligationId: string | TransactionArgument;
|
|
1271
|
+
clock: TransactionObjectInput;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Aborts with `EOperationHeld` while withdraw is held, unless the obligation is exempt.
|
|
1275
|
+
* Debt-free obligations are held too: otherwise a borrower could repay in full, withdraw
|
|
1276
|
+
* and borrow again in one PTB at the same pushed price.
|
|
1277
|
+
*/
|
|
1278
|
+
export declare function assertWithdrawNotHeld(tx: Transaction, typeArg: string, args: AssertWithdrawNotHeldArgs, options?: {
|
|
1279
|
+
env?: EnvConfig;
|
|
1280
|
+
}): TransactionResult;
|
|
1281
|
+
export interface IsWithdrawHoldExemptArgs {
|
|
1282
|
+
lendingMarket: TransactionObjectInput;
|
|
1283
|
+
obligationId: string | TransactionArgument;
|
|
1284
|
+
clock: TransactionObjectInput;
|
|
1285
|
+
}
|
|
1286
|
+
/** True if `obligation_id` was exempted under the withdraw hold that is active now. */
|
|
1287
|
+
export declare function isWithdrawHoldExempt(tx: Transaction, typeArg: string, args: IsWithdrawHoldExemptArgs, options?: {
|
|
1288
|
+
env?: EnvConfig;
|
|
1289
|
+
}): TransactionResult;
|
|
1290
|
+
export declare function withdrawHoldGeneration(tx: Transaction, typeArg: string, lendingMarket: TransactionObjectInput, options?: {
|
|
1291
|
+
env?: EnvConfig;
|
|
1292
|
+
}): TransactionResult;
|
|
1293
|
+
/** The operation code that holds borrow. */
|
|
1294
|
+
export declare function operationBorrow(tx: Transaction, options?: {
|
|
1295
|
+
env?: EnvConfig;
|
|
1296
|
+
}): TransactionResult;
|
|
1297
|
+
/** The operation code that holds liquidate. */
|
|
1298
|
+
export declare function operationLiquidate(tx: Transaction, options?: {
|
|
1299
|
+
env?: EnvConfig;
|
|
1300
|
+
}): TransactionResult;
|
|
1301
|
+
/** The operation code that holds withdrawing collateral from obligations. */
|
|
1302
|
+
export declare function operationWithdraw(tx: Transaction, options?: {
|
|
1303
|
+
env?: EnvConfig;
|
|
1304
|
+
}): TransactionResult;
|
|
1305
|
+
export interface IsOperationHeldArgs {
|
|
1306
|
+
lendingMarket: TransactionObjectInput;
|
|
1307
|
+
operation: number | TransactionArgument;
|
|
1308
|
+
clock: TransactionObjectInput;
|
|
1309
|
+
}
|
|
1310
|
+
/** True while a hold on `operation` has not yet lapsed. Absent the dynamic field, it is not. */
|
|
1311
|
+
export declare function isOperationHeld(tx: Transaction, typeArg: string, args: IsOperationHeldArgs, options?: {
|
|
1312
|
+
env?: EnvConfig;
|
|
1313
|
+
}): TransactionResult;
|
|
1193
1314
|
/**
|
|
1194
1315
|
* True if the market has been paused. Absent the dynamic field, the market is
|
|
1195
1316
|
* unpaused. Pure: no aborts, no side effects. Public so a UI or bot can check
|