@sodax/dapp-kit 0.0.1-rc.3 → 0.0.1-rc.30

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 (126) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -53
  3. package/dist/index.d.mts +1425 -0
  4. package/dist/index.d.ts +1425 -4
  5. package/dist/index.js +931 -194
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +890 -191
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +7 -8
  10. package/src/contexts/index.ts +2 -0
  11. package/src/core/index.ts +5 -33
  12. package/src/hooks/backend/README.md +135 -0
  13. package/src/hooks/backend/index.ts +23 -0
  14. package/src/hooks/backend/useBackendAllMoneyMarketAssets.ts +49 -0
  15. package/src/hooks/backend/useBackendAllMoneyMarketBorrowers.ts +61 -0
  16. package/src/hooks/backend/useBackendIntentByHash.ts +53 -0
  17. package/src/hooks/backend/useBackendIntentByTxHash.ts +52 -0
  18. package/src/hooks/backend/useBackendMoneyMarketAsset.ts +57 -0
  19. package/src/hooks/backend/useBackendMoneyMarketAssetBorrowers.ts +67 -0
  20. package/src/hooks/backend/useBackendMoneyMarketAssetSuppliers.ts +67 -0
  21. package/src/hooks/backend/useBackendMoneyMarketPosition.ts +56 -0
  22. package/src/hooks/backend/useBackendOrderbook.ts +63 -0
  23. package/src/hooks/bridge/index.ts +5 -0
  24. package/src/hooks/bridge/useBridge.ts +57 -0
  25. package/src/hooks/bridge/useBridgeAllowance.ts +49 -0
  26. package/src/hooks/bridge/useBridgeApprove.ts +68 -0
  27. package/src/hooks/bridge/useGetBridgeableAmount.ts +50 -0
  28. package/src/hooks/bridge/useGetBridgeableTokens.ts +62 -0
  29. package/src/hooks/index.ts +3 -0
  30. package/src/hooks/mm/index.ts +3 -1
  31. package/src/hooks/mm/useBorrow.ts +20 -10
  32. package/src/hooks/mm/useMMAllowance.ts +55 -0
  33. package/src/hooks/mm/useMMApprove.ts +67 -0
  34. package/src/hooks/mm/useRepay.ts +20 -10
  35. package/src/hooks/mm/useReservesData.ts +30 -0
  36. package/src/hooks/mm/useReservesHumanized.ts +30 -0
  37. package/src/hooks/mm/useReservesList.ts +29 -0
  38. package/src/hooks/mm/useReservesUsdFormat.ts +38 -0
  39. package/src/hooks/mm/useSupply.ts +9 -6
  40. package/src/hooks/mm/useUserFormattedSummary.ts +54 -0
  41. package/src/hooks/mm/useUserReservesData.ts +30 -48
  42. package/src/hooks/mm/useWithdraw.ts +17 -11
  43. package/src/hooks/provider/useHubProvider.ts +3 -21
  44. package/src/hooks/provider/useSpokeProvider.ts +97 -6
  45. package/src/hooks/shared/index.ts +4 -2
  46. package/src/hooks/shared/useDeriveUserWalletAddress.ts +44 -0
  47. package/src/hooks/shared/useEstimateGas.ts +18 -0
  48. package/src/hooks/shared/useRequestTrustline.ts +82 -0
  49. package/src/hooks/shared/useStellarTrustlineCheck.ts +71 -0
  50. package/src/hooks/staking/index.ts +19 -0
  51. package/src/hooks/staking/useCancelUnstake.ts +52 -0
  52. package/src/hooks/staking/useClaim.ts +46 -0
  53. package/src/hooks/staking/useConvertedAssets.ts +47 -0
  54. package/src/hooks/staking/useInstantUnstake.ts +50 -0
  55. package/src/hooks/staking/useInstantUnstakeAllowance.ts +59 -0
  56. package/src/hooks/staking/useInstantUnstakeApprove.ts +52 -0
  57. package/src/hooks/staking/useInstantUnstakeRatio.ts +54 -0
  58. package/src/hooks/staking/useStake.ts +47 -0
  59. package/src/hooks/staking/useStakeAllowance.ts +57 -0
  60. package/src/hooks/staking/useStakeApprove.ts +50 -0
  61. package/src/hooks/staking/useStakeRatio.ts +53 -0
  62. package/src/hooks/staking/useStakingConfig.ts +40 -0
  63. package/src/hooks/staking/useStakingInfo.ts +50 -0
  64. package/src/hooks/staking/useUnstake.ts +54 -0
  65. package/src/hooks/staking/useUnstakeAllowance.ts +58 -0
  66. package/src/hooks/staking/useUnstakeApprove.ts +52 -0
  67. package/src/hooks/staking/useUnstakingInfo.ts +53 -0
  68. package/src/hooks/staking/useUnstakingInfoWithPenalty.ts +59 -0
  69. package/src/hooks/swap/index.ts +4 -1
  70. package/src/hooks/swap/useCancelSwap.ts +44 -0
  71. package/src/hooks/swap/useQuote.ts +20 -6
  72. package/src/hooks/swap/useStatus.ts +3 -3
  73. package/src/hooks/swap/{useCreateIntentOrder.ts → useSwap.ts} +22 -19
  74. package/src/hooks/swap/useSwapAllowance.ts +48 -0
  75. package/src/hooks/swap/useSwapApprove.ts +68 -0
  76. package/src/providers/SodaxProvider.tsx +7 -4
  77. package/dist/contexts/index.d.ts +0 -7
  78. package/dist/contexts/index.d.ts.map +0 -1
  79. package/dist/core/index.d.ts +0 -4
  80. package/dist/core/index.d.ts.map +0 -1
  81. package/dist/hooks/index.d.ts +0 -5
  82. package/dist/hooks/index.d.ts.map +0 -1
  83. package/dist/hooks/mm/index.d.ts +0 -7
  84. package/dist/hooks/mm/index.d.ts.map +0 -1
  85. package/dist/hooks/mm/useBorrow.d.ts +0 -26
  86. package/dist/hooks/mm/useBorrow.d.ts.map +0 -1
  87. package/dist/hooks/mm/useHubWalletAddress.d.ts +0 -24
  88. package/dist/hooks/mm/useHubWalletAddress.d.ts.map +0 -1
  89. package/dist/hooks/mm/useRepay.d.ts +0 -26
  90. package/dist/hooks/mm/useRepay.d.ts.map +0 -1
  91. package/dist/hooks/mm/useSupply.d.ts +0 -32
  92. package/dist/hooks/mm/useSupply.d.ts.map +0 -1
  93. package/dist/hooks/mm/useUserReservesData.d.ts +0 -9
  94. package/dist/hooks/mm/useUserReservesData.d.ts.map +0 -1
  95. package/dist/hooks/mm/useWithdraw.d.ts +0 -26
  96. package/dist/hooks/mm/useWithdraw.d.ts.map +0 -1
  97. package/dist/hooks/provider/index.d.ts +0 -3
  98. package/dist/hooks/provider/index.d.ts.map +0 -1
  99. package/dist/hooks/provider/useHubProvider.d.ts +0 -3
  100. package/dist/hooks/provider/useHubProvider.d.ts.map +0 -1
  101. package/dist/hooks/provider/useSpokeProvider.d.ts +0 -4
  102. package/dist/hooks/provider/useSpokeProvider.d.ts.map +0 -1
  103. package/dist/hooks/shared/index.d.ts +0 -4
  104. package/dist/hooks/shared/index.d.ts.map +0 -1
  105. package/dist/hooks/shared/useAllowance.d.ts +0 -3
  106. package/dist/hooks/shared/useAllowance.d.ts.map +0 -1
  107. package/dist/hooks/shared/useApprove.d.ts +0 -10
  108. package/dist/hooks/shared/useApprove.d.ts.map +0 -1
  109. package/dist/hooks/shared/useSodaxContext.d.ts +0 -8
  110. package/dist/hooks/shared/useSodaxContext.d.ts.map +0 -1
  111. package/dist/hooks/swap/index.d.ts +0 -4
  112. package/dist/hooks/swap/index.d.ts.map +0 -1
  113. package/dist/hooks/swap/useCreateIntentOrder.d.ts +0 -33
  114. package/dist/hooks/swap/useCreateIntentOrder.d.ts.map +0 -1
  115. package/dist/hooks/swap/useQuote.d.ts +0 -39
  116. package/dist/hooks/swap/useQuote.d.ts.map +0 -1
  117. package/dist/hooks/swap/useStatus.d.ts +0 -31
  118. package/dist/hooks/swap/useStatus.d.ts.map +0 -1
  119. package/dist/index.d.ts.map +0 -1
  120. package/dist/providers/SodaxProvider.d.ts +0 -10
  121. package/dist/providers/SodaxProvider.d.ts.map +0 -1
  122. package/dist/providers/index.d.ts +0 -2
  123. package/dist/providers/index.d.ts.map +0 -1
  124. package/src/hooks/mm/useHubWalletAddress.ts +0 -49
  125. package/src/hooks/shared/useAllowance.ts +0 -31
  126. package/src/hooks/shared/useApprove.ts +0 -53
