@meteora-ag/dlmm 1.0.36-rc.1 → 1.0.36
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/README.md +29 -32
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6922,7 +6922,7 @@ var DLMM = class {
|
|
|
6922
6922
|
);
|
|
6923
6923
|
return program.account.lbPair.all();
|
|
6924
6924
|
}
|
|
6925
|
-
static async
|
|
6925
|
+
static async getPairPubkeyIfExists(connection, tokenX, tokenY, binStep, baseFactor, opt) {
|
|
6926
6926
|
const cluster = opt?.cluster || "mainnet-beta";
|
|
6927
6927
|
const provider = new AnchorProvider(
|
|
6928
6928
|
connection,
|
|
@@ -6948,14 +6948,12 @@ var DLMM = class {
|
|
|
6948
6948
|
program.programId
|
|
6949
6949
|
);
|
|
6950
6950
|
const account = await program.account.lbPair.fetchNullable(lbPairKey);
|
|
6951
|
-
if (
|
|
6952
|
-
return false;
|
|
6953
|
-
}
|
|
6954
|
-
if (account.parameters.baseFactor === baseFactor.toNumber()) {
|
|
6951
|
+
if (account && account.parameters.baseFactor === baseFactor.toNumber()) {
|
|
6955
6952
|
return lbPairKey;
|
|
6956
6953
|
}
|
|
6957
|
-
|
|
6958
|
-
|
|
6954
|
+
return null;
|
|
6955
|
+
} catch (error) {
|
|
6956
|
+
return null;
|
|
6959
6957
|
}
|
|
6960
6958
|
}
|
|
6961
6959
|
/**
|
|
@@ -7643,7 +7641,7 @@ var DLMM = class {
|
|
|
7643
7641
|
AnchorProvider.defaultOptions()
|
|
7644
7642
|
);
|
|
7645
7643
|
const program = new Program(IDL, LBCLMM_PROGRAM_IDS[opt.cluster], provider);
|
|
7646
|
-
const existsPool = await this.
|
|
7644
|
+
const existsPool = await this.getPairPubkeyIfExists(
|
|
7647
7645
|
connection,
|
|
7648
7646
|
tokenX,
|
|
7649
7647
|
tokenY,
|