@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
|
@@ -2,15 +2,11 @@ import * as UpdateConfigMode from "./UpdateConfigMode"
|
|
|
2
2
|
import * as UpdateLendingMarketConfigValue from "./UpdateLendingMarketConfigValue"
|
|
3
3
|
import * as UpdateLendingMarketMode from "./UpdateLendingMarketMode"
|
|
4
4
|
import * as UpdateGlobalConfigMode from "./UpdateGlobalConfigMode"
|
|
5
|
+
import * as AssetTier from "./AssetTier"
|
|
5
6
|
import * as FeeCalculation from "./FeeCalculation"
|
|
6
7
|
import * as ReserveFarmKind from "./ReserveFarmKind"
|
|
7
8
|
import * as ReserveStatus from "./ReserveStatus"
|
|
8
9
|
|
|
9
|
-
export { BorrowOrderConfigArgs } from "./BorrowOrderConfigArgs"
|
|
10
|
-
export type {
|
|
11
|
-
BorrowOrderConfigArgsFields,
|
|
12
|
-
BorrowOrderConfigArgsJSON,
|
|
13
|
-
} from "./BorrowOrderConfigArgs"
|
|
14
10
|
export { UpdateConfigMode }
|
|
15
11
|
|
|
16
12
|
export type UpdateConfigModeKind =
|
|
@@ -47,7 +43,7 @@ export type UpdateConfigModeKind =
|
|
|
47
43
|
| UpdateConfigMode.UpdateMinLiquidationBonusBps
|
|
48
44
|
| UpdateConfigMode.UpdateDeleveragingMarginCallPeriod
|
|
49
45
|
| UpdateConfigMode.UpdateBorrowFactor
|
|
50
|
-
| UpdateConfigMode.
|
|
46
|
+
| UpdateConfigMode.UpdateAssetTier
|
|
51
47
|
| UpdateConfigMode.UpdateElevationGroup
|
|
52
48
|
| UpdateConfigMode.UpdateDeleveragingThresholdDecreaseBpsPerDay
|
|
53
49
|
| UpdateConfigMode.DeprecatedUpdateMultiplierSideBoost
|
|
@@ -67,8 +63,6 @@ export type UpdateConfigModeKind =
|
|
|
67
63
|
| UpdateConfigMode.UpdateProposerAuthorityLock
|
|
68
64
|
| UpdateConfigMode.UpdateMinDeleveragingBonusBps
|
|
69
65
|
| UpdateConfigMode.UpdateBlockCTokenUsage
|
|
70
|
-
| UpdateConfigMode.UpdateDebtMaturityTimestamp
|
|
71
|
-
| UpdateConfigMode.UpdateDebtTermSeconds
|
|
72
66
|
export type UpdateConfigModeJSON =
|
|
73
67
|
| UpdateConfigMode.UpdateLoanToValuePctJSON
|
|
74
68
|
| UpdateConfigMode.UpdateMaxLiquidationBonusBpsJSON
|
|
@@ -103,7 +97,7 @@ export type UpdateConfigModeJSON =
|
|
|
103
97
|
| UpdateConfigMode.UpdateMinLiquidationBonusBpsJSON
|
|
104
98
|
| UpdateConfigMode.UpdateDeleveragingMarginCallPeriodJSON
|
|
105
99
|
| UpdateConfigMode.UpdateBorrowFactorJSON
|
|
106
|
-
| UpdateConfigMode.
|
|
100
|
+
| UpdateConfigMode.UpdateAssetTierJSON
|
|
107
101
|
| UpdateConfigMode.UpdateElevationGroupJSON
|
|
108
102
|
| UpdateConfigMode.UpdateDeleveragingThresholdDecreaseBpsPerDayJSON
|
|
109
103
|
| UpdateConfigMode.DeprecatedUpdateMultiplierSideBoostJSON
|
|
@@ -123,8 +117,6 @@ export type UpdateConfigModeJSON =
|
|
|
123
117
|
| UpdateConfigMode.UpdateProposerAuthorityLockJSON
|
|
124
118
|
| UpdateConfigMode.UpdateMinDeleveragingBonusBpsJSON
|
|
125
119
|
| UpdateConfigMode.UpdateBlockCTokenUsageJSON
|
|
126
|
-
| UpdateConfigMode.UpdateDebtMaturityTimestampJSON
|
|
127
|
-
| UpdateConfigMode.UpdateDebtTermSecondsJSON
|
|
128
120
|
|
|
129
121
|
export { UpdateLendingMarketConfigValue }
|
|
130
122
|
|
|
@@ -179,10 +171,6 @@ export type UpdateLendingMarketModeKind =
|
|
|
179
171
|
| UpdateLendingMarketMode.UpdateObligationOrderCreationEnabled
|
|
180
172
|
| UpdateLendingMarketMode.UpdateProposerAuthority
|
|
181
173
|
| UpdateLendingMarketMode.UpdatePriceTriggeredLiquidationDisabled
|
|
182
|
-
| UpdateLendingMarketMode.UpdateMatureReserveDebtLiquidationEnabled
|
|
183
|
-
| UpdateLendingMarketMode.UpdateObligationBorrowDebtTermLiquidationEnabled
|
|
184
|
-
| UpdateLendingMarketMode.UpdateBorrowOrderCreationEnabled
|
|
185
|
-
| UpdateLendingMarketMode.UpdateBorrowOrderExecutionEnabled
|
|
186
174
|
export type UpdateLendingMarketModeJSON =
|
|
187
175
|
| UpdateLendingMarketMode.UpdateOwnerJSON
|
|
188
176
|
| UpdateLendingMarketMode.UpdateEmergencyModeJSON
|
|
@@ -211,10 +199,6 @@ export type UpdateLendingMarketModeJSON =
|
|
|
211
199
|
| UpdateLendingMarketMode.UpdateObligationOrderCreationEnabledJSON
|
|
212
200
|
| UpdateLendingMarketMode.UpdateProposerAuthorityJSON
|
|
213
201
|
| UpdateLendingMarketMode.UpdatePriceTriggeredLiquidationDisabledJSON
|
|
214
|
-
| UpdateLendingMarketMode.UpdateMatureReserveDebtLiquidationEnabledJSON
|
|
215
|
-
| UpdateLendingMarketMode.UpdateObligationBorrowDebtTermLiquidationEnabledJSON
|
|
216
|
-
| UpdateLendingMarketMode.UpdateBorrowOrderCreationEnabledJSON
|
|
217
|
-
| UpdateLendingMarketMode.UpdateBorrowOrderExecutionEnabledJSON
|
|
218
202
|
|
|
219
203
|
export { UpdateGlobalConfigMode }
|
|
220
204
|
|
|
@@ -229,8 +213,6 @@ export { LastUpdate } from "./LastUpdate"
|
|
|
229
213
|
export type { LastUpdateFields, LastUpdateJSON } from "./LastUpdate"
|
|
230
214
|
export { ElevationGroup } from "./ElevationGroup"
|
|
231
215
|
export type { ElevationGroupFields, ElevationGroupJSON } from "./ElevationGroup"
|
|
232
|
-
export { BorrowOrder } from "./BorrowOrder"
|
|
233
|
-
export type { BorrowOrderFields, BorrowOrderJSON } from "./BorrowOrder"
|
|
234
216
|
export { InitObligationArgs } from "./InitObligationArgs"
|
|
235
217
|
export type {
|
|
236
218
|
InitObligationArgsFields,
|
|
@@ -251,6 +233,17 @@ export type {
|
|
|
251
233
|
ObligationOrderFields,
|
|
252
234
|
ObligationOrderJSON,
|
|
253
235
|
} from "./ObligationOrder"
|
|
236
|
+
export { AssetTier }
|
|
237
|
+
|
|
238
|
+
export type AssetTierKind =
|
|
239
|
+
| AssetTier.Regular
|
|
240
|
+
| AssetTier.IsolatedCollateral
|
|
241
|
+
| AssetTier.IsolatedDebt
|
|
242
|
+
export type AssetTierJSON =
|
|
243
|
+
| AssetTier.RegularJSON
|
|
244
|
+
| AssetTier.IsolatedCollateralJSON
|
|
245
|
+
| AssetTier.IsolatedDebtJSON
|
|
246
|
+
|
|
254
247
|
export { BigFractionBytes } from "./BigFractionBytes"
|
|
255
248
|
export type {
|
|
256
249
|
BigFractionBytesFields,
|
|
@@ -43,7 +43,9 @@ export class ObligationZP {
|
|
|
43
43
|
/** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
|
|
44
44
|
readonly unhealthyBorrowValueSf: BN
|
|
45
45
|
/** The asset tier of the deposits */
|
|
46
|
-
readonly
|
|
46
|
+
readonly depositsAssetTiers: Array<number>
|
|
47
|
+
/** The asset tier of the borrows */
|
|
48
|
+
readonly borrowsAssetTiers: Array<number>
|
|
47
49
|
/** The elevation group id the obligation opted into. */
|
|
48
50
|
readonly elevationGroup: number
|
|
49
51
|
/** The number of obsolete reserves the obligation has a deposit in */
|
|
@@ -71,15 +73,10 @@ export class ObligationZP {
|
|
|
71
73
|
*/
|
|
72
74
|
readonly autodeleverageMarginCallStartedTimestamp: BN
|
|
73
75
|
/**
|
|
74
|
-
* Owner-defined,
|
|
76
|
+
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
75
77
|
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
76
78
|
*/
|
|
77
|
-
readonly
|
|
78
|
-
/**
|
|
79
|
-
* Owner-defined, permissionlessly-executed borrow order applicable to this obligation.
|
|
80
|
-
* Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation.
|
|
81
|
-
*/
|
|
82
|
-
readonly borrowOrder: types.BorrowOrder
|
|
79
|
+
readonly orders: Array<types.ObligationOrder>
|
|
83
80
|
readonly padding3: Array<BN> = new Array(0)
|
|
84
81
|
|
|
85
82
|
static readonly layout = borsh.struct<ObligationZP>([
|
|
@@ -95,7 +92,8 @@ export class ObligationZP {
|
|
|
95
92
|
borsh.u128("borrowedAssetsMarketValueSf"),
|
|
96
93
|
borsh.u128("allowedBorrowValueSf"),
|
|
97
94
|
borsh.u128("unhealthyBorrowValueSf"),
|
|
98
|
-
borsh.array(borsh.u8(),
|
|
95
|
+
borsh.array(borsh.u8(), 8, "depositsAssetTiers"),
|
|
96
|
+
borsh.array(borsh.u8(), 5, "borrowsAssetTiers"),
|
|
99
97
|
borsh.u8("elevationGroup"),
|
|
100
98
|
borsh.u8("numOfObsoleteDepositReserves"),
|
|
101
99
|
borsh.u8("hasDebt"),
|
|
@@ -107,8 +105,7 @@ export class ObligationZP {
|
|
|
107
105
|
borsh.array(borsh.u8(), 4, "reserved"),
|
|
108
106
|
borsh.u64("highestBorrowFactorPct"),
|
|
109
107
|
borsh.u64("autodeleverageMarginCallStartedTimestamp"),
|
|
110
|
-
borsh.array(types.ObligationOrder.layout(), 2, "
|
|
111
|
-
types.BorrowOrder.layout("borrowOrder"),
|
|
108
|
+
borsh.array(types.ObligationOrder.layout(), 2, "orders"),
|
|
112
109
|
])
|
|
113
110
|
|
|
114
111
|
constructor(fields: ObligationFields) {
|
|
@@ -130,7 +127,8 @@ export class ObligationZP {
|
|
|
130
127
|
this.borrowedAssetsMarketValueSf = fields.borrowedAssetsMarketValueSf
|
|
131
128
|
this.allowedBorrowValueSf = fields.allowedBorrowValueSf
|
|
132
129
|
this.unhealthyBorrowValueSf = fields.unhealthyBorrowValueSf
|
|
133
|
-
this.
|
|
130
|
+
this.depositsAssetTiers = fields.depositsAssetTiers
|
|
131
|
+
this.borrowsAssetTiers = fields.borrowsAssetTiers
|
|
134
132
|
this.elevationGroup = fields.elevationGroup
|
|
135
133
|
this.numOfObsoleteDepositReserves = fields.numOfObsoleteDepositReserves
|
|
136
134
|
this.hasDebt = fields.hasDebt
|
|
@@ -143,10 +141,9 @@ export class ObligationZP {
|
|
|
143
141
|
this.highestBorrowFactorPct = fields.highestBorrowFactorPct
|
|
144
142
|
this.autodeleverageMarginCallStartedTimestamp =
|
|
145
143
|
fields.autodeleverageMarginCallStartedTimestamp
|
|
146
|
-
this.
|
|
144
|
+
this.orders = fields.orders.map(
|
|
147
145
|
(item) => new types.ObligationOrder({ ...item })
|
|
148
146
|
)
|
|
149
|
-
this.borrowOrder = new types.BorrowOrder({ ...fields.borrowOrder })
|
|
150
147
|
this.padding3 = new Array<BN>(0);
|
|
151
148
|
}
|
|
152
149
|
|
|
@@ -215,7 +212,8 @@ export class ObligationZP {
|
|
|
215
212
|
borrowedAssetsMarketValueSf: dec.borrowedAssetsMarketValueSf,
|
|
216
213
|
allowedBorrowValueSf: dec.allowedBorrowValueSf,
|
|
217
214
|
unhealthyBorrowValueSf: dec.unhealthyBorrowValueSf,
|
|
218
|
-
|
|
215
|
+
depositsAssetTiers: dec.depositsAssetTiers,
|
|
216
|
+
borrowsAssetTiers: dec.borrowsAssetTiers,
|
|
219
217
|
elevationGroup: dec.elevationGroup,
|
|
220
218
|
numOfObsoleteDepositReserves: dec.numOfObsoleteDepositReserves,
|
|
221
219
|
hasDebt: dec.hasDebt,
|
|
@@ -228,12 +226,11 @@ export class ObligationZP {
|
|
|
228
226
|
highestBorrowFactorPct: dec.highestBorrowFactorPct,
|
|
229
227
|
autodeleverageMarginCallStartedTimestamp:
|
|
230
228
|
dec.autodeleverageMarginCallStartedTimestamp,
|
|
231
|
-
|
|
229
|
+
orders: dec.orders.map(
|
|
232
230
|
(
|
|
233
231
|
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
234
232
|
) => types.ObligationOrder.fromDecoded(item)
|
|
235
233
|
),
|
|
236
|
-
borrowOrder: types.BorrowOrder.fromDecoded(dec.borrowOrder),
|
|
237
234
|
padding3: [],
|
|
238
235
|
})
|
|
239
236
|
}
|