@0xsquid/react-hooks 8.4.1-beta-interactive-to-amount.0 → 8.4.1-beta-tempo.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 (39) hide show
  1. package/dist/core/constants.d.ts +3 -0
  2. package/dist/core/queries/queries-keys.d.ts +1 -1
  3. package/dist/core/types/config.d.ts +0 -1
  4. package/dist/core/types/route.d.ts +1 -1
  5. package/dist/hooks/index.d.ts +2 -2
  6. package/dist/hooks/store/useSquidStore.d.ts +1 -2
  7. package/dist/hooks/swap/useSwap.d.ts +2 -4
  8. package/dist/hooks/tokens/useSourceChainGasToken.d.ts +11 -0
  9. package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +6 -2
  10. package/dist/hooks/transaction/useEstimate.d.ts +5 -11
  11. package/dist/hooks/transaction/useGetRoute.d.ts +0 -1
  12. package/dist/hooks/transaction/useTempoFeeCheck.d.ts +11 -0
  13. package/dist/{index-DnkELFs9.js → index-B4aeecpP.js} +1319 -1203
  14. package/dist/index-B4aeecpP.js.map +1 -0
  15. package/dist/{index-Bg7CS2Uo.js → index-CaI-xWCW.js} +1316 -1200
  16. package/dist/index-CaI-xWCW.js.map +1 -0
  17. package/dist/{index.es-tWag56u3.js → index.es-BXf9jwuI.js} +3 -3
  18. package/dist/{index.es-tWag56u3.js.map → index.es-BXf9jwuI.js.map} +1 -1
  19. package/dist/{index.es-BQGUcysL.js → index.es-DAfqL2H0.js} +3 -3
  20. package/dist/{index.es-BQGUcysL.js.map → index.es-DAfqL2H0.js.map} +1 -1
  21. package/dist/index.esm.js +2 -2
  22. package/dist/index.js +3 -3
  23. package/dist/{secretService-Bs5SPC6i.js → secretService-CIYxEkTN.js} +3 -3
  24. package/dist/{secretService-Bs5SPC6i.js.map → secretService-CIYxEkTN.js.map} +1 -1
  25. package/dist/{secretService-BXleHutG.js → secretService-Cld4gYfG.js} +3 -3
  26. package/dist/{secretService-BXleHutG.js.map → secretService-Cld4gYfG.js.map} +1 -1
  27. package/dist/services/internal/assetsService.d.ts +2 -2
  28. package/dist/services/internal/estimateService.d.ts +13 -27
  29. package/dist/services/internal/tempoService.d.ts +82 -0
  30. package/dist/{stellarService.client-li6iEHAu.js → stellarService.client-COeQeah_.js} +3 -3
  31. package/dist/{stellarService.client-li6iEHAu.js.map → stellarService.client-COeQeah_.js.map} +1 -1
  32. package/dist/{stellarService.client-TTYw1-aB.js → stellarService.client-ocLzRIB4.js} +3 -3
  33. package/dist/{stellarService.client-TTYw1-aB.js.map → stellarService.client-ocLzRIB4.js.map} +1 -1
  34. package/dist/tests/networkGasToken.test.d.ts +1 -0
  35. package/dist/tests/tempoService.test.d.ts +1 -0
  36. package/package.json +1 -1
  37. package/dist/hooks/user/useUserParams.d.ts +0 -4
  38. package/dist/index-Bg7CS2Uo.js.map +0 -1
  39. package/dist/index-DnkELFs9.js.map +0 -1
@@ -69,6 +69,9 @@ export declare const CHAIN_IDS: {
69
69
  readonly SONEIUM: "1868";
70
70
  readonly PEAQ: "3338";
71
71
  readonly HEDERA: "295";
72
+ readonly MANTRA: "5888";
73
+ readonly CITREA: "4114";
74
+ readonly TEMPO: "4217";
72
75
  readonly BITCOIN: "bitcoin";
73
76
  readonly SOLANA: "solana-mainnet-beta";
74
77
  readonly SUI: "sui-mainnet";
@@ -54,7 +54,7 @@ export declare const keys: () => {
54
54
  tokenData: (token?: TokenWithBalance) => (string | undefined)[];
55
55
  balance: (chainId?: number | string, tokenAddress?: string, userAddress?: string) => (string | number | undefined)[];
56
56
  allTokensBalance: (address: string | undefined, chainType: ChainType | undefined, direction?: SwapDirection) => (string | undefined)[];
57
- transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, fromAmount: string | undefined, toAmount: string | undefined, slippage: SlippageOption | undefined, getGasOnDestination: boolean | 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)[];
57
+ 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)[];
58
58
  swapTransactionStatus: (transactionId: string | undefined) => (string | undefined)[];
