@provable-games/ekubo-sdk 0.1.10 → 0.1.11

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/react.js CHANGED
@@ -216,10 +216,10 @@ async function fetchSwapQuote(params) {
216
216
  } = params;
217
217
  const config = { ...DEFAULT_FETCH_CONFIG, ...fetchConfig };
218
218
  const fetchFn = config.fetch;
219
- const receivedAmount = `-${amount.toString()}`;
220
219
  const normalizedTokenFrom = normalizeAddress(tokenFrom);
221
220
  const normalizedTokenTo = normalizeAddress(tokenTo);
222
- const url = `${API_URLS.QUOTER}/${chainId}/${receivedAmount}/${normalizedTokenFrom}/${normalizedTokenTo}`;
221
+ const isExactOutput = amount < 0n;
222
+ const url = isExactOutput ? `${API_URLS.QUOTER}/${chainId}/${amount.toString()}/${normalizedTokenTo}/${normalizedTokenFrom}` : `${API_URLS.QUOTER}/${chainId}/${amount.toString()}/${normalizedTokenFrom}/${normalizedTokenTo}`;
223
223
  let lastError = null;
224
224
  for (let attempt = 0; attempt < config.maxRetries; attempt++) {
225
225
  if (signal?.aborted) {