@meteora-ag/dlmm 1.1.3 → 1.1.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.d.ts CHANGED
@@ -5502,7 +5502,7 @@ declare class DLMM {
5502
5502
  * `LbPairAccount` objects.
5503
5503
  */
5504
5504
  static getLbPairs(connection: Connection, opt?: Opt): Promise<LbPairAccount[]>;
5505
- static getPairPubkeyIfExists(connection: Connection, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, opt?: Opt): Promise<PublicKey>;
5505
+ static getPairPubkeyIfExists(connection: Connection, tokenX: PublicKey, tokenY: PublicKey, binStep: BN, baseFactor: BN, opt?: Opt): Promise<PublicKey | null>;
5506
5506
  /**
5507
5507
  * The `create` function is a static method that creates a new instance of the `DLMM` class
5508
5508
  * @param {Connection} connection - The `connection` parameter is an instance of the `Connection`
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,