@0xsquid/react-hooks 9.0.0-beta-bump-wagmi-viem.1 → 9.0.0-beta-nodev24.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 (141) hide show
  1. package/dist/core/canton/cantonConnector.d.ts +32 -0
  2. package/dist/core/canton/cip103Client.d.ts +20 -0
  3. package/dist/core/canton/errors.d.ts +4 -0
  4. package/dist/core/canton/injectedCantonProvider.d.ts +31 -0
  5. package/dist/core/canton/loopCantonConnector.d.ts +38 -0
  6. package/dist/core/client/index.d.ts +1 -0
  7. package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +3 -0
  8. package/dist/core/connectors/bitcoin/wallets/phantom.d.ts +3 -1
  9. package/dist/core/connectors/bitcoin/wallets/unisat.d.ts +15 -0
  10. package/dist/core/constants.d.ts +9 -4
  11. package/dist/core/externalLinks.d.ts +1 -1
  12. package/dist/core/fallbackWallets.d.ts +16 -0
  13. package/dist/core/index.d.ts +1 -1
  14. package/dist/core/providers/CantonProvider.d.ts +19 -0
  15. package/dist/core/queries/queries-keys.d.ts +9 -4
  16. package/dist/core/queries/queryClient.d.ts +2 -0
  17. package/dist/core/types/bitcoin.d.ts +3 -0
  18. package/dist/core/types/canton.d.ts +92 -0
  19. package/dist/core/types/config.d.ts +9 -3
  20. package/dist/core/types/cosmos.d.ts +5 -0
  21. package/dist/core/types/error.d.ts +0 -6
  22. package/dist/core/types/event.d.ts +4 -0
  23. package/dist/core/types/history.d.ts +14 -6
  24. package/dist/core/types/index.d.ts +4 -3
  25. package/dist/core/types/solana.d.ts +8 -0
  26. package/dist/core/types/status.d.ts +116 -0
  27. package/dist/core/types/stellar.d.ts +52 -0
  28. package/dist/core/types/tokens.d.ts +4 -0
  29. package/dist/core/types/transaction.d.ts +5 -31
  30. package/dist/core/types/wallet.d.ts +16 -8
  31. package/dist/core/wallets.d.ts +5 -0
  32. package/dist/hooks/canton/useCanton.d.ts +2 -0
  33. package/dist/hooks/canton/useCantonWallets.d.ts +10 -0
  34. package/dist/hooks/chains/useSquidChains.d.ts +1 -0
  35. package/dist/hooks/index.d.ts +5 -2
  36. package/dist/hooks/stellar/useStellarTrustLine.d.ts +13 -0
  37. package/dist/hooks/store/historyStoreMigration.d.ts +9 -0
  38. package/dist/hooks/store/useDepositAddressStore.d.ts +18 -5
  39. package/dist/hooks/store/useHistoryStore.d.ts +2 -4
  40. package/dist/hooks/swap/useDepositAddress.d.ts +6 -7
  41. package/dist/hooks/swap/useUrlSwapParams.d.ts +10 -0
  42. package/dist/hooks/tokens/useBalance.d.ts +1 -0
  43. package/dist/hooks/tokens/useNativeBalance.d.ts +1 -0
  44. package/dist/hooks/tokens/useSourceChainGasToken.d.ts +13 -0
  45. package/dist/hooks/tokens/useSquidTokens.d.ts +1 -0
  46. package/dist/hooks/transaction/liveSwapStatus.d.ts +12 -0
  47. package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +11 -2
  48. package/dist/hooks/transaction/swapStatusEffects.d.ts +9 -0
  49. package/dist/hooks/transaction/useAllTransactionsStatus.d.ts +1 -28
  50. package/dist/hooks/transaction/useArcFeeCheck.d.ts +5 -0
  51. package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +18 -0
  52. package/dist/hooks/transaction/useEstimate.d.ts +7 -12
  53. package/dist/hooks/transaction/useSwapStatusQuery.d.ts +42 -0
  54. package/dist/hooks/transaction/useSwapTransactionStatus.d.ts +11 -7
  55. package/dist/hooks/transaction/useTempoFeeCheck.d.ts +11 -0
  56. package/dist/hooks/user/useHistory.d.ts +2 -2
  57. package/dist/hooks/wallet/useMultiChainWallet.d.ts +55 -29
  58. package/dist/hooks/wallet/useSigner.d.ts +1 -0
  59. package/dist/hooks/wallet/useWallet.d.ts +59 -29
  60. package/dist/hooks/xrpl/useXrplWallets.d.ts +2 -2
  61. package/dist/{index-C6kS-jmR.js → index-BlAWmCDu.js} +6331 -2423
  62. package/dist/index-BlAWmCDu.js.map +1 -0
  63. package/dist/{index-qdyx4kRv.js → index-lvZT1hVo.js} +6336 -2420
  64. package/dist/index-lvZT1hVo.js.map +1 -0
  65. package/dist/{index.es-BFUlxkuY.js → index.es-C2hTEGoR.js} +5 -4
  66. package/dist/index.es-C2hTEGoR.js.map +1 -0
  67. package/dist/{index.es-DYkdUayP.js → index.es-hfCMk9rm.js} +5 -4
  68. package/dist/index.es-hfCMk9rm.js.map +1 -0
  69. package/dist/index.esm.js +4 -3
  70. package/dist/index.esm.js.map +1 -1
  71. package/dist/index.js +34 -33
  72. package/dist/index.js.map +1 -1
  73. package/dist/provider/index.d.ts +0 -1
  74. package/dist/{secretService-B0dq0pBR.js → secretService-C3-RQz_Q.js} +5 -4
  75. package/dist/{secretService-B0dq0pBR.js.map → secretService-C3-RQz_Q.js.map} +1 -1
  76. package/dist/{secretService-CVRY2vnf.js → secretService-CqZdXZDv.js} +5 -4
  77. package/dist/{secretService-CVRY2vnf.js.map → secretService-CqZdXZDv.js.map} +1 -1
  78. package/dist/server.d.ts +1 -0
  79. package/dist/server.esm.js +120 -0
  80. package/dist/server.esm.js.map +1 -0
  81. package/dist/server.js +132 -0
  82. package/dist/server.js.map +1 -0
  83. package/dist/services/external/onrampAdapter.d.ts +3 -4
  84. package/dist/services/external/rpcService.d.ts +16 -1
  85. package/dist/services/external/stellarApiClient.d.ts +4 -0
  86. package/dist/services/external/stellarRpcClient.d.ts +2 -2
  87. package/dist/services/external/xrplRpcClient.d.ts +2 -1
  88. package/dist/services/index.d.ts +5 -0
  89. package/dist/services/internal/apiService.d.ts +0 -2
  90. package/dist/services/internal/arcService.d.ts +9 -0
  91. package/dist/services/internal/assetsService.d.ts +12 -3
  92. package/dist/services/internal/cantonDamlValue.d.ts +71 -0
  93. package/dist/services/internal/cantonService.d.ts +82 -0
  94. package/dist/services/internal/cantonTransferService.d.ts +93 -0
  95. package/dist/services/internal/configService.d.ts +2 -1
  96. package/dist/services/internal/errorService.d.ts +6 -4
  97. package/dist/services/internal/estimateService.d.ts +30 -33
  98. package/dist/services/internal/eventService.d.ts +4 -0
  99. package/dist/services/internal/evmService.d.ts +4 -2
  100. package/dist/services/internal/solanaTokenProgramService.d.ts +9 -0
  101. package/dist/services/internal/status/statusApi.d.ts +41 -0
  102. package/dist/services/internal/status/statusExplorerLinks.d.ts +52 -0
  103. package/dist/services/internal/status/statusFollow.d.ts +29 -0
  104. package/dist/services/internal/status/statusGuards.d.ts +19 -0
  105. package/dist/services/internal/status/statusHistory.d.ts +35 -0
  106. package/dist/services/internal/status/statusKeys.d.ts +8 -0
  107. package/dist/services/internal/status/statusMapping.d.ts +73 -0
  108. package/dist/services/internal/status/statusPolicy.d.ts +45 -0
  109. package/dist/services/internal/status/statusSteps.d.ts +40 -0
  110. package/dist/services/internal/status/statusWsClient.d.ts +157 -0
  111. package/dist/services/internal/stellarService.d.ts +9 -0
  112. package/dist/services/internal/tempoService.d.ts +42 -0
  113. package/dist/services/internal/transactionService.d.ts +11 -24
  114. package/dist/services/internal/transactionStatusService.d.ts +1 -54
  115. package/dist/services/internal/typeGuards.d.ts +10 -0
  116. package/dist/services/internal/urlParamsService.d.ts +19 -0
  117. package/dist/services/internal/walletService.d.ts +3 -6
  118. package/dist/services/internal/xrplService.d.ts +2 -0
  119. package/dist/{stellarService.client-BL7JVIrT.js → stellarService.client-C-9OeI3W.js} +7 -6
  120. package/dist/{stellarService.client-BL7JVIrT.js.map → stellarService.client-C-9OeI3W.js.map} +1 -1
  121. package/dist/{stellarService.client-DdI-363G.js → stellarService.client-Dwpk6ir6.js} +7 -6
  122. package/dist/{stellarService.client-DdI-363G.js.map → stellarService.client-Dwpk6ir6.js.map} +1 -1
  123. package/package.json +36 -35
  124. package/dist/hooks/user/useUserParams.d.ts +0 -4
  125. package/dist/index-C6kS-jmR.js.map +0 -1
  126. package/dist/index-qdyx4kRv.js.map +0 -1
  127. package/dist/index.es-BFUlxkuY.js.map +0 -1
  128. package/dist/index.es-DYkdUayP.js.map +0 -1
  129. package/dist/services/internal/fiatToCryptoService.test.d.ts +0 -1
  130. package/dist/tests/apiService.test.d.ts +0 -1
  131. package/dist/tests/assetsService.test.d.ts +0 -1
  132. package/dist/tests/configService.test.d.ts +0 -1
  133. package/dist/tests/estimateService.test.d.ts +0 -1
  134. package/dist/tests/fetchSquidData.d.ts +0 -8
  135. package/dist/tests/numberService.test.d.ts +0 -1
  136. package/dist/tests/priceService.test.d.ts +0 -1
  137. package/dist/tests/searchService.test.d.ts +0 -1
  138. package/dist/tests/swapConfig.test.d.ts +0 -1
  139. package/dist/tests/transactionService.test.d.ts +0 -1
  140. package/dist/tests/transactionStatusService.test.d.ts +0 -1
  141. package/dist/tests/walletService.test.d.ts +0 -1
