@meteora-ag/dlmm 1.0.36 → 1.0.37

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
@@ -5530,6 +5530,27 @@ declare class DLMM {
5530
5530
  * @returns {Promise<SeedLiquidityResponse>}
5531
5531
  */
5532
5532
  seedLiquidity(owner: PublicKey, operator: PublicKey, feeOwner: PublicKey, seedAmount: BN, curvature: number, minPrice: number, maxPrice: number, base: PublicKey): Promise<SeedLiquidityResponse>;
5533
+ /**
5534
+ *
5535
+ * @param
5536
+ * - `lowerBinId`: Lower bin ID of the position. This represent the lowest price of the position
5537
+ * - `positionWidth`: Width of the position. This will decide the upper bin id of the position, which represents the highest price of the position. UpperBinId = lowerBinId + positionWidth
5538
+ * - `owner`: Owner of the position.
5539
+ * - `operator`: Operator of the position. Operator able to manage the position on behalf of the position owner. However, liquidity withdrawal issue by the operator can only send to the position owner.
5540
+ * - `base`: Base key
5541
+ * - `feeOwner`: Owner of the fees earned by the position.
5542
+ * - `payer`: Payer for the position account rental.
5543
+ * @returns
5544
+ */
5545
+ initializePositionByOperator({ lowerBinId, positionWidth, owner, feeOwner, base, operator, payer, }: {
5546
+ lowerBinId: BN;
5547
+ positionWidth: BN;
5548
+ owner: PublicKey;
5549
+ feeOwner: PublicKey;
5550
+ operator: PublicKey;
5551
+ payer: PublicKey;
5552
+ base: PublicKey;
5553
+ }): Promise<Transaction>;
5533
5554
  /**
5534
5555
  * The `claimAllRewards` function to claim swap fees and LM rewards for multiple positions owned by a specific owner.
5535
5556
  * @param
package/dist/index.js CHANGED
@@ -9068,7 +9068,8 @@ var DLMM = class {
9068
9068
  const closePositionIx = await this.program.methods.closePosition().accounts({
9069
9069
  binArrayLower,
9070
9070
  binArrayUpper,
9071
- rentReceiver: user,
9071
+ rentReceiver: owner,
9072
+ // Must be position owner
9072
9073
  position,
9073
9074
  lbPair: this.pubkey,
9074
9075
  sender: user
@@ -9899,6 +9900,53 @@ var DLMM = class {
9899
9900
  addLiquidityIxs
9900
9901
  };
9901
9902
  }
9903
+ /**
9904
+ *
9905
+ * @param
9906
+ * - `lowerBinId`: Lower bin ID of the position. This represent the lowest price of the position
9907
+ * - `positionWidth`: Width of the position. This will decide the upper bin id of the position, which represents the highest price of the position. UpperBinId = lowerBinId + positionWidth
9908
+ * - `owner`: Owner of the position.
9909
+ * - `operator`: Operator of the position. Operator able to manage the position on behalf of the position owner. However, liquidity withdrawal issue by the operator can only send to the position owner.
9910
+ * - `base`: Base key
9911
+ * - `feeOwner`: Owner of the fees earned by the position.
9912
+ * - `payer`: Payer for the position account rental.
9913
+ * @returns
9914
+ */
9915
+ async initializePositionByOperator({
9916
+ lowerBinId,
9917
+ positionWidth,
9918
+ owner,
9919
+ feeOwner,
9920
+ base,
9921
+ operator,
9922
+ payer
9923
+ }) {
9924
+ const [positionPda, _bump] = derivePosition(
9925
+ this.pubkey,
9926
+ base,
9927
+ lowerBinId,
9928
+ positionWidth,
9929
+ this.program.programId
9930
+ );
9931
+ let initializePositionByOperatorTx = await this.program.methods.initializePositionByOperator(
9932
+ lowerBinId.toNumber(),
9933
+ MAX_BIN_PER_POSITION.toNumber(),
9934
+ owner,
9935
+ feeOwner
9936
+ ).accounts({
9937
+ lbPair: this.pubkey,
9938
+ position: positionPda,
9939
+ base,
9940
+ operator,
9941
+ payer
9942
+ }).transaction();
9943
+ const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
9944
+ return new (0, _web3js.Transaction)({
9945
+ feePayer: operator,
9946
+ blockhash,
9947
+ lastValidBlockHeight
9948
+ }).add(initializePositionByOperatorTx);
9949
+ }
9902
9950
  /**
9903
9951
  * The `claimAllRewards` function to claim swap fees and LM rewards for multiple positions owned by a specific owner.
9904
9952
  * @param