@meteora-ag/dlmm 1.7.2 → 1.7.3-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
@@ -10262,7 +10262,7 @@ declare class DLMM {
10262
10262
  */
10263
10263
  static getLbPairs(connection: Connection, opt?: Opt): Promise<LbPairAccount[]>;
10264
10264
  /**
10265
- * Retrieves the public key of a LB pair if it exists.
10265
+ * Retrieves the public key of a LB pair if it exists. This function expect the RPC have getProgramAccounts RPC method enabled.
10266
10266
  * @param connection The connection to the Solana cluster.
10267
10267
  * @param tokenX The mint address of token X.
10268
10268
  * @param tokenY The mint address of token Y.
package/dist/index.js CHANGED
@@ -14125,7 +14125,7 @@ var DLMM = class {
14125
14125
  return program.account.lbPair.all();
14126
14126
  }
14127
14127
  /**
14128
- * Retrieves the public key of a LB pair if it exists.
14128
+ * Retrieves the public key of a LB pair if it exists. This function expect the RPC have getProgramAccounts RPC method enabled.
14129
14129
  * @param connection The connection to the Solana cluster.
14130
14130
  * @param tokenX The mint address of token X.
14131
14131
  * @param tokenY The mint address of token Y.
@@ -14146,8 +14146,9 @@ var DLMM = class {
14146
14146
  program.programId
14147
14147
  );
14148
14148
  const account2 = await program.account.lbPair.fetchNullable(lbPair2Key);
14149
- if (account2)
14149
+ if (account2 && account2.parameters.baseFeePowerFactor == baseFeePowerFactor.toNumber()) {
14150
14150
  return lbPair2Key;
14151
+ }
14151
14152
  const [lbPairKey] = deriveLbPair(
14152
14153
  tokenX,
14153
14154
  tokenY,
@@ -14155,7 +14156,7 @@ var DLMM = class {
14155
14156
  program.programId
14156
14157
  );
14157
14158
  const account = await program.account.lbPair.fetchNullable(lbPairKey);
14158
- if (account && account.parameters.baseFactor === baseFactor.toNumber()) {
14159
+ if (account && account.parameters.baseFactor === baseFactor.toNumber() && account.parameters.baseFeePowerFactor === baseFeePowerFactor.toNumber()) {
14159
14160
  return lbPairKey;
14160
14161
  }
14161
14162
  const presetParametersWithIndex = await program.account.presetParameter2.all([
@@ -14186,6 +14187,7 @@ var DLMM = class {
14186
14187
  }
14187
14188
  return null;
14188
14189
  } catch (error) {
14190
+ console.error(error);
14189
14191
  return null;
14190
14192
  }
14191
14193
  }