@meteora-ag/dlmm 1.1.3 → 1.1.4

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
@@ -9812,10 +9812,8 @@ var DLMM = class {
9812
9812
  );
9813
9813
  createPayerTokenIx && preInstructions.push(createPayerTokenIx);
9814
9814
  const postInstructions = [];
9815
- if ([
9816
- this.tokenX.publicKey.toBase58(),
9817
- this.tokenY.publicKey.toBase58()
9818
- ].includes(_spltoken.NATIVE_MINT.toBase58())) {
9815
+ const shouldUnwrapSOL = removeLiquidityForY && this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) || !removeLiquidityForY && this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT);
9816
+ if (shouldUnwrapSOL) {
9819
9817
  const closeWrappedSOLIx = await unwrapSOLInstruction(user);
9820
9818
  closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
9821
9819
  }
@@ -9838,7 +9836,7 @@ var DLMM = class {
9838
9836
  binArrayUpper,
9839
9837
  sender: user,
9840
9838
  tokenProgram: _spltoken.TOKEN_PROGRAM_ID
9841
- }).preInstructions(preInstructions).transaction();
9839
+ }).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
9842
9840
  const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
9843
9841
  return new (0, _web3js.Transaction)({
9844
9842
  blockhash,