@hawksightco/hawk-sdk 1.3.265 → 1.3.266
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/addresses.d.ts +37 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/addresses.js +84 -0
- package/dist/anchor.d.ts +22 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +121 -0
- package/dist/classes/AltStorage.d.ts +29 -0
- package/dist/classes/AltStorage.d.ts.map +1 -0
- package/dist/classes/AltStorage.js +58 -0
- package/dist/classes/Atomicity.d.ts +34 -0
- package/dist/classes/Atomicity.d.ts.map +1 -0
- package/dist/classes/Atomicity.js +110 -0
- package/dist/classes/Client.d.ts +35 -0
- package/dist/classes/Client.d.ts.map +1 -0
- package/dist/classes/Client.js +66 -0
- package/dist/classes/CombineTransactions.d.ts +11 -0
- package/dist/classes/CombineTransactions.d.ts.map +1 -0
- package/dist/classes/CombineTransactions.js +58 -0
- package/dist/classes/CreateTxMetadata.d.ts +100 -0
- package/dist/classes/CreateTxMetadata.d.ts.map +1 -0
- package/dist/classes/CreateTxMetadata.js +415 -0
- package/dist/classes/General.d.ts +87 -0
- package/dist/classes/General.d.ts.map +1 -0
- package/dist/classes/General.js +176 -0
- package/dist/classes/GeneralUtility.d.ts +79 -0
- package/dist/classes/GeneralUtility.d.ts.map +1 -0
- package/dist/classes/GeneralUtility.js +121 -0
- package/dist/classes/HawkAPI.d.ts +122 -0
- package/dist/classes/HawkAPI.d.ts.map +1 -0
- package/dist/classes/HawkAPI.js +169 -0
- package/dist/classes/Health.d.ts +29 -0
- package/dist/classes/Health.d.ts.map +1 -0
- package/dist/classes/Health.js +48 -0
- package/dist/classes/JupiterAlts.d.ts +37 -0
- package/dist/classes/JupiterAlts.d.ts.map +1 -0
- package/dist/classes/JupiterAlts.js +114 -0
- package/dist/classes/JupiterSwap.d.ts +21 -0
- package/dist/classes/JupiterSwap.d.ts.map +1 -0
- package/dist/classes/JupiterSwap.js +40 -0
- package/dist/classes/Logging.d.ts +13 -0
- package/dist/classes/Logging.d.ts.map +1 -0
- package/dist/classes/Logging.js +50 -0
- package/dist/classes/MultiTransaction.d.ts +75 -0
- package/dist/classes/MultiTransaction.d.ts.map +1 -0
- package/dist/classes/MultiTransaction.js +296 -0
- package/dist/classes/RaydiumSDK.d.ts +67 -0
- package/dist/classes/RaydiumSDK.d.ts.map +1 -0
- package/dist/classes/RaydiumSDK.js +206 -0
- package/dist/classes/Search.d.ts +100 -0
- package/dist/classes/Search.d.ts.map +1 -0
- package/dist/classes/Search.js +216 -0
- package/dist/classes/SimpleIxGenerator.d.ts +57 -0
- package/dist/classes/SimpleIxGenerator.d.ts.map +1 -0
- package/dist/classes/SimpleIxGenerator.js +62 -0
- package/dist/classes/SimplePdaGenerator.d.ts +28 -0
- package/dist/classes/SimplePdaGenerator.d.ts.map +1 -0
- package/dist/classes/SimplePdaGenerator.js +33 -0
- package/dist/classes/Transaction.d.ts +229 -0
- package/dist/classes/Transaction.d.ts.map +1 -0
- package/dist/classes/Transaction.js +643 -0
- package/dist/classes/Transaction2.d.ts +107 -0
- package/dist/classes/Transaction2.d.ts.map +1 -0
- package/dist/classes/Transaction2.js +249 -0
- package/dist/classes/Transaction3.d.ts +165 -0
- package/dist/classes/Transaction3.d.ts.map +1 -0
- package/dist/classes/Transaction3.js +416 -0
- package/dist/classes/TransactionBatchExecute.d.ts +163 -0
- package/dist/classes/TransactionBatchExecute.d.ts.map +1 -0
- package/dist/classes/TransactionBatchExecute.js +466 -0
- package/dist/classes/TransactionBatchExecute2.d.ts +99 -0
- package/dist/classes/TransactionBatchExecute2.d.ts.map +1 -0
- package/dist/classes/TransactionBatchExecute2.js +357 -0
- package/dist/classes/Transactions.d.ts +586 -0
- package/dist/classes/Transactions.d.ts.map +1 -0
- package/dist/classes/Transactions.js +7667 -0
- package/dist/classes/TxGenerator.d.ts +350 -0
- package/dist/classes/TxGenerator.d.ts.map +1 -0
- package/dist/classes/TxGenerator.js +1957 -0
- package/dist/classes/TxGeneratorAutomations.d.ts +186 -0
- package/dist/classes/TxGeneratorAutomations.d.ts.map +1 -0
- package/dist/classes/TxGeneratorAutomations.js +897 -0
- package/dist/classes/Util.d.ts +87 -0
- package/dist/classes/Util.d.ts.map +1 -0
- package/dist/classes/Util.js +148 -0
- package/dist/classes/account-cache/AccountCache.d.ts +54 -0
- package/dist/classes/account-cache/AccountCache.d.ts.map +1 -0
- package/dist/classes/account-cache/AccountCache.js +143 -0
- package/dist/classes/account-cache/MintCache.d.ts +33 -0
- package/dist/classes/account-cache/MintCache.d.ts.map +1 -0
- package/dist/classes/account-cache/MintCache.js +47 -0
- package/dist/classes/account-cache/TokenCache.d.ts +33 -0
- package/dist/classes/account-cache/TokenCache.d.ts.map +1 -0
- package/dist/classes/account-cache/TokenCache.js +47 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +96 -0
- package/dist/functions.d.ts +514 -0
- package/dist/functions.d.ts.map +1 -0
- package/dist/functions.js +1636 -0
- package/dist/hawksight.d.ts +53 -0
- package/dist/hawksight.d.ts.map +1 -0
- package/dist/hawksight.js +328 -0
- package/dist/hsToMeteora.d.ts +31 -0
- package/dist/hsToMeteora.d.ts.map +1 -0
- package/dist/hsToMeteora.js +3175 -0
- package/dist/idl/iyf-extension-idl.d.ts +14583 -0
- package/dist/idl/iyf-extension-idl.d.ts.map +1 -0
- package/dist/idl/iyf-extension-idl.js +14578 -0
- package/dist/idl/iyf-extension-wrapper.d.ts +112 -0
- package/dist/idl/iyf-extension-wrapper.d.ts.map +1 -0
- package/dist/idl/iyf-extension-wrapper.js +2 -0
- package/dist/idl/iyf-main-idl.d.ts +12078 -0
- package/dist/idl/iyf-main-idl.d.ts.map +1 -0
- package/dist/idl/iyf-main-idl.js +12073 -0
- package/dist/idl/iyf-main-wrapper.d.ts +112 -0
- package/dist/idl/iyf-main-wrapper.d.ts.map +1 -0
- package/dist/idl/iyf-main-wrapper.js +2 -0
- package/dist/idl/jupiter-idl.d.ts +3063 -0
- package/dist/idl/jupiter-idl.d.ts.map +1 -0
- package/dist/idl/jupiter-idl.js +3061 -0
- package/dist/idl/meteora-idl.d.ts +7371 -0
- package/dist/idl/meteora-idl.d.ts.map +1 -0
- package/dist/idl/meteora-idl.js +7372 -0
- package/dist/idl/orca-idl.d.ts +3833 -0
- package/dist/idl/orca-idl.d.ts.map +1 -0
- package/dist/idl/orca-idl.js +3834 -0
- package/dist/idl/raydium-idl.d.ts +3054 -0
- package/dist/idl/raydium-idl.d.ts.map +1 -0
- package/dist/idl/raydium-idl.js +3055 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/ixGenerator/IyfExtensionIxGenerator.d.ts +126 -0
- package/dist/ixGenerator/IyfExtensionIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/IyfExtensionIxGenerator.js +467 -0
- package/dist/ixGenerator/IyfMainIxGenerator.d.ts +330 -0
- package/dist/ixGenerator/IyfMainIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/IyfMainIxGenerator.js +1239 -0
- package/dist/ixGenerator/MeteoraDlmmIxGenerator.d.ts +685 -0
- package/dist/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/MeteoraDlmmIxGenerator.js +3005 -0
- package/dist/ixGenerator/OrcaIxGenerator.d.ts +119 -0
- package/dist/ixGenerator/OrcaIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/OrcaIxGenerator.js +438 -0
- package/dist/ixGenerator/RaydiumIxGenerator.d.ts +99 -0
- package/dist/ixGenerator/RaydiumIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/RaydiumIxGenerator.js +558 -0
- package/dist/ixGenerator/UtilIxGenerator.d.ts +20 -0
- package/dist/ixGenerator/UtilIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/UtilIxGenerator.js +25 -0
- package/dist/meteora/index.d.ts +2 -0
- package/dist/meteora/index.d.ts.map +1 -0
- package/dist/meteora/index.js +17 -0
- package/dist/meteora/liquidityStrategy.d.ts +408 -0
- package/dist/meteora/liquidityStrategy.d.ts.map +1 -0
- package/dist/meteora/liquidityStrategy.js +1325 -0
- package/dist/meteora.d.ts +669 -0
- package/dist/meteora.d.ts.map +1 -0
- package/dist/meteora.js +1932 -0
- package/dist/orca.d.ts +57 -0
- package/dist/orca.d.ts.map +1 -0
- package/dist/orca.js +123 -0
- package/dist/pdaGenerator/HawksightPdaGenerator.d.ts +29 -0
- package/dist/pdaGenerator/HawksightPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/HawksightPdaGenerator.js +75 -0
- package/dist/pdaGenerator/MeteoraPdaGenerator.d.ts +76 -0
- package/dist/pdaGenerator/MeteoraPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/MeteoraPdaGenerator.js +166 -0
- package/dist/pdaGenerator/OrcaPdaGenerator.d.ts +23 -0
- package/dist/pdaGenerator/OrcaPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/OrcaPdaGenerator.js +68 -0
- package/dist/pdaGenerator/RaydiumPdaGenerator.d.ts +49 -0
- package/dist/pdaGenerator/RaydiumPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/RaydiumPdaGenerator.js +114 -0
- package/dist/pdaGenerator/UtilPdaGenerator.d.ts +8 -0
- package/dist/pdaGenerator/UtilPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/UtilPdaGenerator.js +51 -0
- package/dist/types.d.ts +1104 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +95 -0
- package/package.json +6 -5
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
import DLMM, { ClmmProgram, LbPosition, PositionV2, Position, LbPair } from '@meteora-ag/dlmm';
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
import * as web3 from "@solana/web3.js";
|
|
4
|
+
import { LabeledInstruction, MeteoraToHawksightFn, MeteoraToHawksightFnLabeled, StrategyType, TokenType } from './types';
|
|
5
|
+
import { SimpleIxGenerator } from './classes/SimpleIxGenerator';
|
|
6
|
+
export declare class MeteoraDLMM {
|
|
7
|
+
readonly dlmm: DLMM;
|
|
8
|
+
readonly ix: SimpleIxGenerator;
|
|
9
|
+
private constructor();
|
|
10
|
+
readonly pubkey: web3.PublicKey;
|
|
11
|
+
private static _program;
|
|
12
|
+
private static _instance;
|
|
13
|
+
private static _poolAddress;
|
|
14
|
+
private static _connection;
|
|
15
|
+
static create(connection: web3.Connection, poolAddress: web3.PublicKey, ix: SimpleIxGenerator): Promise<MeteoraDLMM>;
|
|
16
|
+
/**
|
|
17
|
+
* Meteora DLMM Program
|
|
18
|
+
*
|
|
19
|
+
* @param connection
|
|
20
|
+
*/
|
|
21
|
+
static program(connection: web3.Connection): Promise<ClmmProgram>;
|
|
22
|
+
getXYAmountDistribution(distribution: "SPOT" | "CURVE" | "BID-ASK", activeBin: {
|
|
23
|
+
binId: number;
|
|
24
|
+
price: string;
|
|
25
|
+
}, lowerRange: number, upperRange: number): {
|
|
26
|
+
binId: number;
|
|
27
|
+
xAmountBpsOfTotal: BN;
|
|
28
|
+
yAmountBpsOfTotal: BN;
|
|
29
|
+
}[];
|
|
30
|
+
getActiveBin(): Promise<import("@meteora-ag/dlmm").BinLiquidity>;
|
|
31
|
+
getPositionsByUserAndLbPair(userPubKey: web3.PublicKey): Promise<{
|
|
32
|
+
activeBin: import("@meteora-ag/dlmm").BinLiquidity;
|
|
33
|
+
userPositions: Array<LbPosition>;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Initializes a position and adds liquidity to the specified strategy, with various steps including
|
|
37
|
+
* handling wrapped SOL tokens, depositing tokens, adding liquidity, and handling dust withdrawals.
|
|
38
|
+
*
|
|
39
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
40
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
41
|
+
* @param {Object} params - The parameters for initializing the position and adding liquidity.
|
|
42
|
+
* @param {web3.PublicKey} params.positionPubKey - The public key of the position to be initialized.
|
|
43
|
+
* @param {BN} params.totalXAmount - The total amount of X tokens to be used for liquidity.
|
|
44
|
+
* @param {BN} params.totalYAmount - The total amount of Y tokens to be used for liquidity.
|
|
45
|
+
* @param {Object} params.strategy - The strategy details for adding liquidity.
|
|
46
|
+
* @param {number} params.strategy.maxBinId - The maximum bin ID for the strategy.
|
|
47
|
+
* @param {number} params.strategy.minBinId - The minimum bin ID for the strategy.
|
|
48
|
+
* @param {StrategyType} params.strategy.strategyType - The type of strategy to be applied.
|
|
49
|
+
* @param {web3.PublicKey} params.user - The public key of the user executing the transaction.
|
|
50
|
+
* @param {number} [params.slippage] - Optional slippage tolerance for the transaction.
|
|
51
|
+
*
|
|
52
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions.
|
|
53
|
+
*
|
|
54
|
+
* @throws {Error} - Throws an error if input token(s) do not exist on the blockchain.
|
|
55
|
+
*/
|
|
56
|
+
initializePositionAndAddLiquidityByStrategy(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
57
|
+
positionPubKey: web3.PublicKey;
|
|
58
|
+
totalXAmount: BN;
|
|
59
|
+
totalYAmount: BN;
|
|
60
|
+
strategy: {
|
|
61
|
+
maxBinId: number;
|
|
62
|
+
minBinId: number;
|
|
63
|
+
strategyType: StrategyType;
|
|
64
|
+
};
|
|
65
|
+
user: web3.PublicKey;
|
|
66
|
+
slippage?: number;
|
|
67
|
+
skipInputTokenCheck?: boolean;
|
|
68
|
+
opt?: {
|
|
69
|
+
pdaTokenType?: TokenType;
|
|
70
|
+
withAmount?: {
|
|
71
|
+
userTokenXAmount: BN | null;
|
|
72
|
+
userTokenYAmount: BN | null;
|
|
73
|
+
};
|
|
74
|
+
fuelAccount?: boolean;
|
|
75
|
+
};
|
|
76
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<InitializePositionAndAddLiquidityByStrategyBuilder>;
|
|
77
|
+
/**
|
|
78
|
+
* Initializes a position and adds liquidity to the specified strategy, with various steps including
|
|
79
|
+
* handling wrapped SOL tokens, depositing tokens, adding liquidity, and handling dust withdrawals.
|
|
80
|
+
*
|
|
81
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
82
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
83
|
+
* @param {Object} params - The parameters for initializing the position and adding liquidity.
|
|
84
|
+
* @param {web3.PublicKey} params.positionPubKey - The public key of the position to be initialized.
|
|
85
|
+
* @param {BN} params.totalXAmount - The total amount of X tokens to be used for liquidity.
|
|
86
|
+
* @param {BN} params.totalYAmount - The total amount of Y tokens to be used for liquidity.
|
|
87
|
+
* @param {Object} params.strategy - The strategy details for adding liquidity.
|
|
88
|
+
* @param {number} params.strategy.maxBinId - The maximum bin ID for the strategy.
|
|
89
|
+
* @param {number} params.strategy.minBinId - The minimum bin ID for the strategy.
|
|
90
|
+
* @param {StrategyType} params.strategy.strategyType - The type of strategy to be applied.
|
|
91
|
+
* @param {web3.PublicKey} params.user - The public key of the user executing the transaction.
|
|
92
|
+
* @param {number} [params.slippage] - Optional slippage tolerance for the transaction.
|
|
93
|
+
*
|
|
94
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions.
|
|
95
|
+
*
|
|
96
|
+
* @throws {Error} - Throws an error if input token(s) do not exist on the blockchain.
|
|
97
|
+
*/
|
|
98
|
+
initializePositionAndAddLiquidityByStrategyLabeled(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
99
|
+
positionPubKey: web3.PublicKey;
|
|
100
|
+
totalXAmount: BN;
|
|
101
|
+
totalYAmount: BN;
|
|
102
|
+
strategy: {
|
|
103
|
+
maxBinId: number;
|
|
104
|
+
minBinId: number;
|
|
105
|
+
strategyType: StrategyType;
|
|
106
|
+
};
|
|
107
|
+
user: web3.PublicKey;
|
|
108
|
+
slippage?: number;
|
|
109
|
+
skipInputTokenCheck?: boolean;
|
|
110
|
+
opt?: {
|
|
111
|
+
pdaTokenType?: TokenType;
|
|
112
|
+
withAmount?: {
|
|
113
|
+
userTokenXAmount: BN | null;
|
|
114
|
+
userTokenYAmount: BN | null;
|
|
115
|
+
};
|
|
116
|
+
fuelAccount?: boolean;
|
|
117
|
+
};
|
|
118
|
+
}, meteoraToHawksight: MeteoraToHawksightFnLabeled): Promise<InitializePositionAndAddLiquidityByStrategyBuilderLabeled>;
|
|
119
|
+
/**
|
|
120
|
+
* Initializes a position and adds liquidity to the specified strategy, with various steps including
|
|
121
|
+
* handling wrapped SOL tokens, depositing tokens, adding liquidity, and handling dust withdrawals.
|
|
122
|
+
*
|
|
123
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
124
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
125
|
+
* @param {Object} params - The parameters for initializing the position and adding liquidity.
|
|
126
|
+
* @param {web3.PublicKey} params.positionPubKey - The public key of the position to be initialized.
|
|
127
|
+
* @param {BN} params.totalXAmount - The total amount of X tokens to be used for liquidity.
|
|
128
|
+
* @param {BN} params.totalYAmount - The total amount of Y tokens to be used for liquidity.
|
|
129
|
+
* @param {Object} params.strategy - The strategy details for adding liquidity.
|
|
130
|
+
* @param {number} params.strategy.maxBinId - The maximum bin ID for the strategy.
|
|
131
|
+
* @param {number} params.strategy.minBinId - The minimum bin ID for the strategy.
|
|
132
|
+
* @param {StrategyType} params.strategy.strategyType - The type of strategy to be applied.
|
|
133
|
+
* @param {web3.PublicKey} params.user - The public key of the user executing the transaction.
|
|
134
|
+
* @param {number} [params.slippage] - Optional slippage tolerance for the transaction.
|
|
135
|
+
*
|
|
136
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions.
|
|
137
|
+
*
|
|
138
|
+
* @throws {Error} - Throws an error if input token(s) do not exist on the blockchain.
|
|
139
|
+
*/
|
|
140
|
+
initializePositionAndAddLiquidityByStrategyPda(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
141
|
+
positionPubKey: web3.PublicKey;
|
|
142
|
+
totalXAmount: BN;
|
|
143
|
+
totalYAmount: BN;
|
|
144
|
+
strategy: {
|
|
145
|
+
maxBinId: number;
|
|
146
|
+
minBinId: number;
|
|
147
|
+
strategyType: StrategyType;
|
|
148
|
+
};
|
|
149
|
+
user: web3.PublicKey;
|
|
150
|
+
slippage?: number;
|
|
151
|
+
skipInputTokenCheck?: boolean;
|
|
152
|
+
pdaTokenType?: TokenType;
|
|
153
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<InitializePositionAndAddLiquidityByStrategyPdaBuilder>;
|
|
154
|
+
/**
|
|
155
|
+
* Adds liquidity to an existing position according to a specified strategy.
|
|
156
|
+
*
|
|
157
|
+
* This method involves multiple steps including checking for token existence, handling wrapped SOL (wSOL), depositing tokens,
|
|
158
|
+
* adding liquidity, and handling dust withdrawals. It ensures that all necessary preparations and operations are performed
|
|
159
|
+
* to add liquidity based on the provided strategy.
|
|
160
|
+
*
|
|
161
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
162
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
163
|
+
* @param {Object} params - The parameters for adding liquidity to the position.
|
|
164
|
+
* @param {web3.PublicKey} params.positionPubKey - The public key of the position to add liquidity to.
|
|
165
|
+
* @param {BN} params.totalXAmount - The total amount of X tokens to be used for liquidity.
|
|
166
|
+
* @param {BN} params.totalYAmount - The total amount of Y tokens to be used for liquidity.
|
|
167
|
+
* @param {Object} params.strategy - The strategy details for adding liquidity.
|
|
168
|
+
* @param {number} params.strategy.maxBinId - The maximum bin ID for the strategy.
|
|
169
|
+
* @param {number} params.strategy.minBinId - The minimum bin ID for the strategy.
|
|
170
|
+
* @param {StrategyType} params.strategy.strategyType - The type of strategy to be applied.
|
|
171
|
+
* @param {web3.PublicKey} params.user - The public key of the user executing the transaction.
|
|
172
|
+
*
|
|
173
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions.
|
|
174
|
+
*
|
|
175
|
+
* @throws {Error} - Throws an error if input token(s) do not exist on the blockchain.
|
|
176
|
+
*/
|
|
177
|
+
addLiquidityByStrategy(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
178
|
+
positionPubKey: web3.PublicKey;
|
|
179
|
+
totalXAmount: BN;
|
|
180
|
+
totalYAmount: BN;
|
|
181
|
+
strategy: {
|
|
182
|
+
maxBinId: number;
|
|
183
|
+
minBinId: number;
|
|
184
|
+
strategyType: StrategyType;
|
|
185
|
+
};
|
|
186
|
+
user: web3.PublicKey;
|
|
187
|
+
slippage?: number;
|
|
188
|
+
skipInputTokenCheck: boolean;
|
|
189
|
+
pdaTokenType?: TokenType;
|
|
190
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<AddLiquidityByStrategyBuilder>;
|
|
191
|
+
/**
|
|
192
|
+
* Removes liquidity from an existing position.
|
|
193
|
+
*
|
|
194
|
+
* This method communicates with the DLMM (Dynamic Liquidity Market Maker) to remove liquidity
|
|
195
|
+
* from a specified trading position. It filters the transaction instructions to include only those
|
|
196
|
+
* relevant to the Meteora DLMM program.
|
|
197
|
+
*
|
|
198
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
199
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
200
|
+
* @param {Object} params - The parameters for removing liquidity from the position.
|
|
201
|
+
* @param {web3.PublicKey} params.user - The public key of the user executing the transaction.
|
|
202
|
+
* @param {web3.PublicKey} params.position - The public key of the position from which liquidity is being removed.
|
|
203
|
+
* @param {number[]} params.binIds - An array of bin IDs indicating which bins to remove liquidity from.
|
|
204
|
+
* @param {BN} params.bps - The basis points (in BN) indicating the proportion of liquidity to remove.
|
|
205
|
+
* @param {boolean} [params.shouldClaimAndClose] - Optional flag to indicate whether the position should be claimed and closed after removing liquidity.
|
|
206
|
+
*
|
|
207
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions relevant to the Meteora DLMM program.
|
|
208
|
+
*/
|
|
209
|
+
removeLiquidity(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
210
|
+
user: web3.PublicKey;
|
|
211
|
+
position: web3.PublicKey;
|
|
212
|
+
fromBinId: number;
|
|
213
|
+
toBinId: number;
|
|
214
|
+
bps: BN;
|
|
215
|
+
shouldClaimAndClose?: boolean;
|
|
216
|
+
pdaTokenType?: TokenType;
|
|
217
|
+
fuelAccount?: boolean;
|
|
218
|
+
rewardClaimMode?: 'default' | 'automation';
|
|
219
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<RemoveLiquidityBuilder>;
|
|
220
|
+
/**
|
|
221
|
+
* Removes liquidity from an existing position to the user pda.
|
|
222
|
+
*
|
|
223
|
+
* This method communicates with the DLMM (Dynamic Liquidity Market Maker) to remove liquidity
|
|
224
|
+
* from a specified trading position. It filters the transaction instructions to include only those
|
|
225
|
+
* relevant to the Meteora DLMM program.
|
|
226
|
+
*
|
|
227
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
228
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
229
|
+
* @param {Object} params - The parameters for removing liquidity from the position.
|
|
230
|
+
* @param {web3.PublicKey} params.user - The public key of the user executing the transaction.
|
|
231
|
+
* @param {web3.PublicKey} params.position - The public key of the position from which liquidity is being removed.
|
|
232
|
+
* @param {number[]} params.binIds - An array of bin IDs indicating which bins to remove liquidity from.
|
|
233
|
+
* @param {BN} params.bps - The basis points (in BN) indicating the proportion of liquidity to remove.
|
|
234
|
+
* @param {boolean} [params.shouldClaimAndClose] - Optional flag to indicate whether the position should be claimed and closed after removing liquidity.
|
|
235
|
+
*
|
|
236
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions relevant to the Meteora DLMM program.
|
|
237
|
+
*/
|
|
238
|
+
removeLiquidityPda(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
239
|
+
user: web3.PublicKey;
|
|
240
|
+
position: web3.PublicKey;
|
|
241
|
+
fromBinId: number;
|
|
242
|
+
toBinId: number;
|
|
243
|
+
bps: BN;
|
|
244
|
+
shouldClaimAndClose?: boolean;
|
|
245
|
+
pdaTokenType?: TokenType;
|
|
246
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<RemoveLiquidityPdaBuilder>;
|
|
247
|
+
/**
|
|
248
|
+
* Claims all rewards for a specified position.
|
|
249
|
+
*
|
|
250
|
+
* This method communicates with the DLMM (Dynamic Liquidity Market Maker) to claim all rewards
|
|
251
|
+
* for a given position. It filters the transaction instructions to include only those relevant
|
|
252
|
+
* to the Meteora DLMM program. The method returns a `ClaimAllRewardsByPositionBuilder` object
|
|
253
|
+
* which provides a structured way to build the necessary transaction instructions for the reward
|
|
254
|
+
* claiming process.
|
|
255
|
+
*
|
|
256
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
257
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
258
|
+
* @param {Object} params - The parameters for claiming rewards.
|
|
259
|
+
* @param {web3.PublicKey} params.owner - The public key of the owner of the position.
|
|
260
|
+
* @param {LbPosition} params.position - The position object representing the liquidity position.
|
|
261
|
+
* @param {Function} meteoraToHawksight - A function to convert Meteora instructions to Hawksight instructions.
|
|
262
|
+
*
|
|
263
|
+
* @returns {Promise<ClaimAllRewardsByPositionBuilder>} - A promise that resolves to a `ClaimAllRewardsByPositionBuilder` object.
|
|
264
|
+
*/
|
|
265
|
+
claimAllRewardsByPosition(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
266
|
+
owner: web3.PublicKey;
|
|
267
|
+
position: LbPosition;
|
|
268
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<ClaimAllRewardsByPositionBuilder>;
|
|
269
|
+
/**
|
|
270
|
+
* Closes a specified liquidity position.
|
|
271
|
+
*
|
|
272
|
+
* This method communicates with the DLMM (Dynamic Liquidity Market Maker) to close a given liquidity
|
|
273
|
+
* position. It filters the transaction instructions to include only those relevant to the Meteora DLMM program.
|
|
274
|
+
*
|
|
275
|
+
* @param {Object} params - The parameters for closing the position.
|
|
276
|
+
* @param {web3.PublicKey} params.owner - The public key of the owner of the position.
|
|
277
|
+
* @param {LbPosition} params.position - The position object representing the liquidity position.
|
|
278
|
+
*
|
|
279
|
+
* @returns {Promise<web3.TransactionInstruction[]>} - A promise that resolves to an array of transaction instructions relevant to the Meteora DLMM program.
|
|
280
|
+
*/
|
|
281
|
+
closePosition(userWallet: web3.PublicKey, params: {
|
|
282
|
+
owner: web3.PublicKey;
|
|
283
|
+
position: LbPosition;
|
|
284
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<web3.TransactionInstruction[]>;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Meteora functions / transaction generators that we re-written for performance improvement purposes
|
|
288
|
+
*/
|
|
289
|
+
export declare class MeteoraFunctions {
|
|
290
|
+
private readonly ix;
|
|
291
|
+
constructor(ix: SimpleIxGenerator);
|
|
292
|
+
/**
|
|
293
|
+
* Position cache (v1)
|
|
294
|
+
*/
|
|
295
|
+
readonly positions_v1: Record<string, Position>;
|
|
296
|
+
/**
|
|
297
|
+
* Position cache (v2)
|
|
298
|
+
*/
|
|
299
|
+
readonly positions_v2: Record<string, PositionV2>;
|
|
300
|
+
/**
|
|
301
|
+
* Pool cache
|
|
302
|
+
*/
|
|
303
|
+
readonly pools: Record<string, LbPair>;
|
|
304
|
+
/**
|
|
305
|
+
* Claims all rewards for a specified position.
|
|
306
|
+
*
|
|
307
|
+
* This method communicates with the DLMM (Dynamic Liquidity Market Maker) to claim all rewards
|
|
308
|
+
* for a given position. It filters the transaction instructions to include only those relevant
|
|
309
|
+
* to the Meteora DLMM program. The method returns a `ClaimAllRewardsByPositionBuilder` object
|
|
310
|
+
* which provides a structured way to build the necessary transaction instructions for the reward
|
|
311
|
+
* claiming process.
|
|
312
|
+
*
|
|
313
|
+
* @param {web3.PublicKey} userWallet - The public key of the user's wallet executing the transaction.
|
|
314
|
+
* @param {web3.PublicKey} payer - The public key of the transaction payer.
|
|
315
|
+
* @param {Object} params - The parameters for claiming rewards.
|
|
316
|
+
* @param {web3.PublicKey} params.owner - The public key of the owner of the position.
|
|
317
|
+
* @param {LbPosition} params.position - The position object representing the liquidity position.
|
|
318
|
+
* @param {Function} meteoraToHawksight - A function to convert Meteora instructions to Hawksight instructions.
|
|
319
|
+
*
|
|
320
|
+
* @returns {Promise<ClaimAllRewardsByPositionBuilder>} - A promise that resolves to a `ClaimAllRewardsByPositionBuilder` object.
|
|
321
|
+
*/
|
|
322
|
+
claimAllRewardsByPosition(connection: web3.Connection, userWallet: web3.PublicKey, payer: web3.PublicKey, params: {
|
|
323
|
+
owner: web3.PublicKey;
|
|
324
|
+
lbPair: web3.PublicKey;
|
|
325
|
+
position: web3.PublicKey;
|
|
326
|
+
pdaTokenType: TokenType;
|
|
327
|
+
}, meteoraToHawksight: MeteoraToHawksightFn): Promise<ClaimAllRewardsByPositionBuilder>;
|
|
328
|
+
constants(program: ClmmProgram): {
|
|
329
|
+
MAX_BIN_ARRAY_SIZE: BN;
|
|
330
|
+
MAX_BIN_PER_POSITION: BN;
|
|
331
|
+
BIN_ARRAY_BITMAP_SIZE: BN;
|
|
332
|
+
EXTENSION_BINARRAY_BITMAP_SIZE: BN;
|
|
333
|
+
};
|
|
334
|
+
static findMeteoraTickArrayIndices(minBinId: number, maxBinId: number): BN[];
|
|
335
|
+
static findMeteoraTickArrays(lbPair: web3.PublicKey, minBinId: number, maxBinId: number): web3.PublicKey[];
|
|
336
|
+
deriveReserve(token: web3.PublicKey, lbPair: web3.PublicKey): web3.PublicKey;
|
|
337
|
+
static deriveBinArray(lbPair: web3.PublicKey, index: BN): web3.PublicKey;
|
|
338
|
+
static binIdToBinArrayIndex(MAX_BIN_ARRAY_SIZE: BN, binId: BN): BN;
|
|
339
|
+
getPositionAndLbPair(connection: web3.Connection, lbPair: web3.PublicKey, position: web3.PublicKey): Promise<{
|
|
340
|
+
lbPairAccount: any;
|
|
341
|
+
positionAccount: any;
|
|
342
|
+
constants: any;
|
|
343
|
+
}>;
|
|
344
|
+
/**
|
|
345
|
+
* Returns all position of user
|
|
346
|
+
*
|
|
347
|
+
* @param connection
|
|
348
|
+
* @param userPda
|
|
349
|
+
*/
|
|
350
|
+
getAllUserPosition(connection: web3.Connection, userPda: web3.PublicKey): Promise<web3.PublicKey[]>;
|
|
351
|
+
getPositions(dlmm: DLMM, positions: web3.PublicKey[]): Promise<[{
|
|
352
|
+
lbPair: web3.PublicKey;
|
|
353
|
+
owner: web3.PublicKey;
|
|
354
|
+
liquidityShares: BN[];
|
|
355
|
+
rewardInfos: {
|
|
356
|
+
rewardPerTokenCompletes: BN[];
|
|
357
|
+
rewardPendings: BN[];
|
|
358
|
+
}[];
|
|
359
|
+
feeInfos: {
|
|
360
|
+
feeXPerTokenComplete: BN;
|
|
361
|
+
feeYPerTokenComplete: BN;
|
|
362
|
+
feeXPending: BN;
|
|
363
|
+
feeYPending: BN;
|
|
364
|
+
}[];
|
|
365
|
+
lowerBinId: number;
|
|
366
|
+
upperBinId: number;
|
|
367
|
+
lastUpdatedAt: BN;
|
|
368
|
+
totalClaimedFeeXAmount: BN;
|
|
369
|
+
totalClaimedFeeYAmount: BN;
|
|
370
|
+
totalClaimedRewards: BN[];
|
|
371
|
+
operator: web3.PublicKey;
|
|
372
|
+
lockReleasePoint: BN;
|
|
373
|
+
padding0: number;
|
|
374
|
+
feeOwner: web3.PublicKey;
|
|
375
|
+
reserved: number[];
|
|
376
|
+
}, LbPosition][]>;
|
|
377
|
+
/**
|
|
378
|
+
* Generate instruction that claims all fees and rewards by user
|
|
379
|
+
*
|
|
380
|
+
* @param connection
|
|
381
|
+
* @param lbPair
|
|
382
|
+
* @param positions
|
|
383
|
+
* @param userPda
|
|
384
|
+
* @returns
|
|
385
|
+
*/
|
|
386
|
+
claimFeeAndRewardIxs2(connection: web3.Connection, positions: web3.PublicKey[], userWallet: web3.PublicKey, userPda: web3.PublicKey, meteoraToHawksight: MeteoraToHawksightFn, lbPair?: web3.PublicKey): Promise<ClaimAllRewardsByPositionBuilder>;
|
|
387
|
+
claimFee2AndReward2Ixs(connection: web3.Connection, lbPair: web3.PublicKey, position: web3.PublicKey, userPda: web3.PublicKey, tokenProgramX: web3.PublicKey, tokenProgramY: web3.PublicKey): Promise<web3.TransactionInstruction[]>;
|
|
388
|
+
claimFee2Ix(lbPair: web3.PublicKey, position: web3.PublicKey, userPda: web3.PublicKey, tokenProgramX: web3.PublicKey, tokenProgramY: web3.PublicKey, getPositionAndLbPairResult: {
|
|
389
|
+
lbPairAccount: any;
|
|
390
|
+
positionAccount: any;
|
|
391
|
+
constants: any;
|
|
392
|
+
}): web3.TransactionInstruction;
|
|
393
|
+
claimReward2Ixs(lbPair: web3.PublicKey, position: web3.PublicKey, userPda: web3.PublicKey, getPositionAndLbPairResult: {
|
|
394
|
+
lbPairAccount: any;
|
|
395
|
+
positionAccount: any;
|
|
396
|
+
constants: any;
|
|
397
|
+
}): web3.TransactionInstruction[];
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* A builder class for constructing transaction instructions to claim all rewards by position.
|
|
401
|
+
*
|
|
402
|
+
* This class provides a structured way to build the necessary transaction instructions for claiming
|
|
403
|
+
* rewards, removing liquidity, and managing wrapped SOL (wSOL) accounts.
|
|
404
|
+
*/
|
|
405
|
+
export declare class ClaimAllRewardsByPositionBuilder {
|
|
406
|
+
readonly createAtaIxs: web3.TransactionInstruction[];
|
|
407
|
+
readonly mainIxs: web3.TransactionInstruction[];
|
|
408
|
+
readonly withdrawMultipleTokenIx: web3.TransactionInstruction;
|
|
409
|
+
readonly unwrapWsolIxs: web3.TransactionInstruction[];
|
|
410
|
+
/**
|
|
411
|
+
* Constructs an instance of the ClaimAllRewardsByPositionBuilder class.
|
|
412
|
+
*
|
|
413
|
+
* @param {web3.TransactionInstruction[]} createAtaIxs - Instructions to create associated token accounts (ATAs) prior to withdrawal.
|
|
414
|
+
* @param {web3.TransactionInstruction[]} mainIxs - Main instructions for claiming fees and/or rewards.
|
|
415
|
+
* @param {web3.TransactionInstruction} withdrawMultipleTokenIx - Instruction to withdraw multiple tokens to the user wallet.
|
|
416
|
+
* @param {web3.TransactionInstruction[]} unwrapWsolIxs - Instructions to close wSOL accounts, if any.
|
|
417
|
+
*/
|
|
418
|
+
constructor(createAtaIxs: web3.TransactionInstruction[], mainIxs: web3.TransactionInstruction[], withdrawMultipleTokenIx: web3.TransactionInstruction, unwrapWsolIxs: web3.TransactionInstruction[]);
|
|
419
|
+
/**
|
|
420
|
+
* Builds the default sequence of transaction instructions for claiming all rewards by position.
|
|
421
|
+
*
|
|
422
|
+
* This method returns an array of transaction instructions that includes:
|
|
423
|
+
* - Initializing ATAs prior to withdrawal
|
|
424
|
+
* - Claiming fees and/or rewards
|
|
425
|
+
* - Withdrawing tokens to the user wallet
|
|
426
|
+
* - Closing wSOL accounts, if any
|
|
427
|
+
*
|
|
428
|
+
* @returns {web3.TransactionInstruction[]} - An array of transaction instructions in the required order.
|
|
429
|
+
*/
|
|
430
|
+
default(): web3.TransactionInstruction[];
|
|
431
|
+
/**
|
|
432
|
+
* Replaces claim fee token ixs into storage token account
|
|
433
|
+
*/
|
|
434
|
+
replaceClaimFeeTokenToSTA(): void;
|
|
435
|
+
/**
|
|
436
|
+
* Replaces reward token into storage token account for ALL reward claim instructions.
|
|
437
|
+
* DLMM pools can have up to 2 reward farms, so we need to handle multiple reward claims.
|
|
438
|
+
*/
|
|
439
|
+
replaceClaimRewardToSTA(): void;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* A builder class for constructing transaction instructions to add liquidity according to a specified strategy.
|
|
443
|
+
*
|
|
444
|
+
* This class provides a structured way to build the necessary transaction instructions for adding liquidity to a position
|
|
445
|
+
* based on a strategy, handling operations such as wrapping SOL, depositing tokens, adding liquidity, refunding dust, and
|
|
446
|
+
* managing wrapped SOL (wSOL) accounts.
|
|
447
|
+
*/
|
|
448
|
+
export declare class AddLiquidityByStrategyBuilder {
|
|
449
|
+
readonly wrapSolIxs: web3.TransactionInstruction[];
|
|
450
|
+
readonly depositToPdaIxs: web3.TransactionInstruction;
|
|
451
|
+
readonly mainIxs: web3.TransactionInstruction[];
|
|
452
|
+
readonly refundDustIxs: web3.TransactionInstruction;
|
|
453
|
+
readonly unwrapWsolIxs: web3.TransactionInstruction[];
|
|
454
|
+
/**
|
|
455
|
+
* Constructs an instance of the AddLiquidityByStrategyBuilder class.
|
|
456
|
+
*
|
|
457
|
+
* @param {web3.TransactionInstruction[]} wrapSolIxs - Instructions to wrap SOL to wSOL if needed.
|
|
458
|
+
* @param {web3.TransactionInstruction} depositToPdaIxs - Instruction to deposit X and Y tokens to the UserPDA.
|
|
459
|
+
* @param {web3.TransactionInstruction[]} mainIxs - Main instructions for adding liquidity by strategy.
|
|
460
|
+
* @param {web3.TransactionInstruction} refundDustIxs - Instruction to refund dust tokens to the user wallet.
|
|
461
|
+
* @param {web3.TransactionInstruction[]} unwrapWsolIxs - Instructions to unwrap wSOL to SOL if any.
|
|
462
|
+
*/
|
|
463
|
+
constructor(wrapSolIxs: web3.TransactionInstruction[], depositToPdaIxs: web3.TransactionInstruction, mainIxs: web3.TransactionInstruction[], refundDustIxs: web3.TransactionInstruction, unwrapWsolIxs: web3.TransactionInstruction[]);
|
|
464
|
+
/**
|
|
465
|
+
* Builds the default sequence of transaction instructions for adding liquidity by strategy.
|
|
466
|
+
*
|
|
467
|
+
* This method returns an array of transaction instructions that includes:
|
|
468
|
+
* - Initializing wSOL token accounts if needed
|
|
469
|
+
* - Depositing X and Y tokens to the UserPDA
|
|
470
|
+
* - Adding liquidity according to the strategy
|
|
471
|
+
* - Refunding dust tokens to the user wallet
|
|
472
|
+
* - Closing wSOL accounts if any
|
|
473
|
+
*
|
|
474
|
+
* @returns {web3.TransactionInstruction[]} - An array of transaction instructions in the required order.
|
|
475
|
+
*/
|
|
476
|
+
default(): web3.TransactionInstruction[];
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* A builder class for constructing transaction instructions to remove liquidity from a position.
|
|
480
|
+
*
|
|
481
|
+
* This class provides a structured way to build the necessary transaction instructions for removing liquidity
|
|
482
|
+
* from a position, handling operations such as creating associated token accounts (ATAs), claiming rewards,
|
|
483
|
+
* withdrawing tokens, and managing wrapped SOL (wSOL) accounts.
|
|
484
|
+
*/
|
|
485
|
+
export declare class RemoveLiquidityBuilder {
|
|
486
|
+
readonly createAtaIxs: web3.TransactionInstruction[];
|
|
487
|
+
readonly mainIxs: web3.TransactionInstruction[];
|
|
488
|
+
readonly withdrawMultipleTokenIx: web3.TransactionInstruction;
|
|
489
|
+
readonly unwrapWsolIxs: web3.TransactionInstruction[];
|
|
490
|
+
/**
|
|
491
|
+
* Constructs an instance of the RemoveLiquidityBuilder class.
|
|
492
|
+
*
|
|
493
|
+
* @param {web3.TransactionInstruction[]} createAtaIxs - Instructions to create associated token accounts (ATAs) prior to withdrawal.
|
|
494
|
+
* @param {web3.TransactionInstruction[]} mainIxs - Main instructions for claiming fees/rewards, removing liquidity, and possibly closing the position.
|
|
495
|
+
* @param {web3.TransactionInstruction} withdrawMultipleTokenIx - Instruction to withdraw multiple tokens to the user wallet.
|
|
496
|
+
* @param {web3.TransactionInstruction[]} unwrapWsolIxs - Instructions to close wSOL accounts, if any.
|
|
497
|
+
*/
|
|
498
|
+
constructor(createAtaIxs: web3.TransactionInstruction[], mainIxs: web3.TransactionInstruction[], withdrawMultipleTokenIx: web3.TransactionInstruction, unwrapWsolIxs: web3.TransactionInstruction[]);
|
|
499
|
+
/**
|
|
500
|
+
* Builds the default sequence of transaction instructions for removing liquidity from a position.
|
|
501
|
+
*
|
|
502
|
+
* This method returns an array of transaction instructions that includes:
|
|
503
|
+
* - Initializing associated token accounts (ATAs) prior to withdrawal
|
|
504
|
+
* - Claiming fees and/or rewards, removing liquidity, and possibly closing the position
|
|
505
|
+
* - Withdrawing tokens to the user wallet
|
|
506
|
+
* - Closing wSOL accounts, if any
|
|
507
|
+
*
|
|
508
|
+
* @returns {web3.TransactionInstruction[]} - An array of transaction instructions in the required order.
|
|
509
|
+
*/
|
|
510
|
+
default(): web3.TransactionInstruction[];
|
|
511
|
+
/**
|
|
512
|
+
* Replaces claim fee token ixs into storage token account
|
|
513
|
+
*/
|
|
514
|
+
replaceClaimFeeTokenToSTA(): void;
|
|
515
|
+
/**
|
|
516
|
+
* Replaces reward token into storage token account for ALL reward claim instructions.
|
|
517
|
+
* DLMM pools can have up to 2 reward farms, so we need to handle multiple reward claims.
|
|
518
|
+
*/
|
|
519
|
+
replaceClaimRewardToSTA(): void;
|
|
520
|
+
/**
|
|
521
|
+
* Replaces claim fee token ixs into associated token account
|
|
522
|
+
*/
|
|
523
|
+
replaceClaimFeeTokenToATA(): void;
|
|
524
|
+
/**
|
|
525
|
+
* Replaces reward token into associated token account for ALL reward claim instructions.
|
|
526
|
+
* DLMM pools can have up to 2 reward farms, so we need to handle multiple reward claims.
|
|
527
|
+
*/
|
|
528
|
+
replaceClaimRewardToATA(): void;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* A builder class for constructing transaction instructions to remove liquidity from a position to the pda.
|
|
532
|
+
*
|
|
533
|
+
* This class provides a structured way to build the necessary transaction instructions for removing liquidity
|
|
534
|
+
* from a position, handling operations such as creating associated token accounts (ATAs), claiming rewards,
|
|
535
|
+
* withdrawing tokens, and managing wrapped SOL (wSOL) accounts.
|
|
536
|
+
*/
|
|
537
|
+
export declare class RemoveLiquidityPdaBuilder {
|
|
538
|
+
readonly mainIxs: web3.TransactionInstruction[];
|
|
539
|
+
/**
|
|
540
|
+
* Constructs an instance of the RemoveLiquidityBuilder class.
|
|
541
|
+
*
|
|
542
|
+
* @param {web3.TransactionInstruction[]} createAtaIxs - Instructions to create associated token accounts (ATAs) prior to withdrawal.
|
|
543
|
+
* @param {web3.TransactionInstruction[]} mainIxs - Main instructions for claiming fees/rewards, removing liquidity, and possibly closing the position.
|
|
544
|
+
* @param {web3.TransactionInstruction[]} unwrapWsolIxs - Instructions to close wSOL accounts, if any.
|
|
545
|
+
*/
|
|
546
|
+
constructor(mainIxs: web3.TransactionInstruction[]);
|
|
547
|
+
/**
|
|
548
|
+
* Builds the default sequence of transaction instructions for removing liquidity from a position.
|
|
549
|
+
*
|
|
550
|
+
* This method returns an array of transaction instructions that includes:
|
|
551
|
+
* - Initializing associated token accounts (ATAs) prior to withdrawal
|
|
552
|
+
* - Claiming fees and/or rewards, removing liquidity, and possibly closing the position
|
|
553
|
+
* - Withdrawing tokens to the user wallet
|
|
554
|
+
* - Closing wSOL accounts, if any
|
|
555
|
+
*
|
|
556
|
+
* @returns {web3.TransactionInstruction[]} - An array of transaction instructions in the required order.
|
|
557
|
+
*/
|
|
558
|
+
default(): web3.TransactionInstruction[];
|
|
559
|
+
/**
|
|
560
|
+
* Replaces claim fee token ixs into storage token account
|
|
561
|
+
*/
|
|
562
|
+
replaceClaimFeeTokenToSTA(): void;
|
|
563
|
+
/**
|
|
564
|
+
* Replaces reward token into storage token account for ALL reward claim instructions.
|
|
565
|
+
* DLMM pools can have up to 2 reward farms, so we need to handle multiple reward claims.
|
|
566
|
+
*/
|
|
567
|
+
replaceClaimRewardToSTA(): void;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* A builder class for constructing transaction instructions to remove liquidity from a position.
|
|
571
|
+
*
|
|
572
|
+
* This class provides a structured way to build the necessary transaction instructions for removing liquidity
|
|
573
|
+
* from a position, handling operations such as creating associated token accounts (ATAs), claiming rewards,
|
|
574
|
+
* withdrawing tokens, and managing wrapped SOL (wSOL) accounts.
|
|
575
|
+
*/
|
|
576
|
+
export declare class InitializePositionAndAddLiquidityByStrategyBuilder {
|
|
577
|
+
readonly wrapSolIxs: web3.TransactionInstruction[];
|
|
578
|
+
readonly depositToPdaIxs: web3.TransactionInstruction;
|
|
579
|
+
readonly mainIxs: web3.TransactionInstruction[];
|
|
580
|
+
readonly refundDustIxs: web3.TransactionInstruction;
|
|
581
|
+
readonly unwrapWsolIxs: web3.TransactionInstruction[];
|
|
582
|
+
/**
|
|
583
|
+
* Constructs an instance of the InitializePositionAndAddLiquidityByStrategyBuilder class.
|
|
584
|
+
*
|
|
585
|
+
* @param {web3.TransactionInstruction[]} wrapSolIxs - Instructions to wrap SOL to wSOL if needed.
|
|
586
|
+
* @param {web3.TransactionInstruction} depositToPdaIxs - Instruction to deposit X and Y tokens to the UserPDA.
|
|
587
|
+
* @param {web3.TransactionInstruction[]} mainIxs - Main instructions for adding liquidity by strategy.
|
|
588
|
+
* @param {web3.TransactionInstruction} refundDustIxs - Instruction to refund dust tokens to the user wallet.
|
|
589
|
+
* @param {web3.TransactionInstruction[]} unwrapWsolIxs - Instructions to unwrap wSOL to SOL if any.
|
|
590
|
+
*/
|
|
591
|
+
constructor(wrapSolIxs: web3.TransactionInstruction[], depositToPdaIxs: web3.TransactionInstruction, mainIxs: web3.TransactionInstruction[], refundDustIxs: web3.TransactionInstruction, unwrapWsolIxs: web3.TransactionInstruction[]);
|
|
592
|
+
/**
|
|
593
|
+
* Builds the default sequence of transaction instructions for removing liquidity from a position.
|
|
594
|
+
*
|
|
595
|
+
* This method returns an array of transaction instructions that includes:
|
|
596
|
+
* - Initializing associated token accounts (ATAs) prior to withdrawal
|
|
597
|
+
* - Claiming fees and/or rewards, removing liquidity, and possibly closing the position
|
|
598
|
+
* - Withdrawing tokens to the user wallet
|
|
599
|
+
* - Closing wSOL accounts, if any
|
|
600
|
+
*
|
|
601
|
+
* @returns {web3.TransactionInstruction[]} - An array of transaction instructions in the required order.
|
|
602
|
+
*/
|
|
603
|
+
default(): web3.TransactionInstruction[];
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* A builder class for constructing transaction instructions to remove liquidity from a position.
|
|
607
|
+
*
|
|
608
|
+
* This class provides a structured way to build the necessary transaction instructions for removing liquidity
|
|
609
|
+
* from a position, handling operations such as creating associated token accounts (ATAs), claiming rewards,
|
|
610
|
+
* withdrawing tokens, and managing wrapped SOL (wSOL) accounts.
|
|
611
|
+
*/
|
|
612
|
+
export declare class InitializePositionAndAddLiquidityByStrategyBuilderLabeled {
|
|
613
|
+
readonly wrapSolIxs: LabeledInstruction[];
|
|
614
|
+
readonly depositToPdaIxs: LabeledInstruction;
|
|
615
|
+
readonly mainIxs: LabeledInstruction[];
|
|
616
|
+
readonly refundDustIxs: LabeledInstruction;
|
|
617
|
+
readonly unwrapWsolIxs: LabeledInstruction[];
|
|
618
|
+
/**
|
|
619
|
+
* Constructs an instance of the InitializePositionAndAddLiquidityByStrategyBuilderLabeled class.
|
|
620
|
+
*
|
|
621
|
+
* @param {LabeledInstruction[]} wrapSolIxs - Instructions to wrap SOL to wSOL if needed.
|
|
622
|
+
* @param {LabeledInstruction} depositToPdaIxs - Instruction to deposit X and Y tokens to the UserPDA.
|
|
623
|
+
* @param {LabeledInstruction[]} mainIxs - Main instructions for adding liquidity by strategy.
|
|
624
|
+
* @param {LabeledInstruction} refundDustIxs - Instruction to refund dust tokens to the user wallet.
|
|
625
|
+
* @param {LabeledInstruction[]} unwrapWsolIxs - Instructions to unwrap wSOL to SOL if any.
|
|
626
|
+
*/
|
|
627
|
+
constructor(wrapSolIxs: LabeledInstruction[], depositToPdaIxs: LabeledInstruction, mainIxs: LabeledInstruction[], refundDustIxs: LabeledInstruction, unwrapWsolIxs: LabeledInstruction[]);
|
|
628
|
+
/**
|
|
629
|
+
* Builds the default sequence of transaction instructions for removing liquidity from a position.
|
|
630
|
+
*
|
|
631
|
+
* This method returns an array of transaction instructions that includes:
|
|
632
|
+
* - Initializing associated token accounts (ATAs) prior to withdrawal
|
|
633
|
+
* - Claiming fees and/or rewards, removing liquidity, and possibly closing the position
|
|
634
|
+
* - Withdrawing tokens to the user wallet
|
|
635
|
+
* - Closing wSOL accounts, if any
|
|
636
|
+
*
|
|
637
|
+
* @returns {LabeledInstruction[]} - An array of transaction instructions in the required order.
|
|
638
|
+
*/
|
|
639
|
+
default(): LabeledInstruction[];
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* A builder class for constructing transaction instructions to remove liquidity from a position.
|
|
643
|
+
*
|
|
644
|
+
* This class provides a structured way to build the necessary transaction instructions for removing liquidity
|
|
645
|
+
* from a position, handling operations such as creating associated token accounts (ATAs), claiming rewards,
|
|
646
|
+
* withdrawing tokens, and managing wrapped SOL (wSOL) accounts.
|
|
647
|
+
*/
|
|
648
|
+
export declare class InitializePositionAndAddLiquidityByStrategyPdaBuilder {
|
|
649
|
+
readonly mainIxs: web3.TransactionInstruction[];
|
|
650
|
+
/**
|
|
651
|
+
* Constructs an instance of the InitializePositionAndAddLiquidityByStrategyBuilder class.
|
|
652
|
+
*
|
|
653
|
+
* @param {web3.TransactionInstruction[]} mainIxs - Main instructions for adding liquidity by strategy.
|
|
654
|
+
*/
|
|
655
|
+
constructor(mainIxs: web3.TransactionInstruction[]);
|
|
656
|
+
/**
|
|
657
|
+
* Builds the default sequence of transaction instructions for removing liquidity from a position.
|
|
658
|
+
*
|
|
659
|
+
* This method returns an array of transaction instructions that includes:
|
|
660
|
+
* - Initializing associated token accounts (ATAs) prior to withdrawal
|
|
661
|
+
* - Claiming fees and/or rewards, removing liquidity, and possibly closing the position
|
|
662
|
+
* - Withdrawing tokens to the user wallet
|
|
663
|
+
* - Closing wSOL accounts, if any
|
|
664
|
+
*
|
|
665
|
+
* @returns {web3.TransactionInstruction[]} - An array of transaction instructions in the required order.
|
|
666
|
+
*/
|
|
667
|
+
default(): web3.TransactionInstruction[];
|
|
668
|
+
}
|
|
669
|
+
//# sourceMappingURL=meteora.d.ts.map
|