@meteora-ag/dlmm 1.6.0-rc.3 → 1.6.0-rc.5

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
@@ -18384,6 +18384,27 @@ var DLMM = class {
18384
18384
  simulationResult.actualAmountYWithdrawn,
18385
18385
  slippage
18386
18386
  );
18387
+ const postInstructions = [];
18388
+ if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !simulationResult.actualAmountXDeposited.isZero()) {
18389
+ const wrapSOLIx = wrapSOLInstruction(
18390
+ owner,
18391
+ userTokenX,
18392
+ BigInt(maxDepositXAmount.toString())
18393
+ );
18394
+ preInstructions.push(...wrapSOLIx);
18395
+ }
18396
+ if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !simulationResult.actualAmountYDeposited.isZero()) {
18397
+ const wrapSOLIx = wrapSOLInstruction(
18398
+ owner,
18399
+ userTokenY,
18400
+ BigInt(maxDepositYAmount.toString())
18401
+ );
18402
+ preInstructions.push(...wrapSOLIx);
18403
+ }
18404
+ if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) {
18405
+ const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
18406
+ closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
18407
+ }
18387
18408
  const instruction = await this.program.methods.rebalanceLiquidity(
18388
18409
  {
18389
18410
  adds: depositParams,
@@ -18433,7 +18454,8 @@ var DLMM = class {
18433
18454
  const rebalancePositionInstruction = [
18434
18455
  setCUIX,
18435
18456
  ...preInstructions,
18436
- instruction
18457
+ instruction,
18458
+ ...postInstructions
18437
18459
  ];
18438
18460
  return {
18439
18461
  initBinArrayInstructions,