@meteora-ag/dlmm 1.4.7-rc.0 → 1.4.7-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 +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14265,10 +14265,10 @@ var DLMM = class {
|
|
|
14265
14265
|
} else {
|
|
14266
14266
|
const createPositionOwnerTokenXIx = _spltoken.createAssociatedTokenAccountIdempotentInstruction.call(void 0,
|
|
14267
14267
|
payer,
|
|
14268
|
+
positionOwnerTokenX,
|
|
14268
14269
|
positionOwner,
|
|
14269
14270
|
this.lbPair.tokenXMint,
|
|
14270
|
-
this.tokenX.owner
|
|
14271
|
-
positionOwnerTokenX
|
|
14271
|
+
this.tokenX.owner
|
|
14272
14272
|
);
|
|
14273
14273
|
preInstructions.push(createPositionOwnerTokenXIx);
|
|
14274
14274
|
const transferIx = _spltoken.createTransferCheckedInstruction.call(void 0,
|
|
@@ -14571,9 +14571,15 @@ var DLMM = class {
|
|
|
14571
14571
|
this.lbPair,
|
|
14572
14572
|
_nullishCoalesce(_optionalChain([this, 'access', _94 => _94.binArrayBitmapExtension, 'optionalAccess', _95 => _95.account]), () => ( null))
|
|
14573
14573
|
);
|
|
14574
|
+
const marketPriceBinArrayIndex = findNextBinArrayIndexWithLiquidity(
|
|
14575
|
+
swapForY,
|
|
14576
|
+
new (0, _anchor.BN)(marketPriceBinId),
|
|
14577
|
+
this.lbPair,
|
|
14578
|
+
_nullishCoalesce(_optionalChain([this, 'access', _96 => _96.binArrayBitmapExtension, 'optionalAccess', _97 => _97.account]), () => ( null))
|
|
14579
|
+
);
|
|
14574
14580
|
const accountsToFetch = [];
|
|
14575
14581
|
const binArrayBitMapExtensionPubkey = isOverflowDefaultBinArrayBitmap(
|
|
14576
|
-
new (0, _anchor.BN)(
|
|
14582
|
+
new (0, _anchor.BN)(marketPriceBinArrayIndex)
|
|
14577
14583
|
) ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] : null;
|
|
14578
14584
|
binArrayBitMapExtensionPubkey && accountsToFetch.push(binArrayBitMapExtensionPubkey);
|
|
14579
14585
|
const [fromBinArrayPubkey] = deriveBinArray(
|
|
@@ -14602,7 +14608,7 @@ var DLMM = class {
|
|
|
14602
14608
|
let binArrayBitmapExtension = null;
|
|
14603
14609
|
if (binArrayBitMapExtensionPubkey) {
|
|
14604
14610
|
binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
|
|
14605
|
-
if (!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
14611
|
+
if (!_optionalChain([binArrayAccounts, 'optionalAccess', _98 => _98[0]])) {
|
|
14606
14612
|
const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accounts({
|
|
14607
14613
|
binArrayBitmapExtension: binArrayBitMapExtensionPubkey,
|
|
14608
14614
|
funder: owner,
|
|
@@ -14611,11 +14617,10 @@ var DLMM = class {
|
|
|
14611
14617
|
preInstructions.push(initializeBitmapExtensionIx);
|
|
14612
14618
|
}
|
|
14613
14619
|
}
|
|
14614
|
-
|
|
14615
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _97 => _97[1]])) {
|
|
14620
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _99 => _99[1]])) {
|
|
14616
14621
|
fromBinArray = fromBinArrayPubkey;
|
|
14617
14622
|
}
|
|
14618
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
14623
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _100 => _100[2]]) && !!toBinArrayIndex) {
|
|
14619
14624
|
toBinArray = toBinArrayPubkey;
|
|
14620
14625
|
}
|
|
14621
14626
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
@@ -14955,7 +14960,7 @@ var DLMM = class {
|
|
|
14955
14960
|
);
|
|
14956
14961
|
})
|
|
14957
14962
|
);
|
|
14958
|
-
const version = _nullishCoalesce(_optionalChain([binArrays, 'access',
|
|
14963
|
+
const version = _nullishCoalesce(_optionalChain([binArrays, 'access', _101 => _101.find, 'call', _102 => _102((binArray) => binArray != null), 'optionalAccess', _103 => _103.version]), () => ( 1));
|
|
14959
14964
|
return Array.from(
|
|
14960
14965
|
enumerateBins(
|
|
14961
14966
|
binsById,
|