@meteora-ag/cp-amm-sdk 1.1.7 → 1.1.8

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.mts CHANGED
@@ -6445,6 +6445,7 @@ type SwapParams = {
6445
6445
  tokenAProgram: PublicKey;
6446
6446
  tokenBProgram: PublicKey;
6447
6447
  referralTokenAccount: PublicKey | null;
6448
+ poolState?: PoolState;
6448
6449
  };
6449
6450
  type Swap2Params = {
6450
6451
  payer: PublicKey;
@@ -6458,6 +6459,7 @@ type Swap2Params = {
6458
6459
  tokenAProgram: PublicKey;
6459
6460
  tokenBProgram: PublicKey;
6460
6461
  referralTokenAccount: PublicKey | null;
6462
+ poolState?: PoolState;
6461
6463
  } & ({
6462
6464
  swapMode: SwapMode.ExactIn;
6463
6465
  amountIn: BN;
package/dist/index.d.ts CHANGED
@@ -6445,6 +6445,7 @@ type SwapParams = {
6445
6445
  tokenAProgram: PublicKey;
6446
6446
  tokenBProgram: PublicKey;
6447
6447
  referralTokenAccount: PublicKey | null;
6448
+ poolState?: PoolState;
6448
6449
  };
6449
6450
  type Swap2Params = {
6450
6451
  payer: PublicKey;
@@ -6458,6 +6459,7 @@ type Swap2Params = {
6458
6459
  tokenAProgram: PublicKey;
6459
6460
  tokenBProgram: PublicKey;
6460
6461
  referralTokenAccount: PublicKey | null;
6462
+ poolState?: PoolState;
6461
6463
  } & ({
6462
6464
  swapMode: SwapMode.ExactIn;
6463
6465
  amountIn: BN;
package/dist/index.js CHANGED
@@ -11616,7 +11616,8 @@ var CpAmm = class {
11616
11616
  const closeWrappedSOLIx = yield unwrapSOLInstruction(payer);
11617
11617
  closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
11618
11618
  }
11619
- const poolState = yield this.fetchPoolState(pool);
11619
+ let { poolState } = params;
11620
+ poolState = poolState != null ? poolState : yield this.fetchPoolState(pool);
11620
11621
  const currentPoint = yield getCurrentPoint(
11621
11622
  this._program.provider.connection,
11622
11623
  poolState.activationType
@@ -11717,7 +11718,8 @@ var CpAmm = class {
11717
11718
  const closeWrappedSOLIx = yield unwrapSOLInstruction(payer);
11718
11719
  closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
11719
11720
  }
11720
- const poolState = yield this.fetchPoolState(pool);
11721
+ let { poolState } = params;
11722
+ poolState = poolState != null ? poolState : yield this.fetchPoolState(pool);
11721
11723
  const currentPoint = yield getCurrentPoint(
11722
11724
  this._program.provider.connection,
11723
11725
  poolState.activationType