@@ -0,0 +1,116 @@
1
+ export type SwapStatus = "in_progress" | "in_progress_delayed" | "needs_gas" | "success" | "partial_success" | "failed" | "refunded";
2
+ type OpenString = string & Record<never, never>;
3
+ export type SwapStatusActionType = "CORAL_REFUND" | "AXELAR_BRIDGE" | OpenString;
4
+ export type KnownSwapStatusActionStatus = "NOT_STARTED" | "IN_PROGRESS" | "IN_PROGRESS_DELAYED" | "COMPLETED" | "FAILED" | "REFUNDED";
5
+ export type SwapStatusActionStatus = KnownSwapStatusActionStatus | OpenString;
6
+ export type SwapStatusActionRole = "SOURCE" | "DESTINATION" | OpenString;
7
+ export type SwapStatusBridgeType = "axelar-gmp" | "axelar-its" | OpenString;
8
+ export type SwapStatusBridgeSourceTxHashes = Partial<Record<SwapStatusBridgeType, string>>;
9
+ export interface SwapStatusAction {
10
+ index?: number;
11
+ type: SwapStatusActionType;
12
+ status: SwapStatusActionStatus;
13
+ error?: string;
14
+ role?: SwapStatusActionRole;
15
+ chainId?: string;
16
+ txHash?: string;
17
+ /**
18
+ * Hash of the transaction that started the action, for example the
19
+ * transaction on the intermediate chain that starts an Axelar leg
20
+ */
21
+ sourceTxHash?: string;
22
+ fromChainId?: string;
23
+ toChainId?: string;
24
+ provider?: string;
25
+ bridgeType?: SwapStatusBridgeType;
26
+ /**
27
+ * Only on a `CHAINFLIP_BRIDGE` action
28
+ */
29
+ swapId?: string;
30
+ depositChannelId?: string;
31
+ explorerUrl?: string;
32
+ }
33
+ export interface SwapStatusChain {
34
+ chainId?: string;
35
+ }
36
+ export interface SwapStatusDocument {
37
+ status: SwapStatus;
38
+ transactionId?: string;
39
+ quoteId?: string;
40
+ orderHash?: string;
41
+ fromChain?: SwapStatusChain;
42
+ toChain?: SwapStatusChain;
43
+ actions?: SwapStatusAction[];
44
+ bridges?: SwapStatusBridgeType[];
45
+ destinationTxHash?: string;
46
+ failedAtAction?: number;
47
+ updatedAt?: string;
48
+ }
49
+ export interface SwapStatusSummary extends Pick<SwapStatusDocument, "status" | "transactionId" | "destinationTxHash" | "orderHash" | "bridges" | "updatedAt"> {
50
+ /**
51
+ * Time in milliseconds at which the status became `failed`
52
+ */
53
+ failedSince?: number;
54
+ /**
55
+ * `sourceTxHash` of each bridge action, keyed by bridge type. A route can
56
+ * have more than one bridge, and each explorer needs the hash of its own
57
+ * leg. The status document keeps them in the actions, which the summary
58
+ * does not store.
59
+ */
60
+ bridgeSourceTxHashes?: SwapStatusBridgeSourceTxHashes;
61
+ /**
62
+ * Link to the Chainflip swap or deposit channel of the `CHAINFLIP_BRIDGE`
63
+ * action, which the summary does not store
64
+ */
65
+ chainflipExplorerUrl?: string;
66
+ }
67
+ export interface StatusKeys {
68
+ quoteId: string;
69
+ transactionId?: string;
70
+ }
71
+ export type SwapStatusResult = {
72
+ kind: "document";
73
+ document: SwapStatusDocument;
74
+ } | {
75
+ kind: "not_found";
76
+ };
77
+ export interface StatusWsTicket {
78
+ url: string;
79
+ token: string;
80
+ /**
81
+ * Time in seconds for which the ticket can open a connection
82
+ */
83
+ expiresIn: number;
84
+ }
85
+ export type StatusWsUnsubscribedReason = "terminal" | "client" | "expired";
86
+ export type StatusWsServerFrame = {
87
+ type: "ready";
88
+ integratorId: string;
89
+ limits: {
90
+ conn: number;
91
+ subs: number;
92
+ };
93
+ serverTime: number;
94
+ } | {
95
+ type: "subscribed";
96
+ id: string;
97
+ status: SwapStatusDocument | {
98
+ status: "not_found";
99
+ };
100
+ } | {
101
+ type: "status";
102
+ id: string;
103
+ status: SwapStatusDocument;
104
+ } | {
105
+ type: "unsubscribed";
106
+ id: string;
107
+ reason: StatusWsUnsubscribedReason;
108
+ } | {
109
+ type: "error";
110
+ id?: string;
111
+ code: string;
112
+ message: string;
113
+ } | {
114
+ type: "pong";
115
+ };
116
+ export {};
@@ -1,3 +1,55 @@
1
+ import { BaseChain } from "@0xsquid/squid-types";
1
2
  import type { ModuleInterface } from "@creit.tech/stellar-wallets-kit";
