@kamino-finance/klend-sdk 7.1.4-beta.0 → 7.1.5
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 -144
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +3 -105
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.d.ts +15 -30
- package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.js +21 -31
- package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.d.ts +0 -6
- package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.js +2 -9
- package/dist/@codegen/klend/accounts/Reserve.js.map +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/accounts/index.d.ts +0 -6
- package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/index.js +1 -7
- package/dist/@codegen/klend/accounts/index.js.map +1 -1
- package/dist/@codegen/klend/errors/custom.d.ts +2 -226
- package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/klend/errors/custom.js +3 -396
- package/dist/@codegen/klend/errors/custom.js.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +2 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.js +2 -6
- package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
- package/dist/@codegen/klend/instructions/index.d.ts +0 -16
- package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/index.js +1 -18
- package/dist/@codegen/klend/instructions/index.js.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.js +5 -1
- package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.js +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.js +0 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.js +0 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +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 +29 -141
- package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveConfig.js +25 -89
- package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/types/ReserveFees.d.ts +8 -8
- package/dist/@codegen/klend/types/ReserveFees.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveFees.js +8 -8
- package/dist/@codegen/klend/types/ReserveFees.js.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +8 -26
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.js +8 -14
- package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +14 -92
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.js +23 -168
- package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +0 -130
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +1 -241
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/@codegen/klend/types/index.d.ts +8 -10
- package/dist/@codegen/klend/types/index.d.ts.map +1 -1
- package/dist/@codegen/klend/types/index.js +3 -7
- package/dist/@codegen/klend/types/index.js.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +4 -9
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.js +13 -22
- package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
- package/dist/classes/action.d.ts +3 -30
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +10 -364
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/manager.d.ts +3 -2
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +3 -12
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +2 -6
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +6 -26
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.js +1 -1
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +7 -13
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/unstakingPool.d.ts +3 -20
- package/dist/classes/unstakingPool.d.ts.map +1 -1
- package/dist/classes/unstakingPool.js +8 -62
- package/dist/classes/unstakingPool.js.map +1 -1
- package/dist/classes/vault.d.ts +2 -1
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +59 -38
- package/dist/classes/vault.js.map +1 -1
- package/dist/idl/klend.json +293 -2186
- package/dist/lending_operations/index.d.ts +0 -1
- package/dist/lending_operations/index.d.ts.map +1 -1
- package/dist/lending_operations/index.js +0 -1
- package/dist/lending_operations/index.js.map +1 -1
- package/dist/manager/client_kamino_manager.js +9 -12
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/utils/ata.d.ts +10 -1
- package/dist/utils/ata.d.ts.map +1 -1
- package/dist/utils/ata.js +47 -0
- package/dist/utils/ata.js.map +1 -1
- package/dist/utils/managerTypes.d.ts.map +1 -1
- package/dist/utils/managerTypes.js +4 -9
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/seeds.d.ts +14 -10
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +22 -25
- package/dist/utils/seeds.js.map +1 -1
- package/package.json +1 -1
- package/src/@codegen/klend/accounts/LendingMarket.ts +5 -210
- package/src/@codegen/klend/accounts/Obligation.ts +31 -53
- package/src/@codegen/klend/accounts/Reserve.ts +2 -13
- package/src/@codegen/klend/accounts/UserState.ts +75 -0
- package/src/@codegen/klend/accounts/index.ts +0 -6
- package/src/@codegen/klend/errors/custom.ts +2 -427
- package/src/@codegen/klend/instructions/idlMissingTypes.ts +4 -7
- package/src/@codegen/klend/instructions/index.ts +0 -34
- package/src/@codegen/klend/instructions/initReserve.ts +6 -2
- package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.ts +1 -1
- package/src/@codegen/klend/instructions/updateGlobalConfig.ts +1 -2
- package/src/@codegen/klend/instructions/updateReserveConfig.ts +1 -2
- package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +1 -1
- package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +1 -1
- 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 +39 -171
- package/src/@codegen/klend/types/ReserveFees.ts +12 -12
- package/src/@codegen/klend/types/ReserveLiquidity.ts +12 -30
- package/src/@codegen/klend/types/UpdateConfigMode.ts +26 -206
- package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +0 -300
- package/src/@codegen/klend/types/index.ts +16 -45
- package/src/@codegen/klend/zero_padding/ObligationZP.ts +13 -22
- package/src/classes/action.ts +8 -577
- package/src/classes/manager.ts +7 -13
- package/src/classes/market.ts +5 -36
- package/src/classes/obligation.ts +1 -1
- package/src/classes/reserve.ts +8 -13
- package/src/classes/unstakingPool.ts +6 -83
- package/src/classes/vault.ts +75 -54
- package/src/idl/klend.json +294 -2187
- package/src/lending_operations/index.ts +0 -1
- package/src/manager/client_kamino_manager.ts +9 -13
- package/src/utils/ata.ts +79 -0
- package/src/utils/managerTypes.ts +4 -9
- package/src/utils/seeds.ts +26 -28
- package/dist/@codegen/klend/accounts/PoolState.d.ts +0 -53
- package/dist/@codegen/klend/accounts/PoolState.d.ts.map +0 -1
- package/dist/@codegen/klend/accounts/PoolState.js +0 -167
- package/dist/@codegen/klend/accounts/PoolState.js.map +0 -1
- package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts +0 -41
- package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts.map +0 -1
- package/dist/@codegen/klend/accounts/UnstakeTicket.js +0 -143
- package/dist/@codegen/klend/accounts/UnstakeTicket.js.map +0 -1
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +0 -132
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +0 -1
- package/dist/@codegen/klend/accounts/WithdrawTicket.js +0 -191
- package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +0 -1
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +0 -39
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +0 -67
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +0 -1
- 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/recoverInvalidTicketCollateral.d.ts +0 -47
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +0 -66
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +0 -1
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +0 -31
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/setBorrowOrder.js +0 -64
- package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +0 -1
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts +0 -53
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js +0 -190
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js.map +0 -1
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts +0 -70
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js +0 -261
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js.map +0 -1
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts +0 -41
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.js +0 -135
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.js.map +0 -1
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +0 -51
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +0 -1
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +0 -28
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.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/dist/@codegen/klend/types/WithdrawQueue.d.ts +0 -64
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +0 -1
- package/dist/@codegen/klend/types/WithdrawQueue.js +0 -104
- package/dist/@codegen/klend/types/WithdrawQueue.js.map +0 -1
- package/dist/lending_operations/unstake_lst_collateral.d.ts +0 -12
- package/dist/lending_operations/unstake_lst_collateral.d.ts.map +0 -1
- package/dist/lending_operations/unstake_lst_collateral.js +0 -104
- package/dist/lending_operations/unstake_lst_collateral.js.map +0 -1
- package/src/@codegen/klend/accounts/PoolState.ts +0 -192
- package/src/@codegen/klend/accounts/UnstakeTicket.ts +0 -160
- package/src/@codegen/klend/accounts/WithdrawTicket.ts +0 -256
- package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +0 -89
- package/src/@codegen/klend/instructions/fillBorrowOrder.ts +0 -96
- package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +0 -96
- package/src/@codegen/klend/instructions/setBorrowOrder.ts +0 -77
- package/src/@codegen/klend/instructions/unstakeLstCollateralEnd.ts +0 -251
- package/src/@codegen/klend/instructions/unstakeLstCollateralStart.ts +0 -353
- package/src/@codegen/klend/instructions/withdrawObligationUsol.ts +0 -168
- package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +0 -92
- package/src/@codegen/klend/types/BorrowOrder.ts +0 -267
- package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +0 -87
- package/src/@codegen/klend/types/WithdrawQueue.ts +0 -117
- package/src/lending_operations/unstake_lst_collateral.ts +0 -174
|
@@ -41,7 +41,9 @@ export interface ObligationFields {
|
|
|
41
41
|
/** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
|
|
42
42
|
unhealthyBorrowValueSf: BN
|
|
43
43
|
/** The asset tier of the deposits */
|
|
44
|
-
|
|
44
|
+
depositsAssetTiers: Array<number>
|
|
45
|
+
/** The asset tier of the borrows */
|
|
46
|
+
borrowsAssetTiers: Array<number>
|
|
45
47
|
/** The elevation group id the obligation opted into. */
|
|
46
48
|
elevationGroup: number
|
|
47
49
|
/** The number of obsolete reserves the obligation has a deposit in */
|
|
@@ -69,17 +71,10 @@ export interface ObligationFields {
|
|
|
69
71
|
*/
|
|
70
72
|
autodeleverageMarginCallStartedTimestamp: BN
|
|
71
73
|
/**
|
|
72
|
-
* Owner-defined,
|
|
74
|
+
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
73
75
|
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
74
76
|
*/
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Owner-defined, permissionlessly-executed borrow order applicable to this obligation.
|
|
78
|
-
* Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation.
|
|
79
|
-
*/
|
|
80
|
-
borrowOrder: types.BorrowOrderFields
|
|
81
|
-
/** The unstaking ticket pubkey for LST position closing */
|
|
82
|
-
unstakeTicket: Address
|
|
77
|
+
orders: Array<types.ObligationOrderFields>
|
|
83
78
|
padding3: Array<BN>
|
|
84
79
|
}
|
|
85
80
|
|
|
@@ -109,7 +104,9 @@ export interface ObligationJSON {
|
|
|
109
104
|
/** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
|
|
110
105
|
unhealthyBorrowValueSf: string
|
|
111
106
|
/** The asset tier of the deposits */
|
|
112
|
-
|
|
107
|
+
depositsAssetTiers: Array<number>
|
|
108
|
+
/** The asset tier of the borrows */
|
|
109
|
+
borrowsAssetTiers: Array<number>
|
|
113
110
|
/** The elevation group id the obligation opted into. */
|
|
114
111
|
elevationGroup: number
|
|
115
112
|
/** The number of obsolete reserves the obligation has a deposit in */
|
|
@@ -137,17 +134,10 @@ export interface ObligationJSON {
|
|
|
137
134
|
*/
|
|
138
135
|
autodeleverageMarginCallStartedTimestamp: string
|
|
139
136
|
/**
|
|
140
|
-
* Owner-defined,
|
|
137
|
+
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
141
138
|
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
142
139
|
*/
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Owner-defined, permissionlessly-executed borrow order applicable to this obligation.
|
|
146
|
-
* Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation.
|
|
147
|
-
*/
|
|
148
|
-
borrowOrder: types.BorrowOrderJSON
|
|
149
|
-
/** The unstaking ticket pubkey for LST position closing */
|
|
150
|
-
unstakeTicket: string
|
|
140
|
+
orders: Array<types.ObligationOrderJSON>
|
|
151
141
|
padding3: Array<string>
|
|
152
142
|
}
|
|
153
143
|
|
|
@@ -178,7 +168,9 @@ export class Obligation {
|
|
|
178
168
|
/** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
|
|
179
169
|
readonly unhealthyBorrowValueSf: BN
|
|
180
170
|
/** The asset tier of the deposits */
|
|
181
|
-
readonly
|
|
171
|
+
readonly depositsAssetTiers: Array<number>
|
|
172
|
+
/** The asset tier of the borrows */
|
|
173
|
+
readonly borrowsAssetTiers: Array<number>
|
|
182
174
|
/** The elevation group id the obligation opted into. */
|
|
183
175
|
readonly elevationGroup: number
|
|
184
176
|
/** The number of obsolete reserves the obligation has a deposit in */
|
|
@@ -206,17 +198,10 @@ export class Obligation {
|
|
|
206
198
|
*/
|
|
207
199
|
readonly autodeleverageMarginCallStartedTimestamp: BN
|
|
208
200
|
/**
|
|
209
|
-
* Owner-defined,
|
|
201
|
+
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
210
202
|
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
211
203
|
*/
|
|
212
|
-
readonly
|
|
213
|
-
/**
|
|
214
|
-
* Owner-defined, permissionlessly-executed borrow order applicable to this obligation.
|
|
215
|
-
* Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation.
|
|
216
|
-
*/
|
|
217
|
-
readonly borrowOrder: types.BorrowOrder
|
|
218
|
-
/** The unstaking ticket pubkey for LST position closing */
|
|
219
|
-
readonly unstakeTicket: Address
|
|
204
|
+
readonly orders: Array<types.ObligationOrder>
|
|
220
205
|
readonly padding3: Array<BN>
|
|
221
206
|
|
|
222
207
|
static readonly discriminator = Buffer.from([
|
|
@@ -236,7 +221,8 @@ export class Obligation {
|
|
|
236
221
|
borsh.u128("borrowedAssetsMarketValueSf"),
|
|
237
222
|
borsh.u128("allowedBorrowValueSf"),
|
|
238
223
|
borsh.u128("unhealthyBorrowValueSf"),
|
|
239
|
-
borsh.array(borsh.u8(),
|
|
224
|
+
borsh.array(borsh.u8(), 8, "depositsAssetTiers"),
|
|
225
|
+
borsh.array(borsh.u8(), 5, "borrowsAssetTiers"),
|
|
240
226
|
borsh.u8("elevationGroup"),
|
|
241
227
|
borsh.u8("numOfObsoleteDepositReserves"),
|
|
242
228
|
borsh.u8("hasDebt"),
|
|
@@ -248,10 +234,8 @@ export class Obligation {
|
|
|
248
234
|
borsh.array(borsh.u8(), 4, "reserved"),
|
|
249
235
|
borsh.u64("highestBorrowFactorPct"),
|
|
250
236
|
borsh.u64("autodeleverageMarginCallStartedTimestamp"),
|
|
251
|
-
borsh.array(types.ObligationOrder.layout(), 2, "
|
|
252
|
-
|
|
253
|
-
borshAddress("unstakeTicket"),
|
|
254
|
-
borsh.array(borsh.u64(), 69, "padding3"),
|
|
237
|
+
borsh.array(types.ObligationOrder.layout(), 2, "orders"),
|
|
238
|
+
borsh.array(borsh.u64(), 93, "padding3"),
|
|
255
239
|
])
|
|
256
240
|
|
|
257
241
|
constructor(fields: ObligationFields) {
|
|
@@ -273,7 +257,8 @@ export class Obligation {
|
|
|
273
257
|
this.borrowedAssetsMarketValueSf = fields.borrowedAssetsMarketValueSf
|
|
274
258
|
this.allowedBorrowValueSf = fields.allowedBorrowValueSf
|
|
275
259
|
this.unhealthyBorrowValueSf = fields.unhealthyBorrowValueSf
|
|
276
|
-
this.
|
|
260
|
+
this.depositsAssetTiers = fields.depositsAssetTiers
|
|
261
|
+
this.borrowsAssetTiers = fields.borrowsAssetTiers
|
|
277
262
|
this.elevationGroup = fields.elevationGroup
|
|
278
263
|
this.numOfObsoleteDepositReserves = fields.numOfObsoleteDepositReserves
|
|
279
264
|
this.hasDebt = fields.hasDebt
|
|
@@ -286,11 +271,9 @@ export class Obligation {
|
|
|
286
271
|
this.highestBorrowFactorPct = fields.highestBorrowFactorPct
|
|
287
272
|
this.autodeleverageMarginCallStartedTimestamp =
|
|
288
273
|
fields.autodeleverageMarginCallStartedTimestamp
|
|
289
|
-
this.
|
|
274
|
+
this.orders = fields.orders.map(
|
|
290
275
|
(item) => new types.ObligationOrder({ ...item })
|
|
291
276
|
)
|
|
292
|
-
this.borrowOrder = new types.BorrowOrder({ ...fields.borrowOrder })
|
|
293
|
-
this.unstakeTicket = fields.unstakeTicket
|
|
294
277
|
this.padding3 = fields.padding3
|
|
295
278
|
}
|
|
296
279
|
|
|
@@ -363,7 +346,8 @@ export class Obligation {
|
|
|
363
346
|
borrowedAssetsMarketValueSf: dec.borrowedAssetsMarketValueSf,
|
|
364
347
|
allowedBorrowValueSf: dec.allowedBorrowValueSf,
|
|
365
348
|
unhealthyBorrowValueSf: dec.unhealthyBorrowValueSf,
|
|
366
|
-
|
|
349
|
+
depositsAssetTiers: dec.depositsAssetTiers,
|
|
350
|
+
borrowsAssetTiers: dec.borrowsAssetTiers,
|
|
367
351
|
elevationGroup: dec.elevationGroup,
|
|
368
352
|
numOfObsoleteDepositReserves: dec.numOfObsoleteDepositReserves,
|
|
369
353
|
hasDebt: dec.hasDebt,
|
|
@@ -376,13 +360,11 @@ export class Obligation {
|
|
|
376
360
|
highestBorrowFactorPct: dec.highestBorrowFactorPct,
|
|
377
361
|
autodeleverageMarginCallStartedTimestamp:
|
|
378
362
|
dec.autodeleverageMarginCallStartedTimestamp,
|
|
379
|
-
|
|
363
|
+
orders: dec.orders.map(
|
|
380
364
|
(
|
|
381
365
|
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
382
366
|
) => types.ObligationOrder.fromDecoded(item)
|
|
383
367
|
),
|
|
384
|
-
borrowOrder: types.BorrowOrder.fromDecoded(dec.borrowOrder),
|
|
385
|
-
unstakeTicket: dec.unstakeTicket,
|
|
386
368
|
padding3: dec.padding3,
|
|
387
369
|
})
|
|
388
370
|
}
|
|
@@ -403,7 +385,8 @@ export class Obligation {
|
|
|
403
385
|
borrowedAssetsMarketValueSf: this.borrowedAssetsMarketValueSf.toString(),
|
|
404
386
|
allowedBorrowValueSf: this.allowedBorrowValueSf.toString(),
|
|
405
387
|
unhealthyBorrowValueSf: this.unhealthyBorrowValueSf.toString(),
|
|
406
|
-
|
|
388
|
+
depositsAssetTiers: this.depositsAssetTiers,
|
|
389
|
+
borrowsAssetTiers: this.borrowsAssetTiers,
|
|
407
390
|
elevationGroup: this.elevationGroup,
|
|
408
391
|
numOfObsoleteDepositReserves: this.numOfObsoleteDepositReserves,
|
|
409
392
|
hasDebt: this.hasDebt,
|
|
@@ -416,9 +399,7 @@ export class Obligation {
|
|
|
416
399
|
highestBorrowFactorPct: this.highestBorrowFactorPct.toString(),
|
|
417
400
|
autodeleverageMarginCallStartedTimestamp:
|
|
418
401
|
this.autodeleverageMarginCallStartedTimestamp.toString(),
|
|
419
|
-
|
|
420
|
-
borrowOrder: this.borrowOrder.toJSON(),
|
|
421
|
-
unstakeTicket: this.unstakeTicket,
|
|
402
|
+
orders: this.orders.map((item) => item.toJSON()),
|
|
422
403
|
padding3: this.padding3.map((item) => item.toString()),
|
|
423
404
|
}
|
|
424
405
|
}
|
|
@@ -445,7 +426,8 @@ export class Obligation {
|
|
|
445
426
|
borrowedAssetsMarketValueSf: new BN(obj.borrowedAssetsMarketValueSf),
|
|
446
427
|
allowedBorrowValueSf: new BN(obj.allowedBorrowValueSf),
|
|
447
428
|
unhealthyBorrowValueSf: new BN(obj.unhealthyBorrowValueSf),
|
|
448
|
-
|
|
429
|
+
depositsAssetTiers: obj.depositsAssetTiers,
|
|
430
|
+
borrowsAssetTiers: obj.borrowsAssetTiers,
|
|
449
431
|
elevationGroup: obj.elevationGroup,
|
|
450
432
|
numOfObsoleteDepositReserves: obj.numOfObsoleteDepositReserves,
|
|
451
433
|
hasDebt: obj.hasDebt,
|
|
@@ -459,11 +441,7 @@ export class Obligation {
|
|
|
459
441
|
autodeleverageMarginCallStartedTimestamp: new BN(
|
|
460
442
|
obj.autodeleverageMarginCallStartedTimestamp
|
|
461
443
|
),
|
|
462
|
-
|
|
463
|
-
types.ObligationOrder.fromJSON(item)
|
|
464
|
-
),
|
|
465
|
-
borrowOrder: types.BorrowOrder.fromJSON(obj.borrowOrder),
|
|
466
|
-
unstakeTicket: address(obj.unstakeTicket),
|
|
444
|
+
orders: obj.orders.map((item) => types.ObligationOrder.fromJSON(item)),
|
|
467
445
|
padding3: obj.padding3.map((item) => new BN(item)),
|
|
468
446
|
})
|
|
469
447
|
}
|
|
@@ -39,8 +39,6 @@ export interface ReserveFields {
|
|
|
39
39
|
* elevation group when this reserve is part of the collaterals.
|
|
40
40
|
*/
|
|
41
41
|
borrowedAmountsAgainstThisReserveInElevationGroups: Array<BN>
|
|
42
|
-
/** The tracker of ticket-based withdrawals. */
|
|
43
|
-
withdrawQueue: types.WithdrawQueueFields
|
|
44
42
|
padding: Array<BN>
|
|
45
43
|
}
|
|
46
44
|
|
|
@@ -68,8 +66,6 @@ export interface ReserveJSON {
|
|
|
68
66
|
* elevation group when this reserve is part of the collaterals.
|
|
69
67
|
*/
|
|
70
68
|
borrowedAmountsAgainstThisReserveInElevationGroups: Array<string>
|
|
71
|
-
/** The tracker of ticket-based withdrawals. */
|
|
72
|
-
withdrawQueue: types.WithdrawQueueJSON
|
|
73
69
|
padding: Array<string>
|
|
74
70
|
}
|
|
75
71
|
|
|
@@ -97,8 +93,6 @@ export class Reserve {
|
|
|
97
93
|
* elevation group when this reserve is part of the collaterals.
|
|
98
94
|
*/
|
|
99
95
|
readonly borrowedAmountsAgainstThisReserveInElevationGroups: Array<BN>
|
|
100
|
-
/** The tracker of ticket-based withdrawals. */
|
|
101
|
-
readonly withdrawQueue: types.WithdrawQueue
|
|
102
96
|
readonly padding: Array<BN>
|
|
103
97
|
|
|
104
98
|
static readonly discriminator = Buffer.from([
|
|
@@ -116,15 +110,14 @@ export class Reserve {
|
|
|
116
110
|
types.ReserveCollateral.layout("collateral"),
|
|
117
111
|
borsh.array(borsh.u64(), 150, "reserveCollateralPadding"),
|
|
118
112
|
types.ReserveConfig.layout("config"),
|
|
119
|
-
borsh.array(borsh.u64(),
|
|
113
|
+
borsh.array(borsh.u64(), 116, "configPadding"),
|
|
120
114
|
borsh.u64("borrowedAmountOutsideElevationGroup"),
|
|
121
115
|
borsh.array(
|
|
122
116
|
borsh.u64(),
|
|
123
117
|
32,
|
|
124
118
|
"borrowedAmountsAgainstThisReserveInElevationGroups"
|
|
125
119
|
),
|
|
126
|
-
|
|
127
|
-
borsh.array(borsh.u64(), 204, "padding"),
|
|
120
|
+
borsh.array(borsh.u64(), 207, "padding"),
|
|
128
121
|
])
|
|
129
122
|
|
|
130
123
|
constructor(fields: ReserveFields) {
|
|
@@ -143,7 +136,6 @@ export class Reserve {
|
|
|
143
136
|
fields.borrowedAmountOutsideElevationGroup
|
|
144
137
|
this.borrowedAmountsAgainstThisReserveInElevationGroups =
|
|
145
138
|
fields.borrowedAmountsAgainstThisReserveInElevationGroups
|
|
146
|
-
this.withdrawQueue = new types.WithdrawQueue({ ...fields.withdrawQueue })
|
|
147
139
|
this.padding = fields.padding
|
|
148
140
|
}
|
|
149
141
|
|
|
@@ -210,7 +202,6 @@ export class Reserve {
|
|
|
210
202
|
dec.borrowedAmountOutsideElevationGroup,
|
|
211
203
|
borrowedAmountsAgainstThisReserveInElevationGroups:
|
|
212
204
|
dec.borrowedAmountsAgainstThisReserveInElevationGroups,
|
|
213
|
-
withdrawQueue: types.WithdrawQueue.fromDecoded(dec.withdrawQueue),
|
|
214
205
|
padding: dec.padding,
|
|
215
206
|
})
|
|
216
207
|
}
|
|
@@ -238,7 +229,6 @@ export class Reserve {
|
|
|
238
229
|
this.borrowedAmountsAgainstThisReserveInElevationGroups.map((item) =>
|
|
239
230
|
item.toString()
|
|
240
231
|
),
|
|
241
|
-
withdrawQueue: this.withdrawQueue.toJSON(),
|
|
242
232
|
padding: this.padding.map((item) => item.toString()),
|
|
243
233
|
}
|
|
244
234
|
}
|
|
@@ -267,7 +257,6 @@ export class Reserve {
|
|
|
267
257
|
obj.borrowedAmountsAgainstThisReserveInElevationGroups.map(
|
|
268
258
|
(item) => new BN(item)
|
|
269
259
|
),
|
|
270
|
-
withdrawQueue: types.WithdrawQueue.fromJSON(obj.withdrawQueue),
|
|
271
260
|
padding: obj.padding.map((item) => new BN(item)),
|
|
272
261
|
})
|
|
273
262
|
}
|
|
@@ -19,17 +19,42 @@ export interface UserStateFields {
|
|
|
19
19
|
userId: BN
|
|
20
20
|
farmState: Address
|
|
21
21
|
owner: Address
|
|
22
|
+
/** Indicate if this user state is part of a delegated farm */
|
|
22
23
|
isFarmDelegated: number
|
|
23
24
|
padding0: Array<number>
|
|
25
|
+
/**
|
|
26
|
+
* Rewards tally used for computation of gained rewards
|
|
27
|
+
* (scaled from `Decimal` representation).
|
|
28
|
+
*/
|
|
24
29
|
rewardsTallyScaled: Array<BN>
|
|
30
|
+
/** Number of reward tokens ready for claim */
|
|
25
31
|
rewardsIssuedUnclaimed: Array<BN>
|
|
26
32
|
lastClaimTs: Array<BN>
|
|
33
|
+
/**
|
|
34
|
+
* User stake deposited and usable, generating rewards and fees.
|
|
35
|
+
* (scaled from `Decimal` representation).
|
|
36
|
+
*/
|
|
27
37
|
activeStakeScaled: BN
|
|
38
|
+
/**
|
|
39
|
+
* User stake deposited but not usable and not generating rewards yet.
|
|
40
|
+
* (scaled from `Decimal` representation).
|
|
41
|
+
*/
|
|
28
42
|
pendingDepositStakeScaled: BN
|
|
43
|
+
/**
|
|
44
|
+
* After this timestamp, pending user stake can be moved to user stake
|
|
45
|
+
* Initialized to now() + delayed user stake period
|
|
46
|
+
*/
|
|
29
47
|
pendingDepositStakeTs: BN
|
|
48
|
+
/**
|
|
49
|
+
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
50
|
+
* (scaled from `Decimal` representation).
|
|
51
|
+
*/
|
|
30
52
|
pendingWithdrawalUnstakeScaled: BN
|
|
53
|
+
/** After this timestamp, user can withdraw their deposit. */
|
|
31
54
|
pendingWithdrawalUnstakeTs: BN
|
|
55
|
+
/** User bump used for account address validation */
|
|
32
56
|
bump: BN
|
|
57
|
+
/** Delegatee used for initialisation - useful to check against */
|
|
33
58
|
delegatee: Address
|
|
34
59
|
lastStakeTs: BN
|
|
35
60
|
padding1: Array<BN>
|
|
@@ -39,17 +64,42 @@ export interface UserStateJSON {
|
|
|
39
64
|
userId: string
|
|
40
65
|
farmState: string
|
|
41
66
|
owner: string
|
|
67
|
+
/** Indicate if this user state is part of a delegated farm */
|
|
42
68
|
isFarmDelegated: number
|
|
43
69
|
padding0: Array<number>
|
|
70
|
+
/**
|
|
71
|
+
* Rewards tally used for computation of gained rewards
|
|
72
|
+
* (scaled from `Decimal` representation).
|
|
73
|
+
*/
|
|
44
74
|
rewardsTallyScaled: Array<string>
|
|
75
|
+
/** Number of reward tokens ready for claim */
|
|
45
76
|
rewardsIssuedUnclaimed: Array<string>
|
|
46
77
|
lastClaimTs: Array<string>
|
|
78
|
+
/**
|
|
79
|
+
* User stake deposited and usable, generating rewards and fees.
|
|
80
|
+
* (scaled from `Decimal` representation).
|
|
81
|
+
*/
|
|
47
82
|
activeStakeScaled: string
|
|
83
|
+
/**
|
|
84
|
+
* User stake deposited but not usable and not generating rewards yet.
|
|
85
|
+
* (scaled from `Decimal` representation).
|
|
86
|
+
*/
|
|
48
87
|
pendingDepositStakeScaled: string
|
|
88
|
+
/**
|
|
89
|
+
* After this timestamp, pending user stake can be moved to user stake
|
|
90
|
+
* Initialized to now() + delayed user stake period
|
|
91
|
+
*/
|
|
49
92
|
pendingDepositStakeTs: string
|
|
93
|
+
/**
|
|
94
|
+
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
95
|
+
* (scaled from `Decimal` representation).
|
|
96
|
+
*/
|
|
50
97
|
pendingWithdrawalUnstakeScaled: string
|
|
98
|
+
/** After this timestamp, user can withdraw their deposit. */
|
|
51
99
|
pendingWithdrawalUnstakeTs: string
|
|
100
|
+
/** User bump used for account address validation */
|
|
52
101
|
bump: string
|
|
102
|
+
/** Delegatee used for initialisation - useful to check against */
|
|
53
103
|
delegatee: string
|
|
54
104
|
lastStakeTs: string
|
|
55
105
|
padding1: Array<string>
|
|
@@ -59,17 +109,42 @@ export class UserState {
|
|
|
59
109
|
readonly userId: BN
|
|
60
110
|
readonly farmState: Address
|
|
61
111
|
readonly owner: Address
|
|
112
|
+
/** Indicate if this user state is part of a delegated farm */
|
|
62
113
|
readonly isFarmDelegated: number
|
|
63
114
|
readonly padding0: Array<number>
|
|
115
|
+
/**
|
|
116
|
+
* Rewards tally used for computation of gained rewards
|
|
117
|
+
* (scaled from `Decimal` representation).
|
|
118
|
+
*/
|
|
64
119
|
readonly rewardsTallyScaled: Array<BN>
|
|
120
|
+
/** Number of reward tokens ready for claim */
|
|
65
121
|
readonly rewardsIssuedUnclaimed: Array<BN>
|
|
66
122
|
readonly lastClaimTs: Array<BN>
|
|
123
|
+
/**
|
|
124
|
+
* User stake deposited and usable, generating rewards and fees.
|
|
125
|
+
* (scaled from `Decimal` representation).
|
|
126
|
+
*/
|
|
67
127
|
readonly activeStakeScaled: BN
|
|
128
|
+
/**
|
|
129
|
+
* User stake deposited but not usable and not generating rewards yet.
|
|
130
|
+
* (scaled from `Decimal` representation).
|
|
131
|
+
*/
|
|
68
132
|
readonly pendingDepositStakeScaled: BN
|
|
133
|
+
/**
|
|
134
|
+
* After this timestamp, pending user stake can be moved to user stake
|
|
135
|
+
* Initialized to now() + delayed user stake period
|
|
136
|
+
*/
|
|
69
137
|
readonly pendingDepositStakeTs: BN
|
|
138
|
+
/**
|
|
139
|
+
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
140
|
+
* (scaled from `Decimal` representation).
|
|
141
|
+
*/
|
|
70
142
|
readonly pendingWithdrawalUnstakeScaled: BN
|
|
143
|
+
/** After this timestamp, user can withdraw their deposit. */
|
|
71
144
|
readonly pendingWithdrawalUnstakeTs: BN
|
|
145
|
+
/** User bump used for account address validation */
|
|
72
146
|
readonly bump: BN
|
|
147
|
+
/** Delegatee used for initialisation - useful to check against */
|
|
73
148
|
readonly delegatee: Address
|
|
74
149
|
readonly lastStakeTs: BN
|
|
75
150
|
readonly padding1: Array<BN>
|
|
@@ -19,9 +19,3 @@ export { UserMetadata } from "./UserMetadata"
|
|
|
19
19
|
export type { UserMetadataFields, UserMetadataJSON } from "./UserMetadata"
|
|
20
20
|
export { Reserve } from "./Reserve"
|
|
21
21
|
export type { ReserveFields, ReserveJSON } from "./Reserve"
|
|
22
|
-
export { WithdrawTicket } from "./WithdrawTicket"
|
|
23
|
-
export type { WithdrawTicketFields, WithdrawTicketJSON } from "./WithdrawTicket"
|
|
24
|
-
export { PoolState } from "./PoolState"
|
|
25
|
-
export type { PoolStateFields, PoolStateJSON } from "./PoolState"
|
|
26
|
-
export { UnstakeTicket } from "./UnstakeTicket"
|
|
27
|
-
export type { UnstakeTicketFields, UnstakeTicketJSON } from "./UnstakeTicket"
|