@kamino-finance/klend-sdk 7.3.9 → 7.3.10-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/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/market.d.ts +15 -10
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +49 -26
- 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 +48 -50
- 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/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/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 +0 -2
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/obligation_orders/price_based.js +5 -3
- package/dist/obligation_orders/price_based.js.map +1 -1
- package/dist/utils/Logger.d.ts +14 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/Logger.js +12 -0
- package/dist/utils/Logger.js.map +1 -0
- 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/api.d.ts +13 -4
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +33 -31
- package/dist/utils/api.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/dist/utils/validations.d.ts +1 -0
- package/dist/utils/validations.d.ts.map +1 -1
- package/dist/utils/validations.js +5 -0
- package/dist/utils/validations.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/action.ts +321 -347
- package/src/classes/actionTypes.ts +295 -0
- package/src/classes/market.ts +74 -31
- package/src/classes/obligation.ts +54 -53
- package/src/classes/obligationOrder.ts +6 -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/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 +0 -2
- package/src/obligation_orders/price_based.ts +7 -5
- package/src/utils/Logger.ts +14 -0
- package/src/utils/ObligationType.ts +92 -1
- package/src/utils/api.ts +56 -33
- package/src/utils/userMetadata.ts +64 -30
- package/src/utils/validations.ts +5 -0
package/dist/classes/action.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { KaminoObligation } from './obligation';
|
|
|
6
6
|
import { KaminoReserve } from './reserve';
|
|
7
7
|
import { Scope } from '@kamino-finance/scope-sdk';
|
|
8
8
|
import { ObligationOrderAtIndex } from './obligationOrder';
|
|
9
|
+
import { BuildDepositTxnsProps, BuildBorrowTxnsProps, BuildDepositReserveLiquidityTxnsProps, BuildRedeemReserveCollateralTxnsProps, BuildWithdrawTxnsProps, BuildRepayTxnsProps, BuildDepositAndBorrowTxnsProps, BuildRefreshObligationTxnsProps, BuildRequestElevationGroupTxnsProps, BuildDepositAndWithdrawV2TxnsProps, BuildRepayAndWithdrawTxnsProps, BuildRepayAndWithdrawV2TxnsProps, BuildLiquidateTxnsProps, BuildWithdrawReferrerFeeTxnsProps, BuildDepositObligationCollateralTxnsProps, InitializeActionProps } from './actionTypes';
|
|
9
10
|
export type ActionType = 'deposit' | 'borrow' | 'withdraw' | 'repay' | 'mint' | 'redeem' | 'depositCollateral' | 'liquidate' | 'depositAndBorrow' | 'repayAndWithdraw' | 'refreshObligation' | 'requestElevationGroup' | 'withdrawReferrerFees' | 'repayAndWithdrawV2' | 'depositAndWithdraw';
|
|
10
11
|
export type AuxiliaryIx = 'setup' | 'inBetween' | 'cleanup';
|
|
11
12
|
export declare class KaminoAction {
|
|
@@ -42,100 +43,29 @@ export declare class KaminoAction {
|
|
|
42
43
|
preLoadedDepositReservesSameTx: Array<Address>;
|
|
43
44
|
currentSlot: Slot;
|
|
44
45
|
private constructor();
|
|
45
|
-
static initialize(
|
|
46
|
+
static initialize(props: InitializeActionProps): Promise<KaminoAction>;
|
|
46
47
|
private static getUserAccountAddresses;
|
|
47
48
|
private static loadObligation;
|
|
48
|
-
static buildRefreshObligationTxns(
|
|
49
|
-
|
|
50
|
-
static
|
|
51
|
-
currentSlot?: Slot): Promise<KaminoAction>;
|
|
52
|
-
static buildDepositTxns(kaminoMarket: KaminoMarket, amount: string | BN, mint: Address, owner: TransactionSigner, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
53
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas,
|
|
54
|
-
requestElevationGroup?: boolean, // to be requested *before* the deposit
|
|
55
|
-
initUserMetadata?: {
|
|
56
|
-
skipInitialization: boolean;
|
|
57
|
-
skipLutCreation: boolean;
|
|
58
|
-
}, referrer?: Option<Address>, currentSlot?: Slot, overrideElevationGroupRequest?: number | undefined): Promise<KaminoAction>;
|
|
49
|
+
static buildRefreshObligationTxns(props: BuildRefreshObligationTxnsProps): Promise<KaminoAction>;
|
|
50
|
+
static buildRequestElevationGroupTxns(props: BuildRequestElevationGroupTxnsProps): Promise<KaminoAction>;
|
|
51
|
+
static buildDepositTxns(props: BuildDepositTxnsProps): Promise<KaminoAction>;
|
|
59
52
|
addScopeRefreshIxs(scope: Scope, tokens: number[], scopeConfig: Address): Promise<void>;
|
|
60
|
-
static buildBorrowTxns(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
static
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
static buildRedeemReserveCollateralTxns(kaminoMarket: KaminoMarket, amount: string | BN, mint: Address, owner: TransactionSigner, obligation: KaminoObligation | ObligationType, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
70
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas
|
|
71
|
-
requestElevationGroup?: boolean, referrer?: Option<Address>, currentSlot?: Slot): Promise<KaminoAction>;
|
|
72
|
-
static buildDepositObligationCollateralTxns(kaminoMarket: KaminoMarket, amount: string | BN, mint: Address, owner: TransactionSigner, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
73
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas
|
|
74
|
-
requestElevationGroup?: boolean, initUserMetadata?: {
|
|
75
|
-
skipInitialization: boolean;
|
|
76
|
-
skipLutCreation: boolean;
|
|
77
|
-
}, referrer?: Option<Address>, currentSlot?: Slot): Promise<KaminoAction>;
|
|
78
|
-
static buildDepositAndBorrowTxns(kaminoMarket: KaminoMarket, depositAmount: string | BN, depositMint: Address, borrowAmount: string | BN, borrowMint: Address, owner: TransactionSigner, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
79
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas,
|
|
80
|
-
requestElevationGroup?: boolean, initUserMetadata?: {
|
|
81
|
-
skipInitialization: boolean;
|
|
82
|
-
skipLutCreation: boolean;
|
|
83
|
-
}, referrer?: Option<Address>, currentSlot?: Slot): Promise<KaminoAction>;
|
|
84
|
-
static buildDepositAndWithdrawV2Txns(kaminoMarket: KaminoMarket, depositAmount: string | BN, depositMint: Address, withdrawAmount: string | BN, withdrawMint: Address, owner: TransactionSigner, currentSlot: Slot, obligation: KaminoObligation | ObligationType, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
85
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas,
|
|
86
|
-
requestElevationGroup?: boolean, initUserMetadata?: {
|
|
87
|
-
skipInitialization: boolean;
|
|
88
|
-
skipLutCreation: boolean;
|
|
89
|
-
}, referrer?: Option<Address>): Promise<KaminoAction>;
|
|
90
|
-
static buildRepayAndWithdrawV2Txns(kaminoMarket: KaminoMarket, repayAmount: string | BN, repayMint: Address, withdrawAmount: string | BN, withdrawMint: Address, payer: TransactionSigner, currentSlot: Slot, obligation: KaminoObligation | ObligationType, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
91
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas,
|
|
92
|
-
requestElevationGroup?: boolean, initUserMetadata?: {
|
|
93
|
-
skipInitialization: boolean;
|
|
94
|
-
skipLutCreation: boolean;
|
|
95
|
-
}, referrer?: Option<Address>): Promise<KaminoAction>;
|
|
96
|
-
static buildRepayAndWithdrawTxns(kaminoMarket: KaminoMarket, repayAmount: string | BN, repayMint: Address, withdrawAmount: string | BN, withdrawMint: Address, payer: TransactionSigner, currentSlot: Slot, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
97
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas,
|
|
98
|
-
requestElevationGroup?: boolean, initUserMetadata?: {
|
|
99
|
-
skipInitialization: boolean;
|
|
100
|
-
skipLutCreation: boolean;
|
|
101
|
-
}, referrer?: Option<Address>): Promise<KaminoAction>;
|
|
102
|
-
static buildWithdrawTxns(kaminoMarket: KaminoMarket, amount: string | BN, mint: Address, owner: TransactionSigner, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
103
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas,
|
|
104
|
-
requestElevationGroup?: boolean, // to be requested *after* the withdraw
|
|
105
|
-
initUserMetadata?: {
|
|
106
|
-
skipInitialization: boolean;
|
|
107
|
-
skipLutCreation: boolean;
|
|
108
|
-
}, referrer?: Option<Address>, currentSlot?: Slot, overrideElevationGroupRequest?: number, obligationCustomizations?: {
|
|
109
|
-
addedDepositReserves?: Address[];
|
|
110
|
-
}): Promise<KaminoAction>;
|
|
53
|
+
static buildBorrowTxns(props: BuildBorrowTxnsProps): Promise<KaminoAction>;
|
|
54
|
+
static buildDepositReserveLiquidityTxns(props: BuildDepositReserveLiquidityTxnsProps): Promise<KaminoAction>;
|
|
55
|
+
static buildRedeemReserveCollateralTxns(props: BuildRedeemReserveCollateralTxnsProps): Promise<KaminoAction>;
|
|
56
|
+
static buildDepositObligationCollateralTxns(props: BuildDepositObligationCollateralTxnsProps): Promise<KaminoAction>;
|
|
57
|
+
static buildDepositAndBorrowTxns(props: BuildDepositAndBorrowTxnsProps): Promise<KaminoAction>;
|
|
58
|
+
static buildDepositAndWithdrawV2Txns(props: BuildDepositAndWithdrawV2TxnsProps): Promise<KaminoAction>;
|
|
59
|
+
static buildRepayAndWithdrawV2Txns(props: BuildRepayAndWithdrawV2TxnsProps): Promise<KaminoAction>;
|
|
60
|
+
static buildRepayAndWithdrawTxns(props: BuildRepayAndWithdrawTxnsProps): Promise<KaminoAction>;
|
|
61
|
+
static buildWithdrawTxns(props: BuildWithdrawTxnsProps): Promise<KaminoAction>;
|
|
111
62
|
/**
|
|
112
|
-
*
|
|
113
|
-
* @param
|
|
114
|
-
* @param amount
|
|
115
|
-
* @param mint
|
|
116
|
-
* @param owner
|
|
117
|
-
* @param obligation - obligation to repay or the PDA seeds
|
|
118
|
-
* @param useV2Ixs
|
|
119
|
-
* @param scopeRefreshConfig
|
|
120
|
-
* @param currentSlot
|
|
121
|
-
* @param payer - if not set then owner is used
|
|
122
|
-
* @param extraComputeBudget - if > 0 then adds the ix
|
|
123
|
-
* @param includeAtaIxs - if true it includes create and close wsol and token atas
|
|
124
|
-
* @param requestElevationGroup
|
|
125
|
-
* @param initUserMetadata
|
|
126
|
-
* @param referrer
|
|
63
|
+
* Build repay transactions
|
|
64
|
+
* @param props - BuildRepayTxnsProps containing all required and optional parameters
|
|
127
65
|
*/
|
|
128
|
-
static buildRepayTxns(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, referrer?: Option<Address>): Promise<KaminoAction>;
|
|
132
|
-
static buildLiquidateTxns(kaminoMarket: KaminoMarket, amount: string | BN, minCollateralReceiveAmount: string | BN, repayTokenMint: Address, withdrawTokenMint: Address, liquidator: TransactionSigner, obligationOwner: Address, obligation: KaminoObligation | ObligationType, useV2Ixs: boolean, scopeRefreshConfig?: ScopePriceRefreshConfig | undefined, extraComputeBudget?: number, // if > 0 then adds the ix
|
|
133
|
-
includeAtaIxs?: boolean, // if true it includes create and close wsol and token atas, and creates all other token atas if they don't exist
|
|
134
|
-
requestElevationGroup?: boolean, initUserMetadata?: {
|
|
135
|
-
skipInitialization: boolean;
|
|
136
|
-
skipLutCreation: boolean;
|
|
137
|
-
}, referrer?: Option<Address>, maxAllowedLtvOverridePercent?: number, currentSlot?: Slot): Promise<KaminoAction>;
|
|
138
|
-
static buildWithdrawReferrerFeeTxns(owner: TransactionSigner, tokenMint: Address, kaminoMarket: KaminoMarket, currentSlot?: Slot): Promise<KaminoAction>;
|
|
66
|
+
static buildRepayTxns(props: BuildRepayTxnsProps): Promise<KaminoAction>;
|
|
67
|
+
static buildLiquidateTxns(props: BuildLiquidateTxnsProps): Promise<KaminoAction>;
|
|
68
|
+
static buildWithdrawReferrerFeeTxns(props: BuildWithdrawReferrerFeeTxnsProps): Promise<KaminoAction>;
|
|
139
69
|
/**
|
|
140
70
|
* Builds an instruction for setting the new state of one of the given obligation's orders.
|
|
141
71
|
*
|
|
@@ -185,8 +115,8 @@ export declare class KaminoAction {
|
|
|
185
115
|
private addComputeBudgetIx;
|
|
186
116
|
private addAtaIxs;
|
|
187
117
|
private updateWSOLAccount;
|
|
188
|
-
static initializeMultiTokenAction(kaminoMarket: KaminoMarket, action: ActionType, inflowAmount: string | BN,
|
|
189
|
-
static initializeWithdrawReferrerFees(
|
|
118
|
+
static initializeMultiTokenAction(kaminoMarket: KaminoMarket, action: ActionType, inflowAmount: string | BN, inflowReserveAddress: Address, outflowReserveAddress: Address, signer: TransactionSigner, obligationOwner: Address, obligation: KaminoObligation | ObligationType, outflowAmount?: string | BN, referrer?: Option<Address>, currentSlot?: Slot): Promise<KaminoAction>;
|
|
119
|
+
static initializeWithdrawReferrerFees(reserveAddress: Address, owner: TransactionSigner, kaminoMarket: KaminoMarket, currentSlot?: Slot): Promise<{
|
|
190
120
|
axn: KaminoAction;
|
|
191
121
|
createAtaIxs: Instruction<string, readonly (AccountMeta<string> | import("@solana/kit").AccountLookupMeta<string, string>)[]>[];
|
|
192
122
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/classes/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAEP,WAAW,EACX,WAAW,EAIX,MAAM,EACN,IAAI,EAEJ,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,OAAO,CAAC;AAoCvB,OAAO,EASL,cAAc,EAEd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OAAO,CAAC;IAIrF,+BAA+B,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;WAI3D,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;WAOrD,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;WAW5D,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;WAOrD,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;mBAWrD,yBAAyB;mBA+CzB,cAAc;mBAsBd,gCAAgC;CAUtD"}
|
package/dist/classes/action.js
CHANGED
|
@@ -82,14 +82,15 @@ class KaminoAction {
|
|
|
82
82
|
this.referrer = referrer;
|
|
83
83
|
this.currentSlot = currentSlot;
|
|
84
84
|
}
|
|
85
|
-
static async initialize(
|
|
86
|
-
const
|
|
85
|
+
static async initialize(props) {
|
|
86
|
+
const { kaminoMarket, action, amount, reserveAddress, owner, obligation, referrer = (0, kit_1.none)(), currentSlot = 0n, payer = owner, } = props;
|
|
87
|
+
const reserve = kaminoMarket.getReserveByAddress(reserveAddress);
|
|
87
88
|
if (reserve === undefined) {
|
|
88
|
-
throw new Error(`Reserve ${
|
|
89
|
+
throw new Error(`Reserve ${reserveAddress} not found in market ${kaminoMarket.getAddress()}`);
|
|
89
90
|
}
|
|
90
91
|
const { kaminoObligation, depositReserves, borrowReserves, distinctReserveCount } = await KaminoAction.loadObligation(action, kaminoMarket, owner.address, reserve.address, obligation);
|
|
91
92
|
const referrerKey = await this.getReferrerKey(kaminoMarket, owner.address, kaminoObligation, referrer);
|
|
92
|
-
return new KaminoAction(kaminoMarket, owner, kaminoObligation || obligation,
|
|
93
|
+
return new KaminoAction(kaminoMarket, owner, kaminoObligation || obligation, reserve.getLiquidityMint(), distinctReserveCount, amount, depositReserves, borrowReserves, reserve, currentSlot, undefined, undefined, undefined, referrerKey, payer);
|
|
93
94
|
}
|
|
94
95
|
static async getUserAccountAddresses(owner, reserve) {
|
|
95
96
|
const [userTokenAccountAddress, userCollateralAccountAddress] = await Promise.all([
|
|
@@ -134,30 +135,45 @@ class KaminoAction {
|
|
|
134
135
|
distinctReserveCount,
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
|
-
static async buildRefreshObligationTxns(
|
|
138
|
-
|
|
138
|
+
static async buildRefreshObligationTxns(props) {
|
|
139
|
+
const { kaminoMarket, payer, obligation, extraComputeBudget = 1_000_000, currentSlot = 0n } = props;
|
|
139
140
|
// placeholder for action initialization
|
|
140
141
|
const firstReserve = obligation.getDeposits()[0].reserveAddress;
|
|
141
142
|
const firstKaminoReserve = kaminoMarket.getReserveByAddress(firstReserve);
|
|
142
143
|
if (!firstKaminoReserve) {
|
|
143
144
|
throw new Error(`Reserve ${firstReserve} not found`);
|
|
144
145
|
}
|
|
145
|
-
const axn = await KaminoAction.initialize(
|
|
146
|
-
|
|
146
|
+
const axn = await KaminoAction.initialize({
|
|
147
|
+
kaminoMarket,
|
|
148
|
+
action: 'refreshObligation',
|
|
149
|
+
amount: '0',
|
|
150
|
+
reserveAddress: firstKaminoReserve.address,
|
|
151
|
+
owner: (0, signer_1.noopSigner)(obligation.state.owner), // owner does not need to sign for refresh
|
|
152
|
+
obligation,
|
|
153
|
+
currentSlot,
|
|
154
|
+
});
|
|
147
155
|
if (extraComputeBudget > 0) {
|
|
148
156
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
149
157
|
}
|
|
150
158
|
await axn.addRefreshObligation(payer);
|
|
151
159
|
return axn;
|
|
152
160
|
}
|
|
153
|
-
static async buildRequestElevationGroupTxns(
|
|
154
|
-
|
|
161
|
+
static async buildRequestElevationGroupTxns(props) {
|
|
162
|
+
const { kaminoMarket, owner, obligation, elevationGroup, extraComputeBudget = 1_000_000, currentSlot = 0n } = props;
|
|
155
163
|
const firstReserve = obligation.state.deposits.find((x) => x.depositReserve !== utils_1.DEFAULT_PUBLIC_KEY).depositReserve;
|
|
156
164
|
const firstKaminoReserve = kaminoMarket.getReserveByAddress(firstReserve);
|
|
157
165
|
if (!firstKaminoReserve) {
|
|
158
166
|
throw new Error(`Reserve ${firstReserve} not found`);
|
|
159
167
|
}
|
|
160
|
-
const axn = await KaminoAction.initialize(
|
|
168
|
+
const axn = await KaminoAction.initialize({
|
|
169
|
+
kaminoMarket,
|
|
170
|
+
action: 'requestElevationGroup',
|
|
171
|
+
amount: '0',
|
|
172
|
+
reserveAddress: firstKaminoReserve.address,
|
|
173
|
+
owner,
|
|
174
|
+
obligation,
|
|
175
|
+
currentSlot,
|
|
176
|
+
});
|
|
161
177
|
if (extraComputeBudget > 0) {
|
|
162
178
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
163
179
|
}
|
|
@@ -165,15 +181,18 @@ class KaminoAction {
|
|
|
165
181
|
await axn.addRequestElevationIx(elevationGroup, 'setup');
|
|
166
182
|
return axn;
|
|
167
183
|
}
|
|
168
|
-
static async buildDepositTxns(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
static async buildDepositTxns(props) {
|
|
185
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), currentSlot = 0n, overrideElevationGroupRequest, } = props;
|
|
186
|
+
const axn = await KaminoAction.initialize({
|
|
187
|
+
kaminoMarket,
|
|
188
|
+
action: 'deposit',
|
|
189
|
+
amount,
|
|
190
|
+
reserveAddress,
|
|
191
|
+
owner,
|
|
192
|
+
obligation,
|
|
193
|
+
referrer,
|
|
194
|
+
currentSlot,
|
|
195
|
+
});
|
|
177
196
|
const addInitObligationForFarm = true;
|
|
178
197
|
if (extraComputeBudget > 0) {
|
|
179
198
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -195,14 +214,18 @@ class KaminoAction {
|
|
|
195
214
|
this.setupIxs.unshift(refreshIx);
|
|
196
215
|
}
|
|
197
216
|
}
|
|
198
|
-
static async buildBorrowTxns(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
217
|
+
static async buildBorrowTxns(props) {
|
|
218
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), currentSlot = 0n, overrideElevationGroupRequest, } = props;
|
|
219
|
+
const axn = await KaminoAction.initialize({
|
|
220
|
+
kaminoMarket,
|
|
221
|
+
action: 'borrow',
|
|
222
|
+
amount,
|
|
223
|
+
reserveAddress,
|
|
224
|
+
owner,
|
|
225
|
+
obligation,
|
|
226
|
+
referrer,
|
|
227
|
+
currentSlot,
|
|
228
|
+
});
|
|
206
229
|
const addInitObligationForFarm = true;
|
|
207
230
|
if (extraComputeBudget > 0) {
|
|
208
231
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -224,10 +247,18 @@ class KaminoAction {
|
|
|
224
247
|
axn.addRefreshFarmsCleanupTxnIxsToCleanupIxs();
|
|
225
248
|
return axn;
|
|
226
249
|
}
|
|
227
|
-
static async buildDepositReserveLiquidityTxns(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
250
|
+
static async buildDepositReserveLiquidityTxns(props) {
|
|
251
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, referrer = (0, kit_1.none)(), currentSlot = 0n, } = props;
|
|
252
|
+
const axn = await KaminoAction.initialize({
|
|
253
|
+
kaminoMarket,
|
|
254
|
+
action: 'mint',
|
|
255
|
+
amount,
|
|
256
|
+
reserveAddress,
|
|
257
|
+
owner,
|
|
258
|
+
obligation,
|
|
259
|
+
referrer,
|
|
260
|
+
currentSlot,
|
|
261
|
+
});
|
|
231
262
|
const addInitObligationForFarm = true;
|
|
232
263
|
if (extraComputeBudget > 0) {
|
|
233
264
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -237,10 +268,18 @@ class KaminoAction {
|
|
|
237
268
|
axn.addRefreshFarmsCleanupTxnIxsToCleanupIxs();
|
|
238
269
|
return axn;
|
|
239
270
|
}
|
|
240
|
-
static async buildRedeemReserveCollateralTxns(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
271
|
+
static async buildRedeemReserveCollateralTxns(props) {
|
|
272
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, referrer = (0, kit_1.none)(), currentSlot = 0n, } = props;
|
|
273
|
+
const axn = await KaminoAction.initialize({
|
|
274
|
+
kaminoMarket,
|
|
275
|
+
action: 'redeem',
|
|
276
|
+
amount,
|
|
277
|
+
reserveAddress,
|
|
278
|
+
owner,
|
|
279
|
+
obligation,
|
|
280
|
+
referrer,
|
|
281
|
+
currentSlot,
|
|
282
|
+
});
|
|
244
283
|
const addInitObligationForFarm = true;
|
|
245
284
|
if (extraComputeBudget > 0) {
|
|
246
285
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -250,13 +289,18 @@ class KaminoAction {
|
|
|
250
289
|
axn.addRefreshFarmsCleanupTxnIxsToCleanupIxs();
|
|
251
290
|
return axn;
|
|
252
291
|
}
|
|
253
|
-
static async buildDepositObligationCollateralTxns(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
292
|
+
static async buildDepositObligationCollateralTxns(props) {
|
|
293
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), currentSlot = 0n, } = props;
|
|
294
|
+
const axn = await KaminoAction.initialize({
|
|
295
|
+
kaminoMarket,
|
|
296
|
+
action: 'depositCollateral',
|
|
297
|
+
amount,
|
|
298
|
+
reserveAddress,
|
|
299
|
+
owner,
|
|
300
|
+
obligation,
|
|
301
|
+
referrer,
|
|
302
|
+
currentSlot,
|
|
303
|
+
});
|
|
260
304
|
const addInitObligationForFarm = true;
|
|
261
305
|
if (extraComputeBudget > 0) {
|
|
262
306
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -271,13 +315,9 @@ class KaminoAction {
|
|
|
271
315
|
axn.addRefreshFarmsCleanupTxnIxsToCleanupIxs();
|
|
272
316
|
return axn;
|
|
273
317
|
}
|
|
274
|
-
static async buildDepositAndBorrowTxns(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
skipInitialization: false,
|
|
278
|
-
skipLutCreation: false,
|
|
279
|
-
}, referrer = (0, kit_1.none)(), currentSlot = 0n) {
|
|
280
|
-
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'depositAndBorrow', depositAmount, depositMint, borrowMint, owner, owner.address, obligation, borrowAmount, referrer, currentSlot);
|
|
318
|
+
static async buildDepositAndBorrowTxns(props) {
|
|
319
|
+
const { kaminoMarket, depositAmount, depositReserveAddress, borrowAmount, borrowReserveAddress, owner, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), currentSlot = 0n, } = props;
|
|
320
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'depositAndBorrow', depositAmount, depositReserveAddress, borrowReserveAddress, owner, owner.address, obligation, borrowAmount, referrer, currentSlot);
|
|
281
321
|
const addInitObligationForFarmForDeposit = true;
|
|
282
322
|
const addInitObligationForFarmForBorrow = false;
|
|
283
323
|
const twoTokenAction = true;
|
|
@@ -321,13 +361,9 @@ class KaminoAction {
|
|
|
321
361
|
}
|
|
322
362
|
return axn;
|
|
323
363
|
}
|
|
324
|
-
static async buildDepositAndWithdrawV2Txns(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
skipInitialization: false,
|
|
328
|
-
skipLutCreation: false,
|
|
329
|
-
}, referrer = (0, kit_1.none)()) {
|
|
330
|
-
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'depositAndWithdraw', depositAmount, depositMint, withdrawMint, owner, owner.address, obligation, withdrawAmount, referrer, currentSlot);
|
|
364
|
+
static async buildDepositAndWithdrawV2Txns(props) {
|
|
365
|
+
const { kaminoMarket, depositAmount, depositReserveAddress, withdrawAmount, withdrawReserveAddress, owner, currentSlot, obligation, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), } = props;
|
|
366
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'depositAndWithdraw', depositAmount, depositReserveAddress, withdrawReserveAddress, owner, owner.address, obligation, withdrawAmount, referrer, currentSlot);
|
|
331
367
|
const addInitObligationForFarm = true;
|
|
332
368
|
const twoTokenAction = true;
|
|
333
369
|
if (extraComputeBudget > 0) {
|
|
@@ -338,13 +374,9 @@ class KaminoAction {
|
|
|
338
374
|
await axn.addDepositAndWithdrawV2Ixs(withdrawCollateralAmount);
|
|
339
375
|
return axn;
|
|
340
376
|
}
|
|
341
|
-
static async buildRepayAndWithdrawV2Txns(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
skipInitialization: false,
|
|
345
|
-
skipLutCreation: false,
|
|
346
|
-
}, referrer = (0, kit_1.none)()) {
|
|
347
|
-
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'repayAndWithdrawV2', repayAmount, repayMint, withdrawMint, payer, payer.address, obligation, withdrawAmount, referrer, currentSlot);
|
|
377
|
+
static async buildRepayAndWithdrawV2Txns(props) {
|
|
378
|
+
const { kaminoMarket, repayAmount, repayReserveAddress, withdrawAmount, withdrawReserveAddress, payer, currentSlot, obligation, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), } = props;
|
|
379
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'repayAndWithdrawV2', repayAmount, repayReserveAddress, withdrawReserveAddress, payer, payer.address, obligation, withdrawAmount, referrer, currentSlot);
|
|
348
380
|
const addInitObligationForFarm = true;
|
|
349
381
|
const twoTokenAction = true;
|
|
350
382
|
if (extraComputeBudget > 0) {
|
|
@@ -355,13 +387,9 @@ class KaminoAction {
|
|
|
355
387
|
await axn.addRepayAndWithdrawV2Ixs(withdrawCollateralAmount);
|
|
356
388
|
return axn;
|
|
357
389
|
}
|
|
358
|
-
static async buildRepayAndWithdrawTxns(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
skipInitialization: false,
|
|
362
|
-
skipLutCreation: false,
|
|
363
|
-
}, referrer = (0, kit_1.none)()) {
|
|
364
|
-
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'repayAndWithdraw', repayAmount, repayMint, withdrawMint, payer, payer.address, obligation, withdrawAmount, referrer, currentSlot);
|
|
390
|
+
static async buildRepayAndWithdrawTxns(props) {
|
|
391
|
+
const { kaminoMarket, repayAmount, repayReserveAddress, withdrawAmount, withdrawReserveAddress, payer, currentSlot, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), } = props;
|
|
392
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'repayAndWithdraw', repayAmount, repayReserveAddress, withdrawReserveAddress, payer, payer.address, obligation, withdrawAmount, referrer, currentSlot);
|
|
365
393
|
const addInitObligationForFarmForRepay = true;
|
|
366
394
|
const addInitObligationForFarmForWithdraw = false;
|
|
367
395
|
const twoTokenAction = true;
|
|
@@ -399,16 +427,18 @@ class KaminoAction {
|
|
|
399
427
|
}
|
|
400
428
|
return axn;
|
|
401
429
|
}
|
|
402
|
-
static async buildWithdrawTxns(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
430
|
+
static async buildWithdrawTxns(props) {
|
|
431
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), currentSlot = 0n, overrideElevationGroupRequest, obligationCustomizations, } = props;
|
|
432
|
+
const axn = await KaminoAction.initialize({
|
|
433
|
+
kaminoMarket,
|
|
434
|
+
action: 'withdraw',
|
|
435
|
+
amount,
|
|
436
|
+
reserveAddress,
|
|
437
|
+
owner,
|
|
438
|
+
obligation,
|
|
439
|
+
referrer,
|
|
440
|
+
currentSlot,
|
|
441
|
+
});
|
|
412
442
|
const addInitObligationForFarm = true;
|
|
413
443
|
if (extraComputeBudget > 0) {
|
|
414
444
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -426,27 +456,22 @@ class KaminoAction {
|
|
|
426
456
|
return axn;
|
|
427
457
|
}
|
|
428
458
|
/**
|
|
429
|
-
*
|
|
430
|
-
* @param
|
|
431
|
-
* @param amount
|
|
432
|
-
* @param mint
|
|
433
|
-
* @param owner
|
|
434
|
-
* @param obligation - obligation to repay or the PDA seeds
|
|
435
|
-
* @param useV2Ixs
|
|
436
|
-
* @param scopeRefreshConfig
|
|
437
|
-
* @param currentSlot
|
|
438
|
-
* @param payer - if not set then owner is used
|
|
439
|
-
* @param extraComputeBudget - if > 0 then adds the ix
|
|
440
|
-
* @param includeAtaIxs - if true it includes create and close wsol and token atas
|
|
441
|
-
* @param requestElevationGroup
|
|
442
|
-
* @param initUserMetadata
|
|
443
|
-
* @param referrer
|
|
459
|
+
* Build repay transactions
|
|
460
|
+
* @param props - BuildRepayTxnsProps containing all required and optional parameters
|
|
444
461
|
*/
|
|
445
|
-
static async buildRepayTxns(
|
|
446
|
-
skipInitialization: false,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
462
|
+
static async buildRepayTxns(props) {
|
|
463
|
+
const { kaminoMarket, amount, reserveAddress, owner, obligation, useV2Ixs, scopeRefreshConfig, currentSlot, payer = owner, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), } = props;
|
|
464
|
+
const axn = await KaminoAction.initialize({
|
|
465
|
+
kaminoMarket,
|
|
466
|
+
action: 'repay',
|
|
467
|
+
amount,
|
|
468
|
+
reserveAddress,
|
|
469
|
+
owner,
|
|
470
|
+
obligation,
|
|
471
|
+
referrer,
|
|
472
|
+
currentSlot,
|
|
473
|
+
payer,
|
|
474
|
+
});
|
|
450
475
|
const addInitObligationForFarm = true;
|
|
451
476
|
if (extraComputeBudget > 0) {
|
|
452
477
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -461,13 +486,9 @@ class KaminoAction {
|
|
|
461
486
|
axn.addRefreshFarmsCleanupTxnIxsToCleanupIxs();
|
|
462
487
|
return axn;
|
|
463
488
|
}
|
|
464
|
-
static async buildLiquidateTxns(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
skipInitialization: false,
|
|
468
|
-
skipLutCreation: false,
|
|
469
|
-
}, referrer = (0, kit_1.none)(), maxAllowedLtvOverridePercent = 0, currentSlot = 0n) {
|
|
470
|
-
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'liquidate', amount, repayTokenMint, withdrawTokenMint, liquidator, obligationOwner, obligation, minCollateralReceiveAmount, referrer, currentSlot);
|
|
489
|
+
static async buildLiquidateTxns(props) {
|
|
490
|
+
const { kaminoMarket, amount, minCollateralReceiveAmount, repayReserveAddress, withdrawReserveAddress, liquidator, obligationOwner, obligation, useV2Ixs, scopeRefreshConfig, extraComputeBudget = 1_000_000, includeAtaIxs = true, requestElevationGroup = false, initUserMetadata = { skipInitialization: false, skipLutCreation: false }, referrer = (0, kit_1.none)(), maxAllowedLtvOverridePercent = 0, currentSlot = 0n, } = props;
|
|
491
|
+
const axn = await KaminoAction.initializeMultiTokenAction(kaminoMarket, 'liquidate', amount, repayReserveAddress, withdrawReserveAddress, liquidator, obligationOwner, obligation, minCollateralReceiveAmount, referrer, currentSlot);
|
|
471
492
|
const addInitObligationForFarm = true;
|
|
472
493
|
if (extraComputeBudget > 0) {
|
|
473
494
|
axn.addComputeBudgetIx(extraComputeBudget);
|
|
@@ -482,8 +503,9 @@ class KaminoAction {
|
|
|
482
503
|
axn.addRefreshFarmsCleanupTxnIxsToCleanupIxs();
|
|
483
504
|
return axn;
|
|
484
505
|
}
|
|
485
|
-
static async buildWithdrawReferrerFeeTxns(
|
|
486
|
-
const {
|
|
506
|
+
static async buildWithdrawReferrerFeeTxns(props) {
|
|
507
|
+
const { owner, reserveAddress, kaminoMarket, currentSlot = 0n } = props;
|
|
508
|
+
const { axn, createAtaIxs } = await KaminoAction.initializeWithdrawReferrerFees(reserveAddress, owner, kaminoMarket, currentSlot);
|
|
487
509
|
axn.setupIxs.push(...createAtaIxs);
|
|
488
510
|
axn.setupIxsLabels.push(`createAtasIxs[${axn.owner.toString()}]`);
|
|
489
511
|
if ((0, kit_1.isSome)(axn.referrer)) {
|
|
@@ -2032,9 +2054,9 @@ class KaminoAction {
|
|
|
2032
2054
|
this.cleanupIxs.push(...postIxs);
|
|
2033
2055
|
this.cleanupIxsLabels.push(...postIxsLabels);
|
|
2034
2056
|
}
|
|
2035
|
-
static async initializeMultiTokenAction(kaminoMarket, action, inflowAmount,
|
|
2036
|
-
const inflowReserve = kaminoMarket.
|
|
2037
|
-
const outflowReserve = kaminoMarket.
|
|
2057
|
+
static async initializeMultiTokenAction(kaminoMarket, action, inflowAmount, inflowReserveAddress, outflowReserveAddress, signer, obligationOwner, obligation, outflowAmount, referrer = (0, kit_1.none)(), currentSlot = 0n) {
|
|
2058
|
+
const inflowReserve = kaminoMarket.getExistingReserveByAddress(inflowReserveAddress);
|
|
2059
|
+
const outflowReserve = kaminoMarket.getExistingReserveByAddress(outflowReserveAddress);
|
|
2038
2060
|
const { kaminoObligation, depositReserves, borrowReserves, distinctReserveCount } = await KaminoAction.loadObligation(action, kaminoMarket, obligationOwner, inflowReserve.address, obligation, outflowReserve.address);
|
|
2039
2061
|
const referrerKey = await this.getReferrerKey(kaminoMarket, signer.address, kaminoObligation, referrer);
|
|
2040
2062
|
let secondaryMint;
|
|
@@ -2043,18 +2065,18 @@ class KaminoAction {
|
|
|
2043
2065
|
action === 'depositAndBorrow' ||
|
|
2044
2066
|
action === 'repayAndWithdraw' ||
|
|
2045
2067
|
action === 'repayAndWithdrawV2') {
|
|
2046
|
-
primaryMint =
|
|
2047
|
-
secondaryMint =
|
|
2068
|
+
primaryMint = inflowReserve.getLiquidityMint();
|
|
2069
|
+
secondaryMint = outflowReserve.getLiquidityMint();
|
|
2048
2070
|
}
|
|
2049
2071
|
else {
|
|
2050
2072
|
throw new Error('Invalid action');
|
|
2051
2073
|
}
|
|
2052
2074
|
return new KaminoAction(kaminoMarket, signer, kaminoObligation || obligation, primaryMint, distinctReserveCount, inflowAmount, depositReserves, borrowReserves, inflowReserve, currentSlot, secondaryMint, outflowReserve, outflowAmount, referrerKey);
|
|
2053
2075
|
}
|
|
2054
|
-
static async initializeWithdrawReferrerFees(
|
|
2055
|
-
const reserve = kaminoMarket.
|
|
2076
|
+
static async initializeWithdrawReferrerFees(reserveAddress, owner, kaminoMarket, currentSlot = 0n) {
|
|
2077
|
+
const reserve = kaminoMarket.getReserveByAddress(reserveAddress);
|
|
2056
2078
|
if (reserve === undefined) {
|
|
2057
|
-
throw new Error(`Reserve ${
|
|
2079
|
+
throw new Error(`Reserve ${reserveAddress} not found in market ${kaminoMarket.getAddress()}`);
|
|
2058
2080
|
}
|
|
2059
2081
|
const [{ createAtaIx }] = await (0, utils_1.createAtasIdempotent)(owner, [
|
|
2060
2082
|
{
|
|
@@ -2063,7 +2085,7 @@ class KaminoAction {
|
|
|
2063
2085
|
},
|
|
2064
2086
|
]);
|
|
2065
2087
|
return {
|
|
2066
|
-
axn: new KaminoAction(kaminoMarket, owner, new ObligationType_1.VanillaObligation(kaminoMarket.programId),
|
|
2088
|
+
axn: new KaminoAction(kaminoMarket, owner, new ObligationType_1.VanillaObligation(kaminoMarket.programId), reserve.getLiquidityMint(), 0, new bn_js_1.default(0), [], [], reserve, currentSlot, undefined, undefined, undefined, undefined, undefined),
|
|
2067
2089
|
createAtaIxs: [createAtaIx],
|
|
2068
2090
|
};
|
|
2069
2091
|
}
|