@meteora-ag/dlmm 1.9.2 → 1.9.3
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/index.d.ts +64 -7
- package/dist/index.js +144 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15649,6 +15649,71 @@ async function chunkedGetMultipleAccountInfos(connection, pks, chunkSize = 100)
|
|
|
15649
15649
|
)).flat();
|
|
15650
15650
|
return accountInfos;
|
|
15651
15651
|
}
|
|
15652
|
+
async function chunkedGetProgramAccounts(connection, programId, filters, chunkSize = 100, onChunkFetched, isParallelExecution = false) {
|
|
15653
|
+
const accountsWithoutData = await connection.getProgramAccounts(programId, {
|
|
15654
|
+
filters,
|
|
15655
|
+
dataSlice: { offset: 0, length: 0 }
|
|
15656
|
+
});
|
|
15657
|
+
if (accountsWithoutData.length === 0) {
|
|
15658
|
+
return [];
|
|
15659
|
+
}
|
|
15660
|
+
const pubkeys = accountsWithoutData.map((account) => account.pubkey);
|
|
15661
|
+
const totalAccounts = pubkeys.length;
|
|
15662
|
+
const chunkedPks = chunks(pubkeys, chunkSize);
|
|
15663
|
+
const totalChunks = chunkedPks.length;
|
|
15664
|
+
let chunksLoaded = 0;
|
|
15665
|
+
let accountsLoaded = 0;
|
|
15666
|
+
const chunkResults = new Array(totalChunks);
|
|
15667
|
+
const processChunk = async (chunk, chunkIndex) => {
|
|
15668
|
+
const chunkAccountInfos = await connection.getMultipleAccountsInfo(chunk);
|
|
15669
|
+
chunkResults[chunkIndex] = chunkAccountInfos;
|
|
15670
|
+
if (onChunkFetched) {
|
|
15671
|
+
const chunkAccounts = [];
|
|
15672
|
+
const startIdx = chunkIndex * chunkSize;
|
|
15673
|
+
for (let i = 0; i < chunkAccountInfos.length; i++) {
|
|
15674
|
+
const accountInfo = chunkAccountInfos[i];
|
|
15675
|
+
if (accountInfo) {
|
|
15676
|
+
chunkAccounts.push({
|
|
15677
|
+
pubkey: pubkeys[startIdx + i],
|
|
15678
|
+
account: accountInfo
|
|
15679
|
+
});
|
|
15680
|
+
}
|
|
15681
|
+
}
|
|
15682
|
+
chunksLoaded++;
|
|
15683
|
+
accountsLoaded += chunkAccounts.length;
|
|
15684
|
+
onChunkFetched(chunkAccounts, {
|
|
15685
|
+
chunksLoaded,
|
|
15686
|
+
totalChunks,
|
|
15687
|
+
accountsLoaded,
|
|
15688
|
+
totalAccounts
|
|
15689
|
+
});
|
|
15690
|
+
}
|
|
15691
|
+
};
|
|
15692
|
+
if (isParallelExecution) {
|
|
15693
|
+
await Promise.all(
|
|
15694
|
+
chunkedPks.map((chunk, chunkIndex) => processChunk(chunk, chunkIndex))
|
|
15695
|
+
);
|
|
15696
|
+
} else {
|
|
15697
|
+
for (let chunkIndex = 0; chunkIndex < chunkedPks.length; chunkIndex++) {
|
|
15698
|
+
await processChunk(chunkedPks[chunkIndex], chunkIndex);
|
|
15699
|
+
}
|
|
15700
|
+
}
|
|
15701
|
+
const result = [];
|
|
15702
|
+
for (let chunkIndex = 0; chunkIndex < chunkResults.length; chunkIndex++) {
|
|
15703
|
+
const chunkAccountInfos = chunkResults[chunkIndex];
|
|
15704
|
+
const startIdx = chunkIndex * chunkSize;
|
|
15705
|
+
for (let i = 0; i < chunkAccountInfos.length; i++) {
|
|
15706
|
+
const accountInfo = chunkAccountInfos[i];
|
|
15707
|
+
if (accountInfo) {
|
|
15708
|
+
result.push({
|
|
15709
|
+
pubkey: pubkeys[startIdx + i],
|
|
15710
|
+
account: accountInfo
|
|
15711
|
+
});
|
|
15712
|
+
}
|
|
15713
|
+
}
|
|
15714
|
+
}
|
|
15715
|
+
return result;
|
|
15716
|
+
}
|
|
15652
15717
|
var getEstimatedComputeUnitUsageWithBuffer = async (connection, instructions, feePayer, buffer, altAddress) => {
|
|
15653
15718
|
if (!buffer) {
|
|
15654
15719
|
buffer = 0.1;
|
|
@@ -16669,17 +16734,20 @@ var DLMM = class {
|
|
|
16669
16734
|
* class, which represents the connection to the Solana blockchain.
|
|
16670
16735
|
* @param {PublicKey} userPubKey - The user's wallet public key.
|
|
16671
16736
|
* @param {Opt} [opt] - An optional object that contains additional options for the function.
|
|
16737
|
+
* @param {GetPositionsOpt} [getPositionsOpt] - Optional settings for chunked position fetching
|
|
16672
16738
|
* @returns The function `getAllLbPairPositionsByUser` returns a `Promise` that resolves to a `Map`
|
|
16673
16739
|
* object. The `Map` object contains key-value pairs, where the key is a string representing the LB
|
|
16674
16740
|
* Pair account, and the value is an object of PositionInfo
|
|
16675
16741
|
*/
|
|
16676
|
-
static async getAllLbPairPositionsByUser(connection, userPubKey, opt) {
|
|
16742
|
+
static async getAllLbPairPositionsByUser(connection, userPubKey, opt, getPositionsOpt) {
|
|
16677
16743
|
const program = createProgram(connection, opt);
|
|
16678
|
-
const positionsV2 = await
|
|
16744
|
+
const positionsV2 = await chunkedGetProgramAccounts(
|
|
16745
|
+
program.provider.connection,
|
|
16679
16746
|
program.programId,
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16747
|
+
[positionV2Filter(), positionOwnerFilter(userPubKey)],
|
|
16748
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _60 => _60.chunkSize]),
|
|
16749
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _61 => _61.onChunkFetched]),
|
|
16750
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _62 => _62.isParallelExecution])
|
|
16683
16751
|
);
|
|
16684
16752
|
const positionWrappers = [
|
|
16685
16753
|
...positionsV2.map((p) => wrapPosition(program, p.pubkey, p.account))
|
|
@@ -16810,8 +16878,8 @@ var DLMM = class {
|
|
|
16810
16878
|
const { mintX, mintY, rewardMint0, rewardMint1 } = lbPairMintMap.get(
|
|
16811
16879
|
lbPair.toBase58()
|
|
16812
16880
|
);
|
|
16813
|
-
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access',
|
|
16814
|
-
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access',
|
|
16881
|
+
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access', _63 => _63.get, 'call', _64 => _64(lbPair.toBase58()), 'optionalAccess', _65 => _65.reserveX]), () => ( BigInt(0)));
|
|
16882
|
+
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access', _66 => _66.get, 'call', _67 => _67(lbPair.toBase58()), 'optionalAccess', _68 => _68.reserveY]), () => ( BigInt(0)));
|
|
16815
16883
|
const { tokenXProgram, tokenYProgram } = getTokenProgramId(lbPairAcc);
|
|
16816
16884
|
const tokenX = {
|
|
16817
16885
|
publicKey: lbPairAcc.tokenXMint,
|
|
@@ -16849,7 +16917,7 @@ var DLMM = class {
|
|
|
16849
16917
|
tokenX,
|
|
16850
16918
|
tokenY,
|
|
16851
16919
|
lbPairPositionsData: [
|
|
16852
|
-
..._nullishCoalesce(_optionalChain([positionsMap, 'access',
|
|
16920
|
+
..._nullishCoalesce(_optionalChain([positionsMap, 'access', _69 => _69.get, 'call', _70 => _70(lbPair.toBase58()), 'optionalAccess', _71 => _71.lbPairPositionsData]), () => ( [])),
|
|
16853
16921
|
{
|
|
16854
16922
|
publicKey: positionPubkey,
|
|
16855
16923
|
positionData,
|
|
@@ -16873,16 +16941,19 @@ var DLMM = class {
|
|
|
16873
16941
|
* The function `getLbPairLockInfo` retrieves all pair positions that has locked liquidity.
|
|
16874
16942
|
* @param {number} [lockDurationOpt] - An optional value indicating the minimum position lock duration that the function should return.
|
|
16875
16943
|
* Depending on the lbPair activationType, the param should be a number of seconds or a number of slots.
|
|
16944
|
+
* @param {GetPositionsOpt} [getPositionsOpt] - Optional settings for chunked position fetching
|
|
16876
16945
|
* @returns The function `getLbPairLockInfo` returns a `Promise` that resolves to a `PairLockInfo`
|
|
16877
16946
|
* object. The `PairLockInfo` object contains an array of `PositionLockInfo` objects.
|
|
16878
16947
|
*/
|
|
16879
|
-
async getLbPairLockInfo(lockDurationOpt) {
|
|
16948
|
+
async getLbPairLockInfo(lockDurationOpt, getPositionsOpt) {
|
|
16880
16949
|
const lockDuration = lockDurationOpt | 0;
|
|
16881
|
-
const positionAccounts = await
|
|
16950
|
+
const positionAccounts = await chunkedGetProgramAccounts(
|
|
16951
|
+
this.program.provider.connection,
|
|
16882
16952
|
this.program.programId,
|
|
16883
|
-
|
|
16884
|
-
|
|
16885
|
-
|
|
16953
|
+
[positionLbPairFilter(this.pubkey)],
|
|
16954
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _72 => _72.chunkSize]),
|
|
16955
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _73 => _73.onChunkFetched]),
|
|
16956
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _74 => _74.isParallelExecution])
|
|
16886
16957
|
);
|
|
16887
16958
|
const lbPairPositions = positionAccounts.map((acc) => {
|
|
16888
16959
|
return wrapPosition(this.program, acc.pubkey, acc.account);
|
|
@@ -17047,7 +17118,7 @@ var DLMM = class {
|
|
|
17047
17118
|
);
|
|
17048
17119
|
preInstructions.push(createUserTokenYIx);
|
|
17049
17120
|
const postInstructions = [];
|
|
17050
|
-
if ((tokenX.equals(_spltoken.NATIVE_MINT) || tokenY.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([opt, 'optionalAccess',
|
|
17121
|
+
if ((tokenX.equals(_spltoken.NATIVE_MINT) || tokenY.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([opt, 'optionalAccess', _75 => _75.skipSolWrappingOperation])) {
|
|
17051
17122
|
const wrapAmount = BigInt(1);
|
|
17052
17123
|
if (tokenX.equals(_spltoken.NATIVE_MINT)) {
|
|
17053
17124
|
const wrapSOLIxX = wrapSOLInstruction(
|
|
@@ -17167,7 +17238,7 @@ var DLMM = class {
|
|
|
17167
17238
|
);
|
|
17168
17239
|
preInstructions.push(createUserTokenYIx);
|
|
17169
17240
|
const postInstructions = [];
|
|
17170
|
-
if ((tokenX.equals(_spltoken.NATIVE_MINT) || tokenY.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([opt, 'optionalAccess',
|
|
17241
|
+
if ((tokenX.equals(_spltoken.NATIVE_MINT) || tokenY.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([opt, 'optionalAccess', _76 => _76.skipSolWrappingOperation])) {
|
|
17171
17242
|
const wrapAmount = BigInt(1);
|
|
17172
17243
|
if (tokenX.equals(_spltoken.NATIVE_MINT)) {
|
|
17173
17244
|
const wrapSOLIxX = wrapSOLInstruction(
|
|
@@ -17298,8 +17369,8 @@ var DLMM = class {
|
|
|
17298
17369
|
new (0, _anchor.BN)(presetParameterState.baseFactor),
|
|
17299
17370
|
new (0, _anchor.BN)(presetParameterState.baseFeePowerFactor),
|
|
17300
17371
|
{
|
|
17301
|
-
cluster: _optionalChain([opt, 'optionalAccess',
|
|
17302
|
-
programId: _optionalChain([opt, 'optionalAccess',
|
|
17372
|
+
cluster: _optionalChain([opt, 'optionalAccess', _77 => _77.cluster]),
|
|
17373
|
+
programId: _optionalChain([opt, 'optionalAccess', _78 => _78.programId])
|
|
17303
17374
|
}
|
|
17304
17375
|
);
|
|
17305
17376
|
if (existsPool) {
|
|
@@ -17527,7 +17598,7 @@ var DLMM = class {
|
|
|
17527
17598
|
swapForY,
|
|
17528
17599
|
new (0, _anchor.BN)(activeIdToLoop),
|
|
17529
17600
|
this.lbPair,
|
|
17530
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
17601
|
+
_nullishCoalesce(_optionalChain([this, 'access', _79 => _79.binArrayBitmapExtension, 'optionalAccess', _80 => _80.account]), () => ( null))
|
|
17531
17602
|
);
|
|
17532
17603
|
if (binArrayIndex === null)
|
|
17533
17604
|
shouldStop = true;
|
|
@@ -17776,24 +17847,27 @@ var DLMM = class {
|
|
|
17776
17847
|
* `PublicKey`. It represents the public key of a user. If no `userPubKey` is provided, the function
|
|
17777
17848
|
* will return an object with an empty `userPositions` array and the active bin information obtained
|
|
17778
17849
|
* from the `getActive
|
|
17850
|
+
* @param {GetPositionsOpt} [getPositionsOpt] - Optional settings for chunked position fetching
|
|
17779
17851
|
* @returns The function `getPositionsByUserAndLbPair` returns a Promise that resolves to an object
|
|
17780
17852
|
* with two properties:
|
|
17781
17853
|
* - "activeBin" which is an object with two properties: "binId" and "price". The value of "binId"
|
|
17782
17854
|
* is the active bin ID of the lbPair, and the value of "price" is the price of the active bin.
|
|
17783
17855
|
* - "userPositions" which is an array of Position objects.
|
|
17784
17856
|
*/
|
|
17785
|
-
async getPositionsByUserAndLbPair(userPubKey) {
|
|
17857
|
+
async getPositionsByUserAndLbPair(userPubKey, getPositionsOpt) {
|
|
17786
17858
|
const promiseResults = await Promise.all([
|
|
17787
17859
|
this.getActiveBin(),
|
|
17788
|
-
userPubKey &&
|
|
17860
|
+
userPubKey && chunkedGetProgramAccounts(
|
|
17861
|
+
this.program.provider.connection,
|
|
17789
17862
|
this.program.programId,
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17863
|
+
[
|
|
17864
|
+
positionV2Filter(),
|
|
17865
|
+
positionOwnerFilter(userPubKey),
|
|
17866
|
+
positionLbPairFilter(this.pubkey)
|
|
17867
|
+
],
|
|
17868
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _81 => _81.chunkSize]),
|
|
17869
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _82 => _82.onChunkFetched]),
|
|
17870
|
+
_optionalChain([getPositionsOpt, 'optionalAccess', _83 => _83.isParallelExecution])
|
|
17797
17871
|
)
|
|
17798
17872
|
]);
|
|
17799
17873
|
const [activeBin, positionsV2] = promiseResults;
|
|
@@ -17858,8 +17932,8 @@ var DLMM = class {
|
|
|
17858
17932
|
position,
|
|
17859
17933
|
this.tokenX.mint,
|
|
17860
17934
|
this.tokenY.mint,
|
|
17861
|
-
_optionalChain([this, 'access',
|
|
17862
|
-
_optionalChain([this, 'access',
|
|
17935
|
+
_optionalChain([this, 'access', _84 => _84.rewards, 'access', _85 => _85[0], 'optionalAccess', _86 => _86.mint]),
|
|
17936
|
+
_optionalChain([this, 'access', _87 => _87.rewards, 'access', _88 => _88[1], 'optionalAccess', _89 => _89.mint]),
|
|
17863
17937
|
positionBinArraysMapV2
|
|
17864
17938
|
),
|
|
17865
17939
|
version: position.version()
|
|
@@ -18047,8 +18121,8 @@ var DLMM = class {
|
|
|
18047
18121
|
position,
|
|
18048
18122
|
this.tokenX.mint,
|
|
18049
18123
|
this.tokenY.mint,
|
|
18050
|
-
_optionalChain([this, 'access',
|
|
18051
|
-
_optionalChain([this, 'access',
|
|
18124
|
+
_optionalChain([this, 'access', _90 => _90.rewards, 'access', _91 => _91[0], 'optionalAccess', _92 => _92.mint]),
|
|
18125
|
+
_optionalChain([this, 'access', _93 => _93.rewards, 'access', _94 => _94[1], 'optionalAccess', _95 => _95.mint]),
|
|
18052
18126
|
binArrayMap
|
|
18053
18127
|
),
|
|
18054
18128
|
version: position.version()
|
|
@@ -18073,7 +18147,7 @@ var DLMM = class {
|
|
|
18073
18147
|
);
|
|
18074
18148
|
const { minBinId, maxBinId } = strategy;
|
|
18075
18149
|
const binCount = getBinCount(minBinId, maxBinId);
|
|
18076
|
-
const defaultAltAddressString = _nullishCoalesce(altAddress, () => ( ALT_ADDRESS[_optionalChain([this, 'access',
|
|
18150
|
+
const defaultAltAddressString = _nullishCoalesce(altAddress, () => ( ALT_ADDRESS[_optionalChain([this, 'access', _96 => _96.opt, 'optionalAccess', _97 => _97.cluster])]));
|
|
18077
18151
|
if (defaultAltAddressString) {
|
|
18078
18152
|
altAddress = new (0, _web3js.PublicKey)(defaultAltAddressString);
|
|
18079
18153
|
}
|
|
@@ -18136,7 +18210,7 @@ var DLMM = class {
|
|
|
18136
18210
|
owner,
|
|
18137
18211
|
payer,
|
|
18138
18212
|
true,
|
|
18139
|
-
_optionalChain([this, 'access',
|
|
18213
|
+
_optionalChain([this, 'access', _98 => _98.opt, 'optionalAccess', _99 => _99.skipSolWrappingOperation])
|
|
18140
18214
|
);
|
|
18141
18215
|
for (const instructions of addLiquidityIxs) {
|
|
18142
18216
|
const txIxs = [];
|
|
@@ -18258,7 +18332,7 @@ var DLMM = class {
|
|
|
18258
18332
|
owner,
|
|
18259
18333
|
payer,
|
|
18260
18334
|
false,
|
|
18261
|
-
_optionalChain([this, 'access',
|
|
18335
|
+
_optionalChain([this, 'access', _100 => _100.opt, 'optionalAccess', _101 => _101.skipSolWrappingOperation])
|
|
18262
18336
|
);
|
|
18263
18337
|
instructionsByPositions.push({
|
|
18264
18338
|
positionKeypair: position,
|
|
@@ -18322,7 +18396,7 @@ var DLMM = class {
|
|
|
18322
18396
|
user,
|
|
18323
18397
|
user,
|
|
18324
18398
|
true,
|
|
18325
|
-
_optionalChain([this, 'access',
|
|
18399
|
+
_optionalChain([this, 'access', _102 => _102.opt, 'optionalAccess', _103 => _103.skipSolWrappingOperation])
|
|
18326
18400
|
);
|
|
18327
18401
|
const latestBlockhashInfo = await this.program.provider.connection.getLatestBlockhash();
|
|
18328
18402
|
return chunkedAddLiquidityIx.map((ixs) => {
|
|
@@ -18397,7 +18471,7 @@ var DLMM = class {
|
|
|
18397
18471
|
]);
|
|
18398
18472
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18399
18473
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18400
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18474
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _104 => _104.opt, 'optionalAccess', _105 => _105.skipSolWrappingOperation])) {
|
|
18401
18475
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18402
18476
|
user,
|
|
18403
18477
|
userTokenX,
|
|
@@ -18405,7 +18479,7 @@ var DLMM = class {
|
|
|
18405
18479
|
);
|
|
18406
18480
|
preInstructions.push(...wrapSOLIx);
|
|
18407
18481
|
}
|
|
18408
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18482
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _106 => _106.opt, 'optionalAccess', _107 => _107.skipSolWrappingOperation])) {
|
|
18409
18483
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18410
18484
|
user,
|
|
18411
18485
|
userTokenY,
|
|
@@ -18417,7 +18491,7 @@ var DLMM = class {
|
|
|
18417
18491
|
if ([
|
|
18418
18492
|
this.tokenX.publicKey.toBase58(),
|
|
18419
18493
|
this.tokenY.publicKey.toBase58()
|
|
18420
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18494
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _108 => _108.opt, 'optionalAccess', _109 => _109.skipSolWrappingOperation])) {
|
|
18421
18495
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18422
18496
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18423
18497
|
}
|
|
@@ -18551,7 +18625,7 @@ var DLMM = class {
|
|
|
18551
18625
|
]);
|
|
18552
18626
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18553
18627
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18554
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18628
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _110 => _110.opt, 'optionalAccess', _111 => _111.skipSolWrappingOperation])) {
|
|
18555
18629
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18556
18630
|
user,
|
|
18557
18631
|
userTokenX,
|
|
@@ -18559,7 +18633,7 @@ var DLMM = class {
|
|
|
18559
18633
|
);
|
|
18560
18634
|
preInstructions.push(...wrapSOLIx);
|
|
18561
18635
|
}
|
|
18562
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18636
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _112 => _112.opt, 'optionalAccess', _113 => _113.skipSolWrappingOperation])) {
|
|
18563
18637
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18564
18638
|
user,
|
|
18565
18639
|
userTokenY,
|
|
@@ -18571,7 +18645,7 @@ var DLMM = class {
|
|
|
18571
18645
|
if ([
|
|
18572
18646
|
this.tokenX.publicKey.toBase58(),
|
|
18573
18647
|
this.tokenY.publicKey.toBase58()
|
|
18574
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18648
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _114 => _114.opt, 'optionalAccess', _115 => _115.skipSolWrappingOperation])) {
|
|
18575
18649
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18576
18650
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18577
18651
|
}
|
|
@@ -18755,7 +18829,7 @@ var DLMM = class {
|
|
|
18755
18829
|
]);
|
|
18756
18830
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18757
18831
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18758
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18832
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _116 => _116.opt, 'optionalAccess', _117 => _117.skipSolWrappingOperation])) {
|
|
18759
18833
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18760
18834
|
user,
|
|
18761
18835
|
userTokenX,
|
|
@@ -18763,7 +18837,7 @@ var DLMM = class {
|
|
|
18763
18837
|
);
|
|
18764
18838
|
preInstructions.push(...wrapSOLIx);
|
|
18765
18839
|
}
|
|
18766
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18840
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _118 => _118.opt, 'optionalAccess', _119 => _119.skipSolWrappingOperation])) {
|
|
18767
18841
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18768
18842
|
user,
|
|
18769
18843
|
userTokenY,
|
|
@@ -18775,7 +18849,7 @@ var DLMM = class {
|
|
|
18775
18849
|
if ([
|
|
18776
18850
|
this.tokenX.publicKey.toBase58(),
|
|
18777
18851
|
this.tokenY.publicKey.toBase58()
|
|
18778
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18852
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _120 => _120.opt, 'optionalAccess', _121 => _121.skipSolWrappingOperation])) {
|
|
18779
18853
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18780
18854
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18781
18855
|
}
|
|
@@ -18923,7 +18997,7 @@ var DLMM = class {
|
|
|
18923
18997
|
]);
|
|
18924
18998
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18925
18999
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18926
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
19000
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _122 => _122.opt, 'optionalAccess', _123 => _123.skipSolWrappingOperation])) {
|
|
18927
19001
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18928
19002
|
user,
|
|
18929
19003
|
userTokenX,
|
|
@@ -18931,7 +19005,7 @@ var DLMM = class {
|
|
|
18931
19005
|
);
|
|
18932
19006
|
preInstructions.push(...wrapSOLIx);
|
|
18933
19007
|
}
|
|
18934
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
19008
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _124 => _124.opt, 'optionalAccess', _125 => _125.skipSolWrappingOperation])) {
|
|
18935
19009
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18936
19010
|
user,
|
|
18937
19011
|
userTokenY,
|
|
@@ -18943,7 +19017,7 @@ var DLMM = class {
|
|
|
18943
19017
|
if ([
|
|
18944
19018
|
this.tokenX.publicKey.toBase58(),
|
|
18945
19019
|
this.tokenY.publicKey.toBase58()
|
|
18946
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
19020
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _126 => _126.opt, 'optionalAccess', _127 => _127.skipSolWrappingOperation])) {
|
|
18947
19021
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18948
19022
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18949
19023
|
}
|
|
@@ -19220,7 +19294,7 @@ var DLMM = class {
|
|
|
19220
19294
|
if ([
|
|
19221
19295
|
this.tokenX.publicKey.toBase58(),
|
|
19222
19296
|
this.tokenY.publicKey.toBase58()
|
|
19223
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && (!skipUnwrapSOL || !_optionalChain([this, 'access',
|
|
19297
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && (!skipUnwrapSOL || !_optionalChain([this, 'access', _128 => _128.opt, 'optionalAccess', _129 => _129.skipSolWrappingOperation]))) {
|
|
19224
19298
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19225
19299
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19226
19300
|
}
|
|
@@ -19375,7 +19449,7 @@ var DLMM = class {
|
|
|
19375
19449
|
swapForY,
|
|
19376
19450
|
activeId,
|
|
19377
19451
|
this.lbPair,
|
|
19378
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19452
|
+
_nullishCoalesce(_optionalChain([this, 'access', _130 => _130.binArrayBitmapExtension, 'optionalAccess', _131 => _131.account]), () => ( null)),
|
|
19379
19453
|
binArrays
|
|
19380
19454
|
);
|
|
19381
19455
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19440,7 +19514,7 @@ var DLMM = class {
|
|
|
19440
19514
|
swapForY,
|
|
19441
19515
|
activeId,
|
|
19442
19516
|
this.lbPair,
|
|
19443
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19517
|
+
_nullishCoalesce(_optionalChain([this, 'access', _132 => _132.binArrayBitmapExtension, 'optionalAccess', _133 => _133.account]), () => ( null)),
|
|
19444
19518
|
binArrays
|
|
19445
19519
|
);
|
|
19446
19520
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19537,7 +19611,7 @@ var DLMM = class {
|
|
|
19537
19611
|
swapForY,
|
|
19538
19612
|
activeId,
|
|
19539
19613
|
this.lbPair,
|
|
19540
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19614
|
+
_nullishCoalesce(_optionalChain([this, 'access', _134 => _134.binArrayBitmapExtension, 'optionalAccess', _135 => _135.account]), () => ( null)),
|
|
19541
19615
|
binArrays
|
|
19542
19616
|
);
|
|
19543
19617
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19625,7 +19699,7 @@ var DLMM = class {
|
|
|
19625
19699
|
swapForY,
|
|
19626
19700
|
activeId,
|
|
19627
19701
|
this.lbPair,
|
|
19628
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19702
|
+
_nullishCoalesce(_optionalChain([this, 'access', _136 => _136.binArrayBitmapExtension, 'optionalAccess', _137 => _137.account]), () => ( null)),
|
|
19629
19703
|
binArrays
|
|
19630
19704
|
);
|
|
19631
19705
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19707,7 +19781,7 @@ var DLMM = class {
|
|
|
19707
19781
|
]);
|
|
19708
19782
|
createInTokenAccountIx && preInstructions.push(createInTokenAccountIx);
|
|
19709
19783
|
createOutTokenAccountIx && preInstructions.push(createOutTokenAccountIx);
|
|
19710
|
-
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19784
|
+
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _138 => _138.opt, 'optionalAccess', _139 => _139.skipSolWrappingOperation])) {
|
|
19711
19785
|
const wrapSOLIx = wrapSOLInstruction(
|
|
19712
19786
|
user,
|
|
19713
19787
|
userTokenIn,
|
|
@@ -19717,7 +19791,7 @@ var DLMM = class {
|
|
|
19717
19791
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19718
19792
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19719
19793
|
}
|
|
19720
|
-
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19794
|
+
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _140 => _140.opt, 'optionalAccess', _141 => _141.skipSolWrappingOperation])) {
|
|
19721
19795
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19722
19796
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19723
19797
|
}
|
|
@@ -19800,7 +19874,7 @@ var DLMM = class {
|
|
|
19800
19874
|
]);
|
|
19801
19875
|
createInTokenAccountIx && preInstructions.push(createInTokenAccountIx);
|
|
19802
19876
|
createOutTokenAccountIx && preInstructions.push(createOutTokenAccountIx);
|
|
19803
|
-
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19877
|
+
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _142 => _142.opt, 'optionalAccess', _143 => _143.skipSolWrappingOperation])) {
|
|
19804
19878
|
const wrapSOLIx = wrapSOLInstruction(
|
|
19805
19879
|
user,
|
|
19806
19880
|
userTokenIn,
|
|
@@ -19810,7 +19884,7 @@ var DLMM = class {
|
|
|
19810
19884
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19811
19885
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19812
19886
|
}
|
|
19813
|
-
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19887
|
+
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _144 => _144.opt, 'optionalAccess', _145 => _145.skipSolWrappingOperation])) {
|
|
19814
19888
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19815
19889
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19816
19890
|
}
|
|
@@ -19902,7 +19976,7 @@ var DLMM = class {
|
|
|
19902
19976
|
]);
|
|
19903
19977
|
createInTokenAccountIx && preInstructions.push(createInTokenAccountIx);
|
|
19904
19978
|
createOutTokenAccountIx && preInstructions.push(createOutTokenAccountIx);
|
|
19905
|
-
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19979
|
+
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _146 => _146.opt, 'optionalAccess', _147 => _147.skipSolWrappingOperation])) {
|
|
19906
19980
|
const wrapSOLIx = wrapSOLInstruction(
|
|
19907
19981
|
user,
|
|
19908
19982
|
userTokenIn,
|
|
@@ -19912,7 +19986,7 @@ var DLMM = class {
|
|
|
19912
19986
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19913
19987
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19914
19988
|
}
|
|
19915
|
-
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19989
|
+
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _148 => _148.opt, 'optionalAccess', _149 => _149.skipSolWrappingOperation])) {
|
|
19916
19990
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19917
19991
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19918
19992
|
}
|
|
@@ -20971,7 +21045,7 @@ var DLMM = class {
|
|
|
20971
21045
|
swapForY,
|
|
20972
21046
|
new (0, _anchor.BN)(activeBinId),
|
|
20973
21047
|
this.lbPair,
|
|
20974
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
21048
|
+
_nullishCoalesce(_optionalChain([this, 'access', _150 => _150.binArrayBitmapExtension, 'optionalAccess', _151 => _151.account]), () => ( null))
|
|
20975
21049
|
);
|
|
20976
21050
|
if (toBinArrayIndex === null)
|
|
20977
21051
|
return true;
|
|
@@ -21008,7 +21082,7 @@ var DLMM = class {
|
|
|
21008
21082
|
swapForY,
|
|
21009
21083
|
new (0, _anchor.BN)(activeBinId),
|
|
21010
21084
|
this.lbPair,
|
|
21011
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
21085
|
+
_nullishCoalesce(_optionalChain([this, 'access', _152 => _152.binArrayBitmapExtension, 'optionalAccess', _153 => _153.account]), () => ( null))
|
|
21012
21086
|
);
|
|
21013
21087
|
const marketPriceBinArrayIndex = binIdToBinArrayIndex(
|
|
21014
21088
|
new (0, _anchor.BN)(marketPriceBinId)
|
|
@@ -21044,7 +21118,7 @@ var DLMM = class {
|
|
|
21044
21118
|
let binArrayBitmapExtension = null;
|
|
21045
21119
|
if (binArrayBitMapExtensionPubkey) {
|
|
21046
21120
|
binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
|
|
21047
|
-
if (!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
21121
|
+
if (!_optionalChain([binArrayAccounts, 'optionalAccess', _154 => _154[0]])) {
|
|
21048
21122
|
const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
|
|
21049
21123
|
binArrayBitmapExtension: binArrayBitMapExtensionPubkey,
|
|
21050
21124
|
funder: owner,
|
|
@@ -21053,10 +21127,10 @@ var DLMM = class {
|
|
|
21053
21127
|
preInstructions.push(initializeBitmapExtensionIx);
|
|
21054
21128
|
}
|
|
21055
21129
|
}
|
|
21056
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
21130
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _155 => _155[1]])) {
|
|
21057
21131
|
fromBinArray = fromBinArrayPubkey;
|
|
21058
21132
|
}
|
|
21059
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
21133
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _156 => _156[2]]) && !!toBinArrayIndex) {
|
|
21060
21134
|
toBinArray = toBinArrayPubkey;
|
|
21061
21135
|
}
|
|
21062
21136
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
@@ -21502,7 +21576,7 @@ var DLMM = class {
|
|
|
21502
21576
|
slippage
|
|
21503
21577
|
);
|
|
21504
21578
|
const postInstructions = [];
|
|
21505
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountXDeposited.gtn(0) && !_optionalChain([this, 'access',
|
|
21579
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountXDeposited.gtn(0) && !_optionalChain([this, 'access', _157 => _157.opt, 'optionalAccess', _158 => _158.skipSolWrappingOperation])) {
|
|
21506
21580
|
const wrapSOLIx = wrapSOLInstruction(
|
|
21507
21581
|
owner,
|
|
21508
21582
|
userTokenX,
|
|
@@ -21510,7 +21584,7 @@ var DLMM = class {
|
|
|
21510
21584
|
);
|
|
21511
21585
|
preInstructions.push(...wrapSOLIx);
|
|
21512
21586
|
}
|
|
21513
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountYDeposited.gtn(0) && !_optionalChain([this, 'access',
|
|
21587
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountYDeposited.gtn(0) && !_optionalChain([this, 'access', _159 => _159.opt, 'optionalAccess', _160 => _160.skipSolWrappingOperation])) {
|
|
21514
21588
|
const wrapSOLIx = wrapSOLInstruction(
|
|
21515
21589
|
owner,
|
|
21516
21590
|
userTokenY,
|
|
@@ -21518,7 +21592,7 @@ var DLMM = class {
|
|
|
21518
21592
|
);
|
|
21519
21593
|
preInstructions.push(...wrapSOLIx);
|
|
21520
21594
|
}
|
|
21521
|
-
if ((this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([this, 'access',
|
|
21595
|
+
if ((this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([this, 'access', _161 => _161.opt, 'optionalAccess', _162 => _162.skipSolWrappingOperation])) {
|
|
21522
21596
|
const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
|
|
21523
21597
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
21524
21598
|
}
|
|
@@ -21964,7 +22038,7 @@ var DLMM = class {
|
|
|
21964
22038
|
);
|
|
21965
22039
|
})
|
|
21966
22040
|
);
|
|
21967
|
-
const version = _nullishCoalesce(_optionalChain([binArrays, 'access',
|
|
22041
|
+
const version = _nullishCoalesce(_optionalChain([binArrays, 'access', _163 => _163.find, 'call', _164 => _164((binArray) => binArray != null), 'optionalAccess', _165 => _165.version]), () => ( 1));
|
|
21968
22042
|
return Array.from(
|
|
21969
22043
|
enumerateBins(
|
|
21970
22044
|
binsById,
|
|
@@ -22159,7 +22233,7 @@ var DLMM = class {
|
|
|
22159
22233
|
if ([
|
|
22160
22234
|
this.tokenX.publicKey.toBase58(),
|
|
22161
22235
|
this.tokenY.publicKey.toBase58()
|
|
22162
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
22236
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _166 => _166.opt, 'optionalAccess', _167 => _167.skipSolWrappingOperation])) {
|
|
22163
22237
|
const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
|
|
22164
22238
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
22165
22239
|
}
|
|
@@ -22393,7 +22467,8 @@ var src_default = DLMM;
|
|
|
22393
22467
|
|
|
22394
22468
|
|
|
22395
22469
|
|
|
22396
|
-
|
|
22470
|
+
|
|
22471
|
+
exports.ADMIN = ADMIN; exports.ALT_ADDRESS = ALT_ADDRESS; exports.ActionType = ActionType; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_FEE = BIN_ARRAY_BITMAP_FEE; exports.BIN_ARRAY_BITMAP_FEE_BN = BIN_ARRAY_BITMAP_FEE_BN; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BIN_ARRAY_FEE = BIN_ARRAY_FEE; exports.BIN_ARRAY_FEE_BN = BIN_ARRAY_FEE_BN; exports.BinLiquidity = BinLiquidity; exports.BitmapType = BitmapType; exports.ClockLayout = ClockLayout; exports.DEFAULT_BIN_PER_POSITION = DEFAULT_BIN_PER_POSITION; exports.DLMMError = DLMMError; exports.DlmmSdkError = DlmmSdkError; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.FunctionType = FunctionType; exports.IDL = idl_default; exports.ILM_BASE = ILM_BASE; exports.LBCLMM_PROGRAM_IDS = LBCLMM_PROGRAM_IDS; exports.MAX_ACTIVE_BIN_SLIPPAGE = MAX_ACTIVE_BIN_SLIPPAGE; exports.MAX_BINS_PER_POSITION = MAX_BINS_PER_POSITION; exports.MAX_BIN_ARRAY_SIZE = MAX_BIN_ARRAY_SIZE; exports.MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_EXTRA_BIN_ARRAYS = MAX_EXTRA_BIN_ARRAYS; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.MAX_RESIZE_LENGTH = MAX_RESIZE_LENGTH; exports.MEMO_PROGRAM_ID = MEMO_PROGRAM_ID; exports.Network = Network; exports.POOL_FEE = POOL_FEE; exports.POOL_FEE_BN = POOL_FEE_BN; exports.POSITION_BIN_DATA_SIZE = POSITION_BIN_DATA_SIZE; exports.POSITION_FEE = POSITION_FEE; exports.POSITION_FEE_BN = POSITION_FEE_BN; exports.POSITION_MAX_LENGTH = POSITION_MAX_LENGTH; exports.POSITION_MIN_SIZE = POSITION_MIN_SIZE; exports.PRECISION = PRECISION; exports.PairStatus = PairStatus; exports.PairType = PairType; exports.PositionV2Wrapper = PositionV2Wrapper; exports.PositionVersion = PositionVersion; exports.REBALANCE_POSITION_PADDING = REBALANCE_POSITION_PADDING; exports.RebalancePosition = RebalancePosition; exports.ResizeSide = ResizeSide; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.ShrinkMode = ShrinkMode; exports.Strategy = Strategy; exports.StrategyType = StrategyType; exports.TOKEN_ACCOUNT_FEE = TOKEN_ACCOUNT_FEE; exports.TOKEN_ACCOUNT_FEE_BN = TOKEN_ACCOUNT_FEE_BN; exports.U64_MAX = U64_MAX; exports.autoFillXByStrategy = autoFillXByStrategy; exports.autoFillXByWeight = autoFillXByWeight; exports.autoFillYByStrategy = autoFillYByStrategy; exports.autoFillYByWeight = autoFillYByWeight; exports.binArrayLbPairFilter = binArrayLbPairFilter; exports.binDeltaToMinMaxBinId = binDeltaToMinMaxBinId; exports.binIdToBinArrayIndex = binIdToBinArrayIndex; exports.buildBitFlagAndNegateStrategyParameters = buildBitFlagAndNegateStrategyParameters; exports.buildLiquidityStrategyParameters = buildLiquidityStrategyParameters; exports.calculateBidAskDistribution = calculateBidAskDistribution; exports.calculateNormalDistribution = calculateNormalDistribution; exports.calculatePositionSize = calculatePositionSize; exports.calculateSpotDistribution = calculateSpotDistribution; exports.capSlippagePercentage = capSlippagePercentage; exports.chunkBinRange = chunkBinRange; exports.chunkBinRangeIntoExtendedPositions = chunkBinRangeIntoExtendedPositions; exports.chunkDepositWithRebalanceEndpoint = chunkDepositWithRebalanceEndpoint; exports.chunkPositionBinRange = chunkPositionBinRange; exports.chunkedFetchMultipleBinArrayBitmapExtensionAccount = chunkedFetchMultipleBinArrayBitmapExtensionAccount; exports.chunkedFetchMultiplePoolAccount = chunkedFetchMultiplePoolAccount; exports.chunkedGetMultipleAccountInfos = chunkedGetMultipleAccountInfos; exports.chunkedGetProgramAccounts = chunkedGetProgramAccounts; exports.chunks = chunks; exports.computeFee = computeFee; exports.computeFeeFromAmount = computeFeeFromAmount; exports.computeProtocolFee = computeProtocolFee; exports.createProgram = createProgram; exports.decodeAccount = decodeAccount; exports.decodeExtendedPosition = decodeExtendedPosition; exports.default = src_default; exports.deriveBinArray = deriveBinArray; exports.deriveBinArrayBitmapExtension = deriveBinArrayBitmapExtension; exports.deriveCustomizablePermissionlessLbPair = deriveCustomizablePermissionlessLbPair; exports.deriveEventAuthority = deriveEventAuthority; exports.deriveLbPair = deriveLbPair; exports.deriveLbPair2 = deriveLbPair2; exports.deriveLbPairWithPresetParamWithIndexKey = deriveLbPairWithPresetParamWithIndexKey; exports.deriveOperator = deriveOperator; exports.deriveOracle = deriveOracle; exports.derivePermissionLbPair = derivePermissionLbPair; exports.derivePlaceHolderAccountMeta = derivePlaceHolderAccountMeta; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.derivePresetParameter2 = derivePresetParameter2; exports.derivePresetParameterWithIndex = derivePresetParameterWithIndex; exports.deriveReserve = deriveReserve; exports.deriveRewardVault = deriveRewardVault; exports.deriveTokenBadge = deriveTokenBadge; exports.enumerateBins = enumerateBins; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromWeightDistributionToAmount = fromWeightDistributionToAmount; exports.fromWeightDistributionToAmountOneSide = fromWeightDistributionToAmountOneSide; exports.getAccountDiscriminator = getAccountDiscriminator; exports.getAmountInBinsAskSide = getAmountInBinsAskSide; exports.getAmountInBinsBidSide = getAmountInBinsBidSide; exports.getAndCapMaxActiveBinSlippage = getAndCapMaxActiveBinSlippage; exports.getAutoFillAmountByRebalancedPosition = getAutoFillAmountByRebalancedPosition; exports.getBaseFee = getBaseFee; exports.getBinArrayAccountMetasCoverage = getBinArrayAccountMetasCoverage; exports.getBinArrayIndexesCoverage = getBinArrayIndexesCoverage; exports.getBinArrayKeysCoverage = getBinArrayKeysCoverage; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinArraysRequiredByPositionRange = getBinArraysRequiredByPositionRange; exports.getBinCount = getBinCount; exports.getBinFromBinArray = getBinFromBinArray; exports.getBinIdIndexInBinArray = getBinIdIndexInBinArray; exports.getEstimatedComputeUnitIxWithBuffer = getEstimatedComputeUnitIxWithBuffer; exports.getEstimatedComputeUnitUsageWithBuffer = getEstimatedComputeUnitUsageWithBuffer; exports.getExtendedPositionBinCount = getExtendedPositionBinCount; exports.getLiquidityStrategyParameterBuilder = getLiquidityStrategyParameterBuilder; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPositionCountByBinCount = getPositionCountByBinCount; exports.getPositionExpandRentExemption = getPositionExpandRentExemption; exports.getPositionLowerUpperBinIdWithLiquidity = getPositionLowerUpperBinIdWithLiquidity; exports.getPositionRentExemption = getPositionRentExemption; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getRebalanceBinArrayIndexesAndBitmapCoverage = getRebalanceBinArrayIndexesAndBitmapCoverage; exports.getSlippageMaxAmount = getSlippageMaxAmount; exports.getSlippageMinAmount = getSlippageMinAmount; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgramId = getTokenProgramId; exports.getTokensMintFromPoolAddress = getTokensMintFromPoolAddress; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.isPositionNoFee = isPositionNoFee; exports.isPositionNoReward = isPositionNoReward; exports.parseLogs = parseLogs; exports.positionLbPairFilter = positionLbPairFilter; exports.positionOwnerFilter = positionOwnerFilter; exports.positionV2Filter = positionV2Filter; exports.presetParameter2BaseFactorFilter = presetParameter2BaseFactorFilter; exports.presetParameter2BaseFeePowerFactor = presetParameter2BaseFeePowerFactor; exports.presetParameter2BinStepFilter = presetParameter2BinStepFilter; exports.range = range; exports.resetUninvolvedLiquidityParams = resetUninvolvedLiquidityParams; exports.suggestBalancedXParametersFromY = suggestBalancedXParametersFromY; exports.suggestBalancedYParametersFromX = suggestBalancedYParametersFromX; exports.swapExactInQuoteAtBin = swapExactInQuoteAtBin; exports.swapExactOutQuoteAtBin = swapExactOutQuoteAtBin; exports.toAmountAskSide = toAmountAskSide; exports.toAmountBidSide = toAmountBidSide; exports.toAmountBothSide = toAmountBothSide; exports.toAmountIntoBins = toAmountIntoBins; exports.toAmountsBothSideByStrategy = toAmountsBothSideByStrategy; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.updateBinArray = updateBinArray; exports.wrapPosition = wrapPosition; exports.wrapSOLInstruction = wrapSOLInstruction;
|
|
22397
22472
|
//# sourceMappingURL=index.js.map
|
|
22398
22473
|
|
|
22399
22474
|
// CJS interop: Make default export primary for require() compatibility
|