@0xsquid/react-hooks 8.7.2-beta-interactive-to-amount.2 → 8.8.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.
Files changed (35) hide show
  1. package/dist/core/queries/queries-keys.d.ts +1 -1
  2. package/dist/core/types/config.d.ts +1 -2
  3. package/dist/core/types/event.d.ts +2 -1
  4. package/dist/core/types/route.d.ts +4 -0
  5. package/dist/hooks/store/useSquidStore.d.ts +1 -2
  6. package/dist/hooks/swap/useSwap.d.ts +2 -4
  7. package/dist/hooks/transaction/useGetRoute.d.ts +8 -9
  8. package/dist/{index-BhIaRT6b.js → index-CHdL63Y4.js} +67 -158
  9. package/dist/index-CHdL63Y4.js.map +1 -0
  10. package/dist/{index-cWo0aVvt.js → index-IxCpRlyV.js} +67 -160
  11. package/dist/index-IxCpRlyV.js.map +1 -0
  12. package/dist/{index.es-DDv7Krv1.js → index.es-B_4aEeiW.js} +2 -2
  13. package/dist/{index.es-DDv7Krv1.js.map → index.es-B_4aEeiW.js.map} +1 -1
  14. package/dist/{index.es-DjscAACC.js → index.es-C1qztDII.js} +2 -2
  15. package/dist/{index.es-DjscAACC.js.map → index.es-C1qztDII.js.map} +1 -1
  16. package/dist/index.esm.js +1 -1
  17. package/dist/index.js +2 -4
  18. package/dist/index.js.map +1 -1
  19. package/dist/{secretService-XZVHxElk.js → secretService-D0p2T9tf.js} +2 -2
  20. package/dist/{secretService-XZVHxElk.js.map → secretService-D0p2T9tf.js.map} +1 -1
  21. package/dist/{secretService-cYEbiXXP.js → secretService-vD8qpukk.js} +2 -2
  22. package/dist/{secretService-cYEbiXXP.js.map → secretService-vD8qpukk.js.map} +1 -1
  23. package/dist/services/internal/assetsService.d.ts +1 -1
  24. package/dist/services/internal/errorService.d.ts +0 -9
  25. package/dist/services/internal/estimateService.d.ts +18 -8
  26. package/dist/services/internal/eventService.d.ts +2 -1
  27. package/dist/services/internal/numberService.d.ts +0 -1
  28. package/dist/services/internal/transactionService.d.ts +7 -1
  29. package/dist/{stellarService.client-CBqIkpcb.js → stellarService.client-Cia5YJMU.js} +2 -2
  30. package/dist/{stellarService.client-CBqIkpcb.js.map → stellarService.client-Cia5YJMU.js.map} +1 -1
  31. package/dist/{stellarService.client-B5B1XaV_.js → stellarService.client-DKQ8QpMf.js} +2 -2
  32. package/dist/{stellarService.client-B5B1XaV_.js.map → stellarService.client-DKQ8QpMf.js.map} +1 -1
  33. package/package.json +3 -3
  34. package/dist/index-BhIaRT6b.js.map +0 -1
  35. package/dist/index-cWo0aVvt.js.map +0 -1
