@hawksightco/hawk-sdk 1.3.200 → 1.3.202
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/src/classes/Transactions.d.ts +218 -18
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +1695 -263
- package/dist/src/classes/TxGenerator.d.ts +39 -7
- package/dist/src/classes/TxGenerator.d.ts.map +1 -1
- package/dist/src/classes/TxGenerator.js +189 -6
- package/dist/src/classes/TxGeneratorAutomations.d.ts +79 -1
- package/dist/src/classes/TxGeneratorAutomations.d.ts.map +1 -1
- package/dist/src/classes/TxGeneratorAutomations.js +288 -0
- package/dist/src/functions.js +1 -1
- package/dist/src/hsToMeteora.js +6 -6
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts +21 -2
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +147 -10
- package/dist/src/meteora/liquidityStrategy.d.ts +31 -0
- package/dist/src/meteora/liquidityStrategy.d.ts.map +1 -1
- package/dist/src/meteora/liquidityStrategy.js +76 -0
- package/dist/src/types.d.ts +100 -40
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +20 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as web3 from '@solana/web3.js';
|
|
2
|
-
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraRedeposit, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, MeteoraRebalance3, LabeledInstructions, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RelativeOpenAutomationIx, RaydiumWithdrawAndClosePosition, MeteoraCreatePoolAndPosition, ClaimTokenFromPda, MeteoraInitializeLargePosition,
|
|
2
|
+
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraRedeposit, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, MeteoraRebalance3, LabeledInstructions, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RelativeOpenAutomationIx, RaydiumWithdrawAndClosePosition, MeteoraCreatePoolAndPosition, ClaimTokenFromPda, MeteoraInitializeLargePosition, MeteoraDepositLargerPosition, MeteoraWithdrawLargerPosition, MeteoraRebalanceForLargerPosition, MeteoraRebalanceLargePositionAutomation2, MeteoraReshapePositionAutomationParams } from '../types';
|
|
3
3
|
import { RaydiumIncreaseLiquidity, RaydiumOpenPosition, RaydiumDecreaseLiquidity } from '../types';
|
|
4
4
|
import { GeneralUtility } from './GeneralUtility';
|
|
5
5
|
import { MultiTransaction } from './MultiTransaction';
|
|
@@ -55,6 +55,8 @@ export declare class Transactions {
|
|
|
55
55
|
/**
|
|
56
56
|
* Creates meteora instruction that creates new position and deposit.
|
|
57
57
|
*
|
|
58
|
+
* @deprecated Use meteoraCreatePositionAndDepositToLargePosition instead.
|
|
59
|
+
*
|
|
58
60
|
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
59
61
|
* @param payer The public key of the payer for transaction fees.
|
|
60
62
|
* @param params Parameters required
|
|
@@ -65,6 +67,8 @@ export declare class Transactions {
|
|
|
65
67
|
* Creates meteora instruction that creates new position and deposit
|
|
66
68
|
* - Supports larger positions
|
|
67
69
|
*
|
|
70
|
+
* @deprecated Use meteoraCreatePositionAndDepositToLargePosition instead.
|
|
71
|
+
*
|
|
68
72
|
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
69
73
|
* @param payer The public key of the payer for transaction fees.
|
|
70
74
|
* @param params Parameters required
|
|
@@ -102,6 +106,8 @@ export declare class Transactions {
|
|
|
102
106
|
/**
|
|
103
107
|
* Creates meteora instruction that deposits to position.
|
|
104
108
|
*
|
|
109
|
+
* @deprecated Use meteoraDepositToLargePosition instead
|
|
110
|
+
*
|
|
105
111
|
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
106
112
|
* @param payer The public key of the payer for transaction fees.
|
|
107
113
|
* @param params Parameters required
|
|
@@ -111,6 +117,8 @@ export declare class Transactions {
|
|
|
111
117
|
/**
|
|
112
118
|
* Creates meteora instruction that deposits to position.
|
|
113
119
|
*
|
|
120
|
+
* @deprecated Use meteoraDepositToLargePosition instead
|
|
121
|
+
*
|
|
114
122
|
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
115
123
|
* @param payer The public key of the payer for transaction fees.
|
|
116
124
|
* @param params Parameters required
|
|
@@ -120,6 +128,8 @@ export declare class Transactions {
|
|
|
120
128
|
/**
|
|
121
129
|
* Creates meteora instruction withdraws from a position.
|
|
122
130
|
*
|
|
131
|
+
* @deprecated Use meteoraWithdrawLargePosition instead
|
|
132
|
+
*
|
|
123
133
|
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
124
134
|
* @param payer The public key of the payer for transaction fees.
|
|
125
135
|
* @param params Parameters required
|
|
@@ -138,6 +148,8 @@ export declare class Transactions {
|
|
|
138
148
|
/**
|
|
139
149
|
* Withdraws liquidity from a Meteora DLMM position using simple instructions.
|
|
140
150
|
*
|
|
151
|
+
* @deprecated Use meteoraWithdrawLargePosition instead
|
|
152
|
+
*
|
|
141
153
|
* Unlike meteoraWithdraw which uses Meteora SDK (that generates multiple claimFee ixs
|
|
142
154
|
* potentially bloating tx size), this method uses direct instructions:
|
|
143
155
|
* - removeLiquidityByRange2: Withdraw liquidity from the specified bin range
|
|
@@ -149,7 +161,48 @@ export declare class Transactions {
|
|
|
149
161
|
* @param params Parameters required for withdrawal
|
|
150
162
|
* @returns A ResponseWithStatus containing TransactionMetadataResponse.
|
|
151
163
|
*/
|
|
152
|
-
meteoraWithdrawLargerPosition({ connection, params, }: TxgenParams<MeteoraWithdrawLargerPosition>): Promise<TransactionMetadataResponse>;
|
|
164
|
+
meteoraWithdrawLargerPosition({ connection, params, fetch, }: TxgenParams<MeteoraWithdrawLargerPosition>): Promise<TransactionMetadataResponse>;
|
|
165
|
+
/**
|
|
166
|
+
* Withdraw liquidity from a large Meteora DLMM position (up to 1400 bins).
|
|
167
|
+
*
|
|
168
|
+
* - For ≤149 bins: delegates to meteoraWithdrawLargerPosition (single tx)
|
|
169
|
+
* - For ≥150 bins: resolves pool data once, chunks into ≤149-bin ranges,
|
|
170
|
+
* calls _buildWithdrawInstructions per chunk. Only the last chunk sets
|
|
171
|
+
* shouldClaimAndClose (if requested).
|
|
172
|
+
*
|
|
173
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
174
|
+
* @param params MeteoraWithdrawLargerPosition parameters
|
|
175
|
+
* @returns Array of TransactionMetadataResponse, one per chunk
|
|
176
|
+
*/
|
|
177
|
+
meteoraWithdrawLargePosition({ connection, params, }: {
|
|
178
|
+
connection: web3.Connection;
|
|
179
|
+
params: MeteoraWithdrawLargerPosition;
|
|
180
|
+
}): Promise<TransactionMetadataResponse[]>;
|
|
181
|
+
/**
|
|
182
|
+
* Withdraws liquidity from a Meteora DLMM position using simple instructions.
|
|
183
|
+
*
|
|
184
|
+
* Unlike meteoraWithdraw which uses Meteora SDK (that generates multiple claimFee ixs
|
|
185
|
+
* potentially bloating tx size), this method uses direct instructions:
|
|
186
|
+
* - removeLiquidityByRange2: Withdraw liquidity from the specified bin range
|
|
187
|
+
* - claimFee2: Single instruction to claim fees
|
|
188
|
+
* - claimReward2: N instructions (one per active reward)
|
|
189
|
+
* - closePositionIfEmpty: Closes position if shouldClaimAndClose is true
|
|
190
|
+
*
|
|
191
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
192
|
+
* @param params Parameters required for withdrawal
|
|
193
|
+
* @returns A ResponseWithStatus containing TransactionMetadataResponse.
|
|
194
|
+
*/
|
|
195
|
+
private _meteoraWithdrawLargerPosition;
|
|
196
|
+
/**
|
|
197
|
+
* Resolves pool data needed for withdraw instructions.
|
|
198
|
+
* Call once, then pass the result to _buildWithdrawInstructions for each chunk.
|
|
199
|
+
*/
|
|
200
|
+
private _resolveWithdrawPoolData;
|
|
201
|
+
/**
|
|
202
|
+
* Builds withdraw instructions for a single bin range chunk.
|
|
203
|
+
* Requires pre-resolved pool data (from _resolveWithdrawPoolData).
|
|
204
|
+
*/
|
|
205
|
+
private _buildWithdrawInstructions;
|
|
153
206
|
/**
|
|
154
207
|
* Creates meteora instruction that claims fees and rewards.
|
|
155
208
|
*
|
|
@@ -159,6 +212,21 @@ export declare class Transactions {
|
|
|
159
212
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse.
|
|
160
213
|
*/
|
|
161
214
|
meteoraClaim({ connection, params, }: TxgenParams<MeteoraClaim>): Promise<TransactionMetadataResponse>;
|
|
215
|
+
/**
|
|
216
|
+
* Claim fees and rewards from a large Meteora DLMM position (up to 1400 bins).
|
|
217
|
+
*
|
|
218
|
+
* For ≤149 bins, delegates to the single-TX meteoraClaim.
|
|
219
|
+
* For ≥150 bins, chunks the bin range into ≤149-bin pieces and builds
|
|
220
|
+
* claimFee2 + claimReward2 per chunk, returning multiple TXs.
|
|
221
|
+
*
|
|
222
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
223
|
+
* @param params MeteoraClaim parameters (userWallet, position, fastGeneration)
|
|
224
|
+
* @returns Array of TransactionMetadataResponse, one per chunk
|
|
225
|
+
*/
|
|
226
|
+
meteoraClaimLargePosition({ connection, params, }: {
|
|
227
|
+
connection: web3.Connection;
|
|
228
|
+
params: MeteoraClaim;
|
|
229
|
+
}): Promise<TransactionMetadataResponse[]>;
|
|
162
230
|
/**
|
|
163
231
|
* Claim all meteora fees and rewards by list of pools owned by given user
|
|
164
232
|
*
|
|
@@ -200,10 +268,58 @@ export declare class Transactions {
|
|
|
200
268
|
* @returns
|
|
201
269
|
*/
|
|
202
270
|
claimTokensFromSta({ connection, params, }: TxgenParams<ClaimTokensFromSTA>): Promise<TransactionMetadataResponse>;
|
|
271
|
+
/**
|
|
272
|
+
* @deprecated Use compoundFromLargePositionAutomationIx instead
|
|
273
|
+
*/
|
|
203
274
|
compoundAutomationIx({ connection, params, }: TxgenParams<MeteoraCompound>): Promise<TransactionMetadataResponse>;
|
|
204
275
|
redepositAutomationIx({ connection, params, }: TxgenParams<MeteoraRedeposit>): Promise<TransactionMetadataResponse>;
|
|
276
|
+
/**
|
|
277
|
+
* @deprecated Use claimFromLargePositionAutomationIx instead
|
|
278
|
+
*
|
|
279
|
+
* @param param0
|
|
280
|
+
* @returns
|
|
281
|
+
*/
|
|
205
282
|
claimAutomationIx({ connection, params, }: TxgenParams<MeteoraCompound>): Promise<TransactionMetadataResponse>;
|
|
283
|
+
/**
|
|
284
|
+
* Claim fees and rewards from a large Meteora DLMM position (up to 1400 bins).
|
|
285
|
+
*
|
|
286
|
+
* For ≤149 bins, delegates to the single-TX claimAutomationIx.
|
|
287
|
+
* For ≥150 bins, chunks the bin range into ≤149-bin pieces and builds
|
|
288
|
+
* claimFee2Automation + claimReward2Automation per chunk, returning multiple TXs.
|
|
289
|
+
*
|
|
290
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
291
|
+
* @param params Parameters required for claim (MeteoraCompound: userWallet, position)
|
|
292
|
+
* @returns Array of TransactionMetadataResponse for each transaction
|
|
293
|
+
*/
|
|
294
|
+
claimFromLargePositionAutomationIx({ connection, params, }: TxgenParams<MeteoraCompound>): Promise<TransactionMetadataResponse[]>;
|
|
295
|
+
/**
|
|
296
|
+
* Compound (claim + re-deposit) fees and rewards from a large Meteora DLMM position (up to 1400 bins).
|
|
297
|
+
*
|
|
298
|
+
* For ≤149 bins, delegates to the single-TX compoundAutomationIx.
|
|
299
|
+
* For ≥150 bins:
|
|
300
|
+
* Phase 1: Chunked claim (claimFee2Automation + claimReward2Automation per chunk, to ATA)
|
|
301
|
+
* Phase 2: Chunked re-deposit (rebalanceLiquidityAutomation per chunk, back into same position)
|
|
302
|
+
*
|
|
303
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
304
|
+
* @param params MeteoraCompound parameters (userWallet, position, distribution)
|
|
305
|
+
* @returns Array of TransactionMetadataResponse for each transaction
|
|
306
|
+
*/
|
|
307
|
+
compoundFromLargePositionAutomationIx({ connection, params, }: TxgenParams<MeteoraCompound>): Promise<TransactionMetadataResponse[]>;
|
|
308
|
+
/**
|
|
309
|
+
* @deprecated Use rebalanceLargerPositionAutomation instead
|
|
310
|
+
*
|
|
311
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
312
|
+
* @param params Parameters required for rebalance
|
|
313
|
+
* @returns A ResponseWithStatus containing TransactionMetadataResponse.
|
|
314
|
+
*/
|
|
206
315
|
rebalanceAutomationIx({ connection, params, }: TxgenParams<MeteoraRebalance>): Promise<TransactionMetadataResponse>;
|
|
316
|
+
/**
|
|
317
|
+
* @deprecated Use rebalanceLargerPositionAutomation instaed
|
|
318
|
+
*
|
|
319
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
320
|
+
* @param params Parameters required for rebalance
|
|
321
|
+
* @returns A ResponseWithStatus containing TransactionMetadataResponse.
|
|
322
|
+
*/
|
|
207
323
|
rebalanceAutomationIx2({ connection, params, }: TxgenParams<MeteoraRebalance2>): Promise<TransactionMetadataResponse>;
|
|
208
324
|
/**
|
|
209
325
|
* Rebalance a Meteora DLMM position with hybrid liquidity support.
|
|
@@ -244,23 +360,86 @@ export declare class Transactions {
|
|
|
244
360
|
*
|
|
245
361
|
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
246
362
|
* @param params Parameters required for rebalance (same as MeteoraRebalance)
|
|
247
|
-
* @returns
|
|
363
|
+
* @returns Array of TransactionMetadataResponse for each transaction
|
|
248
364
|
*/
|
|
365
|
+
rebalanceLargerPositionAutomation({ connection, params, }: TxgenParams<MeteoraRebalanceForLargerPosition>): Promise<TransactionMetadataResponse[]>;
|
|
249
366
|
/**
|
|
250
|
-
* Rebalance a Meteora DLMM position
|
|
251
|
-
*
|
|
252
|
-
* This method chunks the rebalance into multiple transactions:
|
|
253
|
-
* - TX 1: Remove liquidity + claim fees + claim rewards + close position
|
|
254
|
-
* - TX 2: Initialize new position + extend position (if > 70 bins)
|
|
255
|
-
* - TX 3: Initialize bin array + add liquidity (if > 70 bins)
|
|
367
|
+
* Rebalance a large Meteora DLMM position (up to 1400 bins) using automation instructions.
|
|
256
368
|
*
|
|
257
|
-
* For
|
|
369
|
+
* For ≤149 bins, delegates to rebalanceLargerPositionAutomation.
|
|
370
|
+
* For ≥150 bins, uses a chunked multi-TX approach:
|
|
371
|
+
* Phase 1: Chunked withdraw from current position
|
|
372
|
+
* Phase 2: Initialize new large position
|
|
373
|
+
* Phase 3: Chunked deposit to new position
|
|
258
374
|
*
|
|
259
|
-
* @param connection
|
|
260
|
-
* @param params
|
|
375
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
376
|
+
* @param params Parameters required for rebalance
|
|
261
377
|
* @returns Array of TransactionMetadataResponse for each transaction
|
|
262
378
|
*/
|
|
263
|
-
|
|
379
|
+
rebalanceLargePositionAutomation({ connection, params, }: TxgenParams<MeteoraRebalanceForLargerPosition>): Promise<TransactionMetadataResponse[]>;
|
|
380
|
+
/**
|
|
381
|
+
* Generates a single rebalanceLiquidityAutomation instruction for reshaping a Meteora DLMM position.
|
|
382
|
+
*
|
|
383
|
+
* This is a low-level building block that creates ONE instruction to:
|
|
384
|
+
* - Remove liquidity from specified bins (removeLiquidityParams)
|
|
385
|
+
* - Add liquidity to new bins (addLiquidityParams)
|
|
386
|
+
*
|
|
387
|
+
* Unlike meteoraRebalanceLargePositionAutomation2 which handles full position reshaping
|
|
388
|
+
* with chunking and multiple TXs, this function returns a single instruction that can
|
|
389
|
+
* be composed into custom transaction flows.
|
|
390
|
+
*
|
|
391
|
+
* Features:
|
|
392
|
+
* - Token2022 transfer hook support
|
|
393
|
+
* - No fee/reward claiming (shouldClaimFee: false, shouldClaimReward: false)
|
|
394
|
+
* - Uses ATA token accounts
|
|
395
|
+
* - NoShrinkBoth shrink mode
|
|
396
|
+
*
|
|
397
|
+
* Note: Not part of test suite yet. For remove + add liquidity params, please fork
|
|
398
|
+
* hawk-api/src/meteora/liquidityStrategy.ts to generate the parameters.
|
|
399
|
+
*
|
|
400
|
+
* @param connection Solana web3 connection
|
|
401
|
+
* @param params Reshape parameters including position, bin ranges, and liquidity params
|
|
402
|
+
* @returns LabeledInstructions with single 'rebalance_liquidity' instruction
|
|
403
|
+
*/
|
|
404
|
+
meteoraReshapePositionAutomation({ connection, params, }: TxgenParams<MeteoraReshapePositionAutomationParams>): Promise<LabeledInstructions>;
|
|
405
|
+
/**
|
|
406
|
+
* @note DO NOT USE. STILL UNDER DEVELOPMENT. Tests still failing
|
|
407
|
+
* Reshape position: withdraw from old bins and deposit to new bins on the SAME position.
|
|
408
|
+
*
|
|
409
|
+
* Uses only rebalanceLiquidityAutomation (one IX per TX):
|
|
410
|
+
* Remove TXs: rebalanceLiquidityAutomation with removeLiquidityParams (~75 bins/TX)
|
|
411
|
+
* Deposit TXs: rebalanceLiquidityAutomation with addLiquidityParams (~75 bins/TX)
|
|
412
|
+
*
|
|
413
|
+
* Meteora's rebalance_liquidity handles position extension and bin array
|
|
414
|
+
* initialization internally — no separate IXs needed.
|
|
415
|
+
*
|
|
416
|
+
* Key differences from rebalanceLargePositionAutomation:
|
|
417
|
+
* - Same position (no close/create, no new position keypair needed)
|
|
418
|
+
* - Supports positions of any size (69 to 1400+ bins)
|
|
419
|
+
*/
|
|
420
|
+
meteoraRebalanceLargePositionAutomation2({ connection, params, }: TxgenParams<MeteoraRebalanceLargePositionAutomation2>): Promise<TransactionMetadataResponse[]>;
|
|
421
|
+
/**
|
|
422
|
+
* Build raw instruction arrays for depositing liquidity to a large Meteora DLMM position
|
|
423
|
+
* using rebalanceLiquidityAutomation (automation variant).
|
|
424
|
+
* Skips depositMultipleTokenV2 since tokens are already in ATA from the withdraw phase.
|
|
425
|
+
*/
|
|
426
|
+
private _meteoraDepositToLargePositionAutomation;
|
|
427
|
+
/**
|
|
428
|
+
* Build merged rebalance chunks that combine withdraw + init/extend + deposit
|
|
429
|
+
* into fewer transactions. Each TX handles ~75 bins of withdraw and deposit,
|
|
430
|
+
* significantly reducing the total number of transactions needed.
|
|
431
|
+
*
|
|
432
|
+
* Per-chunk instructions (in order):
|
|
433
|
+
* [First TX only] initializePositionRelativeAutomation (≤70 bins)
|
|
434
|
+
* [If position not yet covers this chunk] increasePositionLengthAutomation (≤91 bins each)
|
|
435
|
+
* removeLiquidityByRange2Automation (≤75 bins from old position)
|
|
436
|
+
* claimFee2Automation (≤75 bins from old position)
|
|
437
|
+
* claimReward2Automation × N (≤75 bins from old position, per active reward)
|
|
438
|
+
* [Last old chunk only] closePosition2Automation
|
|
439
|
+
* meteoraDlmmInitializeBinArray (≤75 bins for new position)
|
|
440
|
+
* rebalanceLiquidityAutomation (≤75 bins deposit to new position)
|
|
441
|
+
*/
|
|
442
|
+
private _buildMergedRebalanceChunks;
|
|
264
443
|
openAutomationIx({ connection, params, }: TxgenParams<OpenAutomationIx>): Promise<TransactionMetadataResponse>;
|
|
265
444
|
relativeOpenAutomationIx({ connection, params, }: TxgenParams<RelativeOpenAutomationIx>): Promise<TransactionMetadataResponse>;
|
|
266
445
|
closeAutomationIx({ connection, params }: TxgenParams<MeteoraClose>): Promise<TransactionMetadataResponse>;
|
|
@@ -269,14 +448,24 @@ export declare class Transactions {
|
|
|
269
448
|
private removeLiquidityByRangeInfo;
|
|
270
449
|
private removeLiquidityByRange2Info;
|
|
271
450
|
/**
|
|
272
|
-
* Creates a large position with more than 69 bins
|
|
273
|
-
*
|
|
451
|
+
* Creates a large position with more than 69 bins.
|
|
452
|
+
* Splits into multiple transactions if needed (max 1344 bins per tx, max 1400 bins total).
|
|
274
453
|
*
|
|
275
454
|
* @param connection - Solana connection
|
|
276
455
|
* @param params - Parameters containing userWallet, lbPair, position, lowerBinId, upperBinId
|
|
277
|
-
* @returns Array of
|
|
456
|
+
* @returns Array of TransactionMetadataResponse (one per transaction)
|
|
457
|
+
*/
|
|
458
|
+
/**
|
|
459
|
+
* Build raw instruction arrays for initializing a large Meteora DLMM position.
|
|
460
|
+
* Returns a 2D array where each inner array is one transaction's worth of instructions.
|
|
278
461
|
*/
|
|
279
|
-
|
|
462
|
+
private _meteoraInitializeLargePosition;
|
|
463
|
+
meteoraInitializeLargePosition({ connection, params, }: TxgenParams<MeteoraInitializeLargePosition>): Promise<TransactionMetadataResponse[]>;
|
|
464
|
+
/**
|
|
465
|
+
* Build raw instruction arrays for depositing liquidity to a large Meteora DLMM position.
|
|
466
|
+
* Returns a 2D array where each inner array is one transaction's worth of instructions.
|
|
467
|
+
*/
|
|
468
|
+
private _meteoraDepositToLargePosition;
|
|
280
469
|
/**
|
|
281
470
|
* Deposit liquidity to a large Meteora DLMM position using rebalanceLiquidity.
|
|
282
471
|
* Splits the deposit into multiple transactions (one per chunk of bins)
|
|
@@ -286,7 +475,18 @@ export declare class Transactions {
|
|
|
286
475
|
* @param params - MeteoraDepositToLargePosition parameters
|
|
287
476
|
* @returns Array of TransactionMetadataResponse, one per chunk
|
|
288
477
|
*/
|
|
289
|
-
meteoraDepositToLargePosition({ connection, params, }: TxgenParams<
|
|
478
|
+
meteoraDepositToLargePosition({ connection, params, }: TxgenParams<MeteoraDeposit>): Promise<TransactionMetadataResponse[]>;
|
|
479
|
+
/**
|
|
480
|
+
* Create a position and deposit liquidity for any bin count.
|
|
481
|
+
*
|
|
482
|
+
* - For ≤149 bins: delegates to meteoraDepositLargerPosition (single tx with position init)
|
|
483
|
+
* - For ≥150 bins: uses _meteoraInitializeLargePosition + _meteoraDepositToLargePosition (multi-tx)
|
|
484
|
+
* When init produces 2 TXs (>1344 bins), the 2nd init TX is merged into the 1st deposit TX.
|
|
485
|
+
*/
|
|
486
|
+
meteoraCreatePositionAndDepositToLargePosition({ connection, params, }: {
|
|
487
|
+
connection: web3.Connection;
|
|
488
|
+
params: MeteoraCreatePositionAndDeposit;
|
|
489
|
+
}): Promise<TransactionMetadataResponse[]>;
|
|
290
490
|
/**
|
|
291
491
|
* Deposit liquidity to a Meteora DLMM position (up to 128 bins) with optional position initialization.
|
|
292
492
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAiBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EAEjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EAEpB,gBAAgB,EAChB,wBAAwB,EACxB,+BAA+B,EAC/B,4BAA4B,EAC5B,iBAAiB,EAEjB,8BAA8B,EAE9B,4BA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