@0xsquid/react-hooks 8.3.1 → 8.4.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 +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/types/transaction.d.ts +19 -1
- package/dist/hooks/hedera/useHederaAccountActivation.d.ts +10 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/tokens/useNativeBalance.d.ts +2 -0
- package/dist/hooks/transaction/useGetRoute.d.ts +18 -7
- package/dist/{index-qAOvcSon.js → index-BdrSk8Ed.js} +874 -764
- package/dist/index-BdrSk8Ed.js.map +1 -0
- package/dist/{index-CMrdTYeW.js → index-BxJVsDEs.js} +861 -765
- package/dist/index-BxJVsDEs.js.map +1 -0
- package/dist/{index.es-DRgOycmm.js → index.es-CFf55ppw.js} +2 -2
- package/dist/{index.es-DRgOycmm.js.map → index.es-CFf55ppw.js.map} +1 -1
- package/dist/{index.es-Cu_QQTg-.js → index.es-DhiQj1ju.js} +2 -2
- package/dist/{index.es-Cu_QQTg-.js.map → index.es-DhiQj1ju.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/{secretService-B3sc6ibT.js → secretService-D0xrwhEv.js} +2 -2
- package/dist/{secretService-B3sc6ibT.js.map → secretService-D0xrwhEv.js.map} +1 -1
- package/dist/{secretService-B_-XWo1F.js → secretService-DRTd4cda.js} +2 -2
- package/dist/{secretService-B_-XWo1F.js.map → secretService-DRTd4cda.js.map} +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/internal/hederaService.d.ts +2 -0
- package/dist/services/internal/routeService.d.ts +8 -0
- package/dist/services/internal/transactionService.d.ts +14 -1
- package/dist/{stellarService.client-sRzC5VSD.js → stellarService.client-CRFUb2R6.js} +2 -2
- package/dist/{stellarService.client-sRzC5VSD.js.map → stellarService.client-CRFUb2R6.js.map} +1 -1
- package/dist/{stellarService.client-Ciqw9lmL.js → stellarService.client-xMf7fjCz.js} +2 -2
- package/dist/{stellarService.client-Ciqw9lmL.js.map → stellarService.client-xMf7fjCz.js.map} +1 -1
- package/package.json +4 -4
- package/dist/index-CMrdTYeW.js.map +0 -1
- package/dist/index-qAOvcSon.js.map +0 -1
package/dist/core/constants.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare const gasRefundMultiplier = 25;
|
|
|
28
28
|
export declare const internalSquidApiBaseUrl = "https://app.squidrouter.com/api";
|
|
29
29
|
export declare const XAMAN_API_URL: string;
|
|
30
30
|
export declare const TOKEN_PRICE_API_URL: string;
|
|
31
|
+
export declare const DEFAULT_ROUTE_REFETCH_INTERVAL = 30000;
|
|
31
32
|
export declare const SOLANA_RPC_URL = "https://meredith-ute2ko-fast-mainnet.helius-rpc.com";
|
|
32
33
|
export declare const INTEGRATOR_ID = "squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea";
|
|
33
34
|
export declare const DEFAULT_COUNTRY_CODE = "US";
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, DEFAULT_LOCALE, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeStellarTokenAddress, nativeSuiTokenAddress, nativeXrplTokenAddress, } from "./constants";
|
|
1
|
+
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, DEFAULT_LOCALE, DEFAULT_ROUTE_REFETCH_INTERVAL, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeStellarTokenAddress, nativeSuiTokenAddress, nativeXrplTokenAddress, } from "./constants";
|
|
2
2
|
export { CosmosProvider, useCosmosContext } from "./providers/CosmosProvider";
|
|
3
3
|
export { QueryKeys } from "./queries/queries-keys";
|
|
4
4
|
export * from "./types";
|
|
@@ -46,11 +46,24 @@ export interface TransactionParams {
|
|
|
46
46
|
fromChain?: ChainData;
|
|
47
47
|
toChain?: ChainData;
|
|
48
48
|
nonce?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Some transactions require a special transactionId instead of the source tx hash
|
|
51
|
+
* to be passed to the status endpoint (i.e Chainflip transactions)
|
|
52
|
+
*/
|
|
49
53
|
transactionIdForStatus?: string;
|
|
50
54
|
transactionId: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* quoteId is used to correlate /route and /status requests
|
|
57
|
+
*/
|
|
51
58
|
quoteId: string;
|
|
52
59
|
timestamp?: number;
|
|
60
|
+
/**
|
|
61
|
+
* The source chain transaction status
|
|
62
|
+
*/
|
|
53
63
|
sourceStatus?: TransactionStatus;
|
|
64
|
+
/**
|
|
65
|
+
* Cross-chain transaction Status
|
|
66
|
+
*/
|
|
54
67
|
status: TransactionStatus;
|
|
55
68
|
error?: TransactionErrorWithMessage;
|
|
56
69
|
fromAddress?: string;
|
|
@@ -58,6 +71,11 @@ export interface TransactionParams {
|
|
|
58
71
|
axelarUrl?: string;
|
|
59
72
|
sourceTxExplorerUrl?: string;
|
|
60
73
|
sourceExplorerImgUrl?: string;
|
|
74
|
+
/**
|
|
75
|
+
* User signature, sent to Status API for deposit verification
|
|
76
|
+
* Only used for deposit-with-signature routes
|
|
77
|
+
*/
|
|
78
|
+
depositTxVerificationSignature?: string;
|
|
61
79
|
}
|
|
62
80
|
export type SwapTransactionForHistoryStore = TransactionParams & Pick<RouteResponse["route"], "params" | "estimate">;
|
|
63
81
|
export interface StepStatusGetterProps {
|
|
@@ -69,7 +87,7 @@ export interface PatchedRouteActionResponse extends Omit<RouteActionResponse, "d
|
|
|
69
87
|
data?: RouteActionResponse["data"];
|
|
70
88
|
coralV2Order?: Record<string, never>;
|
|
71
89
|
}
|
|
72
|
-
export type SwapTransactionForStatus = Pick<SwapTransactionHistory, "fromChain" | "transactionId" | "toChain" | "status" | "fromAddress" | "bridgeType" | "transactionIdForStatus" | "actions" | "quoteId">;
|
|
90
|
+
export type SwapTransactionForStatus = Pick<SwapTransactionHistory, "fromChain" | "transactionId" | "toChain" | "status" | "fromAddress" | "bridgeType" | "transactionIdForStatus" | "actions" | "quoteId"> & Pick<TransactionParams, "depositTxVerificationSignature">;
|
|
73
91
|
export type SimplifiedRouteAction = Pick<PatchedRouteActionResponse, "type" | "provider"> & {
|
|
74
92
|
data?: any;
|
|
75
93
|
isCoralV2?: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChainData, Token } from "@0xsquid/squid-types";
|
|
2
|
+
interface Params {
|
|
3
|
+
address: string | undefined;
|
|
4
|
+
token: Token | undefined;
|
|
5
|
+
chain: ChainData | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function useHederaAccountActivation({ address, chain, token }: Params): {
|
|
8
|
+
isHederaAccountActivated: boolean;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./onramp/useFiatToCrypto";
|
|
|
8
8
|
export { useSquidQueryClient } from "./query/useSquidQueryClient";
|
|
9
9
|
export { useSquid } from "./squid/useSquid";
|
|
10
10
|
export { useStellarAccountActivation } from "./stellar/useStellarAccountActivation";
|
|
11
|
+
export { useHederaAccountActivation } from "./hedera/useHederaAccountActivation";
|
|
11
12
|
export { useAddressBookStore } from "./store/useAddressBookStore";
|
|
12
13
|
export { useAssetsColorsStore } from "./store/useAssetsColorsStore";
|
|
13
14
|
export { useFavoriteTokensStore, type FavoriteToken, } from "./store/useFavoriteTokensStore";
|
|
@@ -23,7 +24,7 @@ export { useAllTokensWithBalanceForChainType } from "./tokens/useAllTokensWithBa
|
|
|
23
24
|
export { useCosmosBalance, useEvmBalance } from "./tokens/useBalance";
|
|
24
25
|
export { useMultiChainBalance } from "./tokens/useMultiChainBalance";
|
|
25
26
|
export { useMultipleTokenPrices } from "./tokens/useMultipleTokenPrices";
|
|
26
|
-
export { useNativeBalance } from "./tokens/useNativeBalance";
|
|
27
|
+
export { useBitcoinNativeBalance, useCosmosNativeBalance, useEvmNativeBalance, useNativeBalance, useSolanaNativeBalance, useStellarNativeBalance, useSuiNativeBalance, useXrplNativeBalance, } from "./tokens/useNativeBalance";
|
|
27
28
|
export { useNativeTokenForChain } from "./tokens/useNativeTokenForChain";
|
|
28
29
|
export { useSingleTokenPrice } from "./tokens/useSingleTokenPrice";
|
|
29
30
|
export { useSquidTokens } from "./tokens/useSquidTokens";
|
|
@@ -11,6 +11,8 @@ interface UseNativeBalanceOptions {
|
|
|
11
11
|
chain: ChainData | undefined;
|
|
12
12
|
address: string | undefined;
|
|
13
13
|
}
|
|
14
|
+
export declare const useEvmNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
|
|
15
|
+
export declare const useCosmosNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
|
|
14
16
|
export declare const useBitcoinNativeBalance: ({ chain, address, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
|
|
15
17
|
export declare const useSolanaNativeBalance: ({ chain, address, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
|
|
16
18
|
export declare const useSuiNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { RouteResponse } from "@0xsquid/sdk/dist/types";
|
|
1
2
|
import { ChainType, Token } from "@0xsquid/squid-types";
|
|
3
|
+
import { QueryObserverOptions } from "@tanstack/react-query";
|
|
2
4
|
import type { AppConfig } from "../../core/types/config";
|
|
3
5
|
import { RouteRequest } from "../../core/types/route";
|
|
4
6
|
export declare const useGetRoute: () => import("@tanstack/react-query").UseMutationResult<{
|
|
@@ -21,13 +23,22 @@ export declare const useGetRoute: () => import("@tanstack/react-query").UseMutat
|
|
|
21
23
|
postHook: AppConfig["postHook"];
|
|
22
24
|
overrideGasRefundAddress: AppConfig["overrideGasRefundAddress"];
|
|
23
25
|
}, unknown>;
|
|
24
|
-
export declare const useGetRouteWrapper: ({ enabled, cacheTime, staleTime, refetchOnWindowFocus, refetchIntervalInBackground, refetchInterval, quoteOnly, }: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
export declare const useGetRouteWrapper: ({ enabled, cacheTime, staleTime, refetchOnWindowFocus, refetchIntervalInBackground, refetchInterval, quoteOnly, }: Pick<QueryObserverOptions<{
|
|
27
|
+
estimate: import("@0xsquid/squid-types").Estimate;
|
|
28
|
+
transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
|
|
29
|
+
params: import("@0xsquid/squid-types").RouteRequest;
|
|
30
|
+
quoteId: string;
|
|
31
|
+
} | undefined, unknown, {
|
|
32
|
+
estimate: import("@0xsquid/squid-types").Estimate;
|
|
33
|
+
transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
|
|
34
|
+
params: import("@0xsquid/squid-types").RouteRequest;
|
|
35
|
+
quoteId: string;
|
|
36
|
+
} | undefined, {
|
|
37
|
+
estimate: import("@0xsquid/squid-types").Estimate;
|
|
38
|
+
transactionRequest?: import("@0xsquid/squid-types").SquidData | undefined;
|
|
39
|
+
params: import("@0xsquid/squid-types").RouteRequest;
|
|
40
|
+
quoteId: string;
|
|
41
|
+
} | undefined, import("@tanstack/react-query").QueryKey>, "cacheTime" | "enabled" | "staleTime" | "refetchInterval" | "refetchIntervalInBackground" | "refetchOnWindowFocus"> & {
|
|
31
42
|
quoteOnly?: boolean | undefined;
|
|
32
43
|
}) => {
|
|
33
44
|
squidRoute: import("@tanstack/react-query").UseQueryResult<{
|