@meteora-ag/dlmm 1.3.17-rc.6 → 1.3.17-rc.8
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 -0
- package/dist/index.js +58 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7926,6 +7926,32 @@ var DLMM = class {
|
|
|
7926
7926
|
return null;
|
|
7927
7927
|
}
|
|
7928
7928
|
}
|
|
7929
|
+
static async getCustomizablePermissionlessLbPairIfExists(connection, tokenX, tokenY, opt) {
|
|
7930
|
+
const cluster = opt?.cluster || "mainnet-beta";
|
|
7931
|
+
const provider = new AnchorProvider2(
|
|
7932
|
+
connection,
|
|
7933
|
+
{},
|
|
7934
|
+
AnchorProvider2.defaultOptions()
|
|
7935
|
+
);
|
|
7936
|
+
const program = new Program3(
|
|
7937
|
+
IDL,
|
|
7938
|
+
opt?.programId ?? LBCLMM_PROGRAM_IDS[cluster],
|
|
7939
|
+
provider
|
|
7940
|
+
);
|
|
7941
|
+
try {
|
|
7942
|
+
const [lpPair] = deriveCustomizablePermissionlessLbPair(
|
|
7943
|
+
tokenX,
|
|
7944
|
+
tokenY,
|
|
7945
|
+
program.programId
|
|
7946
|
+
);
|
|
7947
|
+
const account = await program.account.lbPair.fetchNullable(lpPair);
|
|
7948
|
+
if (account)
|
|
7949
|
+
return lpPair;
|
|
7950
|
+
return null;
|
|
7951
|
+
} catch (error) {
|
|
7952
|
+
return null;
|
|
7953
|
+
}
|
|
7954
|
+
}
|
|
7929
7955
|
/**
|
|
7930
7956
|
* The `create` function is a static method that creates a new instance of the `DLMM` class
|
|
7931
7957
|
* @param {Connection} connection - The `connection` parameter is an instance of the `Connection`
|
|
@@ -8723,7 +8749,8 @@ var DLMM = class {
|
|
|
8723
8749
|
* @returns a Promise that resolves to the transaction.
|
|
8724
8750
|
*/
|
|
8725
8751
|
async setPairStatusPermissionless(enable, creator) {
|
|
8726
|
-
const
|
|
8752
|
+
const status = enable ? 0 : 1;
|
|
8753
|
+
const tx = await this.program.methods.setPairStatusPermissionless(status).accounts({
|
|
8727
8754
|
lbPair: this.pubkey,
|
|
8728
8755
|
creator
|
|
8729
8756
|
}).transaction();
|
|
@@ -11283,7 +11310,6 @@ var DLMM = class {
|
|
|
11283
11310
|
]);
|
|
11284
11311
|
}
|
|
11285
11312
|
}
|
|
11286
|
-
console.log("let return");
|
|
11287
11313
|
return {
|
|
11288
11314
|
sendPositionOwnerTokenProveIxs,
|
|
11289
11315
|
initializeBinArraysAndPositionIxs,
|