@meteora-ag/dlmm 1.5.0-test.0 → 1.5.1-test.1

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.js CHANGED
@@ -10360,6 +10360,7 @@ var DLMM = class {
10360
10360
  static async create(connection, dlmm, opt) {
10361
10361
  const cluster = _optionalChain([opt, 'optionalAccess', _38 => _38.cluster]) || "mainnet-beta";
10362
10362
  const provider = new (0, _anchor.AnchorProvider)(connection, {}, {
10363
+ ..._anchor.AnchorProvider.defaultOptions(),
10363
10364
  commitment: "confirmed"
10364
10365
  });
10365
10366
  const program = new (0, _anchor.Program)(
@@ -12991,11 +12992,16 @@ var DLMM = class {
12991
12992
  owner,
12992
12993
  position
12993
12994
  }) {
12995
+ const preInstructions = [];
12996
+ if (!position.positionData.feeX.isZero() || !position.positionData.feeY.isZero()) {
12997
+ const claimIx = await this.createClaimSwapFeeMethod({ owner, position });
12998
+ preInstructions.push(...claimIx.instructions);
12999
+ }
12994
13000
  const closePositionIx = await this.program.methods.closePosition2().accounts({
12995
13001
  rentReceiver: owner,
12996
13002
  position: position.publicKey,
12997
13003
  sender: owner
12998
- }).instruction();
13004
+ }).preInstructions(preInstructions).instruction();
12999
13005
  const setCUIx = await getEstimatedComputeUnitIxWithBuffer(
13000
13006
  this.program.provider.connection,
13001
13007
  [closePositionIx],