@meteora-ag/dlmm 1.2.1 → 1.2.2-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.d.ts CHANGED
@@ -5690,10 +5690,10 @@ declare class DLMM {
5690
5690
  positionCost: number;
5691
5691
  }>;
5692
5692
  /**
5693
- * Creates an empty position and initializes the corresponding bin arrays if needed.
5694
- * @param param0 The settings of the requested new position.
5695
- * @returns A promise that resolves into a transaction for creating the requested position.
5696
- */
5693
+ * Creates an empty position and initializes the corresponding bin arrays if needed.
5694
+ * @param param0 The settings of the requested new position.
5695
+ * @returns A promise that resolves into a transaction for creating the requested position.
5696
+ */
5697
5697
  createEmptyPosition({ positionPubKey, minBinId, maxBinId, user, }: {
5698
5698
  positionPubKey: PublicKey;
5699
5699
  minBinId: number;
package/dist/index.js CHANGED
@@ -8939,10 +8939,10 @@ var DLMM = class {
8939
8939
  };
8940
8940
  }
8941
8941
  /**
8942
- * Creates an empty position and initializes the corresponding bin arrays if needed.
8943
- * @param param0 The settings of the requested new position.
8944
- * @returns A promise that resolves into a transaction for creating the requested position.
8945
- */
8942
+ * Creates an empty position and initializes the corresponding bin arrays if needed.
8943
+ * @param param0 The settings of the requested new position.
8944
+ * @returns A promise that resolves into a transaction for creating the requested position.
8945
+ */
8946
8946
  async createEmptyPosition({
8947
8947
  positionPubKey,
8948
8948
  minBinId,
@@ -11579,17 +11579,20 @@ var DLMM = class {
11579
11579
  ).map((idx) => new (0, _anchor.BN)(idx));
11580
11580
  const binArrays = [];
11581
11581
  for (const idx of binArrayIndexes) {
11582
- const [binArray] = deriveBinArray(
11582
+ const [binArrayPubKey] = deriveBinArray(
11583
11583
  this.pubkey,
11584
11584
  idx,
11585
11585
  this.program.programId
11586
11586
  );
11587
- const binArrayAccount = await this.program.provider.connection.getAccountInfo(binArray);
11588
- if (binArrayAccount === null) {
11589
- binArrays.push(binArray);
11590
- }
11587
+ binArrays.push(binArrayPubKey);
11591
11588
  }
11592
- return binArrays;
11589
+ const binArrayAccounts = await this.program.provider.connection.getMultipleAccountsInfo(binArrays);
11590
+ console.log(
11591
+ binArrays.map((binArray, index) => ({
11592
+ [binArray.toBase58()]: binArrayAccounts[index]
11593
+ }))
11594
+ );
11595
+ return binArrayAccounts.filter((binArray) => binArray === null);
11593
11596
  }
11594
11597
  async createBinArraysIfNeeded(upperBinArrayIndex, lowerBinArrayIndex, funder) {
11595
11598
  const ixs = [];