@meteora-ag/dlmm 1.0.34 → 1.0.35-rc.2
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 +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4847,7 +4847,7 @@ declare class DLMM {
|
|
|
4847
4847
|
* `LbPairAccount` objects.
|
|
4848
4848
|
*/
|
|
4849
4849
|
static getLbPairs(connection: Connection, opt?: Opt): Promise<LbPairAccount[]>;
|
|
4850
|
-
static checkPoolExists(connection: Connection, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, opt?: Opt): Promise<
|
|
4850
|
+
static checkPoolExists(connection: Connection, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, opt?: Opt): Promise<false | PublicKey>;
|
|
4851
4851
|
/**
|
|
4852
4852
|
* The `create` function is a static method that creates a new instance of the `DLMM` class
|
|
4853
4853
|
* @param {Connection} connection - The `connection` parameter is an instance of the `Connection`
|
package/dist/index.js
CHANGED
|
@@ -6527,15 +6527,26 @@ var DLMM = class {
|
|
|
6527
6527
|
);
|
|
6528
6528
|
const program = new (0, _anchor.Program)(IDL, LBCLMM_PROGRAM_IDS[cluster], provider);
|
|
6529
6529
|
try {
|
|
6530
|
-
const [
|
|
6530
|
+
const [lbPair2Key] = deriveLbPair2(
|
|
6531
6531
|
tokenX,
|
|
6532
6532
|
tokenY,
|
|
6533
6533
|
binStep,
|
|
6534
6534
|
baseFactor,
|
|
6535
6535
|
program.programId
|
|
6536
6536
|
);
|
|
6537
|
-
await program.account.lbPair.
|
|
6538
|
-
|
|
6537
|
+
const account2 = await program.account.lbPair.fetchNullable(lbPair2Key);
|
|
6538
|
+
if (account2)
|
|
6539
|
+
return lbPair2Key;
|
|
6540
|
+
const [lbPairKey] = deriveLbPair(
|
|
6541
|
+
tokenX,
|
|
6542
|
+
tokenY,
|
|
6543
|
+
binStep,
|
|
6544
|
+
program.programId
|
|
6545
|
+
);
|
|
6546
|
+
const account = await program.account.lbPair.fetchNullable(lbPairKey);
|
|
6547
|
+
if (account)
|
|
6548
|
+
return lbPairKey;
|
|
6549
|
+
return false;
|
|
6539
6550
|
} catch (e2) {
|
|
6540
6551
|
return false;
|
|
6541
6552
|
}
|