@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 +5 -3
- package/dist/index.mjs +5 -3
- package/package.json +1 -1
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
|
|
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:
|
|
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
|
-
|
|
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
|
|
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:
|
|
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
|
-
|
|
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