@@ -0,0 +1,1425 @@
1
+ import * as _sodax_sdk from '@sodax/sdk';
2
+ import { Sodax, SpokeProvider, GetEstimateGasReturnType, TxReturnType, SpokeChainId, StellarSpokeProvider, EvmHubProvider, IWalletProvider, UserReserveData, MoneyMarketAction, SolverIntentQuoteRequest, Result, SolverIntentQuoteResponse, SolverErrorResponse, SolverExecutionResponse, Intent, IntentDeliveryInfo, IntentError, IntentErrorCode, CreateIntentParams, Hex, SolverIntentStatusResponse, IntentResponse, OrderbookResponse, MoneyMarketPosition, MoneyMarketAsset, MoneyMarketAssetBorrowers, MoneyMarketAssetSuppliers, MoneyMarketBorrowers, CreateBridgeIntentParams, SpokeTxHash, HubTxHash, BridgeError, BridgeErrorCode, XToken as XToken$1, StakeParams, UnstakeParams, ClaimParams, CancelUnstakeParams, StakingInfo, UnstakingInfo, UnstakeRequestWithPenalty, StakingConfig, InstantUnstakeParams, SodaxConfig } from '@sodax/sdk';
3
+ import { RpcConfig, SpokeChainId as SpokeChainId$1, XToken, ChainId } from '@sodax/types';
4
+ import * as _tanstack_react_query from '@tanstack/react-query';
5
+ import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
6
+ import { Address } from 'viem';
7
+ import { ReactNode, ReactElement } from 'react';
8
+
9
+ interface SodaxContextType {
10
+ sodax: Sodax;
11
+ testnet: boolean;
12
+ rpcConfig: RpcConfig;
13
+ }
14
+
15
+ /**
16
+ * Hook to access the Sodax context which provides access to the Sodax SDK instance and chain configuration
17
+ * @throws {Error} If used outside of a SodaxProvider
18
+ * @returns {SodaxContextType} The Sodax context containing SDK instance and configuration
19
+ */
20
+ declare const useSodaxContext: () => SodaxContextType;
21
+
22
+ declare function useEstimateGas<T extends SpokeProvider = SpokeProvider>(spokeProvider: T | undefined): UseMutationResult<GetEstimateGasReturnType<T>, Error, TxReturnType<T, true>>;
23
+
24
+ /**
25
+ * Hook for deriving user wallet address for hub abstraction.
26
+ *
27
+ * This hook derives the user's abstracted wallet address for the hub chain.
28
+ * If the spoke chain is the same as the hub chain, it returns the original wallet address.
29
+ * Otherwise, it returns the abstracted wallet address for cross-chain operations.
30
+ *
31
+ * @param spokeProvider - The spoke provider instance for the origin chain
32
+ * @param walletAddress - Optional user wallet address on spoke chain. If not provided, will fetch from spokeProvider
33
+ * @returns A React Query result object containing:
34
+ * - data: The derived user wallet address when available
35
+ * - isLoading: Loading state indicator
36
+ * - error: Any error that occurred during derivation
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * const { data: derivedAddress, isLoading, error } = useDeriveUserWalletAddress(spokeProvider, userAddress);
41
+ * ```
42
+ */
43
+ declare function useDeriveUserWalletAddress(spokeProvider: SpokeProvider | undefined, walletAddress?: string | undefined): UseQueryResult<Address, Error>;
44
+
45
+ /**
46
+ * React hook to check if a Stellar account has a sufficient trustline for a given token and amount.
47
+ *
48
+ * This hook queries the Stellar network (via the provided SpokeProvider) to determine
49
+ * whether the account has established a trustline for the specified token and if the trustline
50
+ * is sufficient for the intended amount. It is useful for gating UI actions that require
51
+ * a trustline to be present and funded.
52
+ *
53
+ * @template T - The type of SpokeProvider, defaults to SpokeProvider.
54
+ * @param {string | undefined} token - The Stellar asset code or token address to check the trustline for.
55
+ * @param {bigint | undefined} amount - The minimum amount required for the trustline.
56
+ * @param {T | undefined} spokeProvider - The provider instance for interacting with the Stellar network.
57
+ * @param {SpokeChainId | undefined} chainId - The chain ID to determine if the check should be performed (only on Stellar mainnet).
58
+ * @returns {UseQueryResult<boolean, Error>} A React Query result object containing:
59
+ * - `data`: `true` if the trustline exists and is sufficient, `false` otherwise.
60
+ * - `error`: Any error encountered during the check.
61
+ * - `isLoading`: Whether the query is in progress.
62
+ * - Other React Query state.
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * import { useStellarTrustlineCheck } from '@sodax/dapp-kit';
67
+ *
68
+ * const { data: hasTrustline, isLoading, error } = useStellarTrustlineCheck(
69
+ * 'USDC-G...TOKEN',
70
+ * 10000000n,
71
+ * stellarProvider,
72
+ * 'stellar'
73
+ * );
74
+ *
75
+ * if (isLoading) return <span>Checking trustline...</span>;
76
+ * if (error) return <span>Error: {error.message}</span>;
77
+ * if (!hasTrustline) return <span>Trustline not established or insufficient.</span>;
78
+ * return <span>Trustline is sufficient!</span>;
79
+ * ```
80
+ */
81
+ declare function useStellarTrustlineCheck<T extends SpokeProvider = SpokeProvider>(token: string | undefined, amount: bigint | undefined, spokeProvider: T | undefined, chainId: SpokeChainId | undefined): UseQueryResult<boolean, Error>;
82
+
83
+ /**
84
+ * React hook to request a Stellar trustline for a given token and amount.
85
+ *
86
+ * This hook provides a mutation for requesting a trustline on the Stellar network
87
+ * using the provided SpokeProvider. It is intended for use with StellarSpokeProvider
88
+ * and will throw if used with a non-Stellar provider. Upon success, it invalidates
89
+ * the trustline check query to ensure UI reflects the updated trustline state.
90
+ *
91
+ * @template T - The type of SpokeProvider, defaults to SpokeProvider.
92
+ * @param {string | undefined} token - The Stellar asset code or token address for which to request a trustline.
93
+ * @returns {UseMutationResult<TxReturnType<StellarSpokeProvider, false>, Error, { token: string; amount: bigint; spokeProvider: T }>}
94
+ * A React Query mutation result object containing:
95
+ * - `mutate`/`mutateAsync`: Function to trigger the trustline request.
96
+ * - `data`: The transaction result if successful.
97
+ * - `error`: Any error encountered during the request.
98
+ * - `isLoading`: Whether the mutation is in progress.
99
+ * - Other React Query mutation state.
100
+ *
101
+ * @example
102
+ * ```tsx
103
+ * import { useRequestTrustline } from '@sodax/dapp-kit';
104
+ *
105
+ * const { mutate: requestTrustline, isLoading, error, data } = useRequestTrustline('USDC-G...TOKEN');
106
+ *
107
+ * // To request a trustline:
108
+ * requestTrustline({
109
+ * token: 'USDC-G...TOKEN',
110
+ * amount: 10000000n,
111
+ * spokeProvider: stellarProvider,
112
+ * });
113
+ *
114
+ * if (isLoading) return <span>Requesting trustline...</span>;
115
+ * if (error) return <span>Error: {error.message}</span>;
116
+ * if (data) return <span>Trustline requested! Tx: {data.txHash}</span>;
117
+ * ```
118
+ */
119
+ declare function useRequestTrustline<T extends SpokeProvider = SpokeProvider>(token: string | undefined): UseMutationResult<TxReturnType<StellarSpokeProvider, false>, Error, {
120
+ token: string;
121
+ amount: bigint;
122
+ spokeProvider: T;
123
+ }>;
124
+
125
+ declare function useHubProvider(): EvmHubProvider;
126
+
127
+ /**
128
+ * Hook to get the appropriate spoke provider based on the chain type.
129
+ * Supports EVM, SUI, ICON and INJECTIVE chains.
130
+ *
131
+ * @param {SpokeChainId | undefined} spokeChainId - The spoke chain ID to get the provider for
132
+ * @param {IWalletProvider | undefined} walletProvider - The wallet provider to use
133
+ * @returns {SpokeProvider | undefined} The appropriate spoke provider instance for the given chain ID, or undefined if invalid/unsupported
134
+ *
135
+ * @example
136
+ * ```tsx
137
+ * // Using a specific SpokeChainId and wallet provider
138
+ * const spokeProvider = useSpokeProvider(spokeChainId, walletProvider);
139
+ * ```
140
+ */
141
+ declare function useSpokeProvider(spokeChainId: SpokeChainId$1 | undefined, walletProvider?: IWalletProvider | undefined): SpokeProvider | undefined;
142
+
143
+ interface BorrowResponse {
144
+ ok: true;
145
+ value: [string, string];
146
+ }
147
+ /**
148
+ * Hook for borrowing tokens from the Sodax money market.
149
+ *
150
+ * This hook provides functionality to borrow tokens from the money market protocol,
151
+ * handling the entire borrow process including transaction creation, submission,
152
+ * and cross-chain communication.
153
+ *
154
+ * @param {XToken} spokeToken - The token to borrow from the spoke chain. Must be an XToken with valid address and chain information.
155
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for the borrow transaction. Must be a valid SpokeProvider instance.
156
+ *
157
+ * @returns {UseMutationResult<BorrowResponse, Error, string>} A mutation result object with the following properties:
158
+ * - mutateAsync: Function to execute the borrow transaction
159
+ * - isPending: Boolean indicating if a transaction is in progress
160
+ * - error: Error object if the last transaction failed, null otherwise
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * const { mutateAsync: borrow, isPending, error } = useBorrow(spokeToken);
165
+ * await borrow('100');
166
+ * ```
167
+ *
168
+ * @throws {Error} When:
169
+ * - spokeProvider is not available
170
+ * - Transaction execution fails
171
+ */
172
+ declare function useBorrow(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<BorrowResponse, Error, string>;
173
+
174
+ interface RepayResponse {
175
+ ok: true;
176
+ value: [string, string];
177
+ }
178
+ /**
179
+ * Hook for repaying borrowed tokens to the Sodax money market.
180
+ *
181
+ * This hook provides functionality to repay borrowed tokens back to the money market protocol,
182
+ * handling the entire repayment process including transaction creation, submission,
183
+ * and cross-chain communication.
184
+ *
185
+ * @param {XToken} spokeToken - The token to repay on the spoke chain. Must be an XToken with valid address and chain information.
186
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for the repay transaction. Must be a valid SpokeProvider instance.
187
+ *
188
+ * @returns {UseMutationResult<RepayResponse, Error, string>} A mutation result object with the following properties:
189
+ * - mutateAsync: Function to execute the repay transaction
190
+ * - isPending: Boolean indicating if a transaction is in progress
191
+ * - error: Error object if the last transaction failed, null otherwise
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const { mutateAsync: repay, isPending, error } = useRepay(spokeToken);
196
+ * await repay('100');
197
+ * ```
198
+ *
199
+ * @throws {Error} When:
200
+ * - spokeProvider is not available
201
+ * - Transaction execution fails
202
+ */
203
+ declare function useRepay(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<RepayResponse, Error, string>;
204
+
205
+ interface SupplyResponse {
206
+ ok: true;
207
+ value: [string, string];
208
+ }
209
+ /**
210
+ * Hook for supplying tokens to the Sodax money market.
211
+ *
212
+ * This hook provides functionality to supply tokens to the money market protocol,
213
+ * handling the entire supply process including transaction creation, submission,
214
+ * and cross-chain communication.
215
+ *
216
+ * @param {XToken} spokeToken - The token to supply on the spoke chain. Must be an XToken with valid address and chain information.
217
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for the supply transaction. Must be a valid SpokeProvider instance.
218
+ *
219
+ * @returns {UseMutationResult<SupplyResponse, Error, string>} A mutation result object with the following properties:
220
+ * - mutateAsync: Function to execute the supply transaction
221
+ * - isPending: Boolean indicating if a transaction is in progress
222
+ * - error: Error object if the last transaction failed, null otherwise
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * const { mutateAsync: supply, isPending, error } = useSupply(spokeToken);
227
+ * await supply('100');
228
+ * ```
229
+ *
230
+ * @throws {Error} When:
231
+ * - spokeProvider is not available
232
+ */
233
+ declare function useSupply(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<SupplyResponse, Error, string>;
234
+
235
+ interface WithdrawResponse {
236
+ ok: true;
237
+ value: [string, string];
238
+ }
239
+ /**
240
+ * Hook for withdrawing supplied tokens from the Sodax money market.
241
+ *
242
+ * This hook provides functionality to withdraw previously supplied tokens from the money market protocol,
243
+ * handling the entire withdrawal process including transaction creation, submission,
244
+ * and cross-chain communication.
245
+ *
246
+ * @param {XToken} spokeToken - The token to withdraw from the spoke chain. Must be an XToken with valid address and chain information.
247
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for the withdraw transaction. Must be a valid SpokeProvider instance.
248
+ *
249
+ * @returns {UseMutationResult<WithdrawResponse, Error, string>} A mutation result object with the following properties:
250
+ * - mutateAsync: Function to execute the withdraw transaction
251
+ * - isPending: Boolean indicating if a transaction is in progress
252
+ * @example
253
+ * ```typescript
254
+ * const { mutateAsync: withdraw, isPending, error } = useWithdraw(spokeToken);
255
+ * await withdraw('100');
256
+ * ```
257
+ *
258
+ * @throws {Error} When:
259
+ * - spokeProvider is not available
260
+ * - Transaction execution fails
261
+ */
262
+ declare function useWithdraw(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<WithdrawResponse, Error, string>;
263
+
264
+ /**
265
+ * Hook for fetching user reserves data from the Sodax money market.
266
+ *
267
+ * This hook provides access to the current state of user reserves in the money market protocol.
268
+ * The data is automatically fetched and cached using React Query.
269
+ *
270
+ * @example
271
+ * ```typescript
272
+ * const { data: userReservesData, isLoading, error } = useUserReservesData(spokeProvider, address);
273
+ * ```
274
+ *
275
+ * @returns A React Query result object containing:
276
+ * - data: The user reserves data when available
277
+ * - isLoading: Loading state indicator
278
+ * - error: Any error that occurred during data fetching
279
+ */
280
+ declare function useUserReservesData(spokeProvider: SpokeProvider | undefined, address: string | undefined, refetchInterval?: number): UseQueryResult<readonly [readonly UserReserveData[], number], Error>;
281
+
282
+ /**
283
+ * Hook for fetching reserves data from the Sodax money market.
284
+ *
285
+ * This hook provides access to the current state of all reserves in the money market protocol,
286
+ * including liquidity, interest rates, and other key metrics. The data is automatically
287
+ * fetched and cached using React Query.
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * const { data: reservesData, isLoading, error } = useReservesData();
292
+ * ```
293
+ *
294
+ * @returns A React Query result object containing:
295
+ * - data: The reserves data when available
296
+ * - isLoading: Loading state indicator
297
+ * - error: Any error that occurred during data fetching
298
+ */
299
+ declare function useReservesData(): _tanstack_react_query.UseQueryResult<readonly [readonly _sodax_sdk.AggregatedReserveData[], _sodax_sdk.BaseCurrencyInfo], Error>;
300
+
301
+ /**
302
+ * Hook for checking token allowance for money market operations.
303
+ *
304
+ * This hook verifies if the user has approved enough tokens for a specific money market action
305
+ * (borrow/repay). It automatically queries and tracks the allowance status.
306
+ *
307
+ * @param {XToken} token - The token to check allowance for. Must be an XToken with valid address and chain information.
308
+ * @param {string} amount - The amount to check allowance for, as a decimal string
309
+ * @param {MoneyMarketAction} action - The money market action to check allowance for ('borrow' or 'repay')
310
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for allowance checks
311
+ *
312
+ * @returns {UseQueryResult<boolean, Error>} A React Query result containing:
313
+ * - data: Boolean indicating if allowance is sufficient
314
+ * - isLoading: Loading state indicator
315
+ * - error: Any error that occurred during the check
316
+ *
317
+ * @example
318
+ * ```typescript
319
+ * const { data: hasAllowed, isLoading } = useMMAllowance(token, "100", "repay", provider);
320
+ * ```
321
+ */
322
+ declare function useMMAllowance(token: XToken, amount: string, action: MoneyMarketAction, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
323
+
324
+ interface UseApproveReturn$1 {
325
+ approve: ({ amount, action }: {
326
+ amount: string;
327
+ action: MoneyMarketAction;
328
+ }) => Promise<boolean>;
329
+ isLoading: boolean;
330
+ error: Error | null;
331
+ resetError: () => void;
332
+ }
333
+ /**
334
+ * Hook for approving token spending for money market actions
335
+ * @param token The token to approve spending for
336
+ * @param spokeProvider The spoke provider instance for the chain
337
+ * @returns Object containing approve function, loading state, error state and reset function
338
+ * @example
339
+ * ```tsx
340
+ * const { approve, isLoading, error } = useMMApprove(token, spokeProvider);
341
+ *
342
+ * // Approve tokens for supply action
343
+ * await approve({ amount: "100", action: "supply" });
344
+ * ```
345
+ */
346
+ declare function useMMApprove(token: XToken, spokeProvider: SpokeProvider | undefined): UseApproveReturn$1;
347
+
348
+ /**
349
+ * Hook for fetching a quote for an intent-based swap.
350
+ *
351
+ * This hook provides real-time quote data for an intent-based swap.
352
+ *
353
+ * @param {SolverIntentQuoteRequest | undefined} payload - The intent quote request parameters. If undefined, the query will be disabled.
354
+ *
355
+ * @returns {UseQueryResult<Result<SolverIntentQuoteResponse, SolverErrorResponse> | undefined>} A query result object containing:
356
+ * - data: The quote result from the solver
357
+ * - isLoading: Boolean indicating if the quote is being fetched
358
+ * - error: Error object if the quote request failed
359
+ * - refetch: Function to manually trigger a quote refresh
360
+ *
361
+ * @example
362
+ * ```typescript
363
+ * const { data: quote, isLoading } = useQuote({
364
+ * token_src: '0x...',
365
+ * token_src_blockchain_id: '1',
366
+ * token_dst: '0x...',
367
+ * token_dst_blockchain_id: '2',
368
+ * amount: '1000000000000000000',
369
+ * quote_type: 'exact_input',
370
+ * });
371
+ *
372
+ * if (isLoading) return <div>Loading quote...</div>;
373
+ * if (quote) {
374
+ * console.log('Quote received:', quote);
375
+ * }
376
+ * ```
377
+ *
378
+ * @remarks
379
+ * - The quote is automatically refreshed every 3 seconds
380
+ * - The query is disabled when payload is undefined
381
+ * - Uses React Query for efficient caching and state management
382
+ */
383
+ declare const useQuote: (payload: SolverIntentQuoteRequest | undefined) => UseQueryResult<Result<SolverIntentQuoteResponse, SolverErrorResponse> | undefined>;
384
+
385
+ type CreateIntentResult = Result<[SolverExecutionResponse, Intent, IntentDeliveryInfo], IntentError<IntentErrorCode>>;
386
+ /**
387
+ * Hook for creating and submitting an swap intent order for cross-chain swaps.
388
+ * Uses React Query's useMutation for better state management and caching.
389
+ *
390
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for the swap
391
+ * @returns {UseMutationResult} Mutation result object containing mutation function and state
392
+ *
393
+ * @example
394
+ * ```typescript
395
+ * const { mutateAsync: swap, isPending } = useSwap(spokeProvider);
396
+ *
397
+ * const handleSwap = async () => {
398
+ * const result = await swap({
399
+ * token_src: '0x...',
400
+ * token_src_blockchain_id: 'arbitrum',
401
+ * token_dst: '0x...',
402
+ * token_dst_blockchain_id: 'polygon',
403
+ * amount: '1000000000000000000',
404
+ * min_output_amount: '900000000000000000'
405
+ * });
406
+ * };
407
+ * ```
408
+ */
409
+ declare function useSwap(spokeProvider: SpokeProvider | undefined): UseMutationResult<CreateIntentResult, Error, CreateIntentParams>;
410
+
411
+ /**
412
+ * Hook for monitoring the status of an intent-based swap.
413
+ *
414
+ * This hook provides real-time status updates for an intent-based swap transaction.
415
+ *
416
+ * @param {Hex} intent_tx_hash - The transaction hash of the intent order on the hub chain
417
+ *
418
+ * @returns {UseQueryResult<Result<SolverIntentStatusResponse, SolverErrorResponse> | undefined>} A query result object containing:
419
+ * - data: The status result from the solver
420
+ * - isLoading: Boolean indicating if the status is being fetched
421
+ * - error: Error object if the status request failed
422
+ * - refetch: Function to manually trigger a status refresh
423
+ *
424
+ * @example
425
+ * ```typescript
426
+ * const { data: status, isLoading } = useStatus('0x...');
427
+ *
428
+ * if (isLoading) return <div>Loading status...</div>;
429
+ * if (status?.ok) {
430
+ * console.log('Status:', status.value);
431
+ * }
432
+ * ```
433
+ *
434
+ * @remarks
435
+ * - The status is automatically refreshed every 3 seconds
436
+ * - Uses React Query for efficient caching and state management
437
+ */
438
+ declare const useStatus: (intent_tx_hash: Hex) => UseQueryResult<Result<SolverIntentStatusResponse, SolverErrorResponse> | undefined>;
439
+
440
+ /**
441
+ * Hook for checking token allowance for money market operations.
442
+ *
443
+ * This hook verifies if the user has approved enough tokens for a specific money market action
444
+ * (borrow/repay). It automatically queries and tracks the allowance status.
445
+ *
446
+ * @param {CreateIntentParams} params - The parameters for the intent to check allowance for.
447
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for allowance checks
448
+ *
449
+ * @returns {UseQueryResult<boolean, Error>} A React Query result containing:
450
+ * - data: Boolean indicating if allowance is sufficient
451
+ * - isLoading: Loading state indicator
452
+ * - error: Any error that occurred during the check
453
+ *
454
+ * @example
455
+ * ```typescript
456
+ * const { data: hasAllowed, isLoading } = useMMAllowance(params, spokeProvider);
457
+ * ```
458
+ */
459
+ declare function useSwapAllowance(params: CreateIntentParams | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
460
+
461
+ interface UseApproveReturn {
462
+ approve: ({ params }: {
463
+ params: CreateIntentParams;
464
+ }) => Promise<boolean>;
465
+ isLoading: boolean;
466
+ error: Error | null;
467
+ resetError: () => void;
468
+ }
469
+ /**
470
+ * Hook for approving token spending for money market actions
471
+ * @param token The token to approve spending for
472
+ * @param spokeProvider The spoke provider instance for the chain
473
+ * @returns Object containing approve function, loading state, error state and reset function
474
+ * @example
475
+ * ```tsx
476
+ * const { approve, isLoading, error } = useApprove(token, spokeProvider);
477
+ *
478
+ * // Approve tokens for supply action
479
+ * await approve({ amount: "100", action: "supply" });
480
+ * ```
481
+ */
482
+ declare function useSwapApprove(params: CreateIntentParams | undefined, spokeProvider: SpokeProvider | undefined): UseApproveReturn;
483
+
484
+ type CancelIntentParams = {
485
+ intent: Intent;
486
+ raw?: boolean;
487
+ };
488
+ type CancelIntentResult = Result<TxReturnType<SpokeProvider, boolean>>;
489
+ /**
490
+ * Hook for canceling a swap intent order.
491
+ * Uses React Query's useMutation for better state management and caching.
492
+ *
493
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for canceling the intent
494
+ * @returns {UseMutationResult} Mutation result object containing mutation function and state
495
+ *
496
+ * @example
497
+ * ```typescript
498
+ * const { mutateAsync: cancelSwap, isPending } = useCancelSwap(spokeProvider);
499
+ *
500
+ * const handleCancelSwap = async () => {
501
+ * const result = await cancelSwap({
502
+ * intent: intentObject,
503
+ * raw: false // optional, defaults to false
504
+ * });
505
+ * };
506
+ * ```
507
+ */
508
+ declare function useCancelSwap(spokeProvider: SpokeProvider | undefined): UseMutationResult<CancelIntentResult, Error, CancelIntentParams>;
509
+
510
+ /**
511
+ * Hook for fetching intent details by transaction hash from the backend API.
512
+ *
513
+ * This hook provides access to intent data associated with a specific transaction hash,
514
+ * including intent details, events, and transaction information. The data is automatically
515
+ * fetched and cached using React Query.
516
+ *
517
+ * @param {string | undefined} txHash - The transaction hash to fetch intent for. If undefined, the query will be disabled.
518
+ *
519
+ * @returns {UseQueryResult<IntentResponse | undefined>} A query result object containing:
520
+ * - data: The intent response data when available
521
+ * - isLoading: Boolean indicating if the request is in progress
522
+ * - error: Error object if the request failed
523
+ * - refetch: Function to manually trigger a data refresh
524
+ *
525
+ * @example
526
+ * ```typescript
527
+ * const { data: intent, isLoading, error } = useIntentByTxHash('0x123...');
528
+ *
529
+ * if (isLoading) return <div>Loading intent...</div>;
530
+ * if (error) return <div>Error: {error.message}</div>;
531
+ * if (intent) {
532
+ * console.log('Intent found:', intent.intentHash);
533
+ * }
534
+ * ```
535
+ *
536
+ * @remarks
537
+ * - The query is disabled when txHash is undefined or empty
538
+ * - Uses React Query for efficient caching and state management
539
+ * - Automatically handles error states and loading indicators
540
+ */
541
+ declare const useBackendIntentByTxHash: (txHash: string | undefined) => UseQueryResult<IntentResponse | undefined>;
542
+
543
+ /**
544
+ * Hook for fetching intent details by intent hash from the backend API.
545
+ *
546
+ * This hook provides access to intent data using the intent hash directly,
547
+ * including intent details, events, and transaction information. The data is automatically
548
+ * fetched and cached using React Query.
549
+ *
550
+ * @param {string | undefined} intentHash - The intent hash to fetch intent for. If undefined, the query will be disabled.
551
+ *
552
+ * @returns {UseQueryResult<IntentResponse | undefined>} A query result object containing:
553
+ * - data: The intent response data when available
554
+ * - isLoading: Boolean indicating if the request is in progress
555
+ * - error: Error object if the request failed
556
+ * - refetch: Function to manually trigger a data refresh
557
+ *
558
+ * @example
559
+ * ```typescript
560
+ * const { data: intent, isLoading, error } = useIntentByHash('0xabc...');
561
+ *
562
+ * if (isLoading) return <div>Loading intent...</div>;
563
+ * if (error) return <div>Error: {error.message}</div>;
564
+ * if (intent) {
565
+ * console.log('Intent found:', intent.intentHash);
566
+ * console.log('Open status:', intent.open);
567
+ * }
568
+ * ```
569
+ *
570
+ * @remarks
571
+ * - The query is disabled when intentHash is undefined or empty
572
+ * - Uses React Query for efficient caching and state management
573
+ * - Automatically handles error states and loading indicators
574
+ */
575
+ declare const useBackendIntentByHash: (intentHash: string | undefined) => UseQueryResult<IntentResponse | undefined>;
576
+
577
+ /**
578
+ * Hook for fetching the solver orderbook from the backend API.
579
+ *
580
+ * This hook provides access to the solver orderbook data, including intent states
581
+ * and intent data for all available intents. The data is automatically fetched
582
+ * and cached using React Query with pagination support.
583
+ *
584
+ * @param {Object} params - Pagination parameters for the orderbook
585
+ * @param {string} params.offset - The offset for pagination (number as string)
586
+ * @param {string} params.limit - The limit for pagination (number as string)
587
+ *
588
+ * @returns {UseQueryResult<OrderbookResponse | undefined>} A query result object containing:
589
+ * - data: The orderbook response data when available
590
+ * - isLoading: Boolean indicating if the request is in progress
591
+ * - error: Error object if the request failed
592
+ * - refetch: Function to manually trigger a data refresh
593
+ *
594
+ * @example
595
+ * ```typescript
596
+ * const { data: orderbook, isLoading, error } = useOrderbook({
597
+ * offset: '0',
598
+ * limit: '10'
599
+ * });
600
+ *
601
+ * if (isLoading) return <div>Loading orderbook...</div>;
602
+ * if (error) return <div>Error: {error.message}</div>;
603
+ * if (orderbook) {
604
+ * console.log('Total intents:', orderbook.total);
605
+ * console.log('Intents:', orderbook.data);
606
+ * }
607
+ * ```
608
+ *
609
+ * @remarks
610
+ * - The query is disabled when params are undefined or invalid
611
+ * - Uses React Query for efficient caching and state management
612
+ * - Automatically handles error states and loading indicators
613
+ * - Stale time of 30 seconds for real-time orderbook data
614
+ * - Supports pagination through offset and limit parameters
615
+ */
616
+ declare const useBackendOrderbook: (params: {
617
+ offset: string;
618
+ limit: string;
619
+ } | undefined) => UseQueryResult<OrderbookResponse | undefined>;
620
+
621
+ /**
622
+ * Hook for fetching money market position for a specific user from the backend API.
623
+ *
624
+ * This hook provides access to a user's money market positions, including their
625
+ * aToken balances, variable debt token balances, and associated reserve information.
626
+ * The data is automatically fetched and cached using React Query.
627
+ *
628
+ * @param {string | undefined} userAddress - The user's wallet address. If undefined, the query will be disabled.
629
+ *
630
+ * @returns {UseQueryResult<MoneyMarketPosition | undefined>} A query result object containing:
631
+ * - data: The money market position data when available
632
+ * - isLoading: Boolean indicating if the request is in progress
633
+ * - error: Error object if the request failed
634
+ * - refetch: Function to manually trigger a data refresh
635
+ *
636
+ * @example
637
+ * ```typescript
638
+ * const { data: position, isLoading, error } = useMoneyMarketPosition('0x123...');
639
+ *
640
+ * if (isLoading) return <div>Loading position...</div>;
641
+ * if (error) return <div>Error: {error.message}</div>;
642
+ * if (position) {
643
+ * console.log('User address:', position.userAddress);
644
+ * console.log('Positions:', position.positions);
645
+ * }
646
+ * ```
647
+ *
648
+ * @remarks
649
+ * - The query is disabled when userAddress is undefined or empty
650
+ * - Uses React Query for efficient caching and state management
651
+ * - Automatically handles error states and loading indicators
652
+ * - Includes user's aToken and debt token balances across all reserves
653
+ */
654
+ declare const useBackendMoneyMarketPosition: (userAddress: string | undefined) => UseQueryResult<MoneyMarketPosition | undefined>;
655
+
656
+ /**
657
+ * Hook for fetching all money market assets from the backend API.
658
+ *
659
+ * This hook provides access to all available money market assets, including
660
+ * their reserve information, liquidity rates, borrow rates, and market statistics.
661
+ * The data is automatically fetched and cached using React Query.
662
+ *
663
+ * @returns {UseQueryResult<MoneyMarketAsset[]>} A query result object containing:
664
+ * - data: Array of money market asset data when available
665
+ * - isLoading: Boolean indicating if the request is in progress
666
+ * - error: Error object if the request failed
667
+ * - refetch: Function to manually trigger a data refresh
668
+ *
669
+ * @example
670
+ * ```typescript
671
+ * const { data: assets, isLoading, error } = useAllMoneyMarketAssets();
672
+ *
673
+ * if (isLoading) return <div>Loading assets...</div>;
674
+ * if (error) return <div>Error: {error.message}</div>;
675
+ * if (assets) {
676
+ * console.log('Total assets:', assets.length);
677
+ * assets.forEach(asset => {
678
+ * console.log(`${asset.symbol}: ${asset.liquidityRate} liquidity rate`);
679
+ * });
680
+ * }
681
+ * ```
682
+ *
683
+ * @remarks
684
+ * - Uses React Query for efficient caching and state management
685
+ * - Automatically handles error states and loading indicators
686
+ * - Returns comprehensive asset information including rates and statistics
687
+ * - No parameters required - fetches all available assets
688
+ */
689
+ declare const useBackendAllMoneyMarketAssets: () => UseQueryResult<MoneyMarketAsset[]>;
690
+
691
+ /**
692
+ * Hook for fetching specific money market asset details from the backend API.
693
+ *
694
+ * This hook provides access to detailed information for a specific money market asset,
695
+ * including reserve information, liquidity rates, borrow rates, and market statistics.
696
+ * The data is automatically fetched and cached using React Query.
697
+ *
698
+ * @param {string | undefined} reserveAddress - The reserve contract address. If undefined, the query will be disabled.
699
+ *
700
+ * @returns {UseQueryResult<MoneyMarketAsset | undefined>} A query result object containing:
701
+ * - data: The money market asset data when available
702
+ * - isLoading: Boolean indicating if the request is in progress
703
+ * - error: Error object if the request failed
704
+ * - refetch: Function to manually trigger a data refresh
705
+ *
706
+ * @example
707
+ * ```typescript
708
+ * const { data: asset, isLoading, error } = useMoneyMarketAsset('0xabc...');
709
+ *
710
+ * if (isLoading) return <div>Loading asset...</div>;
711
+ * if (error) return <div>Error: {error.message}</div>;
712
+ * if (asset) {
713
+ * console.log('Asset symbol:', asset.symbol);
714
+ * console.log('Liquidity rate:', asset.liquidityRate);
715
+ * console.log('Variable borrow rate:', asset.variableBorrowRate);
716
+ * }
717
+ * ```
718
+ *
719
+ * @remarks
720
+ * - The query is disabled when reserveAddress is undefined or empty
721
+ * - Uses React Query for efficient caching and state management
722
+ * - Automatically handles error states and loading indicators
723
+ * - Returns comprehensive asset information for the specified reserve
724
+ */
725
+ declare const useBackendMoneyMarketAsset: (reserveAddress: string | undefined) => UseQueryResult<MoneyMarketAsset | undefined>;
726
+
727
+ /**
728
+ * Hook for fetching borrowers for a specific money market asset from the backend API.
729
+ *
730
+ * This hook provides access to the list of borrowers for a specific money market asset,
731
+ * with pagination support. The data is automatically fetched and cached using React Query.
732
+ *
733
+ * @param {Object} params - Parameters for fetching asset borrowers
734
+ * @param {string | undefined} params.reserveAddress - The reserve contract address. If undefined, the query will be disabled.
735
+ * @param {string} params.offset - The offset for pagination (number as string)
736
+ * @param {string} params.limit - The limit for pagination (number as string)
737
+ *
738
+ * @returns {UseQueryResult<MoneyMarketAssetBorrowers | undefined>} A query result object containing:
739
+ * - data: The asset borrowers data when available
740
+ * - isLoading: Boolean indicating if the request is in progress
741
+ * - error: Error object if the request failed
742
+ * - refetch: Function to manually trigger a data refresh
743
+ *
744
+ * @example
745
+ * ```typescript
746
+ * const { data: borrowers, isLoading, error } = useMoneyMarketAssetBorrowers({
747
+ * reserveAddress: '0xabc...',
748
+ * offset: '0',
749
+ * limit: '20'
750
+ * });
751
+ *
752
+ * if (isLoading) return <div>Loading borrowers...</div>;
753
+ * if (error) return <div>Error: {error.message}</div>;
754
+ * if (borrowers) {
755
+ * console.log('Total borrowers:', borrowers.total);
756
+ * console.log('Borrowers:', borrowers.borrowers);
757
+ * }
758
+ * ```
759
+ *
760
+ * @remarks
761
+ * - The query is disabled when reserveAddress is undefined or empty
762
+ * - Uses React Query for efficient caching and state management
763
+ * - Automatically handles error states and loading indicators
764
+ * - Supports pagination through offset and limit parameters
765
+ */
766
+ declare const useBackendMoneyMarketAssetBorrowers: (params: {
767
+ reserveAddress: string | undefined;
768
+ offset: string;
769
+ limit: string;
770
+ }) => UseQueryResult<MoneyMarketAssetBorrowers | undefined>;
771
+
772
+ /**
773
+ * Hook for fetching suppliers for a specific money market asset from the backend API.
774
+ *
775
+ * This hook provides access to the list of suppliers for a specific money market asset,
776
+ * with pagination support. The data is automatically fetched and cached using React Query.
777
+ *
778
+ * @param {Object} params - Parameters for fetching asset suppliers
779
+ * @param {string | undefined} params.reserveAddress - The reserve contract address. If undefined, the query will be disabled.
780
+ * @param {string} params.offset - The offset for pagination (number as string)
781
+ * @param {string} params.limit - The limit for pagination (number as string)
782
+ *
783
+ * @returns {UseQueryResult<MoneyMarketAssetSuppliers | undefined>} A query result object containing:
784
+ * - data: The asset suppliers data when available
785
+ * - isLoading: Boolean indicating if the request is in progress
786
+ * - error: Error object if the request failed
787
+ * - refetch: Function to manually trigger a data refresh
788
+ *
789
+ * @example
790
+ * ```typescript
791
+ * const { data: suppliers, isLoading, error } = useMoneyMarketAssetSuppliers({
792
+ * reserveAddress: '0xabc...',
793
+ * offset: '0',
794
+ * limit: '20'
795
+ * });
796
+ *
797
+ * if (isLoading) return <div>Loading suppliers...</div>;
798
+ * if (error) return <div>Error: {error.message}</div>;
799
+ * if (suppliers) {
800
+ * console.log('Total suppliers:', suppliers.total);
801
+ * console.log('Suppliers:', suppliers.suppliers);
802
+ * }
803
+ * ```
804
+ *
805
+ * @remarks
806
+ * - The query is disabled when reserveAddress is undefined or empty
807
+ * - Uses React Query for efficient caching and state management
808
+ * - Automatically handles error states and loading indicators
809
+ * - Supports pagination through offset and limit parameters
810
+ */
811
+ declare const useBackendMoneyMarketAssetSuppliers: (params: {
812
+ reserveAddress: string | undefined;
813
+ offset: string;
814
+ limit: string;
815
+ }) => UseQueryResult<MoneyMarketAssetSuppliers | undefined>;
816
+
817
+ /**
818
+ * Hook for fetching all money market borrowers from the backend API.
819
+ *
820
+ * This hook provides access to the list of all borrowers across all money market assets,
821
+ * with pagination support. The data is automatically fetched and cached using React Query.
822
+ *
823
+ * @param {Object} params - Pagination parameters for fetching all borrowers
824
+ * @param {string} params.offset - The offset for pagination (number as string)
825
+ * @param {string} params.limit - The limit for pagination (number as string)
826
+ *
827
+ * @returns {UseQueryResult<MoneyMarketBorrowers | undefined>} A query result object containing:
828
+ * - data: The all borrowers data when available
829
+ * - isLoading: Boolean indicating if the request is in progress
830
+ * - error: Error object if the request failed
831
+ * - refetch: Function to manually trigger a data refresh
832
+ *
833
+ * @example
834
+ * ```typescript
835
+ * const { data: borrowers, isLoading, error } = useAllMoneyMarketBorrowers({
836
+ * offset: '0',
837
+ * limit: '50'
838
+ * });
839
+ *
840
+ * if (isLoading) return <div>Loading borrowers...</div>;
841
+ * if (error) return <div>Error: {error.message}</div>;
842
+ * if (borrowers) {
843
+ * console.log('Total borrowers:', borrowers.total);
844
+ * console.log('Borrowers:', borrowers.borrowers);
845
+ * }
846
+ * ```
847
+ *
848
+ * @remarks
849
+ * - The query is disabled when params are undefined or invalid
850
+ * - Uses React Query for efficient caching and state management
851
+ * - Automatically handles error states and loading indicators
852
+ * - Supports pagination through offset and limit parameters
853
+ * - Returns borrowers across all money market assets
854
+ */
855
+ declare const useBackendAllMoneyMarketBorrowers: (params: {
856
+ offset: string;
857
+ limit: string;
858
+ } | undefined) => UseQueryResult<MoneyMarketBorrowers | undefined>;
859
+
860
+ /**
861
+ * Hook for checking token allowance for bridge operations.
862
+ *
863
+ * This hook verifies if the user has approved enough tokens for a specific bridge action.
864
+ * It automatically queries and tracks the allowance status.
865
+ *
866
+ * @param {BridgeParams} params - The parameters for the bridge to check allowance for.
867
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for allowance checks
868
+ *
869
+ * @returns {UseQueryResult<boolean, Error>} A React Query result containing:
870
+ * - data: Boolean indicating if allowance is sufficient
871
+ * - isLoading: Loading state indicator
872
+ * - error: Any error that occurred during the check
873
+ *
874
+ * @example
875
+ * ```typescript
876
+ * const { data: hasAllowed, isLoading } = useBridgeAllowance(params, spokeProvider);
877
+ * ```
878
+ */
879
+ declare function useBridgeAllowance(params: CreateBridgeIntentParams | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
880
+
881
+ interface UseBridgeApproveReturn {
882
+ approve: (params: CreateBridgeIntentParams) => Promise<boolean>;
883
+ isLoading: boolean;
884
+ error: Error | null;
885
+ resetError: () => void;
886
+ }
887
+ /**
888
+ * Hook for approving token spending for bridge actions
889
+ * @param spokeProvider The spoke provider instance for the chain
890
+ * @returns Object containing approve function, loading state, error state and reset function
891
+ * @example
892
+ * ```tsx
893
+ * const { approve, isLoading, error } = useBridgeApprove(spokeProvider);
894
+ *
895
+ * // Approve tokens for bridge action
896
+ * await approve({
897
+ * srcChainId: '0x2105.base',
898
+ * srcAsset: '0x...',
899
+ * amount: 1000n,
900
+ * dstChainId: '0x89.polygon',
901
+ * dstAsset: '0x...',
902
+ * recipient: '0x...'
903
+ * });
904
+ * ```
905
+ */
906
+ declare function useBridgeApprove(spokeProvider: SpokeProvider | undefined): UseBridgeApproveReturn;
907
+
908
+ /**
909
+ * Hook for executing bridge transactions to transfer tokens between chains.
910
+ * Uses React Query's useMutation for better state management and caching.
911
+ *
912
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for the bridge
913
+ * @returns {UseMutationResult} Mutation result object containing mutation function and state
914
+ *
915
+ * @example
916
+ * ```typescript
917
+ * const { mutateAsync: bridge, isPending } = useBridge(spokeProvider);
918
+ *
919
+ * const handleBridge = async () => {
920
+ * const result = await bridge({
921
+ * srcChainId: '0x2105.base',
922
+ * srcAsset: '0x...',
923
+ * amount: 1000n,
924
+ * dstChainId: '0x89.polygon',
925
+ * dstAsset: '0x...',
926
+ * recipient: '0x...'
927
+ * });
928
+ *
929
+ * console.log('Bridge transaction hashes:', {
930
+ * spokeTxHash: result.spokeTxHash,
931
+ * hubTxHash: result.hubTxHash
932
+ * });
933
+ * };
934
+ * ```
935
+ */
936
+ declare function useBridge(spokeProvider: SpokeProvider | undefined): UseMutationResult<Result<[SpokeTxHash, HubTxHash], BridgeError<BridgeErrorCode>>, Error, CreateBridgeIntentParams>;
937
+
938
+ /**
939
+ * Hook for getting the amount available to be bridged.
940
+ *
941
+ * This hook is used to check if a target chain has enough balance to bridge when bridging.
942
+ * It automatically queries and tracks the available amount to be bridged.
943
+ *
944
+ * @param {SpokeChainId | undefined} chainId - The chain ID to get the balance for
945
+ * @param {string | undefined} token - The token address to get the balance for
946
+ *
947
+ * @returns {UseQueryResult<bigint, Error>} A React Query result containing:
948
+ * - data: The available amount to be bridged (bigint)
949
+ * - error: Any error that occurred during the check
950
+ *
951
+ * @example
952
+ * ```typescript
953
+ * const { data: balance, isLoading } = useSpokeAssetManagerTokenBalance(chainId, tokenAddress);
954
+ *
955
+ * if (balance) {
956
+ * console.log('Asset manager token balance:', balance.toString());
957
+ * }
958
+ * ```
959
+ */
960
+ declare function useGetBridgeableAmount(from: XToken$1 | undefined, to: XToken$1 | undefined): UseQueryResult<bigint, Error>;
961
+
962
+ /**
963
+ /**
964
+ * Hook for retrieving all bridgeable tokens from a source token on one chain to a destination chain.
965
+ *
966
+ * This hook queries and tracks the set of tokens on the destination chain that can be bridged to,
967
+ * given a source chain, destination chain, and source token address.
968
+ *
969
+ * @param {SpokeChainId | undefined} from - The source chain ID
970
+ * @param {SpokeChainId | undefined} to - The destination chain ID
971
+ * @param {string | undefined} token - The source token address
972
+ *
973
+ * @returns {UseQueryResult<XToken[], Error>} A React Query result containing:
974
+ * - data: Array of bridgeable tokens (XToken[]) on the destination chain
975
+ * - error: Any error that occurred during the query
976
+ *
977
+ *
978
+ * @example
979
+ * ```typescript
980
+ * const { data: bridgeableTokens, isLoading } = useGetBridgeableTokens(
981
+ * fromChainId,
982
+ * toChainId,
983
+ * fromTokenAddress
984
+ * );
985
+ *
986
+ * if (bridgeableTokens && bridgeableTokens.length > 0) {
987
+ * bridgeableTokens.forEach(token => {
988
+ * console.log(`Bridgeable token: ${token.symbol} (${token.address}) on chain ${token.xChainId}`);
989
+ * });
990
+ * } else {
991
+ * console.log('No bridgeable tokens found for the selected route.');
992
+ * }
993
+ * ```
994
+ */
995
+ declare function useGetBridgeableTokens(from: SpokeChainId | undefined, to: SpokeChainId | undefined, token: string | undefined): UseQueryResult<XToken$1[], Error>;
996
+
997
+ /**
998
+ * Hook for executing stake transactions to stake SODA tokens and receive xSODA shares.
999
+ * Uses React Query's useMutation for better state management and caching.
1000
+ *
1001
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the stake
1002
+ * @returns {UseMutationResult<[SpokeTxHash, HubTxHash], Error, StakeParams>} Mutation result object containing mutation function and state
1003
+ *
1004
+ * @example
1005
+ * ```typescript
1006
+ * const { mutateAsync: stake, isPending } = useStake(spokeProvider);
1007
+ *
1008
+ * const handleStake = async () => {
1009
+ * const result = await stake({
1010
+ * amount: 1000000000000000000n, // 1 SODA
1011
+ * account: '0x...'
1012
+ * });
1013
+ *
1014
+ * console.log('Stake successful:', result);
1015
+ * };
1016
+ * ```
1017
+ */
1018
+ declare function useStake(spokeProvider: SpokeProvider | undefined): UseMutationResult<[SpokeTxHash, HubTxHash], Error, StakeParams>;
1019
+
1020
+ /**
1021
+ * Hook for approving SODA token spending for staking operations.
1022
+ * Uses React Query's useMutation for better state management and caching.
1023
+ *
1024
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the approval
1025
+ * @returns {UseMutationResult<TxReturnType<SpokeProvider, false>, Error, Omit<StakeParams, 'action'>>} Mutation result object containing mutation function and state
1026
+ *
1027
+ * @example
1028
+ * ```typescript
1029
+ * const { mutateAsync: approve, isPending } = useStakeApprove(spokeProvider);
1030
+ *
1031
+ * const handleApprove = async () => {
1032
+ * const result = await approve({
1033
+ * amount: 1000000000000000000n, // 1 SODA
1034
+ * account: '0x...'
1035
+ * });
1036
+ *
1037
+ * console.log('Approval successful:', result);
1038
+ * };
1039
+ * ```
1040
+ */
1041
+ declare function useStakeApprove(spokeProvider: SpokeProvider | undefined): UseMutationResult<TxReturnType<SpokeProvider, false>, Error, Omit<StakeParams, 'action'>>;
1042
+
1043
+ /**
1044
+ * Hook for checking SODA token allowance for staking operations.
1045
+ * Uses React Query for efficient caching and state management.
1046
+ *
1047
+ * @param {Omit<StakeParams, 'action'> | undefined} params - The staking parameters. If undefined, the query will be disabled.
1048
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the allowance check
1049
+ * @returns {UseQueryResult<boolean, Error>} Query result object containing allowance data and state
1050
+ *
1051
+ * @example
1052
+ * ```typescript
1053
+ * const { data: hasAllowed, isLoading } = useStakeAllowance(
1054
+ * {
1055
+ * amount: 1000000000000000000n, // 1 SODA
1056
+ * account: '0x...'
1057
+ * },
1058
+ * spokeProvider
1059
+ * );
1060
+ *
1061
+ * if (isLoading) return <div>Checking allowance...</div>;
1062
+ * if (hasAllowed) {
1063
+ * console.log('Sufficient allowance for staking');
1064
+ * }
1065
+ * ```
1066
+ */
1067
+ declare function useStakeAllowance(params: Omit<StakeParams, 'action'> | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
1068
+
1069
+ /**
1070
+ * Hook for executing unstake transactions to unstake xSODA shares.
1071
+ * Uses React Query's useMutation for better state management and caching.
1072
+ *
1073
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the unstake
1074
+ * @returns {UseMutationResult<[SpokeTxHash, HubTxHash], Error, Omit<UnstakeParams, 'action'>>} Mutation result object containing mutation function and state
1075
+ *
1076
+ * @example
1077
+ * ```typescript
1078
+ * const { mutateAsync: unstake, isPending } = useUnstake(spokeProvider);
1079
+ *
1080
+ * const handleUnstake = async () => {
1081
+ * const result = await unstake({
1082
+ * amount: 1000000000000000000n, // 1 xSODA
1083
+ * account: '0x...'
1084
+ * });
1085
+ *
1086
+ * console.log('Unstake successful:', result);
1087
+ * };
1088
+ * ```
1089
+ */
1090
+ declare function useUnstake(spokeProvider: SpokeProvider | undefined): UseMutationResult<[SpokeTxHash, HubTxHash], Error, Omit<UnstakeParams, 'action'>>;
1091
+
1092
+ /**
1093
+ * Hook for executing claim transactions to claim unstaked SODA tokens after the unstaking period.
1094
+ * Uses React Query's useMutation for better state management and caching.
1095
+ *
1096
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the claim
1097
+ * @returns {UseMutationResult<[SpokeTxHash, HubTxHash], Error, Omit<ClaimParams, 'action'>>} Mutation result object containing mutation function and state
1098
+ *
1099
+ * @example
1100
+ * ```typescript
1101
+ * const { mutateAsync: claim, isPending } = useClaim(spokeProvider);
1102
+ *
1103
+ * const handleClaim = async () => {
1104
+ * const result = await claim({
1105
+ * requestId: 1n
1106
+ * });
1107
+ *
1108
+ * console.log('Claim successful:', result);
1109
+ * };
1110
+ * ```
1111
+ */
1112
+ declare function useClaim(spokeProvider: SpokeProvider | undefined): UseMutationResult<[SpokeTxHash, HubTxHash], Error, Omit<ClaimParams, 'action'>>;
1113
+
1114
+ /**
1115
+ * Hook for executing cancel unstake transactions to cancel pending unstake requests.
1116
+ * Uses React Query's useMutation for better state management and caching.
1117
+ *
1118
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the cancel unstake
1119
+ * @returns {UseMutationResult<[SpokeTxHash, HubTxHash], Error, Omit<CancelUnstakeParams, 'action'>>} Mutation result object containing mutation function and state
1120
+ *
1121
+ * @example
1122
+ * ```typescript
1123
+ * const { mutateAsync: cancelUnstake, isPending } = useCancelUnstake(spokeProvider);
1124
+ *
1125
+ * const handleCancelUnstake = async () => {
1126
+ * const result = await cancelUnstake({
1127
+ * requestId: 1n
1128
+ * });
1129
+ *
1130
+ * console.log('Cancel unstake successful:', result);
1131
+ * };
1132
+ * ```
1133
+ */
1134
+ declare function useCancelUnstake(spokeProvider: SpokeProvider | undefined): UseMutationResult<[SpokeTxHash, HubTxHash], Error, Omit<CancelUnstakeParams, 'action'>>;
1135
+
1136
+ /**
1137
+ * Hook for fetching comprehensive staking information for a user.
1138
+ * Uses React Query for efficient caching and state management.
1139
+ *
1140
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the query
1141
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 5000)
1142
+ * @returns {UseQueryResult<StakingInfo, Error>} Query result object containing staking info and state
1143
+ *
1144
+ * @example
1145
+ * ```typescript
1146
+ * const { data: stakingInfo, isLoading, error } = useStakingInfo(spokeProvider);
1147
+ *
1148
+ * if (isLoading) return <div>Loading staking info...</div>;
1149
+ * if (stakingInfo) {
1150
+ * console.log('Total staked:', stakingInfo.totalStaked);
1151
+ * console.log('User staked:', stakingInfo.userStaked);
1152
+ * console.log('xSODA balance:', stakingInfo.userXSodaBalance);
1153
+ * }
1154
+ * ```
1155
+ */
1156
+ declare function useStakingInfo(spokeProvider: SpokeProvider | undefined, refetchInterval?: number): UseQueryResult<StakingInfo, Error>;
1157
+
1158
+ type UnstakingInfoWithPenalty = UnstakingInfo & {
1159
+ requestsWithPenalty: UnstakeRequestWithPenalty[];
1160
+ };
1161
+ /**
1162
+ * Hook for fetching unstaking information with penalty calculations from the stakedSoda contract.
1163
+ * Uses React Query for efficient caching and state management.
1164
+ *
1165
+ * @param {string | undefined} userAddress - The user address to fetch unstaking info for
1166
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider instance
1167
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 5000)
1168
+ * @returns {UseQueryResult<UnstakingInfoWithPenalty, Error>} Query result object containing unstaking info with penalties and state
1169
+ *
1170
+ * @example
1171
+ * ```typescript
1172
+ * const { data: unstakingInfo, isLoading, error } = useUnstakingInfoWithPenalty(userAddress, spokeProvider);
1173
+ *
1174
+ * if (isLoading) return <div>Loading unstaking info...</div>;
1175
+ * if (unstakingInfo) {
1176
+ * console.log('Total unstaking:', unstakingInfo.totalUnstaking);
1177
+ * unstakingInfo.requestsWithPenalty.forEach(request => {
1178
+ * console.log('Penalty:', request.penaltyPercentage + '%');
1179
+ * console.log('Claimable amount:', request.claimableAmount);
1180
+ * });
1181
+ * }
1182
+ * ```
1183
+ */
1184
+ declare function useUnstakingInfoWithPenalty(userAddress: string | undefined, spokeProvider: SpokeProvider | undefined, refetchInterval?: number): UseQueryResult<UnstakingInfoWithPenalty, Error>;
1185
+
1186
+ /**
1187
+ * Hook for fetching staking configuration from the stakedSoda contract.
1188
+ * Uses React Query for efficient caching and state management.
1189
+ *
1190
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 30000)
1191
+ * @returns {UseQueryResult<StakingConfig, Error>} Query result object containing staking config and state
1192
+ *
1193
+ * @example
1194
+ * ```typescript
1195
+ * const { data: stakingConfig, isLoading, error } = useStakingConfig();
1196
+ *
1197
+ * if (isLoading) return <div>Loading staking config...</div>;
1198
+ * if (stakingConfig) {
1199
+ * console.log('Unstaking period (days):', stakingConfig.unstakingPeriod / 86400n);
1200
+ * console.log('Max penalty (%):', stakingConfig.maxPenalty);
1201
+ * }
1202
+ * ```
1203
+ */
1204
+ declare function useStakingConfig(refetchInterval?: number): UseQueryResult<StakingConfig, Error>;
1205
+
1206
+ /**
1207
+ * Hook for fetching stake ratio estimates (xSoda amount and preview deposit).
1208
+ * Uses React Query for efficient caching and state management.
1209
+ *
1210
+ * @param {bigint | undefined} amount - The amount of SODA to estimate stake for
1211
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 10000)
1212
+ * @returns {UseQueryResult<[bigint, bigint], Error>} Query result object containing stake ratio estimates and state
1213
+ *
1214
+ * @example
1215
+ * ```typescript
1216
+ * const { data: stakeRatio, isLoading, error } = useStakeRatio(1000000000000000000n); // 1 SODA
1217
+ *
1218
+ * if (isLoading) return <div>Loading stake ratio...</div>;
1219
+ * if (stakeRatio) {
1220
+ * const [xSodaAmount, previewDepositAmount] = stakeRatio;
1221
+ * console.log('xSoda amount:', xSodaAmount);
1222
+ * console.log('Preview deposit:', previewDepositAmount);
1223
+ * }
1224
+ * ```
1225
+ */
1226
+ declare function useStakeRatio(amount: bigint | undefined, refetchInterval?: number): UseQueryResult<[bigint, bigint], Error>;
1227
+
1228
+ /**
1229
+ * Hook for fetching instant unstake ratio estimates.
1230
+ * Uses React Query for efficient caching and state management.
1231
+ *
1232
+ * @param {bigint | undefined} amount - The amount of xSoda to estimate instant unstake for
1233
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 10000)
1234
+ * @returns {UseQueryResult<bigint, Error>} Query result object containing instant unstake ratio and state
1235
+ *
1236
+ * @example
1237
+ * ```typescript
1238
+ * const { data: instantUnstakeRatio, isLoading, error } = useInstantUnstakeRatio(1000000000000000000n); // 1 xSoda
1239
+ *
1240
+ * if (isLoading) return <div>Loading instant unstake ratio...</div>;
1241
+ * if (instantUnstakeRatio) {
1242
+ * console.log('Instant unstake ratio:', instantUnstakeRatio);
1243
+ * }
1244
+ * ```
1245
+ */
1246
+ declare function useInstantUnstakeRatio(amount: bigint | undefined, refetchInterval?: number): UseQueryResult<bigint, Error>;
1247
+
1248
+ /**
1249
+ * Hook for fetching converted assets amount for xSODA shares.
1250
+ * Uses React Query for efficient caching and state management.
1251
+ *
1252
+ * @param {bigint | undefined} amount - The amount of xSODA shares to convert
1253
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 10000)
1254
+ * @returns {UseQueryResult<bigint, Error>} Query result object containing converted assets amount and state
1255
+ *
1256
+ * @example
1257
+ * ```typescript
1258
+ * const { data: convertedAssets, isLoading, error } = useConvertedAssets(1000000000000000000n); // 1 xSODA
1259
+ *
1260
+ * if (isLoading) return <div>Loading converted assets...</div>;
1261
+ * if (convertedAssets) {
1262
+ * console.log('Converted assets:', convertedAssets);
1263
+ * }
1264
+ * ```
1265
+ */
1266
+ declare function useConvertedAssets(amount: bigint | undefined, refetchInterval?: number): UseQueryResult<bigint, Error>;
1267
+
1268
+ /**
1269
+ * Hook for executing instant unstake operations.
1270
+ * Uses React Query for efficient state management and error handling.
1271
+ *
1272
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider for the transaction
1273
+ * @returns {UseMutationResult<[string, string], Error, Omit<InstantUnstakeParams, 'action'>>} Mutation result object containing instant unstake state and methods
1274
+ *
1275
+ * @example
1276
+ * ```typescript
1277
+ * const { mutateAsync: instantUnstake, isPending } = useInstantUnstake(spokeProvider);
1278
+ *
1279
+ * const handleInstantUnstake = async () => {
1280
+ * const result = await instantUnstake({
1281
+ * amount: 1000000000000000000n,
1282
+ * minAmount: 950000000000000000n,
1283
+ * account: '0x...'
1284
+ * });
1285
+ * console.log('Instant unstake successful:', result);
1286
+ * };
1287
+ * ```
1288
+ */
1289
+ declare function useInstantUnstake(spokeProvider: SpokeProvider | undefined): UseMutationResult<[string, string], Error, Omit<InstantUnstakeParams, 'action'>>;
1290
+
1291
+ /**
1292
+ * Hook for checking xSODA token allowance for unstaking operations.
1293
+ * Uses React Query for efficient caching and state management.
1294
+ *
1295
+ * @param {Omit<UnstakeParams, 'action'> | undefined} params - The unstaking parameters. If undefined, the query will be disabled.
1296
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the allowance check
1297
+ * @returns {UseQueryResult<boolean, Error>} Query result object containing allowance data and state
1298
+ *
1299
+ * @example
1300
+ * ```typescript
1301
+ * const { data: hasAllowed, isLoading } = useUnstakeAllowance(
1302
+ * {
1303
+ * amount: 1000000000000000000n, // 1 xSODA
1304
+ * account: '0x...'
1305
+ * },
1306
+ * spokeProvider
1307
+ * );
1308
+ *
1309
+ * if (isLoading) return <div>Checking allowance...</div>;
1310
+ * if (hasAllowed) {
1311
+ * console.log('Sufficient allowance for unstaking');
1312
+ * }
1313
+ * ```
1314
+ */
1315
+ declare function useUnstakeAllowance(params: Omit<UnstakeParams, 'action'> | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
1316
+
1317
+ /**
1318
+ * Hook for approving xSODA token spending for unstaking operations.
1319
+ * Uses React Query's useMutation for better state management and caching.
1320
+ *
1321
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the approval
1322
+ * @returns {UseMutationResult<TxReturnType<SpokeProvider, false>, Error, Omit<UnstakeParams, 'action'>>} Mutation result object containing mutation function and state
1323
+ *
1324
+ * @example
1325
+ * ```typescript
1326
+ * const { mutateAsync: approve, isPending } = useUnstakeApprove(spokeProvider);
1327
+ *
1328
+ * const handleApprove = async () => {
1329
+ * const result = await approve({
1330
+ * amount: 1000000000000000000n, // 1 xSODA
1331
+ * account: '0x...'
1332
+ * });
1333
+ *
1334
+ * console.log('Approval successful:', result);
1335
+ * };
1336
+ * ```
1337
+ */
1338
+ declare function useUnstakeApprove(spokeProvider: SpokeProvider | undefined): UseMutationResult<TxReturnType<SpokeProvider, false>, Error, Omit<UnstakeParams, 'action'>>;
1339
+
1340
+ /**
1341
+ * Hook for fetching unstaking information from the stakedSoda contract.
1342
+ * Uses React Query for efficient caching and state management.
1343
+ *
1344
+ * @param {string | undefined} userAddress - The user address to fetch unstaking info for
1345
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider instance
1346
+ * @param {number} refetchInterval - The interval in milliseconds to refetch data (default: 5000)
1347
+ * @returns {UseQueryResult<UnstakingInfo, Error>} Query result object containing unstaking info and state
1348
+ *
1349
+ * @example
1350
+ * ```typescript
1351
+ * const { data: unstakingInfo, isLoading, error } = useUnstakingInfo(userAddress, spokeProvider);
1352
+ *
1353
+ * if (isLoading) return <div>Loading unstaking info...</div>;
1354
+ * if (unstakingInfo) {
1355
+ * console.log('Total unstaking:', unstakingInfo.totalUnstaking);
1356
+ * unstakingInfo.userUnstakeSodaRequests.forEach(request => {
1357
+ * console.log('Request amount:', request.request.amount);
1358
+ * });
1359
+ * }
1360
+ * ```
1361
+ */
1362
+ declare function useUnstakingInfo(userAddress: string | undefined, spokeProvider: SpokeProvider | undefined, refetchInterval?: number): UseQueryResult<UnstakingInfo, Error>;
1363
+
1364
+ /**
1365
+ * Hook for approving xSODA token spending for instant unstaking operations.
1366
+ * Uses React Query's useMutation for better state management and caching.
1367
+ *
1368
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the approval
1369
+ * @returns {UseMutationResult<TxReturnType<SpokeProvider, false>, Error, Omit<InstantUnstakeParams, 'action'>>} Mutation result object containing mutation function and state
1370
+ *
1371
+ * @example
1372
+ * ```typescript
1373
+ * const { mutateAsync: approve, isPending } = useInstantUnstakeApprove(spokeProvider);
1374
+ *
1375
+ * const handleApprove = async () => {
1376
+ * const result = await approve({
1377
+ * amount: 1000000000000000000n, // 1 xSODA
1378
+ * minAmount: 950000000000000000n, // 0.95 SODA
1379
+ * account: '0x...'
1380
+ * });
1381
+ *
1382
+ * console.log('Approval successful:', result);
1383
+ * };
1384
+ * ```
1385
+ */
1386
+ declare function useInstantUnstakeApprove(spokeProvider: SpokeProvider | undefined): UseMutationResult<TxReturnType<SpokeProvider, false>, Error, Omit<InstantUnstakeParams, 'action'>>;
1387
+
1388
+ /**
1389
+ * Hook for checking xSODA token allowance for instant unstaking operations.
1390
+ * Uses React Query for efficient caching and state management.
1391
+ *
1392
+ * @param {Omit<InstantUnstakeParams, 'action'> | undefined} params - The instant unstaking parameters. If undefined, the query will be disabled.
1393
+ * @param {SpokeProvider | undefined} spokeProvider - The spoke provider to use for the allowance check
1394
+ * @returns {UseQueryResult<boolean, Error>} Query result object containing allowance data and state
1395
+ *
1396
+ * @example
1397
+ * ```typescript
1398
+ * const { data: hasAllowed, isLoading } = useInstantUnstakeAllowance(
1399
+ * {
1400
+ * amount: 1000000000000000000n, // 1 xSODA
1401
+ * minAmount: 950000000000000000n, // 0.95 SODA
1402
+ * account: '0x...'
1403
+ * },
1404
+ * spokeProvider
1405
+ * );
1406
+ *
1407
+ * if (isLoading) return <div>Checking allowance...</div>;
1408
+ * if (hasAllowed) {
1409
+ * console.log('Sufficient allowance for instant unstaking');
1410
+ * }
1411
+ * ```
1412
+ */
1413
+ declare function useInstantUnstakeAllowance(params: Omit<InstantUnstakeParams, 'action'> | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
1414
+
1415
+ interface SodaxProviderProps {
1416
+ children: ReactNode;
1417
+ testnet?: boolean;
1418
+ config?: SodaxConfig;
1419
+ rpcConfig: RpcConfig;
1420
+ }
1421
+ declare const SodaxProvider: ({ children, testnet, config, rpcConfig }: SodaxProviderProps) => ReactElement;
1422
+
1423
+ declare const getSpokeTokenAddressByVault: (spokeChainId: ChainId, vault: string) => string | undefined;
1424
+
1425
+ export { SodaxProvider, getSpokeTokenAddressByVault, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBorrow, useBridge, useBridgeAllowance, useBridgeApprove, useCancelSwap, useCancelUnstake, useClaim, useConvertedAssets, useDeriveUserWalletAddress, useEstimateGas, useGetBridgeableAmount, useGetBridgeableTokens, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useMMAllowance, useMMApprove, useQuote, useRepay, useRequestTrustline, useReservesData, useSodaxContext, useSpokeProvider, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarTrustlineCheck, useSupply, useSwap, useSwapAllowance, useSwapApprove, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserReservesData, useWithdraw };