@cowprotocol/sdk-trading-solana 0.6.0 → 0.7.0

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
@@ -259,7 +259,7 @@ async function getSolanaQuote(params, options = {}) {
259
259
  amount: amount.toString(),
260
260
  swapMode: kind === import_sdk_order_book2.OrderKind.SELL ? "ExactIn" : "ExactOut"
261
261
  });
262
- const suggestedSlippageBps = slippageBpsOverride ?? jupiterOrder.slippageBps;
262
+ const signedSlippageBps = slippageBpsOverride ?? jupiterOrder.slippageBps;
263
263
  const validTo = Math.floor(Date.now() / 1e3) + validForSeconds;
264
264
  const orderParams = {
265
265
  sellToken: sellTokenAddress,
@@ -280,7 +280,7 @@ async function getSolanaQuote(params, options = {}) {
280
280
  };
281
281
  const amountsAndCosts = (0, import_sdk_order_book2.getQuoteAmountsAndCosts)({
282
282
  orderParams,
283
- slippagePercentBps: suggestedSlippageBps,
283
+ slippagePercentBps: signedSlippageBps,
284
284
  // TODO: implement fees
285
285
  partnerFeeBps: 0,
286
286
  protocolFeeBps: 0
@@ -337,7 +337,9 @@ async function getSolanaQuote(params, options = {}) {
337
337
  const quoteResults = {
338
338
  quoteResponse,
339
339
  amountsAndCosts,
340
- suggestedSlippageBps,
340
+ // What the quote provider suggested, never the caller's own `slippageBps`: consumers read this as a
341
+ // recommendation and would otherwise be handed their own input back as advice.
342
+ suggestedSlippageBps: jupiterOrder.slippageBps,
341
343
  tradeParameters,
342
344
  orderToSign: {},
343
345
  appDataInfo: {},
package/dist/index.mjs CHANGED
@@ -220,7 +220,7 @@ async function getSolanaQuote(params, options = {}) {
220
220
  amount: amount.toString(),
221
221
  swapMode: kind === OrderKind2.SELL ? "ExactIn" : "ExactOut"
222
222
  });
223
- const suggestedSlippageBps = slippageBpsOverride ?? jupiterOrder.slippageBps;
223
+ const signedSlippageBps = slippageBpsOverride ?? jupiterOrder.slippageBps;
224
224
  const validTo = Math.floor(Date.now() / 1e3) + validForSeconds;
225
225
  const orderParams = {
226
226
  sellToken: sellTokenAddress,
@@ -241,7 +241,7 @@ async function getSolanaQuote(params, options = {}) {
241
241
  };
242
242
  const amountsAndCosts = getQuoteAmountsAndCosts({
243
243
  orderParams,
244
- slippagePercentBps: suggestedSlippageBps,
244
+ slippagePercentBps: signedSlippageBps,
245
245
  // TODO: implement fees
246
246
  partnerFeeBps: 0,
247
247
  protocolFeeBps: 0
@@ -298,7 +298,9 @@ async function getSolanaQuote(params, options = {}) {
298
298
  const quoteResults = {
299
299
  quoteResponse,
300
300
  amountsAndCosts,
301
- suggestedSlippageBps,
301
+ // What the quote provider suggested, never the caller's own `slippageBps`: consumers read this as a
302
+ // recommendation and would otherwise be handed their own input back as advice.
303
+ suggestedSlippageBps: jupiterOrder.slippageBps,
302
304
  tradeParameters,
303
305
  orderToSign: {},
304
306
  appDataInfo: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-trading-solana",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "CowProtocol Solana trading: Jupiter-sourced quotes and on-chain CreateOrder posting against the Solana settlement program",
5
5
  "repository": {
6
6
  "type": "git",