@meteora-ag/dlmm 1.4.6 → 1.4.7-rc.0

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 CHANGED
@@ -14572,11 +14572,10 @@ var DLMM = class {
14572
14572
  _nullishCoalesce(_optionalChain([this, 'access', _94 => _94.binArrayBitmapExtension, 'optionalAccess', _95 => _95.account]), () => ( null))
14573
14573
  );
14574
14574
  const accountsToFetch = [];
14575
- const [binArrayBitMapExtensionPubkey] = deriveBinArrayBitmapExtension(
14576
- this.pubkey,
14577
- this.program.programId
14578
- );
14579
- accountsToFetch.push(binArrayBitMapExtensionPubkey);
14575
+ const binArrayBitMapExtensionPubkey = isOverflowDefaultBinArrayBitmap(
14576
+ new (0, _anchor.BN)(marketPriceBinId)
14577
+ ) ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] : null;
14578
+ binArrayBitMapExtensionPubkey && accountsToFetch.push(binArrayBitMapExtensionPubkey);
14580
14579
  const [fromBinArrayPubkey] = deriveBinArray(
14581
14580
  this.pubkey,
14582
14581
  fromBinArrayIndex,
@@ -14597,12 +14596,22 @@ var DLMM = class {
14597
14596
  const binArrayAccounts = await this.program.provider.connection.getMultipleAccountsInfo(
14598
14597
  accountsToFetch
14599
14598
  );
14599
+ const preInstructions = [];
14600
14600
  let fromBinArray = null;
14601
14601
  let toBinArray = null;
14602
14602
  let binArrayBitmapExtension = null;
14603
- if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _96 => _96[0]])) {
14603
+ if (binArrayBitMapExtensionPubkey) {
14604
14604
  binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
14605
+ if (!_optionalChain([binArrayAccounts, 'optionalAccess', _96 => _96[0]])) {
14606
+ const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accounts({
14607
+ binArrayBitmapExtension: binArrayBitMapExtensionPubkey,
14608
+ funder: owner,
14609
+ lbPair: this.pubkey
14610
+ }).instruction();
14611
+ preInstructions.push(initializeBitmapExtensionIx);
14612
+ }
14605
14613
  }
14614
+ console.log({ binArrayBitmapExtension });
14606
14615
  if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _97 => _97[1]])) {
14607
14616
  fromBinArray = fromBinArrayPubkey;
14608
14617
  }
@@ -14615,7 +14624,7 @@ var DLMM = class {
14615
14624
  binArrayBitmapExtension,
14616
14625
  fromBinArray,
14617
14626
  toBinArray
14618
- }).transaction();
14627
+ }).preInstructions(preInstructions).transaction();
14619
14628
  return new (0, _web3js.Transaction)({
14620
14629
  feePayer: owner,
14621
14630
  blockhash,