@kamino-finance/klend-sdk 7.4.0-beta.0 → 7.4.0-beta.1
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/dist/@codegen/klend/accounts/LendingMarket.d.ts +3 -51
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +6 -39
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.d.ts +15 -24
- package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.js +21 -24
- package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.js +1 -1
- package/dist/@codegen/klend/accounts/UserState.d.ts +75 -0
- package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/UserState.js +25 -0
- package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
- package/dist/@codegen/klend/errors/custom.d.ts +1 -89
- package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/klend/errors/custom.js +1 -155
- package/dist/@codegen/klend/errors/custom.js.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +1 -0
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.js +2 -0
- package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
- package/dist/@codegen/klend/instructions/index.d.ts +0 -4
- package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/index.js +1 -6
- package/dist/@codegen/klend/instructions/index.js.map +1 -1
- package/dist/@codegen/klend/types/AssetTier.d.ts +45 -0
- package/dist/@codegen/klend/types/AssetTier.d.ts.map +1 -0
- package/dist/@codegen/klend/types/AssetTier.js +132 -0
- package/dist/@codegen/klend/types/AssetTier.js.map +1 -0
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +5 -35
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ObligationLiquidity.js +7 -17
- package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/ObligationOrder.d.ts +4 -4
- package/dist/@codegen/klend/types/ObligationOrder.js +2 -2
- package/dist/@codegen/klend/types/ReserveConfig.d.ts +5 -60
- package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveConfig.js +7 -36
- package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +7 -33
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.js +13 -61
- package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +0 -52
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +1 -97
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/@codegen/klend/types/index.d.ts +8 -8
- package/dist/@codegen/klend/types/index.d.ts.map +1 -1
- package/dist/@codegen/klend/types/index.js +3 -5
- package/dist/@codegen/klend/types/index.js.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +5 -8
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.js +14 -17
- package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
- package/dist/classes/action.d.ts +21 -91
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +141 -119
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/actionTypes.d.ts +310 -0
- package/dist/classes/actionTypes.d.ts.map +1 -0
- package/dist/classes/actionTypes.js +3 -0
- package/dist/classes/actionTypes.js.map +1 -0
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +0 -4
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +5 -11
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +29 -21
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.d.ts +9 -9
- package/dist/classes/obligation.d.ts.map +1 -1
- package/dist/classes/obligation.js +49 -51
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/obligationOrder.d.ts.map +1 -1
- package/dist/classes/obligationOrder.js +6 -3
- package/dist/classes/obligationOrder.js.map +1 -1
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +1 -3
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/shared.d.ts +1 -0
- package/dist/classes/shared.d.ts.map +1 -1
- package/dist/client/commands/borrow.d.ts +1 -1
- package/dist/client/commands/borrow.d.ts.map +1 -1
- package/dist/client/commands/borrow.js +11 -2
- package/dist/client/commands/borrow.js.map +1 -1
- package/dist/client/commands/deposit.d.ts +1 -1
- package/dist/client/commands/deposit.d.ts.map +1 -1
- package/dist/client/commands/deposit.js +11 -2
- package/dist/client/commands/deposit.js.map +1 -1
- package/dist/client/commands/printReserve.d.ts +1 -1
- package/dist/client/commands/printReserve.d.ts.map +1 -1
- package/dist/client/commands/printReserve.js +2 -4
- package/dist/client/commands/printReserve.js.map +1 -1
- package/dist/client/commands/repay.d.ts +1 -1
- package/dist/client/commands/repay.d.ts.map +1 -1
- package/dist/client/commands/repay.js +12 -2
- package/dist/client/commands/repay.js.map +1 -1
- package/dist/client/commands/withdraw.d.ts +1 -1
- package/dist/client/commands/withdraw.d.ts.map +1 -1
- package/dist/client/commands/withdraw.js +11 -2
- package/dist/client/commands/withdraw.js.map +1 -1
- package/dist/idl/klend.json +54 -581
- package/dist/lending_operations/repay_with_collateral_calcs.d.ts +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.js +2 -2
- package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts +4 -4
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js +43 -10
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.d.ts +4 -4
- package/dist/lending_operations/swap_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.js +40 -21
- package/dist/lending_operations/swap_collateral_operations.js.map +1 -1
- package/dist/leverage/operations.d.ts +6 -6
- package/dist/leverage/operations.d.ts.map +1 -1
- package/dist/leverage/operations.js +167 -52
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/types.d.ts +2 -2
- package/dist/leverage/types.d.ts.map +1 -1
- package/dist/manager/client_kamino_manager.js +6 -12
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/obligation_orders/price_based.js +1 -0
- package/dist/obligation_orders/price_based.js.map +1 -1
- package/dist/utils/ObligationType.d.ts +33 -1
- package/dist/utils/ObligationType.d.ts.map +1 -1
- package/dist/utils/ObligationType.js +81 -2
- package/dist/utils/ObligationType.js.map +1 -1
- package/dist/utils/managerTypes.d.ts.map +1 -1
- package/dist/utils/managerTypes.js +1 -3
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/userMetadata.d.ts +2 -2
- package/dist/utils/userMetadata.d.ts.map +1 -1
- package/dist/utils/userMetadata.js +49 -25
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +1 -1
- package/src/@codegen/klend/accounts/LendingMarket.ts +8 -79
- package/src/@codegen/klend/accounts/Obligation.ts +31 -42
- package/src/@codegen/klend/accounts/Reserve.ts +1 -1
- package/src/@codegen/klend/accounts/UserState.ts +75 -0
- package/src/@codegen/klend/errors/custom.ts +0 -172
- package/src/@codegen/klend/instructions/idlMissingTypes.ts +3 -0
- package/src/@codegen/klend/instructions/index.ts +0 -7
- package/src/@codegen/klend/types/AssetTier.ts +119 -0
- package/src/@codegen/klend/types/ObligationLiquidity.ts +9 -39
- package/src/@codegen/klend/types/ObligationOrder.ts +4 -4
- package/src/@codegen/klend/types/ReserveConfig.ts +9 -72
- package/src/@codegen/klend/types/UpdateConfigMode.ts +13 -73
- package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +0 -120
- package/src/@codegen/klend/types/index.ts +14 -21
- package/src/@codegen/klend/zero_padding/ObligationZP.ts +14 -17
- package/src/classes/action.ts +321 -347
- package/src/classes/actionTypes.ts +295 -0
- package/src/classes/manager.ts +0 -5
- package/src/classes/market.ts +42 -32
- package/src/classes/obligation.ts +55 -54
- package/src/classes/obligationOrder.ts +6 -3
- package/src/classes/reserve.ts +1 -3
- package/src/classes/shared.ts +2 -0
- package/src/client/client.ts +17 -18
- package/src/client/commands/borrow.ts +10 -9
- package/src/client/commands/deposit.ts +10 -9
- package/src/client/commands/printReserve.ts +2 -4
- package/src/client/commands/repay.ts +11 -10
- package/src/client/commands/withdraw.ts +15 -9
- package/src/idl/klend.json +54 -581
- package/src/lending_operations/repay_with_collateral_calcs.ts +3 -4
- package/src/lending_operations/repay_with_collateral_operations.ts +40 -38
- package/src/lending_operations/swap_collateral_operations.ts +47 -41
- package/src/leverage/operations.ts +168 -129
- package/src/leverage/types.ts +2 -2
- package/src/manager/client_kamino_manager.ts +6 -12
- package/src/obligation_orders/price_based.ts +1 -0
- package/src/utils/ObligationType.ts +92 -1
- package/src/utils/managerTypes.ts +1 -3
- package/src/utils/userMetadata.ts +64 -30
- package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts +0 -36
- package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/fillBorrowOrder.js +0 -49
- package/dist/@codegen/klend/instructions/fillBorrowOrder.js.map +0 -1
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +0 -33
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/setBorrowOrder.js +0 -66
- package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +0 -1
- package/dist/@codegen/klend/types/BorrowOrder.d.ts +0 -192
- package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +0 -1
- package/dist/@codegen/klend/types/BorrowOrder.js +0 -194
- package/dist/@codegen/klend/types/BorrowOrder.js.map +0 -1
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +0 -39
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +0 -1
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +0 -100
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +0 -1
- package/src/@codegen/klend/instructions/fillBorrowOrder.ts +0 -96
- package/src/@codegen/klend/instructions/setBorrowOrder.ts +0 -81
- package/src/@codegen/klend/types/BorrowOrder.ts +0 -267
- package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +0 -87
|
@@ -9,17 +9,7 @@ export interface ObligationLiquidityFields {
|
|
|
9
9
|
borrowReserve: Address
|
|
10
10
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
11
11
|
cumulativeBorrowRateBsf: types.BigFractionBytesFields
|
|
12
|
-
|
|
13
|
-
* The timestamp at which this debt was taken.
|
|
14
|
-
* More specifically: when the *first* borrow operation from this reserve happened.
|
|
15
|
-
* This means that:
|
|
16
|
-
* - adding debt of the same reserve does *not* change this timestamp,
|
|
17
|
-
* - repaying the entire debt of this reserve *does* reset this timestamp.
|
|
18
|
-
*
|
|
19
|
-
* Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
|
|
20
|
-
* fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
|
|
21
|
-
*/
|
|
22
|
-
firstBorrowedAtTimestamp: BN
|
|
12
|
+
padding: BN
|
|
23
13
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
24
14
|
borrowedAmountSf: BN
|
|
25
15
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
@@ -36,17 +26,7 @@ export interface ObligationLiquidityJSON {
|
|
|
36
26
|
borrowReserve: string
|
|
37
27
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
38
28
|
cumulativeBorrowRateBsf: types.BigFractionBytesJSON
|
|
39
|
-
|
|
40
|
-
* The timestamp at which this debt was taken.
|
|
41
|
-
* More specifically: when the *first* borrow operation from this reserve happened.
|
|
42
|
-
* This means that:
|
|
43
|
-
* - adding debt of the same reserve does *not* change this timestamp,
|
|
44
|
-
* - repaying the entire debt of this reserve *does* reset this timestamp.
|
|
45
|
-
*
|
|
46
|
-
* Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
|
|
47
|
-
* fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
|
|
48
|
-
*/
|
|
49
|
-
firstBorrowedAtTimestamp: string
|
|
29
|
+
padding: string
|
|
50
30
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
51
31
|
borrowedAmountSf: string
|
|
52
32
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
@@ -64,17 +44,7 @@ export class ObligationLiquidity {
|
|
|
64
44
|
readonly borrowReserve: Address
|
|
65
45
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
66
46
|
readonly cumulativeBorrowRateBsf: types.BigFractionBytes
|
|
67
|
-
|
|
68
|
-
* The timestamp at which this debt was taken.
|
|
69
|
-
* More specifically: when the *first* borrow operation from this reserve happened.
|
|
70
|
-
* This means that:
|
|
71
|
-
* - adding debt of the same reserve does *not* change this timestamp,
|
|
72
|
-
* - repaying the entire debt of this reserve *does* reset this timestamp.
|
|
73
|
-
*
|
|
74
|
-
* Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
|
|
75
|
-
* fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
|
|
76
|
-
*/
|
|
77
|
-
readonly firstBorrowedAtTimestamp: BN
|
|
47
|
+
readonly padding: BN
|
|
78
48
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
79
49
|
readonly borrowedAmountSf: BN
|
|
80
50
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
@@ -90,7 +60,7 @@ export class ObligationLiquidity {
|
|
|
90
60
|
this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
|
|
91
61
|
...fields.cumulativeBorrowRateBsf,
|
|
92
62
|
})
|
|
93
|
-
this.
|
|
63
|
+
this.padding = fields.padding
|
|
94
64
|
this.borrowedAmountSf = fields.borrowedAmountSf
|
|
95
65
|
this.marketValueSf = fields.marketValueSf
|
|
96
66
|
this.borrowFactorAdjustedMarketValueSf =
|
|
@@ -105,7 +75,7 @@ export class ObligationLiquidity {
|
|
|
105
75
|
[
|
|
106
76
|
borshAddress("borrowReserve"),
|
|
107
77
|
types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
|
|
108
|
-
borsh.u64("
|
|
78
|
+
borsh.u64("padding"),
|
|
109
79
|
borsh.u128("borrowedAmountSf"),
|
|
110
80
|
borsh.u128("marketValueSf"),
|
|
111
81
|
borsh.u128("borrowFactorAdjustedMarketValueSf"),
|
|
@@ -123,7 +93,7 @@ export class ObligationLiquidity {
|
|
|
123
93
|
cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(
|
|
124
94
|
obj.cumulativeBorrowRateBsf
|
|
125
95
|
),
|
|
126
|
-
|
|
96
|
+
padding: obj.padding,
|
|
127
97
|
borrowedAmountSf: obj.borrowedAmountSf,
|
|
128
98
|
marketValueSf: obj.marketValueSf,
|
|
129
99
|
borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,
|
|
@@ -139,7 +109,7 @@ export class ObligationLiquidity {
|
|
|
139
109
|
cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(
|
|
140
110
|
fields.cumulativeBorrowRateBsf
|
|
141
111
|
),
|
|
142
|
-
|
|
112
|
+
padding: fields.padding,
|
|
143
113
|
borrowedAmountSf: fields.borrowedAmountSf,
|
|
144
114
|
marketValueSf: fields.marketValueSf,
|
|
145
115
|
borrowFactorAdjustedMarketValueSf:
|
|
@@ -154,7 +124,7 @@ export class ObligationLiquidity {
|
|
|
154
124
|
return {
|
|
155
125
|
borrowReserve: this.borrowReserve,
|
|
156
126
|
cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
|
|
157
|
-
|
|
127
|
+
padding: this.padding.toString(),
|
|
158
128
|
borrowedAmountSf: this.borrowedAmountSf.toString(),
|
|
159
129
|
marketValueSf: this.marketValueSf.toString(),
|
|
160
130
|
borrowFactorAdjustedMarketValueSf:
|
|
@@ -171,7 +141,7 @@ export class ObligationLiquidity {
|
|
|
171
141
|
cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(
|
|
172
142
|
obj.cumulativeBorrowRateBsf
|
|
173
143
|
),
|
|
174
|
-
|
|
144
|
+
padding: new BN(obj.padding),
|
|
175
145
|
borrowedAmountSf: new BN(obj.borrowedAmountSf),
|
|
176
146
|
marketValueSf: new BN(obj.marketValueSf),
|
|
177
147
|
borrowFactorAdjustedMarketValueSf: new BN(
|
|
@@ -77,7 +77,7 @@ export interface ObligationOrderFields {
|
|
|
77
77
|
*/
|
|
78
78
|
opportunityType: number
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Internal padding.
|
|
81
81
|
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
82
82
|
* align with `u128`s.
|
|
83
83
|
*/
|
|
@@ -162,7 +162,7 @@ export interface ObligationOrderJSON {
|
|
|
162
162
|
*/
|
|
163
163
|
opportunityType: number
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Internal padding.
|
|
166
166
|
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
167
167
|
* align with `u128`s.
|
|
168
168
|
*/
|
|
@@ -176,7 +176,7 @@ export interface ObligationOrderJSON {
|
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* A single obligation order.
|
|
179
|
-
* See [Obligation::
|
|
179
|
+
* See [Obligation::orders].
|
|
180
180
|
*/
|
|
181
181
|
export class ObligationOrder {
|
|
182
182
|
/**
|
|
@@ -251,7 +251,7 @@ export class ObligationOrder {
|
|
|
251
251
|
*/
|
|
252
252
|
readonly opportunityType: number
|
|
253
253
|
/**
|
|
254
|
-
*
|
|
254
|
+
* Internal padding.
|
|
255
255
|
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
256
256
|
* align with `u128`s.
|
|
257
257
|
*/
|
|
@@ -8,7 +8,7 @@ export interface ReserveConfigFields {
|
|
|
8
8
|
/** Status of the reserve Active/Obsolete/Hidden */
|
|
9
9
|
status: number
|
|
10
10
|
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
11
|
-
|
|
11
|
+
assetTier: number
|
|
12
12
|
/** Flat rate that goes to the host */
|
|
13
13
|
hostFixedInterestRateBps: number
|
|
14
14
|
/** Starting bonus for deleveraging-related liquidations, in bps. */
|
|
@@ -105,30 +105,13 @@ export interface ReserveConfigFields {
|
|
|
105
105
|
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
106
106
|
*/
|
|
107
107
|
deleveragingBonusIncreaseBpsPerDay: BN
|
|
108
|
-
/**
|
|
109
|
-
* The timestamp at which all [Obligation::borrows] using this reserve become liquidatable
|
|
110
|
-
* (on the same terms as reserve-wide deleveraging).
|
|
111
|
-
* Inactive when zeroed (i.e. debt never matures).
|
|
112
|
-
*
|
|
113
|
-
* Note: this feature is independent of [Self::debt_term_seconds] - the liquidation mechanism
|
|
114
|
-
* is based directly on the timestamp defined here, on Reserve's level.
|
|
115
|
-
*/
|
|
116
|
-
debtMaturityTimestamp: BN
|
|
117
|
-
/**
|
|
118
|
-
* The duration after which any debt coming from this Reserve must be repaid.
|
|
119
|
-
* Inactive when zeroed (i.e. funds can be borrowed indefinitely).
|
|
120
|
-
*
|
|
121
|
-
* Note: this feature is independent of [Self::debt_maturity_timestamp] - the liquidation
|
|
122
|
-
* mechanism is based on the [ObligationLiquidity::first_borrowed_at_timestamp].
|
|
123
|
-
*/
|
|
124
|
-
debtTermSeconds: BN
|
|
125
108
|
}
|
|
126
109
|
|
|
127
110
|
export interface ReserveConfigJSON {
|
|
128
111
|
/** Status of the reserve Active/Obsolete/Hidden */
|
|
129
112
|
status: number
|
|
130
113
|
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
131
|
-
|
|
114
|
+
assetTier: number
|
|
132
115
|
/** Flat rate that goes to the host */
|
|
133
116
|
hostFixedInterestRateBps: number
|
|
134
117
|
/** Starting bonus for deleveraging-related liquidations, in bps. */
|
|
@@ -225,23 +208,6 @@ export interface ReserveConfigJSON {
|
|
|
225
208
|
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
226
209
|
*/
|
|
227
210
|
deleveragingBonusIncreaseBpsPerDay: string
|
|
228
|
-
/**
|
|
229
|
-
* The timestamp at which all [Obligation::borrows] using this reserve become liquidatable
|
|
230
|
-
* (on the same terms as reserve-wide deleveraging).
|
|
231
|
-
* Inactive when zeroed (i.e. debt never matures).
|
|
232
|
-
*
|
|
233
|
-
* Note: this feature is independent of [Self::debt_term_seconds] - the liquidation mechanism
|
|
234
|
-
* is based directly on the timestamp defined here, on Reserve's level.
|
|
235
|
-
*/
|
|
236
|
-
debtMaturityTimestamp: string
|
|
237
|
-
/**
|
|
238
|
-
* The duration after which any debt coming from this Reserve must be repaid.
|
|
239
|
-
* Inactive when zeroed (i.e. funds can be borrowed indefinitely).
|
|
240
|
-
*
|
|
241
|
-
* Note: this feature is independent of [Self::debt_maturity_timestamp] - the liquidation
|
|
242
|
-
* mechanism is based on the [ObligationLiquidity::first_borrowed_at_timestamp].
|
|
243
|
-
*/
|
|
244
|
-
debtTermSeconds: string
|
|
245
211
|
}
|
|
246
212
|
|
|
247
213
|
/** Reserve configuration values */
|
|
@@ -249,7 +215,7 @@ export class ReserveConfig {
|
|
|
249
215
|
/** Status of the reserve Active/Obsolete/Hidden */
|
|
250
216
|
readonly status: number
|
|
251
217
|
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
252
|
-
readonly
|
|
218
|
+
readonly assetTier: number
|
|
253
219
|
/** Flat rate that goes to the host */
|
|
254
220
|
readonly hostFixedInterestRateBps: number
|
|
255
221
|
/** Starting bonus for deleveraging-related liquidations, in bps. */
|
|
@@ -346,27 +312,10 @@ export class ReserveConfig {
|
|
|
346
312
|
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
347
313
|
*/
|
|
348
314
|
readonly deleveragingBonusIncreaseBpsPerDay: BN
|
|
349
|
-
/**
|
|
350
|
-
* The timestamp at which all [Obligation::borrows] using this reserve become liquidatable
|
|
351
|
-
* (on the same terms as reserve-wide deleveraging).
|
|
352
|
-
* Inactive when zeroed (i.e. debt never matures).
|
|
353
|
-
*
|
|
354
|
-
* Note: this feature is independent of [Self::debt_term_seconds] - the liquidation mechanism
|
|
355
|
-
* is based directly on the timestamp defined here, on Reserve's level.
|
|
356
|
-
*/
|
|
357
|
-
readonly debtMaturityTimestamp: BN
|
|
358
|
-
/**
|
|
359
|
-
* The duration after which any debt coming from this Reserve must be repaid.
|
|
360
|
-
* Inactive when zeroed (i.e. funds can be borrowed indefinitely).
|
|
361
|
-
*
|
|
362
|
-
* Note: this feature is independent of [Self::debt_maturity_timestamp] - the liquidation
|
|
363
|
-
* mechanism is based on the [ObligationLiquidity::first_borrowed_at_timestamp].
|
|
364
|
-
*/
|
|
365
|
-
readonly debtTermSeconds: BN
|
|
366
315
|
|
|
367
316
|
constructor(fields: ReserveConfigFields) {
|
|
368
317
|
this.status = fields.status
|
|
369
|
-
this.
|
|
318
|
+
this.assetTier = fields.assetTier
|
|
370
319
|
this.hostFixedInterestRateBps = fields.hostFixedInterestRateBps
|
|
371
320
|
this.minDeleveragingBonusBps = fields.minDeleveragingBonusBps
|
|
372
321
|
this.blockCtokenUsage = fields.blockCtokenUsage
|
|
@@ -409,15 +358,13 @@ export class ReserveConfig {
|
|
|
409
358
|
fields.borrowLimitAgainstThisCollateralInElevationGroup
|
|
410
359
|
this.deleveragingBonusIncreaseBpsPerDay =
|
|
411
360
|
fields.deleveragingBonusIncreaseBpsPerDay
|
|
412
|
-
this.debtMaturityTimestamp = fields.debtMaturityTimestamp
|
|
413
|
-
this.debtTermSeconds = fields.debtTermSeconds
|
|
414
361
|
}
|
|
415
362
|
|
|
416
363
|
static layout(property?: string) {
|
|
417
364
|
return borsh.struct(
|
|
418
365
|
[
|
|
419
366
|
borsh.u8("status"),
|
|
420
|
-
borsh.u8("
|
|
367
|
+
borsh.u8("assetTier"),
|
|
421
368
|
borsh.u16("hostFixedInterestRateBps"),
|
|
422
369
|
borsh.u16("minDeleveragingBonusBps"),
|
|
423
370
|
borsh.u8("blockCtokenUsage"),
|
|
@@ -452,8 +399,6 @@ export class ReserveConfig {
|
|
|
452
399
|
"borrowLimitAgainstThisCollateralInElevationGroup"
|
|
453
400
|
),
|
|
454
401
|
borsh.u64("deleveragingBonusIncreaseBpsPerDay"),
|
|
455
|
-
borsh.u64("debtMaturityTimestamp"),
|
|
456
|
-
borsh.u64("debtTermSeconds"),
|
|
457
402
|
],
|
|
458
403
|
property
|
|
459
404
|
)
|
|
@@ -463,7 +408,7 @@ export class ReserveConfig {
|
|
|
463
408
|
static fromDecoded(obj: any) {
|
|
464
409
|
return new ReserveConfig({
|
|
465
410
|
status: obj.status,
|
|
466
|
-
|
|
411
|
+
assetTier: obj.assetTier,
|
|
467
412
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
468
413
|
minDeleveragingBonusBps: obj.minDeleveragingBonusBps,
|
|
469
414
|
blockCtokenUsage: obj.blockCtokenUsage,
|
|
@@ -502,15 +447,13 @@ export class ReserveConfig {
|
|
|
502
447
|
obj.borrowLimitAgainstThisCollateralInElevationGroup,
|
|
503
448
|
deleveragingBonusIncreaseBpsPerDay:
|
|
504
449
|
obj.deleveragingBonusIncreaseBpsPerDay,
|
|
505
|
-
debtMaturityTimestamp: obj.debtMaturityTimestamp,
|
|
506
|
-
debtTermSeconds: obj.debtTermSeconds,
|
|
507
450
|
})
|
|
508
451
|
}
|
|
509
452
|
|
|
510
453
|
static toEncodable(fields: ReserveConfigFields) {
|
|
511
454
|
return {
|
|
512
455
|
status: fields.status,
|
|
513
|
-
|
|
456
|
+
assetTier: fields.assetTier,
|
|
514
457
|
hostFixedInterestRateBps: fields.hostFixedInterestRateBps,
|
|
515
458
|
minDeleveragingBonusBps: fields.minDeleveragingBonusBps,
|
|
516
459
|
blockCtokenUsage: fields.blockCtokenUsage,
|
|
@@ -551,15 +494,13 @@ export class ReserveConfig {
|
|
|
551
494
|
fields.borrowLimitAgainstThisCollateralInElevationGroup,
|
|
552
495
|
deleveragingBonusIncreaseBpsPerDay:
|
|
553
496
|
fields.deleveragingBonusIncreaseBpsPerDay,
|
|
554
|
-
debtMaturityTimestamp: fields.debtMaturityTimestamp,
|
|
555
|
-
debtTermSeconds: fields.debtTermSeconds,
|
|
556
497
|
}
|
|
557
498
|
}
|
|
558
499
|
|
|
559
500
|
toJSON(): ReserveConfigJSON {
|
|
560
501
|
return {
|
|
561
502
|
status: this.status,
|
|
562
|
-
|
|
503
|
+
assetTier: this.assetTier,
|
|
563
504
|
hostFixedInterestRateBps: this.hostFixedInterestRateBps,
|
|
564
505
|
minDeleveragingBonusBps: this.minDeleveragingBonusBps,
|
|
565
506
|
blockCtokenUsage: this.blockCtokenUsage,
|
|
@@ -598,15 +539,13 @@ export class ReserveConfig {
|
|
|
598
539
|
),
|
|
599
540
|
deleveragingBonusIncreaseBpsPerDay:
|
|
600
541
|
this.deleveragingBonusIncreaseBpsPerDay.toString(),
|
|
601
|
-
debtMaturityTimestamp: this.debtMaturityTimestamp.toString(),
|
|
602
|
-
debtTermSeconds: this.debtTermSeconds.toString(),
|
|
603
542
|
}
|
|
604
543
|
}
|
|
605
544
|
|
|
606
545
|
static fromJSON(obj: ReserveConfigJSON): ReserveConfig {
|
|
607
546
|
return new ReserveConfig({
|
|
608
547
|
status: obj.status,
|
|
609
|
-
|
|
548
|
+
assetTier: obj.assetTier,
|
|
610
549
|
hostFixedInterestRateBps: obj.hostFixedInterestRateBps,
|
|
611
550
|
minDeleveragingBonusBps: obj.minDeleveragingBonusBps,
|
|
612
551
|
blockCtokenUsage: obj.blockCtokenUsage,
|
|
@@ -651,8 +590,6 @@ export class ReserveConfig {
|
|
|
651
590
|
deleveragingBonusIncreaseBpsPerDay: new BN(
|
|
652
591
|
obj.deleveragingBonusIncreaseBpsPerDay
|
|
653
592
|
),
|
|
654
|
-
debtMaturityTimestamp: new BN(obj.debtMaturityTimestamp),
|
|
655
|
-
debtTermSeconds: new BN(obj.debtTermSeconds),
|
|
656
593
|
})
|
|
657
594
|
}
|
|
658
595
|
|
|
@@ -763,25 +763,25 @@ export class UpdateBorrowFactor {
|
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
-
export interface
|
|
767
|
-
kind: "
|
|
766
|
+
export interface UpdateAssetTierJSON {
|
|
767
|
+
kind: "UpdateAssetTier"
|
|
768
768
|
}
|
|
769
769
|
|
|
770
|
-
export class
|
|
770
|
+
export class UpdateAssetTier {
|
|
771
771
|
static readonly discriminator = 33
|
|
772
|
-
static readonly kind = "
|
|
772
|
+
static readonly kind = "UpdateAssetTier"
|
|
773
773
|
readonly discriminator = 33
|
|
774
|
-
readonly kind = "
|
|
774
|
+
readonly kind = "UpdateAssetTier"
|
|
775
775
|
|
|
776
|
-
toJSON():
|
|
776
|
+
toJSON(): UpdateAssetTierJSON {
|
|
777
777
|
return {
|
|
778
|
-
kind: "
|
|
778
|
+
kind: "UpdateAssetTier",
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
|
|
782
782
|
toEncodable() {
|
|
783
783
|
return {
|
|
784
|
-
|
|
784
|
+
UpdateAssetTier: {},
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
787
|
}
|
|
@@ -1223,52 +1223,6 @@ export class UpdateBlockCTokenUsage {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
1226
|
-
export interface UpdateDebtMaturityTimestampJSON {
|
|
1227
|
-
kind: "UpdateDebtMaturityTimestamp"
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
export class UpdateDebtMaturityTimestamp {
|
|
1231
|
-
static readonly discriminator = 53
|
|
1232
|
-
static readonly kind = "UpdateDebtMaturityTimestamp"
|
|
1233
|
-
readonly discriminator = 53
|
|
1234
|
-
readonly kind = "UpdateDebtMaturityTimestamp"
|
|
1235
|
-
|
|
1236
|
-
toJSON(): UpdateDebtMaturityTimestampJSON {
|
|
1237
|
-
return {
|
|
1238
|
-
kind: "UpdateDebtMaturityTimestamp",
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
toEncodable() {
|
|
1243
|
-
return {
|
|
1244
|
-
UpdateDebtMaturityTimestamp: {},
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
export interface UpdateDebtTermSecondsJSON {
|
|
1250
|
-
kind: "UpdateDebtTermSeconds"
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
export class UpdateDebtTermSeconds {
|
|
1254
|
-
static readonly discriminator = 54
|
|
1255
|
-
static readonly kind = "UpdateDebtTermSeconds"
|
|
1256
|
-
readonly discriminator = 54
|
|
1257
|
-
readonly kind = "UpdateDebtTermSeconds"
|
|
1258
|
-
|
|
1259
|
-
toJSON(): UpdateDebtTermSecondsJSON {
|
|
1260
|
-
return {
|
|
1261
|
-
kind: "UpdateDebtTermSeconds",
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
toEncodable() {
|
|
1266
|
-
return {
|
|
1267
|
-
UpdateDebtTermSeconds: {},
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
1226
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1273
1227
|
export function fromDecoded(obj: any): types.UpdateConfigModeKind {
|
|
1274
1228
|
if (typeof obj !== "object") {
|
|
@@ -1374,8 +1328,8 @@ export function fromDecoded(obj: any): types.UpdateConfigModeKind {
|
|
|
1374
1328
|
if ("UpdateBorrowFactor" in obj) {
|
|
1375
1329
|
return new UpdateBorrowFactor()
|
|
1376
1330
|
}
|
|
1377
|
-
if ("
|
|
1378
|
-
return new
|
|
1331
|
+
if ("UpdateAssetTier" in obj) {
|
|
1332
|
+
return new UpdateAssetTier()
|
|
1379
1333
|
}
|
|
1380
1334
|
if ("UpdateElevationGroup" in obj) {
|
|
1381
1335
|
return new UpdateElevationGroup()
|
|
@@ -1434,12 +1388,6 @@ export function fromDecoded(obj: any): types.UpdateConfigModeKind {
|
|
|
1434
1388
|
if ("UpdateBlockCTokenUsage" in obj) {
|
|
1435
1389
|
return new UpdateBlockCTokenUsage()
|
|
1436
1390
|
}
|
|
1437
|
-
if ("UpdateDebtMaturityTimestamp" in obj) {
|
|
1438
|
-
return new UpdateDebtMaturityTimestamp()
|
|
1439
|
-
}
|
|
1440
|
-
if ("UpdateDebtTermSeconds" in obj) {
|
|
1441
|
-
return new UpdateDebtTermSeconds()
|
|
1442
|
-
}
|
|
1443
1391
|
|
|
1444
1392
|
throw new Error("Invalid enum object")
|
|
1445
1393
|
}
|
|
@@ -1547,8 +1495,8 @@ export function fromJSON(
|
|
|
1547
1495
|
case "UpdateBorrowFactor": {
|
|
1548
1496
|
return new UpdateBorrowFactor()
|
|
1549
1497
|
}
|
|
1550
|
-
case "
|
|
1551
|
-
return new
|
|
1498
|
+
case "UpdateAssetTier": {
|
|
1499
|
+
return new UpdateAssetTier()
|
|
1552
1500
|
}
|
|
1553
1501
|
case "UpdateElevationGroup": {
|
|
1554
1502
|
return new UpdateElevationGroup()
|
|
@@ -1607,12 +1555,6 @@ export function fromJSON(
|
|
|
1607
1555
|
case "UpdateBlockCTokenUsage": {
|
|
1608
1556
|
return new UpdateBlockCTokenUsage()
|
|
1609
1557
|
}
|
|
1610
|
-
case "UpdateDebtMaturityTimestamp": {
|
|
1611
|
-
return new UpdateDebtMaturityTimestamp()
|
|
1612
|
-
}
|
|
1613
|
-
case "UpdateDebtTermSeconds": {
|
|
1614
|
-
return new UpdateDebtTermSeconds()
|
|
1615
|
-
}
|
|
1616
1558
|
}
|
|
1617
1559
|
}
|
|
1618
1560
|
|
|
@@ -1651,7 +1593,7 @@ export function layout(property?: string) {
|
|
|
1651
1593
|
borsh.struct([], "UpdateMinLiquidationBonusBps"),
|
|
1652
1594
|
borsh.struct([], "UpdateDeleveragingMarginCallPeriod"),
|
|
1653
1595
|
borsh.struct([], "UpdateBorrowFactor"),
|
|
1654
|
-
borsh.struct([], "
|
|
1596
|
+
borsh.struct([], "UpdateAssetTier"),
|
|
1655
1597
|
borsh.struct([], "UpdateElevationGroup"),
|
|
1656
1598
|
borsh.struct([], "UpdateDeleveragingThresholdDecreaseBpsPerDay"),
|
|
1657
1599
|
borsh.struct([], "DeprecatedUpdateMultiplierSideBoost"),
|
|
@@ -1671,8 +1613,6 @@ export function layout(property?: string) {
|
|
|
1671
1613
|
borsh.struct([], "UpdateProposerAuthorityLock"),
|
|
1672
1614
|
borsh.struct([], "UpdateMinDeleveragingBonusBps"),
|
|
1673
1615
|
borsh.struct([], "UpdateBlockCTokenUsage"),
|
|
1674
|
-
borsh.struct([], "UpdateDebtMaturityTimestamp"),
|
|
1675
|
-
borsh.struct([], "UpdateDebtTermSeconds"),
|
|
1676
1616
|
])
|
|
1677
1617
|
if (property !== undefined) {
|
|
1678
1618
|
return ret.replicate(property)
|
|
@@ -625,98 +625,6 @@ export class UpdatePriceTriggeredLiquidationDisabled {
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
export interface UpdateMatureReserveDebtLiquidationEnabledJSON {
|
|
629
|
-
kind: "UpdateMatureReserveDebtLiquidationEnabled"
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export class UpdateMatureReserveDebtLiquidationEnabled {
|
|
633
|
-
static readonly discriminator = 27
|
|
634
|
-
static readonly kind = "UpdateMatureReserveDebtLiquidationEnabled"
|
|
635
|
-
readonly discriminator = 27
|
|
636
|
-
readonly kind = "UpdateMatureReserveDebtLiquidationEnabled"
|
|
637
|
-
|
|
638
|
-
toJSON(): UpdateMatureReserveDebtLiquidationEnabledJSON {
|
|
639
|
-
return {
|
|
640
|
-
kind: "UpdateMatureReserveDebtLiquidationEnabled",
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
toEncodable() {
|
|
645
|
-
return {
|
|
646
|
-
UpdateMatureReserveDebtLiquidationEnabled: {},
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
export interface UpdateObligationBorrowDebtTermLiquidationEnabledJSON {
|
|
652
|
-
kind: "UpdateObligationBorrowDebtTermLiquidationEnabled"
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
export class UpdateObligationBorrowDebtTermLiquidationEnabled {
|
|
656
|
-
static readonly discriminator = 28
|
|
657
|
-
static readonly kind = "UpdateObligationBorrowDebtTermLiquidationEnabled"
|
|
658
|
-
readonly discriminator = 28
|
|
659
|
-
readonly kind = "UpdateObligationBorrowDebtTermLiquidationEnabled"
|
|
660
|
-
|
|
661
|
-
toJSON(): UpdateObligationBorrowDebtTermLiquidationEnabledJSON {
|
|
662
|
-
return {
|
|
663
|
-
kind: "UpdateObligationBorrowDebtTermLiquidationEnabled",
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
toEncodable() {
|
|
668
|
-
return {
|
|
669
|
-
UpdateObligationBorrowDebtTermLiquidationEnabled: {},
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
export interface UpdateBorrowOrderCreationEnabledJSON {
|
|
675
|
-
kind: "UpdateBorrowOrderCreationEnabled"
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
export class UpdateBorrowOrderCreationEnabled {
|
|
679
|
-
static readonly discriminator = 29
|
|
680
|
-
static readonly kind = "UpdateBorrowOrderCreationEnabled"
|
|
681
|
-
readonly discriminator = 29
|
|
682
|
-
readonly kind = "UpdateBorrowOrderCreationEnabled"
|
|
683
|
-
|
|
684
|
-
toJSON(): UpdateBorrowOrderCreationEnabledJSON {
|
|
685
|
-
return {
|
|
686
|
-
kind: "UpdateBorrowOrderCreationEnabled",
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
toEncodable() {
|
|
691
|
-
return {
|
|
692
|
-
UpdateBorrowOrderCreationEnabled: {},
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
export interface UpdateBorrowOrderExecutionEnabledJSON {
|
|
698
|
-
kind: "UpdateBorrowOrderExecutionEnabled"
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
export class UpdateBorrowOrderExecutionEnabled {
|
|
702
|
-
static readonly discriminator = 30
|
|
703
|
-
static readonly kind = "UpdateBorrowOrderExecutionEnabled"
|
|
704
|
-
readonly discriminator = 30
|
|
705
|
-
readonly kind = "UpdateBorrowOrderExecutionEnabled"
|
|
706
|
-
|
|
707
|
-
toJSON(): UpdateBorrowOrderExecutionEnabledJSON {
|
|
708
|
-
return {
|
|
709
|
-
kind: "UpdateBorrowOrderExecutionEnabled",
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
toEncodable() {
|
|
714
|
-
return {
|
|
715
|
-
UpdateBorrowOrderExecutionEnabled: {},
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
|
|
720
628
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
721
629
|
export function fromDecoded(obj: any): types.UpdateLendingMarketModeKind {
|
|
722
630
|
if (typeof obj !== "object") {
|
|
@@ -804,18 +712,6 @@ export function fromDecoded(obj: any): types.UpdateLendingMarketModeKind {
|
|
|
804
712
|
if ("UpdatePriceTriggeredLiquidationDisabled" in obj) {
|
|
805
713
|
return new UpdatePriceTriggeredLiquidationDisabled()
|
|
806
714
|
}
|
|
807
|
-
if ("UpdateMatureReserveDebtLiquidationEnabled" in obj) {
|
|
808
|
-
return new UpdateMatureReserveDebtLiquidationEnabled()
|
|
809
|
-
}
|
|
810
|
-
if ("UpdateObligationBorrowDebtTermLiquidationEnabled" in obj) {
|
|
811
|
-
return new UpdateObligationBorrowDebtTermLiquidationEnabled()
|
|
812
|
-
}
|
|
813
|
-
if ("UpdateBorrowOrderCreationEnabled" in obj) {
|
|
814
|
-
return new UpdateBorrowOrderCreationEnabled()
|
|
815
|
-
}
|
|
816
|
-
if ("UpdateBorrowOrderExecutionEnabled" in obj) {
|
|
817
|
-
return new UpdateBorrowOrderExecutionEnabled()
|
|
818
|
-
}
|
|
819
715
|
|
|
820
716
|
throw new Error("Invalid enum object")
|
|
821
717
|
}
|
|
@@ -905,18 +801,6 @@ export function fromJSON(
|
|
|
905
801
|
case "UpdatePriceTriggeredLiquidationDisabled": {
|
|
906
802
|
return new UpdatePriceTriggeredLiquidationDisabled()
|
|
907
803
|
}
|
|
908
|
-
case "UpdateMatureReserveDebtLiquidationEnabled": {
|
|
909
|
-
return new UpdateMatureReserveDebtLiquidationEnabled()
|
|
910
|
-
}
|
|
911
|
-
case "UpdateObligationBorrowDebtTermLiquidationEnabled": {
|
|
912
|
-
return new UpdateObligationBorrowDebtTermLiquidationEnabled()
|
|
913
|
-
}
|
|
914
|
-
case "UpdateBorrowOrderCreationEnabled": {
|
|
915
|
-
return new UpdateBorrowOrderCreationEnabled()
|
|
916
|
-
}
|
|
917
|
-
case "UpdateBorrowOrderExecutionEnabled": {
|
|
918
|
-
return new UpdateBorrowOrderExecutionEnabled()
|
|
919
|
-
}
|
|
920
804
|
}
|
|
921
805
|
}
|
|
922
806
|
|
|
@@ -949,10 +833,6 @@ export function layout(property?: string) {
|
|
|
949
833
|
borsh.struct([], "UpdateObligationOrderCreationEnabled"),
|
|
950
834
|
borsh.struct([], "UpdateProposerAuthority"),
|
|
951
835
|
borsh.struct([], "UpdatePriceTriggeredLiquidationDisabled"),
|
|
952
|
-
borsh.struct([], "UpdateMatureReserveDebtLiquidationEnabled"),
|
|
953
|
-
borsh.struct([], "UpdateObligationBorrowDebtTermLiquidationEnabled"),
|
|
954
|
-
borsh.struct([], "UpdateBorrowOrderCreationEnabled"),
|
|
955
|
-
borsh.struct([], "UpdateBorrowOrderExecutionEnabled"),
|
|
956
836
|
])
|
|
957
837
|
if (property !== undefined) {
|
|
958
838
|
return ret.replicate(property)
|