@drift-labs/sdk 2.86.0-beta.29 → 2.86.0-beta.30

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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.86.0-beta.29
1
+ 2.86.0-beta.30
@@ -2384,9 +2384,6 @@ class DriftClient {
2384
2384
  async getJupiterSwapIxV6({ jupiterClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, quote, reduceOnly, userAccountPublicKey, }) {
2385
2385
  const outMarket = this.getSpotMarketAccount(outMarketIndex);
2386
2386
  const inMarket = this.getSpotMarketAccount(inMarketIndex);
2387
- const isExactOut = swapMode === 'ExactOut' || quote.swapMode === 'ExactOut';
2388
- const amountIn = new anchor_1.BN(quote.inAmount);
2389
- const exactOutBufferedAmountIn = amountIn.muln(1001).divn(1000); // Add 10bp buffer
2390
2387
  if (!quote) {
2391
2388
  const fetchedQuote = await jupiterClient.getQuote({
2392
2389
  inputMint: inMarket.mint,
@@ -2401,6 +2398,9 @@ class DriftClient {
2401
2398
  if (!quote) {
2402
2399
  throw new Error("Could not fetch Jupiter's quote. Please try again.");
2403
2400
  }
2401
+ const isExactOut = swapMode === 'ExactOut' || quote.swapMode === 'ExactOut';
2402
+ const amountIn = new anchor_1.BN(quote.inAmount);
2403
+ const exactOutBufferedAmountIn = amountIn.muln(1001).divn(1000); // Add 10bp buffer
2404
2404
  const transaction = await jupiterClient.getSwap({
2405
2405
  quote,
2406
2406
  userPublicKey: this.provider.wallet.publicKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.86.0-beta.29",
3
+ "version": "2.86.0-beta.30",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -4310,10 +4310,6 @@ export class DriftClient {
4310
4310
  const outMarket = this.getSpotMarketAccount(outMarketIndex);
4311
4311
  const inMarket = this.getSpotMarketAccount(inMarketIndex);
4312
4312
 
4313
- const isExactOut = swapMode === 'ExactOut' || quote.swapMode === 'ExactOut';
4314
- const amountIn = new BN(quote.inAmount);
4315
- const exactOutBufferedAmountIn = amountIn.muln(1001).divn(1000); // Add 10bp buffer
4316
-
4317
4313
  if (!quote) {
4318
4314
  const fetchedQuote = await jupiterClient.getQuote({
4319
4315
  inputMint: inMarket.mint,
@@ -4331,6 +4327,10 @@ export class DriftClient {
4331
4327
  throw new Error("Could not fetch Jupiter's quote. Please try again.");
4332
4328
  }
4333
4329
 
4330
+ const isExactOut = swapMode === 'ExactOut' || quote.swapMode === 'ExactOut';
4331
+ const amountIn = new BN(quote.inAmount);
4332
+ const exactOutBufferedAmountIn = amountIn.muln(1001).divn(1000); // Add 10bp buffer
4333
+
4334
4334
  const transaction = await jupiterClient.getSwap({
4335
4335
  quote,
4336
4336
  userPublicKey: this.provider.wallet.publicKey,