@meteora-ag/dlmm 1.9.1-rc.0 → 1.9.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +67 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17032,6 +17032,16 @@ var DLMM = class {
|
|
|
17032
17032
|
tokenYAccount.owner
|
|
17033
17033
|
);
|
|
17034
17034
|
createUserTokenYIx && preInstructions.push(createUserTokenYIx);
|
|
17035
|
+
const postInstructions = [];
|
|
17036
|
+
if (tokenY.equals(_spltoken.NATIVE_MINT) && !_optionalChain([opt, 'optionalAccess', _69 => _69.skipSolWrappingOperation])) {
|
|
17037
|
+
const wrapAmount = BigInt(1e6);
|
|
17038
|
+
const wrapSOLIx = wrapSOLInstruction(creatorKey, userTokenY, wrapAmount);
|
|
17039
|
+
preInstructions.push(...wrapSOLIx);
|
|
17040
|
+
const unwrapSOLIx = await unwrapSOLInstruction(creatorKey);
|
|
17041
|
+
if (unwrapSOLIx) {
|
|
17042
|
+
postInstructions.push(unwrapSOLIx);
|
|
17043
|
+
}
|
|
17044
|
+
}
|
|
17035
17045
|
return program.methods.initializeCustomizablePermissionlessLbPair2(ixData).accountsPartial({
|
|
17036
17046
|
tokenBadgeX: tokenBadgeXAccount ? tokenBadgeX : program.programId,
|
|
17037
17047
|
tokenBadgeY: tokenBadgeYAccount ? tokenBadgeY : program.programId,
|
|
@@ -17048,7 +17058,7 @@ var DLMM = class {
|
|
|
17048
17058
|
funder: creatorKey,
|
|
17049
17059
|
tokenProgramX: tokenXAccount.owner,
|
|
17050
17060
|
tokenProgramY: tokenYAccount.owner
|
|
17051
|
-
}).preInstructions(preInstructions).transaction();
|
|
17061
|
+
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
17052
17062
|
}
|
|
17053
17063
|
/**
|
|
17054
17064
|
* Create a new customizable permissionless pair. Support only token program.
|
|
@@ -17072,13 +17082,7 @@ var DLMM = class {
|
|
|
17072
17082
|
tokenY,
|
|
17073
17083
|
program.programId
|
|
17074
17084
|
);
|
|
17075
|
-
const [
|
|
17076
|
-
tokenXAccount,
|
|
17077
|
-
tokenYAccount
|
|
17078
|
-
] = await connection.getMultipleAccountsInfo([
|
|
17079
|
-
tokenX,
|
|
17080
|
-
tokenY
|
|
17081
|
-
]);
|
|
17085
|
+
const [tokenXAccount, tokenYAccount] = await connection.getMultipleAccountsInfo([tokenX, tokenY]);
|
|
17082
17086
|
const [reserveX] = deriveReserve(tokenX, lbPair, program.programId);
|
|
17083
17087
|
const [reserveY] = deriveReserve(tokenY, lbPair, program.programId);
|
|
17084
17088
|
const [oracle] = deriveOracle(lbPair, program.programId);
|
|
@@ -17120,6 +17124,16 @@ var DLMM = class {
|
|
|
17120
17124
|
tokenYAccount.owner
|
|
17121
17125
|
);
|
|
17122
17126
|
createUserTokenYIx && preInstructions.push(createUserTokenYIx);
|
|
17127
|
+
const postInstructions = [];
|
|
17128
|
+
if (tokenY.equals(_spltoken.NATIVE_MINT) && !_optionalChain([opt, 'optionalAccess', _70 => _70.skipSolWrappingOperation])) {
|
|
17129
|
+
const wrapAmount = BigInt(1e6);
|
|
17130
|
+
const wrapSOLIx = wrapSOLInstruction(creatorKey, userTokenY, wrapAmount);
|
|
17131
|
+
preInstructions.push(...wrapSOLIx);
|
|
17132
|
+
const unwrapSOLIx = await unwrapSOLInstruction(creatorKey);
|
|
17133
|
+
if (unwrapSOLIx) {
|
|
17134
|
+
postInstructions.push(unwrapSOLIx);
|
|
17135
|
+
}
|
|
17136
|
+
}
|
|
17123
17137
|
return program.methods.initializeCustomizablePermissionlessLbPair(ixData).accountsPartial({
|
|
17124
17138
|
lbPair,
|
|
17125
17139
|
reserveX,
|
|
@@ -17132,7 +17146,7 @@ var DLMM = class {
|
|
|
17132
17146
|
userTokenX,
|
|
17133
17147
|
userTokenY,
|
|
17134
17148
|
funder: creatorKey
|
|
17135
|
-
}).preInstructions(preInstructions).transaction();
|
|
17149
|
+
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
17136
17150
|
}
|
|
17137
17151
|
/**
|
|
17138
17152
|
* Create a new liquidity pair. Support only token program.
|
|
@@ -17228,8 +17242,8 @@ var DLMM = class {
|
|
|
17228
17242
|
new (0, _anchor.BN)(presetParameterState.baseFactor),
|
|
17229
17243
|
new (0, _anchor.BN)(presetParameterState.baseFeePowerFactor),
|
|
17230
17244
|
{
|
|
17231
|
-
cluster: _optionalChain([opt, 'optionalAccess',
|
|
17232
|
-
programId: _optionalChain([opt, 'optionalAccess',
|
|
17245
|
+
cluster: _optionalChain([opt, 'optionalAccess', _71 => _71.cluster]),
|
|
17246
|
+
programId: _optionalChain([opt, 'optionalAccess', _72 => _72.programId])
|
|
17233
17247
|
}
|
|
17234
17248
|
);
|
|
17235
17249
|
if (existsPool) {
|
|
@@ -17457,7 +17471,7 @@ var DLMM = class {
|
|
|
17457
17471
|
swapForY,
|
|
17458
17472
|
new (0, _anchor.BN)(activeIdToLoop),
|
|
17459
17473
|
this.lbPair,
|
|
17460
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
17474
|
+
_nullishCoalesce(_optionalChain([this, 'access', _73 => _73.binArrayBitmapExtension, 'optionalAccess', _74 => _74.account]), () => ( null))
|
|
17461
17475
|
);
|
|
17462
17476
|
if (binArrayIndex === null)
|
|
17463
17477
|
shouldStop = true;
|
|
@@ -17788,8 +17802,8 @@ var DLMM = class {
|
|
|
17788
17802
|
position,
|
|
17789
17803
|
this.tokenX.mint,
|
|
17790
17804
|
this.tokenY.mint,
|
|
17791
|
-
_optionalChain([this, 'access',
|
|
17792
|
-
_optionalChain([this, 'access',
|
|
17805
|
+
_optionalChain([this, 'access', _75 => _75.rewards, 'access', _76 => _76[0], 'optionalAccess', _77 => _77.mint]),
|
|
17806
|
+
_optionalChain([this, 'access', _78 => _78.rewards, 'access', _79 => _79[1], 'optionalAccess', _80 => _80.mint]),
|
|
17793
17807
|
positionBinArraysMapV2
|
|
17794
17808
|
),
|
|
17795
17809
|
version: position.version()
|
|
@@ -17977,8 +17991,8 @@ var DLMM = class {
|
|
|
17977
17991
|
position,
|
|
17978
17992
|
this.tokenX.mint,
|
|
17979
17993
|
this.tokenY.mint,
|
|
17980
|
-
_optionalChain([this, 'access',
|
|
17981
|
-
_optionalChain([this, 'access',
|
|
17994
|
+
_optionalChain([this, 'access', _81 => _81.rewards, 'access', _82 => _82[0], 'optionalAccess', _83 => _83.mint]),
|
|
17995
|
+
_optionalChain([this, 'access', _84 => _84.rewards, 'access', _85 => _85[1], 'optionalAccess', _86 => _86.mint]),
|
|
17982
17996
|
binArrayMap
|
|
17983
17997
|
),
|
|
17984
17998
|
version: position.version()
|
|
@@ -18003,7 +18017,7 @@ var DLMM = class {
|
|
|
18003
18017
|
);
|
|
18004
18018
|
const { minBinId, maxBinId } = strategy;
|
|
18005
18019
|
const binCount = getBinCount(minBinId, maxBinId);
|
|
18006
|
-
const defaultAltAddressString = _nullishCoalesce(altAddress, () => ( ALT_ADDRESS[_optionalChain([this, 'access',
|
|
18020
|
+
const defaultAltAddressString = _nullishCoalesce(altAddress, () => ( ALT_ADDRESS[_optionalChain([this, 'access', _87 => _87.opt, 'optionalAccess', _88 => _88.cluster])]));
|
|
18007
18021
|
if (defaultAltAddressString) {
|
|
18008
18022
|
altAddress = new (0, _web3js.PublicKey)(defaultAltAddressString);
|
|
18009
18023
|
}
|
|
@@ -18066,7 +18080,7 @@ var DLMM = class {
|
|
|
18066
18080
|
owner,
|
|
18067
18081
|
payer,
|
|
18068
18082
|
true,
|
|
18069
|
-
_optionalChain([this, 'access',
|
|
18083
|
+
_optionalChain([this, 'access', _89 => _89.opt, 'optionalAccess', _90 => _90.skipSolWrappingOperation])
|
|
18070
18084
|
);
|
|
18071
18085
|
for (const instructions of addLiquidityIxs) {
|
|
18072
18086
|
const txIxs = [];
|
|
@@ -18188,7 +18202,7 @@ var DLMM = class {
|
|
|
18188
18202
|
owner,
|
|
18189
18203
|
payer,
|
|
18190
18204
|
false,
|
|
18191
|
-
_optionalChain([this, 'access',
|
|
18205
|
+
_optionalChain([this, 'access', _91 => _91.opt, 'optionalAccess', _92 => _92.skipSolWrappingOperation])
|
|
18192
18206
|
);
|
|
18193
18207
|
instructionsByPositions.push({
|
|
18194
18208
|
positionKeypair: position,
|
|
@@ -18252,7 +18266,7 @@ var DLMM = class {
|
|
|
18252
18266
|
user,
|
|
18253
18267
|
user,
|
|
18254
18268
|
true,
|
|
18255
|
-
_optionalChain([this, 'access',
|
|
18269
|
+
_optionalChain([this, 'access', _93 => _93.opt, 'optionalAccess', _94 => _94.skipSolWrappingOperation])
|
|
18256
18270
|
);
|
|
18257
18271
|
const latestBlockhashInfo = await this.program.provider.connection.getLatestBlockhash();
|
|
18258
18272
|
return chunkedAddLiquidityIx.map((ixs) => {
|
|
@@ -18327,7 +18341,7 @@ var DLMM = class {
|
|
|
18327
18341
|
]);
|
|
18328
18342
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18329
18343
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18330
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18344
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _95 => _95.opt, 'optionalAccess', _96 => _96.skipSolWrappingOperation])) {
|
|
18331
18345
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18332
18346
|
user,
|
|
18333
18347
|
userTokenX,
|
|
@@ -18335,7 +18349,7 @@ var DLMM = class {
|
|
|
18335
18349
|
);
|
|
18336
18350
|
preInstructions.push(...wrapSOLIx);
|
|
18337
18351
|
}
|
|
18338
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18352
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _97 => _97.opt, 'optionalAccess', _98 => _98.skipSolWrappingOperation])) {
|
|
18339
18353
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18340
18354
|
user,
|
|
18341
18355
|
userTokenY,
|
|
@@ -18347,7 +18361,7 @@ var DLMM = class {
|
|
|
18347
18361
|
if ([
|
|
18348
18362
|
this.tokenX.publicKey.toBase58(),
|
|
18349
18363
|
this.tokenY.publicKey.toBase58()
|
|
18350
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18364
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _99 => _99.opt, 'optionalAccess', _100 => _100.skipSolWrappingOperation])) {
|
|
18351
18365
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18352
18366
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18353
18367
|
}
|
|
@@ -18481,7 +18495,7 @@ var DLMM = class {
|
|
|
18481
18495
|
]);
|
|
18482
18496
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18483
18497
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18484
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18498
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _101 => _101.opt, 'optionalAccess', _102 => _102.skipSolWrappingOperation])) {
|
|
18485
18499
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18486
18500
|
user,
|
|
18487
18501
|
userTokenX,
|
|
@@ -18489,7 +18503,7 @@ var DLMM = class {
|
|
|
18489
18503
|
);
|
|
18490
18504
|
preInstructions.push(...wrapSOLIx);
|
|
18491
18505
|
}
|
|
18492
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18506
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _103 => _103.opt, 'optionalAccess', _104 => _104.skipSolWrappingOperation])) {
|
|
18493
18507
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18494
18508
|
user,
|
|
18495
18509
|
userTokenY,
|
|
@@ -18501,7 +18515,7 @@ var DLMM = class {
|
|
|
18501
18515
|
if ([
|
|
18502
18516
|
this.tokenX.publicKey.toBase58(),
|
|
18503
18517
|
this.tokenY.publicKey.toBase58()
|
|
18504
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18518
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _105 => _105.opt, 'optionalAccess', _106 => _106.skipSolWrappingOperation])) {
|
|
18505
18519
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18506
18520
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18507
18521
|
}
|
|
@@ -18685,7 +18699,7 @@ var DLMM = class {
|
|
|
18685
18699
|
]);
|
|
18686
18700
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18687
18701
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18688
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18702
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _107 => _107.opt, 'optionalAccess', _108 => _108.skipSolWrappingOperation])) {
|
|
18689
18703
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18690
18704
|
user,
|
|
18691
18705
|
userTokenX,
|
|
@@ -18693,7 +18707,7 @@ var DLMM = class {
|
|
|
18693
18707
|
);
|
|
18694
18708
|
preInstructions.push(...wrapSOLIx);
|
|
18695
18709
|
}
|
|
18696
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18710
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _109 => _109.opt, 'optionalAccess', _110 => _110.skipSolWrappingOperation])) {
|
|
18697
18711
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18698
18712
|
user,
|
|
18699
18713
|
userTokenY,
|
|
@@ -18705,7 +18719,7 @@ var DLMM = class {
|
|
|
18705
18719
|
if ([
|
|
18706
18720
|
this.tokenX.publicKey.toBase58(),
|
|
18707
18721
|
this.tokenY.publicKey.toBase58()
|
|
18708
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18722
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _111 => _111.opt, 'optionalAccess', _112 => _112.skipSolWrappingOperation])) {
|
|
18709
18723
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18710
18724
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18711
18725
|
}
|
|
@@ -18853,7 +18867,7 @@ var DLMM = class {
|
|
|
18853
18867
|
]);
|
|
18854
18868
|
createPayerTokenXIx && preInstructions.push(createPayerTokenXIx);
|
|
18855
18869
|
createPayerTokenYIx && preInstructions.push(createPayerTokenYIx);
|
|
18856
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access',
|
|
18870
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !totalXAmount.isZero() && !_optionalChain([this, 'access', _113 => _113.opt, 'optionalAccess', _114 => _114.skipSolWrappingOperation])) {
|
|
18857
18871
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18858
18872
|
user,
|
|
18859
18873
|
userTokenX,
|
|
@@ -18861,7 +18875,7 @@ var DLMM = class {
|
|
|
18861
18875
|
);
|
|
18862
18876
|
preInstructions.push(...wrapSOLIx);
|
|
18863
18877
|
}
|
|
18864
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access',
|
|
18878
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !totalYAmount.isZero() && !_optionalChain([this, 'access', _115 => _115.opt, 'optionalAccess', _116 => _116.skipSolWrappingOperation])) {
|
|
18865
18879
|
const wrapSOLIx = wrapSOLInstruction(
|
|
18866
18880
|
user,
|
|
18867
18881
|
userTokenY,
|
|
@@ -18873,7 +18887,7 @@ var DLMM = class {
|
|
|
18873
18887
|
if ([
|
|
18874
18888
|
this.tokenX.publicKey.toBase58(),
|
|
18875
18889
|
this.tokenY.publicKey.toBase58()
|
|
18876
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
18890
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _117 => _117.opt, 'optionalAccess', _118 => _118.skipSolWrappingOperation])) {
|
|
18877
18891
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
18878
18892
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18879
18893
|
}
|
|
@@ -19150,7 +19164,7 @@ var DLMM = class {
|
|
|
19150
19164
|
if ([
|
|
19151
19165
|
this.tokenX.publicKey.toBase58(),
|
|
19152
19166
|
this.tokenY.publicKey.toBase58()
|
|
19153
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && (!skipUnwrapSOL || !_optionalChain([this, 'access',
|
|
19167
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && (!skipUnwrapSOL || !_optionalChain([this, 'access', _119 => _119.opt, 'optionalAccess', _120 => _120.skipSolWrappingOperation]))) {
|
|
19154
19168
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19155
19169
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19156
19170
|
}
|
|
@@ -19305,7 +19319,7 @@ var DLMM = class {
|
|
|
19305
19319
|
swapForY,
|
|
19306
19320
|
activeId,
|
|
19307
19321
|
this.lbPair,
|
|
19308
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19322
|
+
_nullishCoalesce(_optionalChain([this, 'access', _121 => _121.binArrayBitmapExtension, 'optionalAccess', _122 => _122.account]), () => ( null)),
|
|
19309
19323
|
binArrays
|
|
19310
19324
|
);
|
|
19311
19325
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19370,7 +19384,7 @@ var DLMM = class {
|
|
|
19370
19384
|
swapForY,
|
|
19371
19385
|
activeId,
|
|
19372
19386
|
this.lbPair,
|
|
19373
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19387
|
+
_nullishCoalesce(_optionalChain([this, 'access', _123 => _123.binArrayBitmapExtension, 'optionalAccess', _124 => _124.account]), () => ( null)),
|
|
19374
19388
|
binArrays
|
|
19375
19389
|
);
|
|
19376
19390
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19467,7 +19481,7 @@ var DLMM = class {
|
|
|
19467
19481
|
swapForY,
|
|
19468
19482
|
activeId,
|
|
19469
19483
|
this.lbPair,
|
|
19470
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19484
|
+
_nullishCoalesce(_optionalChain([this, 'access', _125 => _125.binArrayBitmapExtension, 'optionalAccess', _126 => _126.account]), () => ( null)),
|
|
19471
19485
|
binArrays
|
|
19472
19486
|
);
|
|
19473
19487
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19555,7 +19569,7 @@ var DLMM = class {
|
|
|
19555
19569
|
swapForY,
|
|
19556
19570
|
activeId,
|
|
19557
19571
|
this.lbPair,
|
|
19558
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
19572
|
+
_nullishCoalesce(_optionalChain([this, 'access', _127 => _127.binArrayBitmapExtension, 'optionalAccess', _128 => _128.account]), () => ( null)),
|
|
19559
19573
|
binArrays
|
|
19560
19574
|
);
|
|
19561
19575
|
if (binArrayAccountToSwap == null) {
|
|
@@ -19637,7 +19651,7 @@ var DLMM = class {
|
|
|
19637
19651
|
]);
|
|
19638
19652
|
createInTokenAccountIx && preInstructions.push(createInTokenAccountIx);
|
|
19639
19653
|
createOutTokenAccountIx && preInstructions.push(createOutTokenAccountIx);
|
|
19640
|
-
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19654
|
+
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _129 => _129.opt, 'optionalAccess', _130 => _130.skipSolWrappingOperation])) {
|
|
19641
19655
|
const wrapSOLIx = wrapSOLInstruction(
|
|
19642
19656
|
user,
|
|
19643
19657
|
userTokenIn,
|
|
@@ -19647,7 +19661,7 @@ var DLMM = class {
|
|
|
19647
19661
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19648
19662
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19649
19663
|
}
|
|
19650
|
-
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19664
|
+
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _131 => _131.opt, 'optionalAccess', _132 => _132.skipSolWrappingOperation])) {
|
|
19651
19665
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19652
19666
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19653
19667
|
}
|
|
@@ -19730,7 +19744,7 @@ var DLMM = class {
|
|
|
19730
19744
|
]);
|
|
19731
19745
|
createInTokenAccountIx && preInstructions.push(createInTokenAccountIx);
|
|
19732
19746
|
createOutTokenAccountIx && preInstructions.push(createOutTokenAccountIx);
|
|
19733
|
-
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19747
|
+
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _133 => _133.opt, 'optionalAccess', _134 => _134.skipSolWrappingOperation])) {
|
|
19734
19748
|
const wrapSOLIx = wrapSOLInstruction(
|
|
19735
19749
|
user,
|
|
19736
19750
|
userTokenIn,
|
|
@@ -19740,7 +19754,7 @@ var DLMM = class {
|
|
|
19740
19754
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19741
19755
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19742
19756
|
}
|
|
19743
|
-
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19757
|
+
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _135 => _135.opt, 'optionalAccess', _136 => _136.skipSolWrappingOperation])) {
|
|
19744
19758
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19745
19759
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19746
19760
|
}
|
|
@@ -19832,7 +19846,7 @@ var DLMM = class {
|
|
|
19832
19846
|
]);
|
|
19833
19847
|
createInTokenAccountIx && preInstructions.push(createInTokenAccountIx);
|
|
19834
19848
|
createOutTokenAccountIx && preInstructions.push(createOutTokenAccountIx);
|
|
19835
|
-
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19849
|
+
if (inToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _137 => _137.opt, 'optionalAccess', _138 => _138.skipSolWrappingOperation])) {
|
|
19836
19850
|
const wrapSOLIx = wrapSOLInstruction(
|
|
19837
19851
|
user,
|
|
19838
19852
|
userTokenIn,
|
|
@@ -19842,7 +19856,7 @@ var DLMM = class {
|
|
|
19842
19856
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19843
19857
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19844
19858
|
}
|
|
19845
|
-
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access',
|
|
19859
|
+
if (outToken.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _139 => _139.opt, 'optionalAccess', _140 => _140.skipSolWrappingOperation])) {
|
|
19846
19860
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
19847
19861
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
19848
19862
|
}
|
|
@@ -20901,7 +20915,7 @@ var DLMM = class {
|
|
|
20901
20915
|
swapForY,
|
|
20902
20916
|
new (0, _anchor.BN)(activeBinId),
|
|
20903
20917
|
this.lbPair,
|
|
20904
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
20918
|
+
_nullishCoalesce(_optionalChain([this, 'access', _141 => _141.binArrayBitmapExtension, 'optionalAccess', _142 => _142.account]), () => ( null))
|
|
20905
20919
|
);
|
|
20906
20920
|
if (toBinArrayIndex === null)
|
|
20907
20921
|
return true;
|
|
@@ -20938,7 +20952,7 @@ var DLMM = class {
|
|
|
20938
20952
|
swapForY,
|
|
20939
20953
|
new (0, _anchor.BN)(activeBinId),
|
|
20940
20954
|
this.lbPair,
|
|
20941
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
20955
|
+
_nullishCoalesce(_optionalChain([this, 'access', _143 => _143.binArrayBitmapExtension, 'optionalAccess', _144 => _144.account]), () => ( null))
|
|
20942
20956
|
);
|
|
20943
20957
|
const marketPriceBinArrayIndex = binIdToBinArrayIndex(
|
|
20944
20958
|
new (0, _anchor.BN)(marketPriceBinId)
|
|
@@ -20974,7 +20988,7 @@ var DLMM = class {
|
|
|
20974
20988
|
let binArrayBitmapExtension = null;
|
|
20975
20989
|
if (binArrayBitMapExtensionPubkey) {
|
|
20976
20990
|
binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
|
|
20977
|
-
if (!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
20991
|
+
if (!_optionalChain([binArrayAccounts, 'optionalAccess', _145 => _145[0]])) {
|
|
20978
20992
|
const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
|
|
20979
20993
|
binArrayBitmapExtension: binArrayBitMapExtensionPubkey,
|
|
20980
20994
|
funder: owner,
|
|
@@ -20983,10 +20997,10 @@ var DLMM = class {
|
|
|
20983
20997
|
preInstructions.push(initializeBitmapExtensionIx);
|
|
20984
20998
|
}
|
|
20985
20999
|
}
|
|
20986
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
21000
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _146 => _146[1]])) {
|
|
20987
21001
|
fromBinArray = fromBinArrayPubkey;
|
|
20988
21002
|
}
|
|
20989
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
21003
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _147 => _147[2]]) && !!toBinArrayIndex) {
|
|
20990
21004
|
toBinArray = toBinArrayPubkey;
|
|
20991
21005
|
}
|
|
20992
21006
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
@@ -21432,7 +21446,7 @@ var DLMM = class {
|
|
|
21432
21446
|
slippage
|
|
21433
21447
|
);
|
|
21434
21448
|
const postInstructions = [];
|
|
21435
|
-
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountXDeposited.gtn(0) && !_optionalChain([this, 'access',
|
|
21449
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountXDeposited.gtn(0) && !_optionalChain([this, 'access', _148 => _148.opt, 'optionalAccess', _149 => _149.skipSolWrappingOperation])) {
|
|
21436
21450
|
const wrapSOLIx = wrapSOLInstruction(
|
|
21437
21451
|
owner,
|
|
21438
21452
|
userTokenX,
|
|
@@ -21440,7 +21454,7 @@ var DLMM = class {
|
|
|
21440
21454
|
);
|
|
21441
21455
|
preInstructions.push(...wrapSOLIx);
|
|
21442
21456
|
}
|
|
21443
|
-
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountYDeposited.gtn(0) && !_optionalChain([this, 'access',
|
|
21457
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && simulationResult.actualAmountYDeposited.gtn(0) && !_optionalChain([this, 'access', _150 => _150.opt, 'optionalAccess', _151 => _151.skipSolWrappingOperation])) {
|
|
21444
21458
|
const wrapSOLIx = wrapSOLInstruction(
|
|
21445
21459
|
owner,
|
|
21446
21460
|
userTokenY,
|
|
@@ -21448,7 +21462,7 @@ var DLMM = class {
|
|
|
21448
21462
|
);
|
|
21449
21463
|
preInstructions.push(...wrapSOLIx);
|
|
21450
21464
|
}
|
|
21451
|
-
if ((this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([this, 'access',
|
|
21465
|
+
if ((this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) && !_optionalChain([this, 'access', _152 => _152.opt, 'optionalAccess', _153 => _153.skipSolWrappingOperation])) {
|
|
21452
21466
|
const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
|
|
21453
21467
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
21454
21468
|
}
|
|
@@ -21894,7 +21908,7 @@ var DLMM = class {
|
|
|
21894
21908
|
);
|
|
21895
21909
|
})
|
|
21896
21910
|
);
|
|
21897
|
-
const version = _nullishCoalesce(_optionalChain([binArrays, 'access',
|
|
21911
|
+
const version = _nullishCoalesce(_optionalChain([binArrays, 'access', _154 => _154.find, 'call', _155 => _155((binArray) => binArray != null), 'optionalAccess', _156 => _156.version]), () => ( 1));
|
|
21898
21912
|
return Array.from(
|
|
21899
21913
|
enumerateBins(
|
|
21900
21914
|
binsById,
|
|
@@ -22089,7 +22103,7 @@ var DLMM = class {
|
|
|
22089
22103
|
if ([
|
|
22090
22104
|
this.tokenX.publicKey.toBase58(),
|
|
22091
22105
|
this.tokenY.publicKey.toBase58()
|
|
22092
|
-
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access',
|
|
22106
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !_optionalChain([this, 'access', _157 => _157.opt, 'optionalAccess', _158 => _158.skipSolWrappingOperation])) {
|
|
22093
22107
|
const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
|
|
22094
22108
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
22095
22109
|
}
|