@kamino-finance/klend-sdk 2.10.16 → 2.10.18
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 +3 -1
- package/dist/classes/action.js +17 -0
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/market.d.ts +6 -4
- package/dist/classes/market.js +33 -10
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.d.ts +2 -0
- package/dist/classes/obligation.js +80 -0
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts +21 -0
- package/dist/classes/reserve.js +43 -0
- package/dist/classes/reserve.js.map +1 -1
- package/dist/idl.json +30 -2
- package/dist/idl_codegen/errors/custom.d.ts +9 -1
- package/dist/idl_codegen/errors/custom.js +14 -1
- package/dist/idl_codegen/errors/custom.js.map +1 -1
- package/dist/idl_codegen/types/ReserveConfig.d.ts +13 -4
- package/dist/idl_codegen/types/ReserveConfig.js +8 -1
- package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen/types/TokenInfo.d.ts +12 -4
- package/dist/idl_codegen/types/TokenInfo.js +13 -1
- package/dist/idl_codegen/types/TokenInfo.js.map +1 -1
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts +26 -0
- package/dist/idl_codegen/types/UpdateConfigMode.js +53 -1
- package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
- package/dist/idl_codegen/types/index.d.ts +2 -2
- package/dist/idl_codegen/types/index.js.map +1 -1
- package/package.json +1 -1
package/dist/classes/action.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { KaminoReserve } from './reserve';
|
|
|
7
7
|
export declare const POSITION_LIMIT = 10;
|
|
8
8
|
export declare const BORROWS_LIMIT = 5;
|
|
9
9
|
export declare const DEPOSITS_LIMIT = 8;
|
|
10
|
-
export type ActionType = 'deposit' | 'borrow' | 'withdraw' | 'repay' | 'mint' | 'redeem' | 'depositCollateral' | 'liquidate' | 'depositAndBorrow' | 'repayAndWithdraw' | 'refreshObligation' | 'withdrawReferrerFees';
|
|
10
|
+
export type ActionType = 'deposit' | 'borrow' | 'withdraw' | 'repay' | 'mint' | 'redeem' | 'depositCollateral' | 'liquidate' | 'depositAndBorrow' | 'repayAndWithdraw' | 'refreshObligation' | 'requestElevationGroup' | 'withdrawReferrerFees';
|
|
11
11
|
export declare class KaminoAction {
|
|
12
12
|
kaminoMarket: KaminoMarket;
|
|
13
13
|
reserve: KaminoReserve;
|
|
@@ -54,6 +54,8 @@ export declare class KaminoAction {
|
|
|
54
54
|
private static loadObligation;
|
|
55
55
|
static buildRefreshObligationTxns(kaminoMarket: KaminoMarket, payer: PublicKey, obligation: KaminoObligation, extraComputeBudget?: number, // if > 0 then adds the ixn
|
|
56
56
|
currentSlot?: number): Promise<KaminoAction>;
|
|
57
|
+
static buildRequestElevationGroupTxns(kaminoMarket: KaminoMarket, payer: PublicKey, obligation: KaminoObligation, elevationGroup: number, extraComputeBudget?: number, // if > 0 then adds the ixn
|
|
58
|
+
currentSlot?: number): Promise<KaminoAction>;
|
|
57
59
|
static buildDepositTxns(kaminoMarket: KaminoMarket, amount: string | BN, mint: PublicKey, owner: PublicKey, obligation: KaminoObligation | ObligationType, extraComputeBudget?: number, // if > 0 then adds the ixn
|
|
58
60
|
includeAtaIxns?: boolean, // if true it includes create and close wsol and token atas,
|
|
59
61
|
requestElevationGroup?: boolean, includeUserMetadata?: boolean, // if true it includes user metadata
|
package/dist/classes/action.js
CHANGED
|
@@ -161,6 +161,23 @@ class KaminoAction {
|
|
|
161
161
|
return axn;
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
+
static buildRequestElevationGroupTxns(kaminoMarket, payer, obligation, elevationGroup, extraComputeBudget = 1000000, // if > 0 then adds the ixn
|
|
165
|
+
currentSlot = 0) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const firstReserve = obligation.state.deposits[0].depositReserve;
|
|
168
|
+
const firstKaminoReserve = kaminoMarket.getReserveByAddress(firstReserve);
|
|
169
|
+
if (!firstKaminoReserve) {
|
|
170
|
+
throw new Error(`Reserve ${firstReserve.toBase58()} not found`);
|
|
171
|
+
}
|
|
172
|
+
const axn = yield KaminoAction.initialize('requestElevationGroup', '0', firstKaminoReserve === null || firstKaminoReserve === void 0 ? void 0 : firstKaminoReserve.getLiquidityMint(), obligation.state.owner, kaminoMarket, obligation, kaminoMarket.programId, currentSlot);
|
|
173
|
+
if (extraComputeBudget > 0) {
|
|
174
|
+
axn.addComputeBudgetIxn(extraComputeBudget);
|
|
175
|
+
}
|
|
176
|
+
axn.addRefreshObligation(payer);
|
|
177
|
+
axn.addRequestElevationIx(elevationGroup, true);
|
|
178
|
+
return axn;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
164
181
|
static buildDepositTxns(kaminoMarket, amount, mint, owner, obligation, extraComputeBudget = 1000000, // if > 0 then adds the ixn
|
|
165
182
|
includeAtaIxns = true, // if true it includes create and close wsol and token atas,
|
|
166
183
|
requestElevationGroup = false, includeUserMetadata = true, // if true it includes user metadata
|