@kamino-finance/klend-sdk 5.11.18 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/action.d.ts +9 -1
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +15 -1
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/fraction.d.ts +6 -5
- package/dist/classes/fraction.d.ts.map +1 -1
- package/dist/classes/fraction.js +13 -8
- package/dist/classes/fraction.js.map +1 -1
- package/dist/classes/manager.d.ts +1 -1
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +10 -0
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/obligation.d.ts +54 -1
- package/dist/classes/obligation.d.ts.map +1 -1
- package/dist/classes/obligation.js +47 -1
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/obligationOrder.d.ts +206 -0
- package/dist/classes/obligationOrder.d.ts.map +1 -0
- package/dist/classes/obligationOrder.js +359 -0
- package/dist/classes/obligationOrder.js.map +1 -0
- package/dist/classes/reserve.d.ts +5 -5
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +80 -264
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/types.d.ts +14 -1
- package/dist/classes/types.d.ts.map +1 -1
- package/dist/classes/utils.d.ts +9 -0
- package/dist/classes/utils.d.ts.map +1 -1
- package/dist/classes/utils.js +21 -0
- package/dist/classes/utils.js.map +1 -1
- package/dist/client_kamino_manager.js +6 -6
- package/dist/client_kamino_manager.js.map +1 -1
- package/dist/idl.json +244 -23
- package/dist/idl_codegen/accounts/LendingMarket.d.ts +12 -6
- package/dist/idl_codegen/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/idl_codegen/accounts/LendingMarket.js +15 -3
- package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -1
- package/dist/idl_codegen/accounts/Obligation.d.ts +27 -6
- package/dist/idl_codegen/accounts/Obligation.d.ts.map +1 -1
- package/dist/idl_codegen/accounts/Obligation.js +26 -9
- package/dist/idl_codegen/accounts/Obligation.js.map +1 -1
- package/dist/idl_codegen/errors/custom.d.ts +36 -4
- package/dist/idl_codegen/errors/custom.d.ts.map +1 -1
- package/dist/idl_codegen/errors/custom.js +64 -8
- package/dist/idl_codegen/errors/custom.js.map +1 -1
- package/dist/idl_codegen/instructions/index.d.ts +2 -0
- package/dist/idl_codegen/instructions/index.d.ts.map +1 -1
- package/dist/idl_codegen/instructions/index.js +3 -1
- package/dist/idl_codegen/instructions/index.js.map +1 -1
- package/dist/idl_codegen/instructions/setObligationOrder.d.ts +14 -0
- package/dist/idl_codegen/instructions/setObligationOrder.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/setObligationOrder.js +62 -0
- package/dist/idl_codegen/instructions/setObligationOrder.js.map +1 -0
- package/dist/idl_codegen/types/ObligationOrder.d.ts +284 -0
- package/dist/idl_codegen/types/ObligationOrder.d.ts.map +1 -0
- package/dist/idl_codegen/types/ObligationOrder.js +205 -0
- package/dist/idl_codegen/types/ObligationOrder.js.map +1 -0
- package/dist/idl_codegen/types/ReserveConfig.d.ts +26 -11
- package/dist/idl_codegen/types/ReserveConfig.d.ts.map +1 -1
- package/dist/idl_codegen/types/ReserveConfig.js +15 -10
- package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts +34 -21
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/idl_codegen/types/UpdateConfigMode.js +58 -34
- package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +13 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js +25 -1
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/idl_codegen/types/index.d.ts +6 -4
- package/dist/idl_codegen/types/index.d.ts.map +1 -1
- package/dist/idl_codegen/types/index.js +3 -1
- package/dist/idl_codegen/types/index.js.map +1 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +13 -6
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts.map +1 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.js +25 -11
- package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -1
- package/dist/utils/instruction.d.ts +1 -1
- package/dist/utils/instruction.d.ts.map +1 -1
- package/dist/utils/instruction.js +5 -1
- package/dist/utils/instruction.js.map +1 -1
- package/dist/utils/managerTypes.js +2 -2
- package/dist/utils/managerTypes.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/action.ts +26 -1
- package/src/classes/fraction.ts +16 -12
- package/src/classes/manager.ts +13 -0
- package/src/classes/obligation.ts +77 -1
- package/src/classes/obligationOrder.ts +514 -0
- package/src/classes/reserve.ts +257 -336
- package/src/classes/types.ts +15 -1
- package/src/classes/utils.ts +21 -0
- package/src/client_kamino_manager.ts +6 -6
- package/src/idl.json +244 -23
- package/src/idl_codegen/accounts/LendingMarket.ts +23 -7
- package/src/idl_codegen/accounts/Obligation.ts +50 -13
- package/src/idl_codegen/errors/custom.ts +68 -6
- package/src/idl_codegen/instructions/index.ts +5 -0
- package/src/idl_codegen/instructions/setObligationOrder.ts +45 -0
- package/src/idl_codegen/types/ObligationOrder.ts +347 -0
- package/src/idl_codegen/types/ReserveConfig.ts +31 -16
- package/src/idl_codegen/types/UpdateConfigMode.ts +69 -39
- package/src/idl_codegen/types/UpdateLendingMarketMode.ts +30 -0
- package/src/idl_codegen/types/index.ts +15 -6
- package/src/idl_codegen/zero_padding/ObligationZP.ts +37 -15
- package/src/utils/instruction.ts +5 -1
- package/src/utils/managerTypes.ts +2 -2
|
@@ -509,6 +509,29 @@ export class UpdateInitialDepositAmount {
|
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
+
export interface UpdateObligationOrdersEnabledJSON {
|
|
513
|
+
kind: "UpdateObligationOrdersEnabled"
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export class UpdateObligationOrdersEnabled {
|
|
517
|
+
static readonly discriminator = 22
|
|
518
|
+
static readonly kind = "UpdateObligationOrdersEnabled"
|
|
519
|
+
readonly discriminator = 22
|
|
520
|
+
readonly kind = "UpdateObligationOrdersEnabled"
|
|
521
|
+
|
|
522
|
+
toJSON(): UpdateObligationOrdersEnabledJSON {
|
|
523
|
+
return {
|
|
524
|
+
kind: "UpdateObligationOrdersEnabled",
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
toEncodable() {
|
|
529
|
+
return {
|
|
530
|
+
UpdateObligationOrdersEnabled: {},
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
512
535
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
513
536
|
export function fromDecoded(obj: any): types.UpdateLendingMarketModeKind {
|
|
514
537
|
if (typeof obj !== "object") {
|
|
@@ -581,6 +604,9 @@ export function fromDecoded(obj: any): types.UpdateLendingMarketModeKind {
|
|
|
581
604
|
if ("UpdateInitialDepositAmount" in obj) {
|
|
582
605
|
return new UpdateInitialDepositAmount()
|
|
583
606
|
}
|
|
607
|
+
if ("UpdateObligationOrdersEnabled" in obj) {
|
|
608
|
+
return new UpdateObligationOrdersEnabled()
|
|
609
|
+
}
|
|
584
610
|
|
|
585
611
|
throw new Error("Invalid enum object")
|
|
586
612
|
}
|
|
@@ -655,6 +681,9 @@ export function fromJSON(
|
|
|
655
681
|
case "UpdateInitialDepositAmount": {
|
|
656
682
|
return new UpdateInitialDepositAmount()
|
|
657
683
|
}
|
|
684
|
+
case "UpdateObligationOrdersEnabled": {
|
|
685
|
+
return new UpdateObligationOrdersEnabled()
|
|
686
|
+
}
|
|
658
687
|
}
|
|
659
688
|
}
|
|
660
689
|
|
|
@@ -682,6 +711,7 @@ export function layout(property?: string) {
|
|
|
682
711
|
borsh.struct([], "UpdateName"),
|
|
683
712
|
borsh.struct([], "UpdateIndividualAutodeleverageMarginCallPeriodSecs"),
|
|
684
713
|
borsh.struct([], "UpdateInitialDepositAmount"),
|
|
714
|
+
borsh.struct([], "UpdateObligationOrdersEnabled"),
|
|
685
715
|
])
|
|
686
716
|
if (property !== undefined) {
|
|
687
717
|
return ret.replicate(property)
|
|
@@ -16,7 +16,7 @@ export type UpdateConfigModeKind =
|
|
|
16
16
|
| UpdateConfigMode.UpdateProtocolTakeRate
|
|
17
17
|
| UpdateConfigMode.UpdateFeesBorrowFee
|
|
18
18
|
| UpdateConfigMode.UpdateFeesFlashLoanFee
|
|
19
|
-
| UpdateConfigMode.
|
|
19
|
+
| UpdateConfigMode.DeprecatedUpdateFeesReferralFeeBps
|
|
20
20
|
| UpdateConfigMode.UpdateDepositLimit
|
|
21
21
|
| UpdateConfigMode.UpdateBorrowLimit
|
|
22
22
|
| UpdateConfigMode.UpdateTokenInfoLowerHeuristic
|
|
@@ -36,8 +36,8 @@ export type UpdateConfigModeKind =
|
|
|
36
36
|
| UpdateConfigMode.UpdateEntireReserveConfig
|
|
37
37
|
| UpdateConfigMode.UpdateDebtWithdrawalCap
|
|
38
38
|
| UpdateConfigMode.UpdateDepositWithdrawalCap
|
|
39
|
-
| UpdateConfigMode.
|
|
40
|
-
| UpdateConfigMode.
|
|
39
|
+
| UpdateConfigMode.DeprecatedUpdateDebtWithdrawalCapCurrentTotal
|
|
40
|
+
| UpdateConfigMode.DeprecatedUpdateDepositWithdrawalCapCurrentTotal
|
|
41
41
|
| UpdateConfigMode.UpdateBadDebtLiquidationBonusBps
|
|
42
42
|
| UpdateConfigMode.UpdateMinLiquidationBonusBps
|
|
43
43
|
| UpdateConfigMode.UpdateDeleveragingMarginCallPeriod
|
|
@@ -58,6 +58,7 @@ export type UpdateConfigModeKind =
|
|
|
58
58
|
| UpdateConfigMode.UpdateHostFixedInterestRateBps
|
|
59
59
|
| UpdateConfigMode.UpdateAutodeleverageEnabled
|
|
60
60
|
| UpdateConfigMode.UpdateDeleveragingBonusIncreaseBpsPerDay
|
|
61
|
+
| UpdateConfigMode.UpdateProtocolOrderExecutionFee
|
|
61
62
|
export type UpdateConfigModeJSON =
|
|
62
63
|
| UpdateConfigMode.UpdateLoanToValuePctJSON
|
|
63
64
|
| UpdateConfigMode.UpdateMaxLiquidationBonusBpsJSON
|
|
@@ -66,7 +67,7 @@ export type UpdateConfigModeJSON =
|
|
|
66
67
|
| UpdateConfigMode.UpdateProtocolTakeRateJSON
|
|
67
68
|
| UpdateConfigMode.UpdateFeesBorrowFeeJSON
|
|
68
69
|
| UpdateConfigMode.UpdateFeesFlashLoanFeeJSON
|
|
69
|
-
| UpdateConfigMode.
|
|
70
|
+
| UpdateConfigMode.DeprecatedUpdateFeesReferralFeeBpsJSON
|
|
70
71
|
| UpdateConfigMode.UpdateDepositLimitJSON
|
|
71
72
|
| UpdateConfigMode.UpdateBorrowLimitJSON
|
|
72
73
|
| UpdateConfigMode.UpdateTokenInfoLowerHeuristicJSON
|
|
@@ -86,8 +87,8 @@ export type UpdateConfigModeJSON =
|
|
|
86
87
|
| UpdateConfigMode.UpdateEntireReserveConfigJSON
|
|
87
88
|
| UpdateConfigMode.UpdateDebtWithdrawalCapJSON
|
|
88
89
|
| UpdateConfigMode.UpdateDepositWithdrawalCapJSON
|
|
89
|
-
| UpdateConfigMode.
|
|
90
|
-
| UpdateConfigMode.
|
|
90
|
+
| UpdateConfigMode.DeprecatedUpdateDebtWithdrawalCapCurrentTotalJSON
|
|
91
|
+
| UpdateConfigMode.DeprecatedUpdateDepositWithdrawalCapCurrentTotalJSON
|
|
91
92
|
| UpdateConfigMode.UpdateBadDebtLiquidationBonusBpsJSON
|
|
92
93
|
| UpdateConfigMode.UpdateMinLiquidationBonusBpsJSON
|
|
93
94
|
| UpdateConfigMode.UpdateDeleveragingMarginCallPeriodJSON
|
|
@@ -108,6 +109,7 @@ export type UpdateConfigModeJSON =
|
|
|
108
109
|
| UpdateConfigMode.UpdateHostFixedInterestRateBpsJSON
|
|
109
110
|
| UpdateConfigMode.UpdateAutodeleverageEnabledJSON
|
|
110
111
|
| UpdateConfigMode.UpdateDeleveragingBonusIncreaseBpsPerDayJSON
|
|
112
|
+
| UpdateConfigMode.UpdateProtocolOrderExecutionFeeJSON
|
|
111
113
|
|
|
112
114
|
export { UpdateLendingMarketConfigValue }
|
|
113
115
|
|
|
@@ -157,6 +159,7 @@ export type UpdateLendingMarketModeKind =
|
|
|
157
159
|
| UpdateLendingMarketMode.UpdateName
|
|
158
160
|
| UpdateLendingMarketMode.UpdateIndividualAutodeleverageMarginCallPeriodSecs
|
|
159
161
|
| UpdateLendingMarketMode.UpdateInitialDepositAmount
|
|
162
|
+
| UpdateLendingMarketMode.UpdateObligationOrdersEnabled
|
|
160
163
|
export type UpdateLendingMarketModeJSON =
|
|
161
164
|
| UpdateLendingMarketMode.UpdateOwnerJSON
|
|
162
165
|
| UpdateLendingMarketMode.UpdateEmergencyModeJSON
|
|
@@ -180,6 +183,7 @@ export type UpdateLendingMarketModeJSON =
|
|
|
180
183
|
| UpdateLendingMarketMode.UpdateNameJSON
|
|
181
184
|
| UpdateLendingMarketMode.UpdateIndividualAutodeleverageMarginCallPeriodSecsJSON
|
|
182
185
|
| UpdateLendingMarketMode.UpdateInitialDepositAmountJSON
|
|
186
|
+
| UpdateLendingMarketMode.UpdateObligationOrdersEnabledJSON
|
|
183
187
|
|
|
184
188
|
export { LastUpdate } from "./LastUpdate"
|
|
185
189
|
export type { LastUpdateFields, LastUpdateJSON } from "./LastUpdate"
|
|
@@ -200,6 +204,11 @@ export type {
|
|
|
200
204
|
ObligationLiquidityFields,
|
|
201
205
|
ObligationLiquidityJSON,
|
|
202
206
|
} from "./ObligationLiquidity"
|
|
207
|
+
export { ObligationOrder } from "./ObligationOrder"
|
|
208
|
+
export type {
|
|
209
|
+
ObligationOrderFields,
|
|
210
|
+
ObligationOrderJSON,
|
|
211
|
+
} from "./ObligationOrder"
|
|
203
212
|
export { AssetTier }
|
|
204
213
|
|
|
205
214
|
export type AssetTierKind =
|
|
@@ -40,8 +40,8 @@ export class ObligationZP {
|
|
|
40
40
|
readonly borrowsAssetTiers: Array<number>
|
|
41
41
|
/** The elevation group id the obligation opted into. */
|
|
42
42
|
readonly elevationGroup: number
|
|
43
|
-
/** The number of
|
|
44
|
-
readonly
|
|
43
|
+
/** The number of obsolete reserves the obligation has a deposit in */
|
|
44
|
+
readonly numOfObsoleteDepositReserves: number
|
|
45
45
|
/** Marked = 1 if borrows array is not empty, 0 = borrows empty */
|
|
46
46
|
readonly hasDebt: number
|
|
47
47
|
/** Wallet address of the referrer */
|
|
@@ -49,19 +49,26 @@ export class ObligationZP {
|
|
|
49
49
|
/** Marked = 1 if borrowing disabled, 0 = borrowing enabled */
|
|
50
50
|
readonly borrowingDisabled: number
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
* Only effective when `deleveraging_margin_call_started_slot != 0`.
|
|
54
|
-
|
|
52
|
+
* A target LTV set by the risk council when marking this obligation for deleveraging.
|
|
53
|
+
* Only effective when `deleveraging_margin_call_started_slot != 0`.
|
|
54
|
+
*/
|
|
55
55
|
readonly autodeleverageTargetLtvPct: number
|
|
56
56
|
/** The lowest max LTV found amongst the collateral deposits */
|
|
57
57
|
readonly lowestReserveDepositMaxLtvPct: number
|
|
58
|
+
/** The number of obsolete reserves the obligation has a borrow in */
|
|
59
|
+
readonly numOfObsoleteBorrowReserves: number
|
|
58
60
|
readonly reserved: Array<number>
|
|
59
61
|
readonly highestBorrowFactorPct: BN
|
|
60
|
-
/**
|
|
62
|
+
/**
|
|
61
63
|
* A timestamp at which the risk council most-recently marked this obligation for deleveraging.
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
+
* Zero if not currently subject to deleveraging.
|
|
65
|
+
*/
|
|
64
66
|
readonly autodeleverageMarginCallStartedTimestamp: BN
|
|
67
|
+
/**
|
|
68
|
+
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
69
|
+
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
70
|
+
*/
|
|
71
|
+
readonly orders: Array<types.ObligationOrder>
|
|
65
72
|
readonly padding3: Array<BN> = new Array(0)
|
|
66
73
|
|
|
67
74
|
static readonly layout = borsh.struct([
|
|
@@ -80,15 +87,17 @@ export class ObligationZP {
|
|
|
80
87
|
borsh.array(borsh.u8(), 8, "depositsAssetTiers"),
|
|
81
88
|
borsh.array(borsh.u8(), 5, "borrowsAssetTiers"),
|
|
82
89
|
borsh.u8("elevationGroup"),
|
|
83
|
-
borsh.u8("
|
|
90
|
+
borsh.u8("numOfObsoleteDepositReserves"),
|
|
84
91
|
borsh.u8("hasDebt"),
|
|
85
92
|
borsh.publicKey("referrer"),
|
|
86
93
|
borsh.u8("borrowingDisabled"),
|
|
87
94
|
borsh.u8("autodeleverageTargetLtvPct"),
|
|
88
95
|
borsh.u8("lowestReserveDepositMaxLtvPct"),
|
|
89
|
-
borsh.
|
|
96
|
+
borsh.u8("numOfObsoleteBorrowReserves"),
|
|
97
|
+
borsh.array(borsh.u8(), 4, "reserved"),
|
|
90
98
|
borsh.u64("highestBorrowFactorPct"),
|
|
91
99
|
borsh.u64("autodeleverageMarginCallStartedTimestamp"),
|
|
100
|
+
borsh.array(types.ObligationOrder.layout(), 2, "orders"),
|
|
92
101
|
])
|
|
93
102
|
|
|
94
103
|
constructor(fields: ObligationFields) {
|
|
@@ -113,15 +122,20 @@ export class ObligationZP {
|
|
|
113
122
|
this.depositsAssetTiers = fields.depositsAssetTiers
|
|
114
123
|
this.borrowsAssetTiers = fields.borrowsAssetTiers
|
|
115
124
|
this.elevationGroup = fields.elevationGroup
|
|
116
|
-
this.
|
|
125
|
+
this.numOfObsoleteDepositReserves = fields.numOfObsoleteDepositReserves
|
|
117
126
|
this.hasDebt = fields.hasDebt
|
|
118
127
|
this.referrer = fields.referrer
|
|
119
128
|
this.borrowingDisabled = fields.borrowingDisabled
|
|
120
129
|
this.autodeleverageTargetLtvPct = fields.autodeleverageTargetLtvPct
|
|
121
130
|
this.lowestReserveDepositMaxLtvPct = fields.lowestReserveDepositMaxLtvPct
|
|
131
|
+
this.numOfObsoleteBorrowReserves = fields.numOfObsoleteBorrowReserves
|
|
122
132
|
this.reserved = new Array<number>(0)
|
|
123
133
|
this.highestBorrowFactorPct = fields.highestBorrowFactorPct
|
|
124
|
-
this.autodeleverageMarginCallStartedTimestamp =
|
|
134
|
+
this.autodeleverageMarginCallStartedTimestamp =
|
|
135
|
+
fields.autodeleverageMarginCallStartedTimestamp
|
|
136
|
+
this.orders = fields.orders.map(
|
|
137
|
+
(item) => new types.ObligationOrder({ ...item })
|
|
138
|
+
)
|
|
125
139
|
this.padding3 = new Array<BN>(0);
|
|
126
140
|
}
|
|
127
141
|
|
|
@@ -178,7 +192,8 @@ export class ObligationZP {
|
|
|
178
192
|
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
179
193
|
) => types.ObligationCollateral.fromDecoded(item)
|
|
180
194
|
),
|
|
181
|
-
lowestReserveDepositLiquidationLtv:
|
|
195
|
+
lowestReserveDepositLiquidationLtv:
|
|
196
|
+
dec.lowestReserveDepositLiquidationLtv,
|
|
182
197
|
depositedValueSf: dec.depositedValueSf,
|
|
183
198
|
borrows: dec.borrows.map(
|
|
184
199
|
(
|
|
@@ -192,15 +207,22 @@ export class ObligationZP {
|
|
|
192
207
|
depositsAssetTiers: dec.depositsAssetTiers,
|
|
193
208
|
borrowsAssetTiers: dec.borrowsAssetTiers,
|
|
194
209
|
elevationGroup: dec.elevationGroup,
|
|
195
|
-
|
|
210
|
+
numOfObsoleteDepositReserves: dec.numOfObsoleteDepositReserves,
|
|
196
211
|
hasDebt: dec.hasDebt,
|
|
197
212
|
referrer: dec.referrer,
|
|
198
213
|
borrowingDisabled: dec.borrowingDisabled,
|
|
199
214
|
autodeleverageTargetLtvPct: dec.autodeleverageTargetLtvPct,
|
|
200
215
|
lowestReserveDepositMaxLtvPct: dec.lowestReserveDepositMaxLtvPct,
|
|
216
|
+
numOfObsoleteBorrowReserves: dec.numOfObsoleteBorrowReserves,
|
|
201
217
|
reserved: dec.reserved,
|
|
202
218
|
highestBorrowFactorPct: dec.highestBorrowFactorPct,
|
|
203
|
-
autodeleverageMarginCallStartedTimestamp:
|
|
219
|
+
autodeleverageMarginCallStartedTimestamp:
|
|
220
|
+
dec.autodeleverageMarginCallStartedTimestamp,
|
|
221
|
+
orders: dec.orders.map(
|
|
222
|
+
(
|
|
223
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
224
|
+
) => types.ObligationOrder.fromDecoded(item)
|
|
225
|
+
),
|
|
204
226
|
padding3: [],
|
|
205
227
|
})
|
|
206
228
|
}
|
package/src/utils/instruction.ts
CHANGED
|
@@ -28,7 +28,8 @@ export async function buildAndSendTxnWithLogs(
|
|
|
28
28
|
owner: Keypair,
|
|
29
29
|
signers: Signer[],
|
|
30
30
|
withLogsIfSuccess: boolean = false,
|
|
31
|
-
withDescription: string = ''
|
|
31
|
+
withDescription: string = '',
|
|
32
|
+
throwOnError: boolean = false // TODO(error-surfacing): the "recovery" logic is broken/outdated + the "hide error" behavior seems wrong in general - migrate to "just throw"
|
|
32
33
|
): Promise<TransactionSignature> {
|
|
33
34
|
tx.sign([owner, ...signers]);
|
|
34
35
|
|
|
@@ -47,6 +48,9 @@ export async function buildAndSendTxnWithLogs(
|
|
|
47
48
|
}
|
|
48
49
|
return sig;
|
|
49
50
|
} catch (e: any) {
|
|
51
|
+
if (throwOnError) {
|
|
52
|
+
throw e;
|
|
53
|
+
}
|
|
50
54
|
console.log(e);
|
|
51
55
|
process.stdout.write(e.logs.toString());
|
|
52
56
|
const sig = e.toString().split(' failed ')[0].split('Transaction ')[1];
|
|
@@ -292,6 +292,7 @@ function buildReserveConfig(fields: {
|
|
|
292
292
|
liquidationThresholdPct: fields.configParams.liquidationThresholdPct,
|
|
293
293
|
minLiquidationBonusBps: fields.configParams.minLiquidationBonusBps,
|
|
294
294
|
protocolLiquidationFeePct: 0,
|
|
295
|
+
protocolOrderExecutionFeePct: 0,
|
|
295
296
|
protocolTakeRatePct: fields.configParams.protocolTakeRate,
|
|
296
297
|
assetTier: 0,
|
|
297
298
|
maxLiquidationBonusBps: fields.configParams.maxLiquidationBonusBps,
|
|
@@ -345,8 +346,7 @@ function buildReserveConfig(fields: {
|
|
|
345
346
|
borrowLimitAgainstThisCollateralInElevationGroup: Array(32).fill(new BN(0)),
|
|
346
347
|
deleveragingBonusIncreaseBpsPerDay: new BN(100),
|
|
347
348
|
reserved1: Array(1).fill(0),
|
|
348
|
-
reserved2: Array(
|
|
349
|
-
reserved3: Array(8).fill(0),
|
|
349
|
+
reserved2: Array(9).fill(0),
|
|
350
350
|
};
|
|
351
351
|
|
|
352
352
|
return new ReserveConfig(reserveConfigFields);
|