@meteora-ag/dlmm 1.0.39-rc.28 → 1.0.39-rc.29

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.mjs CHANGED
@@ -7521,6 +7521,23 @@ var DLMM = class {
7521
7521
  }
7522
7522
  ]);
7523
7523
  }
7524
+ async getBinArraysWithLiquidity() {
7525
+ const binArrayIndex = findNextBinArrayIndexWithLiquidity(
7526
+ false,
7527
+ new BN9(this.lbPair.parameters.maxBinId),
7528
+ this.lbPair,
7529
+ this.binArrayBitmapExtension?.account ?? null
7530
+ );
7531
+ const [binArrayPubkey] = deriveBinArray(
7532
+ this.pubkey,
7533
+ binArrayIndex,
7534
+ this.program.programId
7535
+ );
7536
+ const binArrayAccount = await this.program.account.binArray.fetch(
7537
+ binArrayPubkey
7538
+ );
7539
+ return binArrayAccount;
7540
+ }
7524
7541
  /**
7525
7542
  * The function `getBinArrayAroundActiveBin` retrieves a specified number of `BinArrayAccount`
7526
7543
  * objects from the blockchain, based on the active bin and its surrounding bin arrays.
@@ -9898,21 +9915,7 @@ var DLMM = class {
9898
9915
  lastValidBlockHeight
9899
9916
  }).add(syncWithMarketPriceTx);
9900
9917
  }
9901
- async getMaxPrice() {
9902
- const binArrayIndex = findNextBinArrayIndexWithLiquidity(
9903
- false,
9904
- new BN9(this.lbPair.parameters.maxBinId),
9905
- this.lbPair,
9906
- this.binArrayBitmapExtension?.account ?? null
9907
- );
9908
- const [binArrayPubkey] = deriveBinArray(
9909
- this.pubkey,
9910
- binArrayIndex,
9911
- this.program.programId
9912
- );
9913
- const binArrayAccount = await this.program.account.binArray.fetch(
9914
- binArrayPubkey
9915
- );
9918
+ async getMaxPrice(binArrayAccount) {
9916
9919
  const { bins } = binArrayAccount;
9917
9920
  const lastBinWithLiquidityIndex = bins.findLastIndex(
9918
9921
  ({ amountX }) => !amountX.isZero()