59
59
  fiatToCryptoStatus: (transactionId?: string) => (string | undefined)[];
60
60
  sendTransactionStatus: (txHash: string | undefined, chainId: string | undefined) => (string | undefined)[];
@@ -7,7 +7,6 @@ export type TokenConfig = {
7
7
  export interface AppConfig {
8
8
  integratorId: string;
9
9
  slippage?: SlippageOption;
10
- enableGetGasOnDestination?: boolean;
11
10
  /**
12
11
  * If set to true, will load initial tokens and chains from local storage
13
12
  */
@@ -1,4 +1,4 @@
1
1
  import { RouteRequest as SquidRouteRequest } from "@0xsquid/squid-types";
2
2
  export type RouteRequest = SquidRouteRequest & {
3
- toAmount?: string;
3
+ overrideGasRefundAddress?: string;
4
4
  };
@@ -2,13 +2,13 @@ export { useTrackSearchEmpty } from "./analytics/useTrackSearchEmpty";
2
2
  export { useSquidChains } from "./chains/useSquidChains";
3
3
  export { useClient } from "./client/useClient";
4
4
  export { useCosmosForChain } from "./cosmos/useCosmosForChain";
5
+ export { useHederaAccountActivation } from "./hedera/useHederaAccountActivation";
5
6
  export { useHederaTokenAssociations } from "./hedera/useHederaTokenAssociations";
6
7
  export { useKeyboardNavigation } from "./navigation/useKeyboardNavigation";
7
8
  export * from "./onramp/useFiatToCrypto";
8
9
  export { useSquidQueryClient } from "./query/useSquidQueryClient";
9
10
  export { useSquid } from "./squid/useSquid";
10
11
  export { useStellarAccountActivation } from "./stellar/useStellarAccountActivation";
11
- export { useHederaAccountActivation } from "./hedera/useHederaAccountActivation";
12
12
  export { useAddressBookStore } from "./store/useAddressBookStore";
13
13
  export { useAssetsColorsStore } from "./store/useAssetsColorsStore";
14
14
  export { useFavoriteTokensStore, type FavoriteToken, } from "./store/useFavoriteTokensStore";
@@ -27,6 +27,7 @@ export { useMultipleTokenPrices } from "./tokens/useMultipleTokenPrices";
27
27
  export { useBitcoinNativeBalance, useCosmosNativeBalance, useEvmNativeBalance, useNativeBalance, useSolanaNativeBalance, useStellarNativeBalance, useSuiNativeBalance, useXrplNativeBalance, } from "./tokens/useNativeBalance";
28
28
  export { useNativeTokenForChain } from "./tokens/useNativeTokenForChain";
29
29
  export { useSingleTokenPrice } from "./tokens/useSingleTokenPrice";
30
+ export { useSourceChainGasToken } from "./tokens/useSourceChainGasToken";
30
31
  export { useSquidTokens } from "./tokens/useSquidTokens";
31
32
  export { useHistoricalData, useTokensData, } from "./tokens/useTokenHistoricalData";
32
33
  export { useEstimateSendTransaction } from "./transaction/send/useEstimateSendTransactionGas";
@@ -43,7 +44,6 @@ export { useSendTransactionStatus } from "./transaction/useSendTransactionStatus
43
44
  export { useSwapTransactionStatus } from "./transaction/useSwapTransactionStatus";
44
45
  export { useAvatar } from "./user/useAvatar";
45
46
  export { useHistory } from "./user/useHistory";
46
- export { useUserParams } from "./user/useUserParams";
47
47
  export { useDebouncedValue } from "./utils/useUtils";
48
48
  export { useAddToken } from "./wallet/useAddToken";
49
49
  export { useAutoConnect } from "./wallet/useAutoConnect";
@@ -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;
@@ -0,0 +1,11 @@
1
+ import { ChainData } from "@0xsquid/squid-types";
2
+ import { Token } from "../../core";
3
+ /**
4
+ * Resolves the token that pays network gas fees for a given chain
5
+ */
6
+ export declare function useSourceChainGasToken({ fromChain, fromToken, }: {
7
+ fromChain: ChainData | undefined;
8
+ fromToken: Token | undefined;
9
+ }): {
10
+ gasToken: Token | undefined;
11
+ };
@@ -6,9 +6,9 @@ interface UseEstimateSendReturnType {
6
6
  estimatedGas: bigint | undefined;
7
7
  isLoading: boolean;
8
8
  /**
9
- * Whether the native balance is enough to pay for the network gas fees
9
+ * Whether the gas token balance is enough to pay for the network gas fees
10
10
  */
11
- isNativeBalanceEnoughToPayGasFees: boolean;
11
+ isGasBalanceEnough: boolean;
12
12
  /**
13
13
  * Whether the balance of the selected token is enough to send the requested `amount`.
14
14
  */
@@ -17,6 +17,10 @@ interface UseEstimateSendReturnType {
17
17
  * The safe amount the user can send to have enough balance to pay for the network gas fees
18
18
  */
19
19
  minAmountValueWarnMsg: string | undefined;
20
+ /**
21
+ * Whether the selected token pays the network fee
22
+ */
23
+ tokenPaysNetworkFee: boolean;
20
24
  }
21
25
  export declare function useEstimateSendTransaction({ chain, token, amount, balance, from, }: {
22
26
  chain: ChainData | undefined;
@@ -5,25 +5,19 @@ type FeeFormatted = {
5
5
  imageUrl: string;
6
6
  };
7
7
  export declare const useEstimate: (squidRoute?: RouteResponse["route"]) => {
8
- balanceFormatted: string;
8
+ fromBalanceFormatted: string;
9
9
  slippageFormatted: string;
10
10
  totalWithRefundEstimate: {
11
11
  totalAmount: string;
12
12
  totalAmountUSD: number;
13
13
  feeToken: import("@0xsquid/squid-types").Token | undefined;
14
14
  };
15
- proposedGasDestinationAmount: {
16
- value: number;
17
- currency: string | undefined;
18
- };
19
- enoughBalanceToSwap: boolean;
15
+ fromBalanceEnoughToSwap: boolean;
20
16
  feeCostsFormatted: FeeFormatted[];
21
17
  totalFeeCostsUsd: string;
22
- fromToken: any;
18
+ fromToken: import("@0xsquid/squid-types").Token | undefined;
23
19
  fromAmount: string | undefined;
24
20
  fromAmountFormatted: string;
25
- sourceChainNativeToken: import("@0xsquid/squid-types").Token | undefined;
26
- destChainNativeToken: import("@0xsquid/squid-types").Token | undefined;
27
21
  toAmountUSD: string | undefined;
28
22
  exchangeRate: string;
29
23
  toAmountMinUSD: string;
@@ -38,10 +32,10 @@ export declare const useEstimate: (squidRoute?: RouteResponse["route"]) => {
38
32
  expectedGasRefundCost: bigint;
39
33
  expectedGasRefundCostUSD: string;
40
34
  sameTokenBetweenFees: boolean;
41
- isFromTokenNative: boolean;
35
+ fromTokenPaysNetworkFee: boolean;
42
36
  totalNativeFees: bigint;
43
37
  totalFeesInNativeTokenPlusRatio: bigint;
44
- fromBalanceEnoughToSwap: boolean;
38
+ gasBalanceEnough: boolean;
45
39
  minAmountValueWarnMsg: string | undefined;
46
40
  estimatedRouteDuration: {
47
41
  seconds: number;
@@ -16,7 +16,6 @@ export declare const useGetRoute: () => import("@tanstack/react-query").UseMutat
16
16
  sourceUserAddress: string | undefined;
17
17
  destinationAddress: string | undefined;
18
18
  fromPrice: string | undefined;
19
- toPrice: string | undefined;
20
19
  bypassGuardrails: RouteRequest["bypassGuardrails"] | undefined;
21
20
  quoteOnly: boolean | undefined;
22
21
  fromChainType: ChainType | undefined;
@@ -0,0 +1,11 @@
1
+ import { ChainData } from "@0xsquid/squid-types";
2
+ import { Token } from "../../core/types";
3
+ import { TempoFeeData } from "../../services/internal/tempoService";
4
+ /**
5
+ * Returns raw on-chain gas token data for Tempo chains, or null when the source
6
+ * chain is not Tempo.
7
+ */
8
+ export declare const useTempoFeeCheck: ({ fromChain, fromToken, }: {
9
+ fromChain: ChainData | undefined;
10
+ fromToken: Token | undefined;
11
+ }) => TempoFeeData | null;