@meteora-ag/dlmm 1.6.0-rc.4 → 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
@@ -18361,27 +18361,6 @@ var DLMM = class {
18361
18361
  ]);
18362
18362
  createUserTokenXIx && preInstructions.push(createUserTokenXIx);
18363
18363
  createUserTokenYIx && preInstructions.push(createUserTokenYIx);
18364
- const postInstructions = [];
18365
- if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !simulationResult.actualAmountXDeposited.isZero()) {
18366
- const wrapSOLIx = wrapSOLInstruction(
18367
- owner,
18368
- userTokenX,
18369
- BigInt(simulationResult.actualAmountXDeposited.toString())
18370
- );
18371
- preInstructions.push(...wrapSOLIx);
18372
- }
18373
- if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !simulationResult.actualAmountYDeposited.isZero()) {
18374
- const wrapSOLIx = wrapSOLInstruction(
18375
- owner,
18376
- userTokenY,
18377
- BigInt(simulationResult.actualAmountYDeposited.toString())
18378
- );
18379
- preInstructions.push(...wrapSOLIx);
18380
- }
18381
- if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) {
18382
- const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
18383
- closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
18384
- }
18385
18364
  slippage = capSlippagePercentage(slippage);
18386
18365
  const applySlippageMaxAmount = (amount, slippage2) => {
18387
18366
  return slippage2 == 100 ? U64_MAX : amount.muln(100 + slippage2).divn(100);
@@ -18405,6 +18384,27 @@ var DLMM = class {
18405
18384
  simulationResult.actualAmountYWithdrawn,
18406
18385
  slippage
18407
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
+ }
18408
18408
  const instruction = await this.program.methods.rebalanceLiquidity(
18409
18409
  {
18410
18410
  adds: depositParams,