@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
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
2
|
-
import BN from "bn.js";
|
|
3
|
-
import * as types from "../types";
|
|
4
|
-
export interface BorrowOrderFields {
|
|
5
|
-
/**
|
|
6
|
-
* The asset to be borrowed.
|
|
7
|
-
* The reserves used for [Obligation::borrows] *must* all provide exactly this asset.
|
|
8
|
-
*/
|
|
9
|
-
debtLiquidityMint: Address;
|
|
10
|
-
/** The amount of debt that still needs to be filled, in lamports. */
|
|
11
|
-
remainingDebtAmount: BN;
|
|
12
|
-
/**
|
|
13
|
-
* The token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint],
|
|
14
|
-
* where the filled funds should be transferred to.
|
|
15
|
-
*/
|
|
16
|
-
filledDebtDestination: Address;
|
|
17
|
-
/**
|
|
18
|
-
* The minimum allowed debt term that the obligation owner agrees to.
|
|
19
|
-
* The reserves used to fill this order *cannot* define their debt term *lower* than this.
|
|
20
|
-
*
|
|
21
|
-
* If zeroed, then only indefinite-term reserves may be used.
|
|
22
|
-
*/
|
|
23
|
-
minDebtTermSeconds: BN;
|
|
24
|
-
/** The time until which the borrow order can still be filled. */
|
|
25
|
-
fillableUntilTimestamp: BN;
|
|
26
|
-
/**
|
|
27
|
-
* The time at which this order was placed.
|
|
28
|
-
* Currently, this is only a piece of metadata.
|
|
29
|
-
*/
|
|
30
|
-
placedAtTimestamp: BN;
|
|
31
|
-
/**
|
|
32
|
-
* The time at which this order was most-recently updated (including: created).
|
|
33
|
-
* Currently, this is only a piece of metadata.
|
|
34
|
-
*/
|
|
35
|
-
lastUpdatedAtTimestamp: BN;
|
|
36
|
-
/**
|
|
37
|
-
* The amount of debt that was originally requested when this order was most-recently updated.
|
|
38
|
-
* In other words: this field holds a value of [Self::remaining_debt_amount] captured at
|
|
39
|
-
* [Self::last_updated_at_timestamp].
|
|
40
|
-
* Currently, this is only a piece of metadata.
|
|
41
|
-
*/
|
|
42
|
-
requestedDebtAmount: BN;
|
|
43
|
-
/**
|
|
44
|
-
* The maximum borrow rate that the obligation owner agrees to.
|
|
45
|
-
* The reserves used for [Obligation::borrows] *cannot* define their maximum borrow rate
|
|
46
|
-
* *higher* than this.
|
|
47
|
-
*/
|
|
48
|
-
maxBorrowRateBps: number;
|
|
49
|
-
/** Alignment padding. */
|
|
50
|
-
padding1: Array<number>;
|
|
51
|
-
/** End padding. */
|
|
52
|
-
endPadding: Array<BN>;
|
|
53
|
-
}
|
|
54
|
-
export interface BorrowOrderJSON {
|
|
55
|
-
/**
|
|
56
|
-
* The asset to be borrowed.
|
|
57
|
-
* The reserves used for [Obligation::borrows] *must* all provide exactly this asset.
|
|
58
|
-
*/
|
|
59
|
-
debtLiquidityMint: string;
|
|
60
|
-
/** The amount of debt that still needs to be filled, in lamports. */
|
|
61
|
-
remainingDebtAmount: string;
|
|
62
|
-
/**
|
|
63
|
-
* The token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint],
|
|
64
|
-
* where the filled funds should be transferred to.
|
|
65
|
-
*/
|
|
66
|
-
filledDebtDestination: string;
|
|
67
|
-
/**
|
|
68
|
-
* The minimum allowed debt term that the obligation owner agrees to.
|
|
69
|
-
* The reserves used to fill this order *cannot* define their debt term *lower* than this.
|
|
70
|
-
*
|
|
71
|
-
* If zeroed, then only indefinite-term reserves may be used.
|
|
72
|
-
*/
|
|
73
|
-
minDebtTermSeconds: string;
|
|
74
|
-
/** The time until which the borrow order can still be filled. */
|
|
75
|
-
fillableUntilTimestamp: string;
|
|
76
|
-
/**
|
|
77
|
-
* The time at which this order was placed.
|
|
78
|
-
* Currently, this is only a piece of metadata.
|
|
79
|
-
*/
|
|
80
|
-
placedAtTimestamp: string;
|
|
81
|
-
/**
|
|
82
|
-
* The time at which this order was most-recently updated (including: created).
|
|
83
|
-
* Currently, this is only a piece of metadata.
|
|
84
|
-
*/
|
|
85
|
-
lastUpdatedAtTimestamp: string;
|
|
86
|
-
/**
|
|
87
|
-
* The amount of debt that was originally requested when this order was most-recently updated.
|
|
88
|
-
* In other words: this field holds a value of [Self::remaining_debt_amount] captured at
|
|
89
|
-
* [Self::last_updated_at_timestamp].
|
|
90
|
-
* Currently, this is only a piece of metadata.
|
|
91
|
-
*/
|
|
92
|
-
requestedDebtAmount: string;
|
|
93
|
-
/**
|
|
94
|
-
* The maximum borrow rate that the obligation owner agrees to.
|
|
95
|
-
* The reserves used for [Obligation::borrows] *cannot* define their maximum borrow rate
|
|
96
|
-
* *higher* than this.
|
|
97
|
-
*/
|
|
98
|
-
maxBorrowRateBps: number;
|
|
99
|
-
/** Alignment padding. */
|
|
100
|
-
padding1: Array<number>;
|
|
101
|
-
/** End padding. */
|
|
102
|
-
endPadding: Array<string>;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* A borrow order.
|
|
106
|
-
*
|
|
107
|
-
* When the [Obligation::borrow_order] is populated (i.e. non-zeroed) on an Obligation, then the
|
|
108
|
-
* permissionless "fill" operations may borrow liquidity to the owner according to this
|
|
109
|
-
* specification.
|
|
110
|
-
*/
|
|
111
|
-
export declare class BorrowOrder {
|
|
112
|
-
/**
|
|
113
|
-
* The asset to be borrowed.
|
|
114
|
-
* The reserves used for [Obligation::borrows] *must* all provide exactly this asset.
|
|
115
|
-
*/
|
|
116
|
-
readonly debtLiquidityMint: Address;
|
|
117
|
-
/** The amount of debt that still needs to be filled, in lamports. */
|
|
118
|
-
readonly remainingDebtAmount: BN;
|
|
119
|
-
/**
|
|
120
|
-
* The token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint],
|
|
121
|
-
* where the filled funds should be transferred to.
|
|
122
|
-
*/
|
|
123
|
-
readonly filledDebtDestination: Address;
|
|
124
|
-
/**
|
|
125
|
-
* The minimum allowed debt term that the obligation owner agrees to.
|
|
126
|
-
* The reserves used to fill this order *cannot* define their debt term *lower* than this.
|
|
127
|
-
*
|
|
128
|
-
* If zeroed, then only indefinite-term reserves may be used.
|
|
129
|
-
*/
|
|
130
|
-
readonly minDebtTermSeconds: BN;
|
|
131
|
-
/** The time until which the borrow order can still be filled. */
|
|
132
|
-
readonly fillableUntilTimestamp: BN;
|
|
133
|
-
/**
|
|
134
|
-
* The time at which this order was placed.
|
|
135
|
-
* Currently, this is only a piece of metadata.
|
|
136
|
-
*/
|
|
137
|
-
readonly placedAtTimestamp: BN;
|
|
138
|
-
/**
|
|
139
|
-
* The time at which this order was most-recently updated (including: created).
|
|
140
|
-
* Currently, this is only a piece of metadata.
|
|
141
|
-
*/
|
|
142
|
-
readonly lastUpdatedAtTimestamp: BN;
|
|
143
|
-
/**
|
|
144
|
-
* The amount of debt that was originally requested when this order was most-recently updated.
|
|
145
|
-
* In other words: this field holds a value of [Self::remaining_debt_amount] captured at
|
|
146
|
-
* [Self::last_updated_at_timestamp].
|
|
147
|
-
* Currently, this is only a piece of metadata.
|
|
148
|
-
*/
|
|
149
|
-
readonly requestedDebtAmount: BN;
|
|
150
|
-
/**
|
|
151
|
-
* The maximum borrow rate that the obligation owner agrees to.
|
|
152
|
-
* The reserves used for [Obligation::borrows] *cannot* define their maximum borrow rate
|
|
153
|
-
* *higher* than this.
|
|
154
|
-
*/
|
|
155
|
-
readonly maxBorrowRateBps: number;
|
|
156
|
-
/** Alignment padding. */
|
|
157
|
-
readonly padding1: Array<number>;
|
|
158
|
-
/** End padding. */
|
|
159
|
-
readonly endPadding: Array<BN>;
|
|
160
|
-
constructor(fields: BorrowOrderFields);
|
|
161
|
-
static layout(property?: string): import("buffer-layout").Layout<unknown>;
|
|
162
|
-
static fromDecoded(obj: any): types.BorrowOrder;
|
|
163
|
-
static toEncodable(fields: BorrowOrderFields): {
|
|
164
|
-
debtLiquidityMint: Address;
|
|
165
|
-
remainingDebtAmount: BN;
|
|
166
|
-
filledDebtDestination: Address;
|
|
167
|
-
minDebtTermSeconds: BN;
|
|
168
|
-
fillableUntilTimestamp: BN;
|
|
169
|
-
placedAtTimestamp: BN;
|
|
170
|
-
lastUpdatedAtTimestamp: BN;
|
|
171
|
-
requestedDebtAmount: BN;
|
|
172
|
-
maxBorrowRateBps: number;
|
|
173
|
-
padding1: number[];
|
|
174
|
-
endPadding: BN[];
|
|
175
|
-
};
|
|
176
|
-
toJSON(): BorrowOrderJSON;
|
|
177
|
-
static fromJSON(obj: BorrowOrderJSON): BorrowOrder;
|
|
178
|
-
toEncodable(): {
|
|
179
|
-
debtLiquidityMint: Address;
|
|
180
|
-
remainingDebtAmount: BN;
|
|
181
|
-
filledDebtDestination: Address;
|
|
182
|
-
minDebtTermSeconds: BN;
|
|
183
|
-
fillableUntilTimestamp: BN;
|
|
184
|
-
placedAtTimestamp: BN;
|
|
185
|
-
lastUpdatedAtTimestamp: BN;
|
|
186
|
-
requestedDebtAmount: BN;
|
|
187
|
-
maxBorrowRateBps: number;
|
|
188
|
-
padding1: number[];
|
|
189
|
-
endPadding: BN[];
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
//# sourceMappingURL=BorrowOrder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BorrowOrder.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/types/BorrowOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,MAAM,OAAO,CAAA;AACtB,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAIjC,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAA;IAC1B,qEAAqE;IACrE,mBAAmB,EAAE,EAAE,CAAA;IACvB;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAA;IAC9B;;;;;OAKG;IACH,kBAAkB,EAAE,EAAE,CAAA;IACtB,iEAAiE;IACjE,sBAAsB,EAAE,EAAE,CAAA;IAC1B;;;OAGG;IACH,iBAAiB,EAAE,EAAE,CAAA;IACrB;;;OAGG;IACH,sBAAsB,EAAE,EAAE,CAAA;IAC1B;;;;;OAKG;IACH,mBAAmB,EAAE,EAAE,CAAA;IACvB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB,yBAAyB;IACzB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACvB,mBAAmB;IACnB,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IACzB,qEAAqE;IACrE,mBAAmB,EAAE,MAAM,CAAA;IAC3B;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAA;IAC7B;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iEAAiE;IACjE,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,sBAAsB,EAAE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AC,GAAG,EAAE,eAAe,GAAG,WAAW;IAgBlD,WAAW;;;;;;;;;;;;;CAGZ"}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BorrowOrder = void 0;
|
|
40
|
-
const kit_1 = require("@solana/kit"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
41
|
-
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
42
|
-
const borsh = __importStar(require("@coral-xyz/borsh"));
|
|
43
|
-
const utils_1 = require("../utils");
|
|
44
|
-
/**
|
|
45
|
-
* A borrow order.
|
|
46
|
-
*
|
|
47
|
-
* When the [Obligation::borrow_order] is populated (i.e. non-zeroed) on an Obligation, then the
|
|
48
|
-
* permissionless "fill" operations may borrow liquidity to the owner according to this
|
|
49
|
-
* specification.
|
|
50
|
-
*/
|
|
51
|
-
class BorrowOrder {
|
|
52
|
-
/**
|
|
53
|
-
* The asset to be borrowed.
|
|
54
|
-
* The reserves used for [Obligation::borrows] *must* all provide exactly this asset.
|
|
55
|
-
*/
|
|
56
|
-
debtLiquidityMint;
|
|
57
|
-
/** The amount of debt that still needs to be filled, in lamports. */
|
|
58
|
-
remainingDebtAmount;
|
|
59
|
-
/**
|
|
60
|
-
* The token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint],
|
|
61
|
-
* where the filled funds should be transferred to.
|
|
62
|
-
*/
|
|
63
|
-
filledDebtDestination;
|
|
64
|
-
/**
|
|
65
|
-
* The minimum allowed debt term that the obligation owner agrees to.
|
|
66
|
-
* The reserves used to fill this order *cannot* define their debt term *lower* than this.
|
|
67
|
-
*
|
|
68
|
-
* If zeroed, then only indefinite-term reserves may be used.
|
|
69
|
-
*/
|
|
70
|
-
minDebtTermSeconds;
|
|
71
|
-
/** The time until which the borrow order can still be filled. */
|
|
72
|
-
fillableUntilTimestamp;
|
|
73
|
-
/**
|
|
74
|
-
* The time at which this order was placed.
|
|
75
|
-
* Currently, this is only a piece of metadata.
|
|
76
|
-
*/
|
|
77
|
-
placedAtTimestamp;
|
|
78
|
-
/**
|
|
79
|
-
* The time at which this order was most-recently updated (including: created).
|
|
80
|
-
* Currently, this is only a piece of metadata.
|
|
81
|
-
*/
|
|
82
|
-
lastUpdatedAtTimestamp;
|
|
83
|
-
/**
|
|
84
|
-
* The amount of debt that was originally requested when this order was most-recently updated.
|
|
85
|
-
* In other words: this field holds a value of [Self::remaining_debt_amount] captured at
|
|
86
|
-
* [Self::last_updated_at_timestamp].
|
|
87
|
-
* Currently, this is only a piece of metadata.
|
|
88
|
-
*/
|
|
89
|
-
requestedDebtAmount;
|
|
90
|
-
/**
|
|
91
|
-
* The maximum borrow rate that the obligation owner agrees to.
|
|
92
|
-
* The reserves used for [Obligation::borrows] *cannot* define their maximum borrow rate
|
|
93
|
-
* *higher* than this.
|
|
94
|
-
*/
|
|
95
|
-
maxBorrowRateBps;
|
|
96
|
-
/** Alignment padding. */
|
|
97
|
-
padding1;
|
|
98
|
-
/** End padding. */
|
|
99
|
-
endPadding;
|
|
100
|
-
constructor(fields) {
|
|
101
|
-
this.debtLiquidityMint = fields.debtLiquidityMint;
|
|
102
|
-
this.remainingDebtAmount = fields.remainingDebtAmount;
|
|
103
|
-
this.filledDebtDestination = fields.filledDebtDestination;
|
|
104
|
-
this.minDebtTermSeconds = fields.minDebtTermSeconds;
|
|
105
|
-
this.fillableUntilTimestamp = fields.fillableUntilTimestamp;
|
|
106
|
-
this.placedAtTimestamp = fields.placedAtTimestamp;
|
|
107
|
-
this.lastUpdatedAtTimestamp = fields.lastUpdatedAtTimestamp;
|
|
108
|
-
this.requestedDebtAmount = fields.requestedDebtAmount;
|
|
109
|
-
this.maxBorrowRateBps = fields.maxBorrowRateBps;
|
|
110
|
-
this.padding1 = fields.padding1;
|
|
111
|
-
this.endPadding = fields.endPadding;
|
|
112
|
-
}
|
|
113
|
-
static layout(property) {
|
|
114
|
-
return borsh.struct([
|
|
115
|
-
(0, utils_1.borshAddress)("debtLiquidityMint"),
|
|
116
|
-
borsh.u64("remainingDebtAmount"),
|
|
117
|
-
(0, utils_1.borshAddress)("filledDebtDestination"),
|
|
118
|
-
borsh.u64("minDebtTermSeconds"),
|
|
119
|
-
borsh.u64("fillableUntilTimestamp"),
|
|
120
|
-
borsh.u64("placedAtTimestamp"),
|
|
121
|
-
borsh.u64("lastUpdatedAtTimestamp"),
|
|
122
|
-
borsh.u64("requestedDebtAmount"),
|
|
123
|
-
borsh.u32("maxBorrowRateBps"),
|
|
124
|
-
borsh.array(borsh.u8(), 4, "padding1"),
|
|
125
|
-
borsh.array(borsh.u64(), 5, "endPadding"),
|
|
126
|
-
], property);
|
|
127
|
-
}
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
129
|
-
static fromDecoded(obj) {
|
|
130
|
-
return new BorrowOrder({
|
|
131
|
-
debtLiquidityMint: obj.debtLiquidityMint,
|
|
132
|
-
remainingDebtAmount: obj.remainingDebtAmount,
|
|
133
|
-
filledDebtDestination: obj.filledDebtDestination,
|
|
134
|
-
minDebtTermSeconds: obj.minDebtTermSeconds,
|
|
135
|
-
fillableUntilTimestamp: obj.fillableUntilTimestamp,
|
|
136
|
-
placedAtTimestamp: obj.placedAtTimestamp,
|
|
137
|
-
lastUpdatedAtTimestamp: obj.lastUpdatedAtTimestamp,
|
|
138
|
-
requestedDebtAmount: obj.requestedDebtAmount,
|
|
139
|
-
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
140
|
-
padding1: obj.padding1,
|
|
141
|
-
endPadding: obj.endPadding,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
static toEncodable(fields) {
|
|
145
|
-
return {
|
|
146
|
-
debtLiquidityMint: fields.debtLiquidityMint,
|
|
147
|
-
remainingDebtAmount: fields.remainingDebtAmount,
|
|
148
|
-
filledDebtDestination: fields.filledDebtDestination,
|
|
149
|
-
minDebtTermSeconds: fields.minDebtTermSeconds,
|
|
150
|
-
fillableUntilTimestamp: fields.fillableUntilTimestamp,
|
|
151
|
-
placedAtTimestamp: fields.placedAtTimestamp,
|
|
152
|
-
lastUpdatedAtTimestamp: fields.lastUpdatedAtTimestamp,
|
|
153
|
-
requestedDebtAmount: fields.requestedDebtAmount,
|
|
154
|
-
maxBorrowRateBps: fields.maxBorrowRateBps,
|
|
155
|
-
padding1: fields.padding1,
|
|
156
|
-
endPadding: fields.endPadding,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
toJSON() {
|
|
160
|
-
return {
|
|
161
|
-
debtLiquidityMint: this.debtLiquidityMint,
|
|
162
|
-
remainingDebtAmount: this.remainingDebtAmount.toString(),
|
|
163
|
-
filledDebtDestination: this.filledDebtDestination,
|
|
164
|
-
minDebtTermSeconds: this.minDebtTermSeconds.toString(),
|
|
165
|
-
fillableUntilTimestamp: this.fillableUntilTimestamp.toString(),
|
|
166
|
-
placedAtTimestamp: this.placedAtTimestamp.toString(),
|
|
167
|
-
lastUpdatedAtTimestamp: this.lastUpdatedAtTimestamp.toString(),
|
|
168
|
-
requestedDebtAmount: this.requestedDebtAmount.toString(),
|
|
169
|
-
maxBorrowRateBps: this.maxBorrowRateBps,
|
|
170
|
-
padding1: this.padding1,
|
|
171
|
-
endPadding: this.endPadding.map((item) => item.toString()),
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
static fromJSON(obj) {
|
|
175
|
-
return new BorrowOrder({
|
|
176
|
-
debtLiquidityMint: (0, kit_1.address)(obj.debtLiquidityMint),
|
|
177
|
-
remainingDebtAmount: new bn_js_1.default(obj.remainingDebtAmount),
|
|
178
|
-
filledDebtDestination: (0, kit_1.address)(obj.filledDebtDestination),
|
|
179
|
-
minDebtTermSeconds: new bn_js_1.default(obj.minDebtTermSeconds),
|
|
180
|
-
fillableUntilTimestamp: new bn_js_1.default(obj.fillableUntilTimestamp),
|
|
181
|
-
placedAtTimestamp: new bn_js_1.default(obj.placedAtTimestamp),
|
|
182
|
-
lastUpdatedAtTimestamp: new bn_js_1.default(obj.lastUpdatedAtTimestamp),
|
|
183
|
-
requestedDebtAmount: new bn_js_1.default(obj.requestedDebtAmount),
|
|
184
|
-
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
185
|
-
padding1: obj.padding1,
|
|
186
|
-
endPadding: obj.endPadding.map((item) => new bn_js_1.default(item)),
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
toEncodable() {
|
|
190
|
-
return BorrowOrder.toEncodable(this);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
exports.BorrowOrder = BorrowOrder;
|
|
194
|
-
//# sourceMappingURL=BorrowOrder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BorrowOrder.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/types/BorrowOrder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA8C,CAAC,wDAAwD;AACvG,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;AACzC,oCAAuC;AAwGvC;;;;;;GAMG;AACH,MAAa,WAAW;IACtB;;;OAGG;IACM,iBAAiB,CAAS;IACnC,qEAAqE;IAC5D,mBAAmB,CAAI;IAChC;;;OAGG;IACM,qBAAqB,CAAS;IACvC;;;;;OAKG;IACM,kBAAkB,CAAI;IAC/B,iEAAiE;IACxD,sBAAsB,CAAI;IACnC;;;OAGG;IACM,iBAAiB,CAAI;IAC9B;;;OAGG;IACM,sBAAsB,CAAI;IACnC;;;;;OAKG;IACM,mBAAmB,CAAI;IAChC;;;;OAIG;IACM,gBAAgB,CAAQ;IACjC,yBAAyB;IAChB,QAAQ,CAAe;IAChC,mBAAmB;IACV,UAAU,CAAW;IAE9B,YAAY,MAAyB;QACnC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAA;QACrD,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC,qBAAq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,CAAC,IAAI,CAAC,CAAC;SACvD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACtC,CAAC;CACF;AAvJD,kCAuJC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import BN from "bn.js";
|
|
2
|
-
import * as types from "../types";
|
|
3
|
-
export interface BorrowOrderConfigArgsFields {
|
|
4
|
-
remainingDebtAmount: BN;
|
|
5
|
-
maxBorrowRateBps: number;
|
|
6
|
-
minDebtTermSeconds: BN;
|
|
7
|
-
fillableUntilTimestamp: BN;
|
|
8
|
-
}
|
|
9
|
-
export interface BorrowOrderConfigArgsJSON {
|
|
10
|
-
remainingDebtAmount: string;
|
|
11
|
-
maxBorrowRateBps: number;
|
|
12
|
-
minDebtTermSeconds: string;
|
|
13
|
-
fillableUntilTimestamp: string;
|
|
14
|
-
}
|
|
15
|
-
/** A subset of [BorrowOrderConfig] excluding the accounts passed via [SetBorrowOrder]. */
|
|
16
|
-
export declare class BorrowOrderConfigArgs {
|
|
17
|
-
readonly remainingDebtAmount: BN;
|
|
18
|
-
readonly maxBorrowRateBps: number;
|
|
19
|
-
readonly minDebtTermSeconds: BN;
|
|
20
|
-
readonly fillableUntilTimestamp: BN;
|
|
21
|
-
constructor(fields: BorrowOrderConfigArgsFields);
|
|
22
|
-
static layout(property?: string): import("buffer-layout").Layout<unknown>;
|
|
23
|
-
static fromDecoded(obj: any): types.BorrowOrderConfigArgs;
|
|
24
|
-
static toEncodable(fields: BorrowOrderConfigArgsFields): {
|
|
25
|
-
remainingDebtAmount: BN;
|
|
26
|
-
maxBorrowRateBps: number;
|
|
27
|
-
minDebtTermSeconds: BN;
|
|
28
|
-
fillableUntilTimestamp: BN;
|
|
29
|
-
};
|
|
30
|
-
toJSON(): BorrowOrderConfigArgsJSON;
|
|
31
|
-
static fromJSON(obj: BorrowOrderConfigArgsJSON): BorrowOrderConfigArgs;
|
|
32
|
-
toEncodable(): {
|
|
33
|
-
remainingDebtAmount: BN;
|
|
34
|
-
maxBorrowRateBps: number;
|
|
35
|
-
minDebtTermSeconds: BN;
|
|
36
|
-
fillableUntilTimestamp: BN;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=BorrowOrderConfigArgs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BorrowOrderConfigArgs.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/types/BorrowOrderConfigArgs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,OAAO,CAAA;AACtB,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAIjC,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,EAAE,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,EAAE,CAAA;IACtB,sBAAsB,EAAE,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,MAAM,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,sBAAsB,EAAE,MAAM,CAAA;CAC/B;AAED,0FAA0F;AAC1F,qBAAa,qBAAqB;IAChC,QAAQ,CAAC,mBAAmB,EAAE,EAAE,CAAA;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,kBAAkB,EAAE,EAAE,CAAA;IAC/B,QAAQ,CAAC,sBAAsB,EAAE,EAAE,CAAA;gBAEvB,MAAM,EAAE,2BAA2B;IAO/C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM;IAa/B,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG;IAS3B,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,2BAA2B;;;;;;IAStD,MAAM,IAAI,yBAAyB;IASnC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,yBAAyB,GAAG,qBAAqB;IAStE,WAAW;;;;;;CAGZ"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BorrowOrderConfigArgs = void 0;
|
|
40
|
-
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
41
|
-
const borsh = __importStar(require("@coral-xyz/borsh"));
|
|
42
|
-
/** A subset of [BorrowOrderConfig] excluding the accounts passed via [SetBorrowOrder]. */
|
|
43
|
-
class BorrowOrderConfigArgs {
|
|
44
|
-
remainingDebtAmount;
|
|
45
|
-
maxBorrowRateBps;
|
|
46
|
-
minDebtTermSeconds;
|
|
47
|
-
fillableUntilTimestamp;
|
|
48
|
-
constructor(fields) {
|
|
49
|
-
this.remainingDebtAmount = fields.remainingDebtAmount;
|
|
50
|
-
this.maxBorrowRateBps = fields.maxBorrowRateBps;
|
|
51
|
-
this.minDebtTermSeconds = fields.minDebtTermSeconds;
|
|
52
|
-
this.fillableUntilTimestamp = fields.fillableUntilTimestamp;
|
|
53
|
-
}
|
|
54
|
-
static layout(property) {
|
|
55
|
-
return borsh.struct([
|
|
56
|
-
borsh.u64("remainingDebtAmount"),
|
|
57
|
-
borsh.u32("maxBorrowRateBps"),
|
|
58
|
-
borsh.u64("minDebtTermSeconds"),
|
|
59
|
-
borsh.u64("fillableUntilTimestamp"),
|
|
60
|
-
], property);
|
|
61
|
-
}
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
|
-
static fromDecoded(obj) {
|
|
64
|
-
return new BorrowOrderConfigArgs({
|
|
65
|
-
remainingDebtAmount: obj.remainingDebtAmount,
|
|
66
|
-
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
67
|
-
minDebtTermSeconds: obj.minDebtTermSeconds,
|
|
68
|
-
fillableUntilTimestamp: obj.fillableUntilTimestamp,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
static toEncodable(fields) {
|
|
72
|
-
return {
|
|
73
|
-
remainingDebtAmount: fields.remainingDebtAmount,
|
|
74
|
-
maxBorrowRateBps: fields.maxBorrowRateBps,
|
|
75
|
-
minDebtTermSeconds: fields.minDebtTermSeconds,
|
|
76
|
-
fillableUntilTimestamp: fields.fillableUntilTimestamp,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
toJSON() {
|
|
80
|
-
return {
|
|
81
|
-
remainingDebtAmount: this.remainingDebtAmount.toString(),
|
|
82
|
-
maxBorrowRateBps: this.maxBorrowRateBps,
|
|
83
|
-
minDebtTermSeconds: this.minDebtTermSeconds.toString(),
|
|
84
|
-
fillableUntilTimestamp: this.fillableUntilTimestamp.toString(),
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
static fromJSON(obj) {
|
|
88
|
-
return new BorrowOrderConfigArgs({
|
|
89
|
-
remainingDebtAmount: new bn_js_1.default(obj.remainingDebtAmount),
|
|
90
|
-
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
91
|
-
minDebtTermSeconds: new bn_js_1.default(obj.minDebtTermSeconds),
|
|
92
|
-
fillableUntilTimestamp: new bn_js_1.default(obj.fillableUntilTimestamp),
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
toEncodable() {
|
|
96
|
-
return BorrowOrderConfigArgs.toEncodable(this);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.BorrowOrderConfigArgs = BorrowOrderConfigArgs;
|
|
100
|
-
//# sourceMappingURL=BorrowOrderConfigArgs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BorrowOrderConfigArgs.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/types/BorrowOrderConfigArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;AAiBzC,0FAA0F;AAC1F,MAAa,qBAAqB;IACvB,mBAAmB,CAAI;IACvB,gBAAgB,CAAQ;IACx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,gBAAgB;YACvC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;YACtD,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE;SAC/D,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAA8B;QAC5C,OAAO,IAAI,qBAAqB,CAAC;YAC/B,mBAAmB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC;YACpD,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACtC,kBAAkB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC;YAClD,sBAAsB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC;SAC3D,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAChD,CAAC;CACF;AAjED,sDAiEC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import {
|
|
3
|
-
Address,
|
|
4
|
-
isSome,
|
|
5
|
-
AccountMeta,
|
|
6
|
-
AccountSignerMeta,
|
|
7
|
-
Instruction,
|
|
8
|
-
Option,
|
|
9
|
-
TransactionSigner,
|
|
10
|
-
} from "@solana/kit"
|
|
11
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
12
|
-
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
13
|
-
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14
|
-
import { borshAddress } from "../utils" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
15
|
-
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
16
|
-
import { PROGRAM_ID } from "../programId"
|
|
17
|
-
|
|
18
|
-
export const DISCRIMINATOR = Buffer.from([102, 4, 167, 76, 131, 170, 93, 19])
|
|
19
|
-
|
|
20
|
-
export interface FillBorrowOrderAccounts {
|
|
21
|
-
borrowAccounts: {
|
|
22
|
-
payer: TransactionSigner
|
|
23
|
-
/** The obligation with a [BorrowOrder]. */
|
|
24
|
-
obligation: Address
|
|
25
|
-
/** The [Self::obligation]'s market - needed for borrowing-related configuration. */
|
|
26
|
-
lendingMarket: Address
|
|
27
|
-
/** The [Self::lending_market]'s authority, needed to transfer the newly-borrowed funds out of the [Self::reserve_source_liquidity]. */
|
|
28
|
-
lendingMarketAuthority: Address
|
|
29
|
-
/** The reserve to borrow from. Its mint must match the asset requested by the [BorrowOrder::debt_liquidity_mint]. */
|
|
30
|
-
borrowReserve: Address
|
|
31
|
-
/** The mint of [Self::borrow_reserve] - needed to execute the transfer. */
|
|
32
|
-
borrowReserveLiquidityMint: Address
|
|
33
|
-
/** The vault of [Self::borrow_reserve], from which the funds are transferred. */
|
|
34
|
-
reserveSourceLiquidity: Address
|
|
35
|
-
/** The fee vault of [Self::borrow_reserve], to which the fees are transferred. */
|
|
36
|
-
borrowReserveLiquidityFeeReceiver: Address
|
|
37
|
-
/** The destination token account that should receive the newly borrowed funds. It must match [BorrowOrder::filled_debt_destination], owner and mint. **Warning:** An altered destination account will prevent an order from being filled. */
|
|
38
|
-
userDestinationLiquidity: Address
|
|
39
|
-
/** The referrer's account, for accumulating fees - needed if the [Obligation::has_referrer]. */
|
|
40
|
-
referrerTokenState: Option<Address>
|
|
41
|
-
/** The token program of [Self::borrow_reserve] - needed to execute the transfer. */
|
|
42
|
-
tokenProgram: Address
|
|
43
|
-
}
|
|
44
|
-
farmsAccounts: {
|
|
45
|
-
obligationFarmUserState: Option<Address>
|
|
46
|
-
reserveFarmState: Option<Address>
|
|
47
|
-
}
|
|
48
|
-
farmsProgram: Address
|
|
49
|
-
eventAuthority: Address
|
|
50
|
-
program: Address
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function fillBorrowOrder(
|
|
54
|
-
accounts: FillBorrowOrderAccounts,
|
|
55
|
-
remainingAccounts: Array<AccountMeta | AccountSignerMeta> = [],
|
|
56
|
-
programAddress: Address = PROGRAM_ID
|
|
57
|
-
) {
|
|
58
|
-
const keys: Array<AccountMeta | AccountSignerMeta> = [
|
|
59
|
-
{
|
|
60
|
-
address: accounts.borrowAccounts.payer.address,
|
|
61
|
-
role: 2,
|
|
62
|
-
signer: accounts.borrowAccounts.payer,
|
|
63
|
-
},
|
|
64
|
-
{ address: accounts.borrowAccounts.obligation, role: 1 },
|
|
65
|
-
{ address: accounts.borrowAccounts.lendingMarket, role: 0 },
|
|
66
|
-
{ address: accounts.borrowAccounts.lendingMarketAuthority, role: 0 },
|
|
67
|
-
{ address: accounts.borrowAccounts.borrowReserve, role: 1 },
|
|
68
|
-
{ address: accounts.borrowAccounts.borrowReserveLiquidityMint, role: 0 },
|
|
69
|
-
{ address: accounts.borrowAccounts.reserveSourceLiquidity, role: 1 },
|
|
70
|
-
{
|
|
71
|
-
address: accounts.borrowAccounts.borrowReserveLiquidityFeeReceiver,
|
|
72
|
-
role: 1,
|
|
73
|
-
},
|
|
74
|
-
{ address: accounts.borrowAccounts.userDestinationLiquidity, role: 1 },
|
|
75
|
-
isSome(accounts.borrowAccounts.referrerTokenState)
|
|
76
|
-
? { address: accounts.borrowAccounts.referrerTokenState.value, role: 1 }
|
|
77
|
-
: { address: programAddress, role: 0 },
|
|
78
|
-
{ address: accounts.borrowAccounts.tokenProgram, role: 0 },
|
|
79
|
-
isSome(accounts.farmsAccounts.obligationFarmUserState)
|
|
80
|
-
? {
|
|
81
|
-
address: accounts.farmsAccounts.obligationFarmUserState.value,
|
|
82
|
-
role: 1,
|
|
83
|
-
}
|
|
84
|
-
: { address: programAddress, role: 0 },
|
|
85
|
-
isSome(accounts.farmsAccounts.reserveFarmState)
|
|
86
|
-
? { address: accounts.farmsAccounts.reserveFarmState.value, role: 1 }
|
|
87
|
-
: { address: programAddress, role: 0 },
|
|
88
|
-
{ address: accounts.farmsProgram, role: 0 },
|
|
89
|
-
{ address: accounts.eventAuthority, role: 0 },
|
|
90
|
-
{ address: accounts.program, role: 0 },
|
|
91
|
-
...remainingAccounts,
|
|
92
|
-
]
|
|
93
|
-
const data = DISCRIMINATOR
|
|
94
|
-
const ix: Instruction = { accounts: keys, programAddress, data }
|
|
95
|
-
return ix
|
|
96
|
-
}
|