@0xsquid/react-hooks 8.4.1-beta-onchain-exec-with-sig.1 → 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.
- package/dist/core/constants.d.ts +3 -0
- package/dist/core/queries/queries-keys.d.ts +1 -1
- package/dist/core/types/config.d.ts +0 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/tokens/useSourceChainGasToken.d.ts +11 -0
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +6 -2
- package/dist/hooks/transaction/useEstimate.d.ts +5 -11
- package/dist/hooks/transaction/useTempoFeeCheck.d.ts +11 -0
- package/dist/{index-BwyqlDlg.js → index-B4aeecpP.js} +1311 -1170
- package/dist/index-B4aeecpP.js.map +1 -0
- package/dist/{index-D3m1pR9o.js → index-CaI-xWCW.js} +1309 -1167
- package/dist/index-CaI-xWCW.js.map +1 -0
- package/dist/{index.es-BqHGfsIC.js → index.es-BXf9jwuI.js} +3 -3
- package/dist/{index.es-BqHGfsIC.js.map → index.es-BXf9jwuI.js.map} +1 -1
- package/dist/{index.es-BxbRmlQ1.js → index.es-DAfqL2H0.js} +3 -3
- package/dist/{index.es-BxbRmlQ1.js.map → index.es-DAfqL2H0.js.map} +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/{secretService-CpimyAc7.js → secretService-CIYxEkTN.js} +3 -3
- package/dist/{secretService-CpimyAc7.js.map → secretService-CIYxEkTN.js.map} +1 -1
- package/dist/{secretService-y3m09F3S.js → secretService-Cld4gYfG.js} +3 -3
- package/dist/{secretService-y3m09F3S.js.map → secretService-Cld4gYfG.js.map} +1 -1
- package/dist/services/internal/assetsService.d.ts +2 -2
- package/dist/services/internal/estimateService.d.ts +13 -27
- package/dist/services/internal/tempoService.d.ts +82 -0
- package/dist/services/internal/transactionService.d.ts +7 -0
- package/dist/{stellarService.client-DBurXZXn.js → stellarService.client-COeQeah_.js} +3 -3
- package/dist/{stellarService.client-DBurXZXn.js.map → stellarService.client-COeQeah_.js.map} +1 -1
- package/dist/{stellarService.client-BYqhRu1u.js → stellarService.client-ocLzRIB4.js} +3 -3
- package/dist/{stellarService.client-BYqhRu1u.js.map → stellarService.client-ocLzRIB4.js.map} +1 -1
- package/dist/tests/networkGasToken.test.d.ts +1 -0
- package/dist/tests/tempoService.test.d.ts +1 -0
- package/package.json +2 -2
- package/dist/hooks/user/useUserParams.d.ts +0 -4
- package/dist/index-BwyqlDlg.js.map +0 -1
- package/dist/index-D3m1pR9o.js.map +0 -1
package/dist/core/constants.d.ts
CHANGED
|
@@ -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, price: string | undefined, slippage: SlippageOption | 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)[];
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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";
|
|
@@ -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
|
|
9
|
+
* Whether the gas token balance is enough to pay for the network gas fees
|
|
10
10
|
*/
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
-
value: number;
|
|
17
|
-
currency: string | undefined;
|
|
18
|
-
};
|
|
19
|
-
enoughBalanceToSwap: boolean;
|
|
15
|
+
fromBalanceEnoughToSwap: boolean;
|
|
20
16
|
feeCostsFormatted: FeeFormatted[];
|
|
21
17
|
totalFeeCostsUsd: string;
|
|
22
|
-
fromToken:
|
|
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
|
-
|
|
35
|
+
fromTokenPaysNetworkFee: boolean;
|
|
42
36
|
totalNativeFees: bigint;
|
|
43
37
|
totalFeesInNativeTokenPlusRatio: bigint;
|
|
44
|
-
|
|
38
|
+
gasBalanceEnough: boolean;
|
|
45
39
|
minAmountValueWarnMsg: string | undefined;
|
|
46
40
|
estimatedRouteDuration: {
|
|
47
41
|
seconds: number;
|
|
@@ -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;
|