3
+ import { Token } from "./tokens";
2
4
  export interface StellarConnector extends ModuleInterface {
3
5
  }
6
+ export declare enum StellarHorizonAssetType {
7
+ /**
8
+ * XLM native token
9
+ */
10
+ NATIVE = "native",
11
+ /**
12
+ * 1-4 char asset code (e.g. USDC)
13
+ */
14
+ ALPHANUM4 = "credit_alphanum4",
15
+ /**
16
+ * 5-12 char asset code (e.g. wstETH)
17
+ */
18
+ ALPHANUM12 = "credit_alphanum12"
19
+ }
20
+ export interface StellarHorizonNativeAsset {
21
+ balance: string;
22
+ asset_type: StellarHorizonAssetType.NATIVE;
23
+ }
24
+ export interface StellarHorizonIssuedAsset {
25
+ balance: string;
26
+ asset_type: Exclude<StellarHorizonAssetType, StellarHorizonAssetType.NATIVE>;
27
+ asset_code: string;
28
+ asset_issuer: string;
29
+ limit: string;
30
+ }
31
+ export type StellarTrustLine = StellarHorizonIssuedAsset;
32
+ export declare enum StellarTokenType {
33
+ NATIVE_TOKEN = "nativeToken",
34
+ ISSUER_TOKEN = "issuerToken",
35
+ CONTRACT_TOKEN = "contractToken"
36
+ }
37
+ export interface StellarToken extends Token {
38
+ chainAssetConfig: {
39
+ stellar: {
40
+ assetType: StellarTokenType;
41
+ contractAddress: string;
42
+ };
43
+ };
44
+ }
45
+ export interface StellarIssuedToken extends StellarToken {
46
+ chainAssetConfig: {
47
+ stellar: {
48
+ assetType: StellarTokenType.ISSUER_TOKEN;
49
+ contractAddress: string;
50
+ };
51
+ };
52
+ }
53
+ export interface StellarChain extends BaseChain {
54
+ horizonRpcList: string[];
55
+ }
@@ -76,3 +76,7 @@ export interface TokenData {
76
76
  export type TokenWithTokenData = TokenWithBalance & {
77
77
  tokenData?: TokenData | null;
78
78
  };
79
+ export interface TrustLineAsset {
80
+ code: string;
81
+ issuer: string;
82
+ }
@@ -1,31 +1,11 @@
1
1
  import type { ChainData, RouteActionResponse, RouteResponse } from "@0xsquid/squid-types";
2
- import type { UseQueryResult } from "@tanstack/react-query";
3
2
  import type { TransactionErrorWithMessage } from "./error";
4
3
  import { SwapTransactionHistory } from "./history";
5
- export declare enum TransactionType {
6
- BRIDGE = "BRIDGE",
7
- BRIDGE_CALL = "BRIDGE_CALL",
8
- CALL_BRIDGE = "CALL_BRIDGE",
9
- CALL_BRIDGE_CALL = "CALL_BRIDGE_CALL"
10
- }
11
- export declare enum AxelarStatusResponseType {
12
- GAS_PAID_NOT_ENOUGH_GAS = "gas_paid_not_enough_gas",
13
- DESTINATION_EXECUTED = "destination_executed",
14
- EXPRESS_EXECUTED = "express_executed",
15
- CROSS_MULTICALL_EXECUTED = "CrossMulticallExecuted",
16
- CROSS_MULTICALL_FAILED = "CrossMulticallFailed",
17
- SRC_GATEWAY_CALLED = "source_gateway_called",
18
- DEST_GATEWAY_APPROVED = "destination_gateway_approved",
19
- DESTINATION_EXECUTE_ERROR = "destination_execute_error",
20
- DESTINATION_EXECUTING = "executing",
21
- UNKNOWN_ERROR = "unknown_error",
22
- CANNOT_FETCH_STATUS = "cannot_fetch_status",
23
- ERROR = "error"
24
- }
25
4
  export declare enum TransactionStatus {
26
5
  SUCCESS = "success",
27
6
  NEEDS_GAS = "needs_gas",
28
7
  ONGOING = "ongoing",
8
+ DELAYED = "delayed",
29
9
  PARTIAL_SUCCESS = "partial_success",
30
10
  NOT_FOUND = "not_found",
31
11
  INITIAL_LOADING = "initialLoading",
@@ -67,27 +47,21 @@ export interface TransactionParams {
67
47
  status: TransactionStatus;
68
48
  error?: TransactionErrorWithMessage;
69
49
  fromAddress?: string;
70
- statusResponse?: any;
71
- axelarUrl?: string;
72
50
  sourceTxExplorerUrl?: string;
73
51
  sourceExplorerImgUrl?: string;
74
52
  /**
75
- * User signature, sent to Status API for deposit verification
76
- * Only used for deposit-with-signature routes
53
+ * Signature of the order hash by the user, sent with the status request.
54
+ * Only routes with a `SquidDataType.OnChainExecutionWithSignature` or
55
+ * `SquidDataType.DepositAddressWithSignature` transaction request have it.
77
56
  */
78
57
  depositTxVerificationSignature?: string;
79
58
  }
80
59
  export type SwapTransactionForHistoryStore = TransactionParams & Pick<RouteResponse["route"], "params" | "estimate">;
81
- export interface StepStatusGetterProps {
82
- transaction?: TransactionParams;
83
- statusResponse?: UseQueryResult<any, unknown>;
84
- onlyFullStatusStep?: boolean;
85
- }
86
60
  export interface PatchedRouteActionResponse extends Omit<RouteActionResponse, "data"> {
87
61
  data?: RouteActionResponse["data"];
88
62
  coralV2Order?: Record<string, never>;
89
63
  }
90
- export type SwapTransactionForStatus = Pick<SwapTransactionHistory, "fromChain" | "transactionId" | "toChain" | "status" | "fromAddress" | "bridgeType" | "transactionIdForStatus" | "actions" | "quoteId"> & Pick<TransactionParams, "depositTxVerificationSignature">;
64
+ export type SwapTransactionForStatus = Pick<SwapTransactionHistory, "fromChain" | "transactionId" | "status" | "fromAddress" | "transactionIdForStatus" | "quoteId" | "depositTxVerificationSignature">;
91
65
  export type SimplifiedRouteAction = Pick<PatchedRouteActionResponse, "type" | "provider"> & {
92
66
  data?: any;
93
67
  isCoralV2?: boolean;
@@ -1,5 +1,7 @@
1
1
  import type { ChainType } from "@0xsquid/squid-types";
2
2
  import { BitcoinConnector } from "./bitcoin";
3
+ import { CantonConnector } from "./canton";
4
+ import { CosmosConnector } from "./cosmos";
3
5
  import { EvmConnector } from "./evm";
4
6
  import { SolanaConnector } from "./solana";
5
7
  import { StellarConnector } from "./stellar";
@@ -27,15 +29,10 @@ export declare enum WindowWalletFlag {
27
29
  HotWallet = "hotWallet",
28
30
  XBull = "xBullSDK"
29
31
  }
30
- export type ConnectorID = "metamask" | "coinbase" | "walletConnect" | "keplr" | "cosmostation" | "leap" | "ctrl" | "bitget" | "rabby" | "okx" | "injected" | "trustwallet" | "exodus" | "rainbow" | "phantom" | "backpack" | "unisat" | "xrpl-metamask-snap" | "crossmark" | "xaman-xapp" | "xaman-qr" | "joey" | "girin" | "bifrost" | "brave" | "tokenpocket" | "nightly" | "cryptodotcom" | "freighter" | "xBull" | "lobstr" | "albedo" | "hanaWallet" | "hotWallet";
32
+ export type ConnectorID = "canton-loop" | "metamask" | "coinbase" | "walletConnect" | "keplr" | "cosmostation" | "leap" | "ctrl" | "bitget" | "rabby" | "okx" | "injected" | "trustwallet" | "exodus" | "rainbow" | "phantom" | "backpack" | "unisat" | "xrpl-metamask-snap" | "crossmark" | "xaman-xapp" | "xaman-qr" | "joey" | "girin" | "bifrost" | "brave" | "tokenpocket" | "nightly" | "cryptodotcom" | "freighter" | "xBull" | "lobstr" | "albedo" | "hanaWallet" | "hotWallet";
31
33
  export type EvmWallet = Wallet & {
32
34
  type: ChainType.EVM;
33
- connector: EvmConnector;
34
- };
35
- type CosmosConnector = () => {
36
- id: string;
37
- name: string;
38
- provider: any;
35
+ connector: ConnectorByChainType[ChainType.EVM];
39
36
  };
40
37
  export type CosmosWallet = Wallet & {
41
38
  type: ChainType.COSMOS;
@@ -61,6 +58,10 @@ export type StellarWallet = Wallet & {
61
58
  type: ChainType.STELLAR;
62
59
  connector: ConnectorByChainType[ChainType.STELLAR];
63
60
  };
61
+ export type CantonWallet = Wallet & {
62
+ type: ChainType.CANTON;
63
+ connector: ConnectorByChainType[ChainType.CANTON];
64
+ };
64
65
  export type SupportedChain = {
65
66
  chainType: ChainType;
66
67
  chains?: string[];
@@ -71,6 +72,11 @@ export type NetworkConfig = {
71
72
  connector: ConnectorByChainType[T];
72
73
  };
73
74
  }[ChainType];
75
+ export type WalletLinks = {
76
+ website?: string;
77
+ chrome?: string;
78
+ firefox?: string;
79
+ };
74
80
  export type Wallet = {
75
81
  name: string;
76
82
  connectorId: ConnectorID;
@@ -82,7 +88,7 @@ export type Wallet = {
82
88
  isInstalled?: () => boolean;
83
89
  skipInstallCheck?: boolean;
84
90
  rdns?: string;
85
- url?: string;
91
+ links?: WalletLinks;
86
92
  } & ({
87
93
  isMultiChain: true;
88
94
  supportedNetworks: NetworkConfig[];
@@ -137,6 +143,7 @@ export interface ChainTypeToWalletState {
137
143
  [ChainType.SUI]: BaseWalletState<SuiWallet> & SuiAccount;
138
144
  [ChainType.XRPL]: BaseWalletState<XrplWallet>;
139
145
  [ChainType.STELLAR]: BaseWalletState<StellarWallet>;
146
+ [ChainType.CANTON]: BaseWalletState<CantonWallet>;
140
147
  }
141
148
  interface ConnectorByChainType extends Record<ChainType, unknown> {
142
149
  [ChainType.EVM]: EvmConnector;
@@ -146,5 +153,6 @@ interface ConnectorByChainType extends Record<ChainType, unknown> {
146
153
  [ChainType.SUI]: SuiConnector;
147
154
  [ChainType.XRPL]: XrplConnector;
148
155
  [ChainType.STELLAR]: StellarConnector;
156
+ [ChainType.CANTON]: CantonConnector;
149
157
  }
150
158
  export {};
@@ -1,6 +1,11 @@
1
1
  import { ConnectorID } from "./types";
2
2
  import { Wallet, XrplWallet } from "./types/wallet";
3
3
  export declare const walletIconBaseUrl = "https://raw.githubusercontent.com/0xsquid/assets/main/images/webp128/wallets";
4
+ /**
5
+ * Dynamically accesses a nested property of an object based on a dot-separated string path.
6
+ * Returns the value of the property if found, otherwise undefined.
7
+ */
8
+ export declare const accessProperty: (object: Record<string, any>, path: string) => any;
4
9
  export declare const xrplWallets: XrplWallet[];
5
10
  export declare const multiChainWallets: Wallet[];
6
11
  export declare const singleChainWallets: Wallet[];
@@ -0,0 +1,2 @@
1
+ import { ICantonContextData } from "../../core/providers/CantonProvider";
2
+ export declare function useCanton(): ICantonContextData;
@@ -0,0 +1,10 @@
1
+ import { CantonWallet } from "../../core/types/wallet";
2
+ /**
3
+ * Discovers Canton browser-extension wallets and maps each to a
4
+ * {@link CantonWallet}: CIP-103 announce-protocol wallets (on mount and on
5
+ * window focus), plus injected wallets that ship the CIP-103 RPC surface as a
6
+ * `window` global instead of announcing (see `INJECTED_CANTON_WALLETS`).
7
+ */
8
+ export declare function useCantonWallets(): {
9
+ wallets: CantonWallet[];
10
+ };
@@ -12,6 +12,7 @@ export declare const useSquidChains: (direction?: SwapDirection) => {
12
12
  suiChains: ChainData[];
13
13
  xrplChains: ChainData[];
14
14
  stellarChains: ChainData[];
15
+ cantonChains: ChainData[];
15
16
  getChainType: (chainId?: string) => ChainType | undefined;
16
17
  findChain: (chainId: string | undefined) => ChainData | undefined;
17
18
  };
@@ -2,13 +2,14 @@ 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
+ export { useStellarTrustLine } from "./stellar/useStellarTrustLine";
12
13
  export { useAddressBookStore } from "./store/useAddressBookStore";
13
14
  export { useAssetsColorsStore } from "./store/useAssetsColorsStore";
14
15
  export { useFavoriteTokensStore, type FavoriteToken, } from "./store/useFavoriteTokensStore";
@@ -19,6 +20,7 @@ export { ConnectingWalletStatus, useWalletStore } from "./store/useWalletStore";
19
20
  export type { ConnectingWalletState } from "./store/useWalletStore";
20
21
  export { useDepositAddress } from "./swap/useDepositAddress";
21
22
  export { useSwap } from "./swap/useSwap";
23
+ export { buildUrlSearchParamsFromSwapEvent, parseInitialAssetsFromUrl, useUrlSwapParams, } from "./swap/useUrlSwapParams";
22
24
  export { useAllConnectedWalletBalances } from "./tokens/useAllConnectedWalletBalances";
23
25
  export { useAllTokensWithBalanceForChainType } from "./tokens/useAllTokensWithBalanceForChainType";
24
26
  export { useCosmosBalance, useEvmBalance } from "./tokens/useBalance";
@@ -27,6 +29,7 @@ export { useMultipleTokenPrices } from "./tokens/useMultipleTokenPrices";
27
29
  export { useBitcoinNativeBalance, useCosmosNativeBalance, useEvmNativeBalance, useNativeBalance, useSolanaNativeBalance, useStellarNativeBalance, useSuiNativeBalance, useXrplNativeBalance, } from "./tokens/useNativeBalance";
28
30
  export { useNativeTokenForChain } from "./tokens/useNativeTokenForChain";
29
31
  export { useSingleTokenPrice } from "./tokens/useSingleTokenPrice";
32
+ export { useSourceChainGasToken } from "./tokens/useSourceChainGasToken";
30
33
  export { useSquidTokens } from "./tokens/useSquidTokens";
31
34
  export { useHistoricalData, useTokensData, } from "./tokens/useTokenHistoricalData";
32
35
  export { useEstimateSendTransaction } from "./transaction/send/useEstimateSendTransactionGas";
@@ -34,6 +37,7 @@ export { useSendTransaction } from "./transaction/send/useSendTransaction";
34
37
  export { useSendTransactionGas } from "./transaction/send/useSendTransactionGas";
35
38
  export { useAllTransactionsStatus } from "./transaction/useAllTransactionsStatus";
36
39
  export { useApproval } from "./transaction/useApproval";
40
+ export { useDepositTransactionStatus } from "./transaction/useDepositTransactionStatus";
37
41
  export { useEstimate } from "./transaction/useEstimate";
38
42
  export { useEstimatePriceImpact } from "./transaction/useEstimatePriceImpact";
39
43
  export { useExecuteTransaction } from "./transaction/useExecuteTransaction";
@@ -43,7 +47,6 @@ export { useSendTransactionStatus } from "./transaction/useSendTransactionStatus
43
47
  export { useSwapTransactionStatus } from "./transaction/useSwapTransactionStatus";
44
48
  export { useAvatar } from "./user/useAvatar";
45
49
  export { useHistory } from "./user/useHistory";
46
- export { useUserParams } from "./user/useUserParams";
47
50
  export { useDebouncedValue } from "./utils/useUtils";
48
51
  export { useAddToken } from "./wallet/useAddToken";
49
52
  export { useAutoConnect } from "./wallet/useAutoConnect";
@@ -0,0 +1,13 @@
1
+ import { ChainData, Token } from "@0xsquid/squid-types";
2
+ interface Params {
3
+ address: string | undefined;
4
+ token: Token | undefined;
5
+ chain: ChainData | undefined;
6
+ amount: bigint | undefined;
7
+ }
8
+ export declare function useStellarTrustLine({ address, chain, token, amount }: Params): {
9
+ createTrustLine: import("@tanstack/react-query").UseMutationResult<boolean, unknown, void, unknown>;
10
+ trustLineQuery: import("@tanstack/react-query").UseQueryResult<import("../../core/types/stellar").StellarHorizonIssuedAsset | null, unknown>;
11
+ isTrustLineApproved: import("@tanstack/react-query").UseQueryResult<boolean, unknown>;
12
+ };
13
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { HistoryTransaction } from "../../core/types/history";
2
+ export interface HistoryStoreState {
3
+ transactions: HistoryTransaction[];
4
+ }
5
+ /**
6
+ * Migrates the persisted history to the current version. It never throws:
7
+ * items that cannot be read are dropped.
8
+ */
9
+ export declare const migrateHistoryStore: (persistedState: unknown, version: number) => HistoryStoreState;
@@ -1,9 +1,22 @@
1
- import { DepositAddressResponse } from "@0xsquid/squid-types";
1
+ export interface DepositData {
2
+ depositAddress: string;
3
+ amount: string;
4
+ /**
5
+ * Identifier sent to backend to check for deposit status
6
+ */
7
+ statusTrackingId: string;
8
+ /**
9
+ * Memo to be sent with the deposit transaction on-chain
10
+ * Used by backend to track and index deposits
11
+ */
12
+ memo?: string;
13
+ }
14
+ export type PaymentMethod = "connectedWallet" | "depositAddress";
2
15
  interface DepositAddressStore {
3
- deposit: DepositAddressResponse | null;
4
- isEnabled: boolean;
5
- setDeposit(data: DepositAddressResponse | null): void;
6
- toggleDepositFlow(enabled: boolean): void;
16
+ deposit: DepositData | null;
17
+ selectedPaymentMethod: PaymentMethod;
18
+ setDeposit(data: DepositData | null): void;
19
+ setPaymentMethod(method: PaymentMethod): void;
7
20
  }
8
21
  export declare const useDepositAddressStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DepositAddressStore>>;
9
22
  export {};
@@ -1,11 +1,9 @@
1
1
  import type { FiatTransactionHistory, HistoryTransaction, SendTransactionHistory, SwapTransactionHistory, TxTypeToTransactionMap } from "../../core/types/history";
2
2
  import { HistoryTxType } from "../../core/types/history";
3
- interface HistoryStoreState {
4
- transactions: HistoryTransaction[];
5
- }
3
+ import { type HistoryStoreState } from "./historyStoreMigration";
6
4
  export type ReplaceTransactionStatusParams = ({
7
5
  txType: HistoryTxType.SWAP;
8
- } & Pick<SwapTransactionHistory, "statusResponse" | "status" | "transactionId">) | ({
6
+ } & Pick<SwapTransactionHistory, "statusSummary" | "status" | "transactionId">) | ({
9
7
  txType: HistoryTxType.SEND;
10
8
  } & Pick<SendTransactionHistory, "hash" | "status">) | ({
11
9
  txType: HistoryTxType.BUY;
@@ -1,16 +1,15 @@
1
1
  import { RouteResponse } from "@0xsquid/squid-types";
2
+ import { PaymentMethod } from "../store/useDepositAddressStore";
2
3
  export declare function useDepositAddress(squidRoute?: RouteResponse["route"]): {
3
- isEnabled: boolean;
4
+ paymentMethod: PaymentMethod;
5
+ isDepositAddressActive: boolean;
4
6
  isAvailableAsPaymentMethod: boolean;
5
7
  swapWillGenerateDepositAddress: boolean;
6
- enable: () => void;
7
- disable: () => void;
8
- getRouteWithDeposit: import("@tanstack/react-query").UseMutationResult<{
9
- depositAddress: import("@0xsquid/squid-types").ChainflipDepositAddressResponse;
10
- }, unknown, {
8
+ setPaymentMethod: (method: PaymentMethod) => void;
9
+ getRouteWithDeposit: import("@tanstack/react-query").UseMutationResult<void, unknown, {
11
10
  route: RouteResponse["route"];
12
11
  }, unknown>;
13
12
  depositAddress: string | undefined;
14
13
  closeDepositChannel: () => void;
15
- depositData: import("@0xsquid/squid-types").ChainflipDepositAddressResponse | null;
14
+ depositData: import("../store/useDepositAddressStore").DepositData | null;
16
15
  };
@@ -0,0 +1,10 @@
1
+ import type { AppConfig } from "../../core/types/config";
2
+ import { buildUrlSearchParamsFromSwapEvent, parseInitialAssetsFromUrl } from "../../services/internal/urlParamsService";
3
+ export { buildUrlSearchParamsFromSwapEvent, parseInitialAssetsFromUrl };
4
+ /**
5
+ * Reads initial swap assets from URL params on mount, and keeps the URL in
6
+ * sync with swap param changes emitted by the widget.
7
+ */
8
+ export declare const useUrlSwapParams: () => {
9
+ initialAssets: AppConfig["initialAssets"];
10
+ };
@@ -17,4 +17,5 @@ export declare const useBitcoinBalance: ({ userAddress, chain, }: UseBalanceOpti
17
17
  export declare const useSuiBalance: ({ chain, token, userAddress, enabled, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
18
18
  export declare const useXrplBalance: ({ userAddress, chain, enabled, token, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
19
19
  export declare const useStellarBalance: ({ userAddress, chain, enabled, token, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
20
+ export declare const useCantonBalance: ({ chain, token, userAddress, enabled, refreshIntervalMs, }: UseBalanceOptions) => UseBalanceResult;
20
21
  export {};
@@ -18,6 +18,7 @@ export declare const useSolanaNativeBalance: ({ chain, address, }: UseNativeBala
18
18
  export declare const useSuiNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
19
19
  export declare const useXrplNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
20
20
  export declare const useStellarNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
21
+ export declare const useCantonNativeBalance: ({ address, chain, }: UseNativeBalanceOptions) => UseNativeBalanceResult;
21
22
  export declare const useNativeBalance: (chain?: ChainData) => {
22
23
  nativeBalance: Balance | undefined;
23
24
  nativeBalanceFormatted: string | undefined;
@@ -0,0 +1,13 @@
1
+ import { ChainData } from "@0xsquid/squid-types";
2
+ import { Token } from "../../core";
3
+ import { ChainFeeParams } from "../../services/internal/tempoService";
4
+ /**
5
+ * Hook that returns the gas token and chain fee params for a given source chain and token.
6
+ */
7
+ export declare function useSourceChainGasToken({ fromChain, fromToken, }: {
8
+ fromChain: ChainData | undefined;
9
+ fromToken: Token | undefined;
10
+ }): {
11
+ gasToken: Token | undefined;
12
+ chainFeeParams: ChainFeeParams | null;
13
+ };
@@ -13,4 +13,5 @@ export declare const useSquidTokens: (direction?: SwapDirection) => {
13
13
  suiTokens: Token[];
14
14
  xrplTokens: Token[];
15
15
  stellarTokens: Token[];
16
+ cantonTokens: Token[];
16
17
  };
@@ -0,0 +1,12 @@
1
+ import type { QueryClient } from "@tanstack/react-query";
2
+ import type { StatusKeys, SwapStatusResult } from "../../core/types/status";
3
+ export declare const subscribeLive: (listener: () => void) => (() => void);
4
+ export declare const getLiveVersion: () => number;
5
+ export declare const isLive: (keys: StatusKeys) => boolean;
6
+ export declare const watchLive: (keys: StatusKeys, onUpdate: (result: SwapStatusResult) => void, depositTxVerificationSignature?: string) => (() => void);
7
+ export declare const pushSwapStatus: (queryClient: QueryClient, statusKeys: StatusKeys, result: SwapStatusResult) => void;
8
+ /**
9
+ * Watches the status keys and writes each push to the query cache once, for
10
+ * all the watchers of the status keys
11
+ */
12
+ export declare const watchSwapStatus: (queryClient: QueryClient, statusKeys: StatusKeys, depositTxVerificationSignature?: string) => (() => void);
@@ -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,15 @@ 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
+ tokenPaysGasFees: boolean;
24
+ /**
25
+ * The balance of the gas token needed
26
+ * including source amount if the source token is the gas token
27
+ */
28
+ gasBalanceNeeded: string | undefined;
20
29
  }
21
30
  export declare function useEstimateSendTransaction({ chain, token, amount, balance, from, }: {
22
31
  chain: ChainData | undefined;
@@ -0,0 +1,9 @@
1
+ import { type QueryClient } from "@tanstack/react-query";
2
+ /**
3
+ * Writes the swap status data of the query cache to the history, and drops
4
+ * the status data when the API or the integrator changes. This is the one
5
+ * place for these side effects, whatever view or poller requested the status.
6
+ *
7
+ * @returns the function that removes the effects
8
+ */
9
+ export declare const installSwapStatusEffects: (queryClient: QueryClient) => (() => void);
@@ -5,32 +5,5 @@ export declare const useAllTransactionsStatus: ({ enabled }: {
5
5
  }) => {
6
6
  isLoading: boolean;
7
7
  isError: boolean;
8
- data: ((import("@0xsquid/squid-types").ApiBasicResponse & {
9
- id: string;
10
- status: string;
11
- gasStatus: string;
12
- isGMPTransaction?: boolean | undefined;
13
- axelarTransactionUrl: string;
14
- fromChain?: {
15
- transactionId: string;
16
- blockNumber: string;
17
- callEventStatus: string;
18
- callEventLog: any[];
19
- chainData?: any;
20
- transactionUrl?: string | undefined;
21
- destinationAddress?: string | undefined;
22
- } | undefined;
23
- toChain?: {
24
- transactionId: string;
25
- blockNumber: string;
26
- callEventStatus: string;
27
- callEventLog: any[];
28
- chainData?: any;
29
- transactionUrl?: string | undefined;
30
- destinationAddress?: string | undefined;
31
- } | undefined;
32
- timeSpent?: {} | Record<string, number> | undefined;
33
- squidTransactionStatus?: import("@0xsquid/squid-types").SquidTransactionStatus | undefined;
34
- routeStatus?: any[] | undefined;
35
- } & OnRampTransactionStatus & SendTransactionStatus) | undefined)[];
8
+ data: ((OnRampTransactionStatus & SendTransactionStatus) | undefined)[];
36
9
  };
@@ -0,0 +1,5 @@
1
+ import { ChainData } from "@0xsquid/squid-types";
2
+ import { ArcFeeData } from "../../services/internal/arcService";
3
+ export declare const useArcFeeCheck: ({ fromChain, }: {
4
+ fromChain: ChainData | undefined;
5
+ }) => ArcFeeData | null;