@@ -56,7 +56,7 @@ export declare const keys: () => {
56
56
  tokenData: (token?: TokenWithBalance) => (string | undefined)[];
57
57
  balance: (chainId?: number | string, tokenAddress?: string, userAddress?: string) => (string | number | undefined)[];
58
58
  allTokensBalance: (address: string | undefined, chainType: ChainType | undefined, direction?: SwapDirection) => (string | undefined)[];
59
- transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, fromAmount: string | undefined, toAmount: string | undefined, slippage: SlippageOption | undefined, sourceUserAddress: string | undefined, degenMode: boolean | undefined, destinationAddress: string | undefined, fallbackAddress: string | undefined, quoteOnly: boolean | undefined, fromChainType: ChainType | undefined, preHook: AppConfig["preHook"] | undefined, postHook: AppConfig["postHook"] | undefined, overrideGasRefundAddress: AppConfig["overrideGasRefundAddress"] | undefined, prefer: AppConfig["prefer"] | undefined) => (string | number | boolean | string[] | Omit<import("@0xsquid/squid-types").Hook, "fundAmount" | "fundToken"> | undefined)[];
59
+ transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, price: string | undefined, slippage: SlippageOption | undefined, sourceUserAddress: string | undefined, degenMode: boolean | undefined, destinationAddress: string | undefined, fallbackAddress: string | undefined, quoteOnly: boolean | undefined, fromChainType: ChainType | undefined, preHook: AppConfig["preHook"] | undefined, postHook: AppConfig["postHook"] | undefined, overrideGasRefundAddress: AppConfig["overrideGasRefundAddress"] | undefined) => (string | number | boolean | Omit<import("@0xsquid/squid-types").Hook, "fundAmount" | "fundToken"> | undefined)[];
60
60
  swapTransactionStatus: (transactionId: string | undefined) => (string | undefined)[];
61
61
  fiatToCryptoStatus: (transactionId?: string) => (string | undefined)[];
62
62
  sendTransactionStatus: (txHash: string | undefined, chainId: string | undefined) => (string | undefined)[];
@@ -1,4 +1,4 @@
1
- import { RouteRequest } from "@0xsquid/squid-types";
1
+ import { RouteRequest } from "./route";
2
2
  export type SlippageOption = RouteRequest["slippage"];
