@provable-games/ekubo-sdk 0.1.9 → 0.1.10

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.d.cts CHANGED
@@ -12,13 +12,16 @@ interface EkuboProviderProps {
12
12
  /**
13
13
  * Provider component for EkuboClient
14
14
  *
15
+ * Defaults to mainnet if no config is provided. Chain can also be
16
+ * specified per-hook via the `config` option.
17
+ *
15
18
  * @example
16
19
  * ```tsx
17
20
  * import { EkuboProvider } from '@provable-games/ekubo-sdk/react';
18
21
  *
19
22
  * function App() {
20
23
  * return (
21
- * <EkuboProvider config={{ chain: 'mainnet' }}>
24
+ * <EkuboProvider>
22
25
  * <YourApp />
23
26
  * </EkuboProvider>
24
27
  * );
package/dist/react.d.ts CHANGED
@@ -12,13 +12,16 @@ interface EkuboProviderProps {
12
12
  /**
13
13
  * Provider component for EkuboClient
14
14
  *
15
+ * Defaults to mainnet if no config is provided. Chain can also be
16
+ * specified per-hook via the `config` option.
17
+ *
15
18
  * @example
16
19
  * ```tsx
17
20
  * import { EkuboProvider } from '@provable-games/ekubo-sdk/react';
18
21
  *
19
22
  * function App() {
20
23
  * return (
21
- * <EkuboProvider config={{ chain: 'mainnet' }}>
24
+ * <EkuboProvider>
22
25
  * <YourApp />
23
26
  * </EkuboProvider>
24
27
  * );
package/dist/react.js CHANGED
@@ -2029,12 +2029,13 @@ function useEkuboQuotes({
2029
2029
  }
2030
2030
  return updated;
2031
2031
  });
2032
+ const exactOutputAmount = amount > 0n ? -amount : amount;
2032
2033
  const fetchPromises = sellTokens.filter((sellToken) => sellToken.toLowerCase() !== buyToken.toLowerCase()).map(async (sellToken) => {
2033
2034
  const abortController = new AbortController();
2034
2035
  abortControllersRef.current.set(sellToken, abortController);
2035
2036
  try {
2036
2037
  const quote = await client.getQuote({
2037
- amount,
2038
+ amount: exactOutputAmount,
2038
2039
  tokenFrom: sellToken,
2039
2040
  tokenTo: buyToken,
2040
2041
  signal: abortController.signal