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