3
3
  export type TokenConfig = {
4
4
  address: string;
@@ -72,5 +72,4 @@ export interface AppConfig {
72
72
  * Override the default gas refund address in Axelar routes
73
73
  */
74
74
  overrideGasRefundAddress?: RouteRequest["overrideGasRefundAddress"];
75
- prefer?: string[];
76
75
  }
@@ -1,6 +1,7 @@
1
- import type { RouteRequest, RouteResponse } from "@0xsquid/squid-types";
1
+ import type { RouteResponse } from "@0xsquid/squid-types";
2
2
  import { TransactionErrorWithMessage } from "./error";
3
3
  import { ExecuteQuoteServer } from "./onramps";
4
+ import { RouteRequest } from "./route";
4
5
  type BaseSwapEventParams = Pick<RouteRequest, "fromAddress" | "toAddress" | "fromChain" | "toChain" | "fromToken" | "toToken" | "fromAmount">;
5
6
  type BaseSendTransactionEventParams = {
6
7
  fromAddress: string;
@@ -0,0 +1,4 @@
1
+ import { RouteRequest as SquidRouteRequest } from "@0xsquid/squid-types";
2
+ export type RouteRequest = SquidRouteRequest & {
3
+ overrideGasRefundAddress?: string;
4
+ };
@@ -21,8 +21,7 @@ export interface ConfigState {
21
21
  }
22
22
  export declare const useConfigStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConfigState>>;
23
23
  interface TransactionState {
24
- fromAmount?: string;
25
- toAmount?: string;
24
+ fromPrice?: string;
26
25
  txLocalId?: string;
27
26
  transactions: Record<string, TransactionParams>;
28
27
  currentTransaction?: TransactionParams;
@@ -7,10 +7,8 @@ export declare const useSwap: () => {
7
7
  };
8
8
  onSwapChange: (inputSwapParams: SwapParams) => SwapParams;
9
9
  invertSwaps: (() => SwapParams) | undefined;
10
- fromAmount: string | undefined;
11
- toAmount: string | undefined;
12
- fromAmountChanged: (amount: string) => void;
13
- toAmountChanged: (amount: string) => void;
10
+ fromPrice: string | undefined;
11
+ fromPriceChanged: (price: string) => void;
14
12
  toToken: import("../../core").Token | undefined;
15
13
  fromToken: import("../../core").Token | undefined;
16
14
  fromChain: import("@0xsquid/squid-types").ChainData | undefined;
@@ -1,11 +1,12 @@
1
1
  import { RouteResponse } from "@0xsquid/sdk/dist/types";
2
- import { ChainType, RouteRequest, Token } from "@0xsquid/squid-types";
2
+ import { ChainType, Token } from "@0xsquid/squid-types";
3
3
  import { QueryObserverOptions } from "@tanstack/react-query";
4
4
  import type { AppConfig } from "../../core/types/config";
5
+ import { RouteRequest } from "../../core/types/route";
5
6
  export declare const useGetRoute: () => import("@tanstack/react-query").UseMutationResult<{
6
7
  estimate: import("@0xsquid/squid-types").Estimate;
7
8
  transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
8
- params: RouteRequest;
9
+ params: import("@0xsquid/squid-types").RouteRequest;
9
10
  quoteId: string;
10
11
  } | undefined, unknown, {
11
12
  fromChain: RouteRequest["fromChain"] | undefined;
@@ -15,29 +16,27 @@ export declare const useGetRoute: () => import("@tanstack/react-query").UseMutat
15
16
  sourceUserAddress: string | undefined;
16
17
  destinationAddress: string | undefined;
17
18
  fromPrice: string | undefined;
18
- toPrice: string | undefined;
19
19
  bypassGuardrails: RouteRequest["bypassGuardrails"] | undefined;
20
20
  quoteOnly: boolean | undefined;
21
21
  fromChainType: ChainType | undefined;
22
22
  preHook: AppConfig["preHook"];
23
23
  postHook: AppConfig["postHook"];
24
24
  overrideGasRefundAddress: AppConfig["overrideGasRefundAddress"];
25
- prefer: AppConfig["prefer"];
26
25
  }, unknown>;
27
26
  export declare const useGetRouteWrapper: ({ enabled, cacheTime, staleTime, refetchOnWindowFocus, refetchIntervalInBackground, refetchInterval, quoteOnly, }: Pick<QueryObserverOptions<{
28
27
  estimate: import("@0xsquid/squid-types").Estimate;
29
28
  transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
30
- params: RouteRequest;
29
+ params: import("@0xsquid/squid-types").RouteRequest;
31
30
  quoteId: string;
32
31
  } | undefined, unknown, {
33
32
  estimate: import("@0xsquid/squid-types").Estimate;
34
33
  transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
35
- params: RouteRequest;
34
+ params: import("@0xsquid/squid-types").RouteRequest;
36
35
  quoteId: string;
37
36
  } | undefined, {
38
37
  estimate: import("@0xsquid/squid-types").Estimate;
39
38
  transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
40
- params: RouteRequest;
39
+ params: import("@0xsquid/squid-types").RouteRequest;
41
40
  quoteId: string;
42
41
  } | undefined, import("@tanstack/react-query").QueryKey>, "cacheTime" | "enabled" | "staleTime" | "refetchInterval" | "refetchIntervalInBackground" | "refetchOnWindowFocus"> & {
43
42
  quoteOnly?: boolean | undefined;
@@ -45,7 +44,7 @@ export declare const useGetRouteWrapper: ({ enabled, cacheTime, staleTime, refet
45
44
  squidRoute: import("@tanstack/react-query").UseQueryResult<{
46
45
  estimate: import("@0xsquid/squid-types").Estimate;
47
46
  transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
48
- params: RouteRequest;
47
+ params: import("@0xsquid/squid-types").RouteRequest;
49
48
  quoteId: string;
50
49
  } | undefined, unknown>;
51
50
  showLoading: boolean;
@@ -53,7 +52,7 @@ export declare const useGetRouteWrapper: ({ enabled, cacheTime, staleTime, refet
53
52
  routeData: {
54
53
  estimate: import("@0xsquid/squid-types").Estimate;
55
54
  transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
56
- params: RouteRequest;
55
+ params: import("@0xsquid/squid-types").RouteRequest;
57
56
  quoteId: string;
58
57
  } | undefined;
59
58
  };