@sodax/dapp-kit 1.0.1-beta-rc3 → 1.0.2-beta

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 (40) hide show
  1. package/README.md +130 -39
  2. package/dist/index.d.mts +541 -347
  3. package/dist/index.d.ts +541 -347
  4. package/dist/index.js +317 -176
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +315 -178
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +4 -4
  9. package/src/hooks/backend/README.md +148 -49
  10. package/src/hooks/backend/index.ts +2 -0
  11. package/src/hooks/backend/types.ts +4 -0
  12. package/src/hooks/backend/useBackendAllMoneyMarketAssets.ts +31 -20
  13. package/src/hooks/backend/useBackendAllMoneyMarketBorrowers.ts +25 -7
  14. package/src/hooks/backend/useBackendIntentByHash.ts +36 -26
  15. package/src/hooks/backend/useBackendIntentByTxHash.ts +41 -29
  16. package/src/hooks/backend/useBackendMoneyMarketAsset.ts +40 -27
  17. package/src/hooks/backend/useBackendMoneyMarketAssetBorrowers.ts +45 -36
  18. package/src/hooks/backend/useBackendMoneyMarketAssetSuppliers.ts +45 -36
  19. package/src/hooks/backend/useBackendMoneyMarketPosition.ts +34 -37
  20. package/src/hooks/backend/useBackendOrderbook.ts +38 -38
  21. package/src/hooks/backend/useBackendUserIntents.ts +81 -0
  22. package/src/hooks/mm/index.ts +1 -0
  23. package/src/hooks/mm/useAToken.ts +37 -20
  24. package/src/hooks/mm/useBorrow.ts +36 -36
  25. package/src/hooks/mm/useMMAllowance.ts +33 -24
  26. package/src/hooks/mm/useMMApprove.ts +43 -48
  27. package/src/hooks/mm/useRepay.ts +32 -36
  28. package/src/hooks/mm/useReservesData.ts +35 -16
  29. package/src/hooks/mm/useReservesHumanized.ts +15 -3
  30. package/src/hooks/mm/useReservesList.ts +28 -15
  31. package/src/hooks/mm/useReservesUsdFormat.ts +30 -21
  32. package/src/hooks/mm/useSupply.ts +34 -36
  33. package/src/hooks/mm/useUserFormattedSummary.ts +42 -20
  34. package/src/hooks/mm/useUserReservesData.ts +34 -19
  35. package/src/hooks/mm/useWithdraw.ts +33 -35
  36. package/src/hooks/swap/index.ts +2 -0
  37. package/src/hooks/swap/useCancelLimitOrder.ts +53 -0
  38. package/src/hooks/swap/useCreateLimitOrder.ts +72 -0
  39. package/src/hooks/swap/useSwapAllowance.ts +7 -7
  40. package/src/hooks/swap/useSwapApprove.ts +6 -6
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- import * as _sodax_sdk from '@sodax/sdk';
2
- import { Sodax, SpokeProvider, GetEstimateGasReturnType, TxReturnType, SpokeChainId, StellarSpokeProvider, EvmHubProvider, IWalletProvider, UserReserveData, MoneyMarketAction, Address as Address$1, XToken as XToken$1, ReserveData, FormatReserveUSDResponse, SolverIntentQuoteRequest, Result, SolverIntentQuoteResponse, SolverErrorResponse, SolverExecutionResponse, Intent, IntentDeliveryInfo, IntentError, IntentErrorCode, CreateIntentParams, Hex, SolverIntentStatusResponse, IntentResponse, OrderbookResponse, MoneyMarketPosition, MoneyMarketAsset, MoneyMarketAssetBorrowers, MoneyMarketAssetSuppliers, MoneyMarketBorrowers, CreateBridgeIntentParams, SpokeTxHash, HubTxHash, BridgeError, BridgeErrorCode, StakeParams, UnstakeParams, ClaimParams, CancelUnstakeParams, StakingInfo, UnstakingInfo, UnstakeRequestWithPenalty, StakingConfig, InstantUnstakeParams, SodaxConfig } from '@sodax/sdk';
3
- import { RpcConfig, SpokeChainId as SpokeChainId$1, XToken } from '@sodax/types';
4
- import * as _tanstack_react_query from '@tanstack/react-query';
5
- import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
1
+ import { Sodax, SpokeProvider, GetEstimateGasReturnType, TxReturnType, SpokeChainId, StellarSpokeProvider, EvmHubProvider, IWalletProvider, MoneyMarketBorrowParams, MoneyMarketError, RelayErrorCode, MoneyMarketRepayParams, MoneyMarketSupplyParams, MoneyMarketWithdrawParams, UserReserveData, AggregatedReserveData, BaseCurrencyInfo, MoneyMarketParams, XToken, ReserveData, FormatReserveUSDResponse, FormatUserSummaryResponse, SolverIntentQuoteRequest, Result, SolverIntentQuoteResponse, SolverErrorResponse, SolverExecutionResponse, Intent, IntentDeliveryInfo, IntentError, IntentErrorCode, CreateIntentParams, Hex, SolverIntentStatusResponse, CreateLimitOrderParams, IntentResponse, Address as Address$1, UserIntentsResponse, OrderbookResponse, MoneyMarketPosition, MoneyMarketAsset, MoneyMarketAssetBorrowers, MoneyMarketAssetSuppliers, MoneyMarketBorrowers, CreateBridgeIntentParams, SpokeTxHash, HubTxHash, BridgeError, BridgeErrorCode, StakeParams, UnstakeParams, ClaimParams, CancelUnstakeParams, StakingInfo, UnstakingInfo, UnstakeRequestWithPenalty, StakingConfig, InstantUnstakeParams, SodaxConfig } from '@sodax/sdk';
2
+ import { RpcConfig, SpokeChainId as SpokeChainId$1, XToken as XToken$1 } from '@sodax/types';
3
+ import { UseMutationResult, UseQueryResult, UseQueryOptions } from '@tanstack/react-query';
6
4
  import { Address } from 'viem';
7
5
  import { ReactNode, ReactElement } from 'react';
8
6
 
@@ -156,160 +154,196 @@ interface BorrowResponse {
156
154
  ok: true;
157
155
  value: [string, string];
158
156
  }
157
+ type UseBorrowParams = {
158
+ params: MoneyMarketBorrowParams;
159
+ spokeProvider: SpokeProvider;
160
+ };
159
161
  /**
160
- * Hook for borrowing tokens from the Sodax money market.
161
- *
162
- * This hook provides functionality to borrow tokens from the money market protocol,
163
- * handling the entire borrow process including transaction creation, submission,
164
- * and cross-chain communication.
162
+ * React hook for borrowing tokens in the Sodax money market protocol.
165
163
  *
166
- * @param {XToken} spokeToken - The token to borrow from the spoke chain. Must be an XToken with valid address and chain information.
167
- * @param {SpokeProvider} spokeProvider - The spoke provider to use for the borrow transaction. Must be a valid SpokeProvider instance.
164
+ * Encapsulates the async process to initiate a borrow transaction via the money market,
165
+ * handling transaction creation, submission, and cross-chain logic.
168
166
  *
169
- * @returns {UseMutationResult<BorrowResponse, Error, string>} A mutation result object with the following properties:
170
- * - mutateAsync: Function to execute the borrow transaction
171
- * - isPending: Boolean indicating if a transaction is in progress
172
- * - error: Error object if the last transaction failed, null otherwise
167
+ * @returns {UseMutationResult<
168
+ * BorrowResponse,
169
+ * MoneyMarketError<'CREATE_BORROW_INTENT_FAILED' | 'BORROW_UNKNOWN_ERROR' | RelayErrorCode>,
170
+ * UseBorrowParams
171
+ * >} A React Query mutation result object containing:
172
+ * - mutateAsync: (params: UseBorrowParams) => Promise<BorrowResponse>
173
+ * Triggers the borrow action. Expects an object with valid borrow params and a `SpokeProvider`.
174
+ * - isPending: `boolean` if a borrow transaction is in progress.
175
+ * - error: `MoneyMarketError` if the transaction fails, or `null`.
173
176
  *
174
177
  * @example
175
178
  * ```typescript
176
- * const { mutateAsync: borrow, isPending, error } = useBorrow(spokeToken);
177
- * await borrow('100');
179
+ * const { mutateAsync: borrow, isPending, error } = useBorrow();
180
+ * await borrow({ params: borrowParams, spokeProvider });
178
181
  * ```
179
182
  *
180
183
  * @throws {Error} When:
181
- * - spokeProvider is not available
182
- * - Transaction execution fails
184
+ * - `spokeProvider` is missing or invalid.
185
+ * - The underlying borrow transaction fails.
183
186
  */
184
- declare function useBorrow(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<BorrowResponse, Error, string>;
187
+ declare function useBorrow(): UseMutationResult<BorrowResponse, MoneyMarketError<'CREATE_BORROW_INTENT_FAILED' | 'BORROW_UNKNOWN_ERROR' | RelayErrorCode>, UseBorrowParams>;
185
188
 
186
189
  interface RepayResponse {
187
190
  ok: true;
188
191
  value: [string, string];
189
192
  }
193
+ type UseRepayParams = {
194
+ params: MoneyMarketRepayParams;
195
+ spokeProvider: SpokeProvider;
196
+ };
190
197
  /**
191
- * Hook for repaying borrowed tokens to the Sodax money market.
192
- *
193
- * This hook provides functionality to repay borrowed tokens back to the money market protocol,
194
- * handling the entire repayment process including transaction creation, submission,
195
- * and cross-chain communication.
198
+ * React hook for repaying a borrow in the Sodax money market protocol.
196
199
  *
197
- * @param {XToken} spokeToken - The token to repay on the spoke chain. Must be an XToken with valid address and chain information.
198
- * @param {SpokeProvider} spokeProvider - The spoke provider to use for the repay transaction. Must be a valid SpokeProvider instance.
200
+ * This hook encapsulates the process of sending a repay transaction to the money market.
201
+ * It manages the asynchronous operation for repayment, including sending the transaction
202
+ * and error handling.
199
203
  *
200
- * @returns {UseMutationResult<RepayResponse, Error, string>} A mutation result object with the following properties:
201
- * - mutateAsync: Function to execute the repay transaction
202
- * - isPending: Boolean indicating if a transaction is in progress
203
- * - error: Error object if the last transaction failed, null otherwise
204
+ * @returns {UseMutationResult<RepayResponse, MoneyMarketError<'CREATE_REPAY_INTENT_FAILED' | 'REPAY_UNKNOWN_ERROR' | RelayErrorCode>, UseRepayParams>} React Query mutation result object containing:
205
+ * - mutateAsync: (params: UseRepayParams) => Promise<RepayResponse>
206
+ * Initiates a repay transaction using the given MoneyMarketRepayParams and SpokeProvider.
207
+ * - isPending: boolean indicating if a transaction is in progress.
208
+ * - error: MoneyMarketError if an error occurred while repaying, otherwise undefined.
204
209
  *
205
210
  * @example
206
211
  * ```typescript
207
- * const { mutateAsync: repay, isPending, error } = useRepay(spokeToken);
208
- * await repay('100');
212
+ * const { mutateAsync: repay, isPending, error } = useRepay();
213
+ * await repay({ params: repayParams, spokeProvider });
209
214
  * ```
210
215
  *
211
216
  * @throws {Error} When:
212
- * - spokeProvider is not available
213
- * - Transaction execution fails
217
+ * - `spokeProvider` is missing or invalid.
218
+ * - The underlying repay transaction fails.
214
219
  */
215
- declare function useRepay(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<RepayResponse, Error, string>;
220
+ declare function useRepay(): UseMutationResult<RepayResponse, MoneyMarketError<'CREATE_REPAY_INTENT_FAILED' | 'REPAY_UNKNOWN_ERROR' | RelayErrorCode>, UseRepayParams>;
216
221
 
217
222
  interface SupplyResponse {
218
223
  ok: true;
219
224
  value: [string, string];
220
225
  }
226
+ type UseSupplyParams = {
227
+ params: MoneyMarketSupplyParams;
228
+ spokeProvider: SpokeProvider;
229
+ };
221
230
  /**
222
- * Hook for supplying tokens to the Sodax money market.
223
- *
224
- * This hook provides functionality to supply tokens to the money market protocol,
225
- * handling the entire supply process including transaction creation, submission,
226
- * and cross-chain communication.
231
+ * React hook for supplying tokens to the Sodax money market protocol.
227
232
  *
228
- * @param {XToken} spokeToken - The token to supply on the spoke chain. Must be an XToken with valid address and chain information.
229
- * @param {SpokeProvider} spokeProvider - The spoke provider to use for the supply transaction. Must be a valid SpokeProvider instance.
233
+ * Provides a mutation for performing the supply operation using React Query. Useful
234
+ * for UI components needing to manage the full state (pending, error, etc.) of a supply
235
+ * transaction. It handles transaction creation, cross-chain logic, and errors.
230
236
  *
231
- * @returns {UseMutationResult<SupplyResponse, Error, string>} A mutation result object with the following properties:
232
- * - mutateAsync: Function to execute the supply transaction
233
- * - isPending: Boolean indicating if a transaction is in progress
234
- * - error: Error object if the last transaction failed, null otherwise
237
+ * @returns {UseMutationResult<SupplyResponse, MoneyMarketError<'CREATE_SUPPLY_INTENT_FAILED' | 'SUPPLY_UNKNOWN_ERROR' | RelayErrorCode>, UseSupplyParams>}
238
+ * Mutation result object from React Query, where:
239
+ * - mutateAsync(params: UseSupplyParams): Promise<SupplyResponse>
240
+ * Initiates a supply transaction using the given MoneyMarketSupplyParams and SpokeProvider.
241
+ * - isPending: boolean indicating if a transaction is in progress.
242
+ * - error: MoneyMarketError if an error occurred while supplying, otherwise undefined.
235
243
  *
236
244
  * @example
237
245
  * ```typescript
238
- * const { mutateAsync: supply, isPending, error } = useSupply(spokeToken);
239
- * await supply('100');
246
+ * const { mutateAsync: supply, isPending, error } = useSupply();
247
+ * await supply({ params: supplyParams, spokeProvider });
240
248
  * ```
241
249
  *
242
- * @throws {Error} When:
243
- * - spokeProvider is not available
250
+ * @throws {Error|MoneyMarketError<...>} When:
251
+ * - `spokeProvider` is not provided or invalid.
252
+ * - The underlying supply transaction fails.
244
253
  */
245
- declare function useSupply(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<SupplyResponse, Error, string>;
254
+ declare function useSupply(): UseMutationResult<SupplyResponse, MoneyMarketError<'CREATE_SUPPLY_INTENT_FAILED' | 'SUPPLY_UNKNOWN_ERROR' | RelayErrorCode>, UseSupplyParams>;
246
255
 
256
+ type UseWithdrawParams = {
257
+ params: MoneyMarketWithdrawParams;
258
+ spokeProvider: SpokeProvider;
259
+ };
247
260
  interface WithdrawResponse {
248
261
  ok: true;
249
262
  value: [string, string];
250
263
  }
251
264
  /**
252
- * Hook for withdrawing supplied tokens from the Sodax money market.
265
+ * Hook for performing withdrawals from the Sodax money market.
253
266
  *
254
- * This hook provides functionality to withdraw previously supplied tokens from the money market protocol,
255
- * handling the entire withdrawal process including transaction creation, submission,
256
- * and cross-chain communication.
267
+ * This hook exposes a mutation that executes the complete withdrawal logic, including transaction
268
+ * creation and handling cross-chain communication. It leverages React Query's mutation API for
269
+ * easy asynchronous handling and status tracking within UI components.
257
270
  *
258
- * @param {XToken} spokeToken - The token to withdraw from the spoke chain. Must be an XToken with valid address and chain information.
259
- * @param {SpokeProvider} spokeProvider - The spoke provider to use for the withdraw transaction. Must be a valid SpokeProvider instance.
271
+ * @returns {UseMutationResult<WithdrawResponse, MoneyMarketError<'CREATE_WITHDRAW_INTENT_FAILED' | 'WITHDRAW_UNKNOWN_ERROR' | RelayErrorCode>, UseWithdrawParams>}
272
+ * Mutation result object, with:
273
+ * - mutateAsync: (params: UseWithdrawParams) => Promise<WithdrawResponse>
274
+ * Initiates the withdrawal using the provided params.
275
+ * - isPending: boolean indicating if a transaction is in progress.
276
+ * - error: MoneyMarketError if an error occurred while withdrawing, otherwise undefined.
260
277
  *
261
- * @returns {UseMutationResult<WithdrawResponse, Error, string>} A mutation result object with the following properties:
262
- * - mutateAsync: Function to execute the withdraw transaction
263
- * - isPending: Boolean indicating if a transaction is in progress
264
278
  * @example
265
279
  * ```typescript
266
- * const { mutateAsync: withdraw, isPending, error } = useWithdraw(spokeToken);
267
- * await withdraw('100');
280
+ * const { mutateAsync: withdraw, isPending, error } = useWithdraw();
281
+ * await withdraw({ params: withdrawParams, spokeProvider });
268
282
  * ```
269
283
  *
270
284
  * @throws {Error} When:
271
- * - spokeProvider is not available
272
- * - Transaction execution fails
285
+ * - spokeProvider is not provided or invalid.
286
+ * - Underlying withdrawal logic fails.
273
287
  */
274
- declare function useWithdraw(spokeToken: XToken, spokeProvider: SpokeProvider | undefined): UseMutationResult<WithdrawResponse, Error, string>;
288
+ declare function useWithdraw(): UseMutationResult<WithdrawResponse, MoneyMarketError<'CREATE_WITHDRAW_INTENT_FAILED' | 'WITHDRAW_UNKNOWN_ERROR' | RelayErrorCode>, UseWithdrawParams>;
275
289
 
290
+ type UseUserReservesDataParams = {
291
+ spokeProvider: SpokeProvider | undefined;
292
+ address: string | undefined;
293
+ queryOptions?: UseQueryOptions<readonly [readonly UserReserveData[], number], Error>;
294
+ };
276
295
  /**
277
296
  * Hook for fetching user reserves data from the Sodax money market.
278
297
  *
279
- * This hook provides access to the current state of user reserves in the money market protocol.
280
- * The data is automatically fetched and cached using React Query.
298
+ * @param params (optional) - Object including:
299
+ * - spokeProvider: The SpokeProvider instance required for data fetching. If not provided, data fetching is disabled.
300
+ * - address: The user's address (string) whose reserves data will be fetched. If not provided, data fetching is disabled.
301
+ * - queryOptions: (optional) Custom React Query options such as `queryKey`, `enabled`, or cache policy.
281
302
  *
282
- * @example
283
- * ```typescript
284
- * const { data: userReservesData, isLoading, error } = useUserReservesData(spokeProvider, address);
285
- * ```
303
+ * @returns {UseQueryResult<readonly [readonly UserReserveData[], number], Error>} React Query result object containing:
304
+ * - data: A tuple with array of UserReserveData and associated number, or undefined if loading
305
+ * - isLoading: Boolean loading state
306
+ * - isError: Boolean error state
307
+ * - error: Error object, if present
286
308
  *
287
- * @returns A React Query result object containing:
288
- * - data: The user reserves data when available
289
- * - isLoading: Loading state indicator
290
- * - error: Any error that occurred during data fetching
309
+ * @example
310
+ * const { data: userReservesData, isLoading, error } = useUserReservesData({
311
+ * spokeProvider,
312
+ * address,
313
+ * });
291
314
  */
292
- declare function useUserReservesData(spokeProvider: SpokeProvider | undefined, address: string | undefined, refetchInterval?: number): UseQueryResult<readonly [readonly UserReserveData[], number], Error>;
315
+ declare function useUserReservesData(params?: UseUserReservesDataParams): UseQueryResult<readonly [readonly UserReserveData[], number], Error>;
293
316
 
317
+ type UseReservesDataParams = {
318
+ queryOptions?: UseQueryOptions<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo], Error>;
319
+ };
294
320
  /**
295
- * Hook for fetching reserves data from the Sodax money market.
321
+ * React hook for fetching the latest reserves data from the Sodax money market.
296
322
  *
297
- * This hook provides access to the current state of all reserves in the money market protocol,
298
- * including liquidity, interest rates, and other key metrics. The data is automatically
299
- * fetched and cached using React Query.
323
+ * Provides the full set of aggregated reserves and base currency information.
324
+ * Optionally accepts React Query options for customizing the query key, cache time, and related behaviors.
300
325
  *
301
- * @example
302
- * ```typescript
303
- * const { data: reservesData, isLoading, error } = useReservesData();
304
- * ```
326
+ * @param params (optional) - Object including:
327
+ * - queryOptions: Custom React Query options
305
328
  *
306
- * @returns A React Query result object containing:
307
- * - data: The reserves data when available
308
- * - isLoading: Loading state indicator
309
- * - error: Any error that occurred during data fetching
329
+ * @returns {UseQueryResult<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo], Error>}
330
+ * React Query result object containing:
331
+ * - data: [aggregated reserves[], base currency info], or undefined if not loaded
332
+ * - isLoading: True if the request is loading
333
+ * - isError: True if the request failed
334
+ * - error: Error object, if present
335
+ *
336
+ * @example
337
+ * const { data, isLoading, error } = useReservesData();
338
+ * const { data } = useReservesData({ queryOptions: { queryKey: ['custom', 'reservesData'] } });
310
339
  */
311
- declare function useReservesData(): _tanstack_react_query.UseQueryResult<readonly [readonly _sodax_sdk.AggregatedReserveData[], _sodax_sdk.BaseCurrencyInfo], Error>;
340
+ declare function useReservesData(params?: UseReservesDataParams): UseQueryResult<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo], Error>;
312
341
 
342
+ type UseMMAllowanceParams = {
343
+ params: MoneyMarketParams | undefined;
344
+ spokeProvider: SpokeProvider | undefined;
345
+ queryOptions?: UseQueryOptions<boolean, Error>;
346
+ };
313
347
  /**
314
348
  * Hook for checking token allowance for money market operations.
315
349
  *
@@ -331,77 +365,125 @@ declare function useReservesData(): _tanstack_react_query.UseQueryResult<readonl
331
365
  * const { data: hasAllowed, isLoading } = useMMAllowance(token, "100", "repay", provider);
332
366
  * ```
333
367
  */
334
- declare function useMMAllowance(token: XToken, amount: string, action: MoneyMarketAction, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
368
+ declare function useMMAllowance({ params, spokeProvider, queryOptions, }: UseMMAllowanceParams): UseQueryResult<boolean, Error>;
335
369
 
336
- interface UseApproveReturn$2 {
337
- approve: ({ amount, action }: {
338
- amount: string;
339
- action: MoneyMarketAction;
340
- }) => Promise<boolean>;
341
- isLoading: boolean;
342
- error: Error | null;
343
- resetError: () => void;
344
- }
370
+ type UseMMApproveParams = {
371
+ params: MoneyMarketParams;
372
+ spokeProvider: SpokeProvider | undefined;
373
+ };
345
374
  /**
346
- * Hook for approving token spending for money market actions
347
- * @param token The token to approve spending for
348
- * @param spokeProvider The spoke provider instance for the chain
349
- * @returns Object containing approve function, loading state, error state and reset function
375
+ * Hook for approving ERC20 token spending for Sodax money market actions.
376
+ *
377
+ * This hook manages the approval transaction, allowing the user
378
+ * to grant the protocol permission to spend their tokens for specific money market actions
379
+ * (such as supply, borrow, or repay). Upon successful approval, it also invalidates and
380
+ * refetches the associated allowance status so the UI remains up-to-date.
381
+ *
382
+ * @returns {UseMutationResult<string, Error, UseMMApproveParams>} A React Query mutation result containing:
383
+ * - mutateAsync: Function to trigger the approval (see below)
384
+ * - isPending: Boolean indicating if approval transaction is in progress
385
+ * - error: Error object if the last approval failed, null otherwise
386
+ *
350
387
  * @example
351
388
  * ```tsx
352
- * const { approve, isLoading, error } = useMMApprove(token, spokeProvider);
353
- *
354
- * // Approve tokens for supply action
355
- * await approve({ amount: "100", action: "supply" });
389
+ * const { mutateAsync: approve, isPending, error } = useMMApprove();
390
+ * await approve({ params: { token, amount: "100", action: "supply", ... }, spokeProvider });
356
391
  * ```
392
+ *
393
+ * @throws {Error} When:
394
+ * - spokeProvider is undefined or invalid
395
+ * - Approval transaction fails for any reason
357
396
  */
358
- declare function useMMApprove(token: XToken, spokeProvider: SpokeProvider | undefined): UseApproveReturn$2;
397
+ declare function useMMApprove(): UseMutationResult<string, Error, UseMMApproveParams>;
359
398
 
399
+ type UseATokenParams = {
400
+ aToken: string;
401
+ queryOptions?: UseQueryOptions<XToken, Error>;
402
+ };
360
403
  /**
361
- * React hook for fetching an AToken's ERC20 metadata from the Sodax money market.
404
+ * React hook to fetch and cache metadata for a given aToken address.
362
405
  *
363
- * Fetches and caches the metadata (name, symbol, decimals, address) for a given aToken address and chain using React Query.
364
- * This metadata is typically required for rendering balances and labels in UI components.
406
+ * Accepts an aToken address and React Query options to control query behavior.
407
+ * Returns the aToken's ERC20-style metadata from the Sodax money market, with querying/caching
408
+ * powered by React Query.
365
409
  *
366
- * @param {Address | undefined} aToken - The aToken contract address to look up. Should be an EVM address.
367
- * @param {ChainId | undefined} chainId - The EVM chain ID for the aToken.
410
+ * @param {UseATokenParams} params - Required params object:
411
+ * @property {Address} aToken - The aToken contract address to query.
412
+ * @property {UseQueryOptions<XToken, Error>} queryOptions - React Query options to control query (e.g., staleTime, refetch, etc.).
413
+ *
414
+ * @returns {UseQueryResult<XToken, Error>} React Query result object:
415
+ * - data: XToken metadata, if available
416
+ * - isLoading: Boolean loading state
417
+ * - error: Error, if API call fails
368
418
  *
369
419
  * @example
370
- * ```typescript
371
- * const { data: aToken, isLoading, error } = useAToken(aTokenAddress, chainId);
372
- * if (aToken) {
373
- * console.log(aToken.symbol); // 'aETH'
420
+ * const { data: xToken, isLoading, error } = useAToken({ aToken: aTokenAddress, queryOptions: {} });
421
+ * if (xToken) {
422
+ * console.log(xToken.symbol);
374
423
  * }
375
- * ```
376
- *
377
- * @returns {UseQueryResult<Erc20Token, Error>} A React Query result object containing:
378
- * - data: The aToken ERC20 metadata when available.
379
- * - isLoading: Loading state indicator.
380
- * - error: Any error that occurred during data fetching.
381
424
  */
382
- declare function useAToken(aToken: Address$1 | undefined): UseQueryResult<XToken$1, Error>;
425
+ declare function useAToken({ aToken, queryOptions }: UseATokenParams): UseQueryResult<XToken, Error>;
383
426
 
427
+ type UseReservesUsdFormatParams = {
428
+ queryOptions?: UseQueryOptions<(ReserveData & {
429
+ priceInMarketReferenceCurrency: string;
430
+ } & FormatReserveUSDResponse)[], Error>;
431
+ };
384
432
  /**
385
- * Hook for fetching formatted summary of Sodax user portfolio (holdings, total liquidity,
386
- * collateral, borrows, liquidation threshold, health factor, available borrowing power, etc..).
433
+ * Hook for fetching reserves data formatted with USD values in the Sodax money market.
387
434
  *
388
- * This hook provides access to the current state of user portfolio in the money market protocol.
389
- * The data is automatically fetched and cached using React Query.
435
+ * This hook returns an array of reserve objects, each extended with its price in the market reference
436
+ * currency and formatted USD values. Data is automatically fetched and cached using React Query.
390
437
  *
391
- * @example
392
- * ```typescript
393
- * const { data: userFormattedSummary, isLoading, error } = useUserFormattedSummary();
394
- * ```
438
+ * @param params (optional) - Object including:
439
+ * - queryOptions: Custom React Query options such as `queryKey`, cache behavior, or refetching policy.
395
440
  *
396
- * @returns A React Query result object containing:
397
- * - data: The formatted summary of Sodax user portfolio when available
398
- * - isLoading: Loading state indicator
399
- * - error: Any error that occurred during data fetching
441
+ * @returns {UseQueryResult<(ReserveData & { priceInMarketReferenceCurrency: string } & FormatReserveUSDResponse)[], Error>} React Query result object containing:
442
+ * - data: Array of reserves with USD-formatted values, or undefined if loading
443
+ * - isLoading: Boolean loading state
444
+ * - isError: Boolean error state
445
+ * - error: Error object, if present
446
+ *
447
+ * @example
448
+ * const { data: reservesUSD, isLoading, error } = useReservesUsdFormat();
400
449
  */
401
- declare function useReservesUsdFormat(): UseQueryResult<(ReserveData & {
450
+ declare function useReservesUsdFormat(params?: UseReservesUsdFormatParams): UseQueryResult<(ReserveData & {
402
451
  priceInMarketReferenceCurrency: string;
403
452
  } & FormatReserveUSDResponse)[], Error>;
404
453
 
454
+ type UseUserFormattedSummaryParams = {
455
+ spokeProvider?: SpokeProvider;
456
+ address?: string;
457
+ queryOptions?: UseQueryOptions<FormatUserSummaryResponse<FormatReserveUSDResponse>, Error>;
458
+ };
459
+ /**
460
+ * React hook to fetch a formatted summary of a user's Sodax money market portfolio.
461
+ *
462
+ * Accepts an optional params object:
463
+ * - `spokeProvider`: The SpokeProvider instance for the target chain
464
+ * - `address`: The user wallet address to get the summary for
465
+ * - `queryOptions`: Optional React Query options (key, caching, intervals, etc)
466
+ *
467
+ * The hook returns a React Query result object containing the formatted summary, loading and error state.
468
+ * The query is enabled only if both the spokeProvider and address are provided.
469
+ *
470
+ * @param params Optional parameters:
471
+ * - spokeProvider: SpokeProvider to query chain data (required for enabled query)
472
+ * - address: User account address (required for enabled query)
473
+ * - queryOptions: React Query options for customization (optional)
474
+ *
475
+ * @returns {UseQueryResult<FormatUserSummaryResponse<FormatReserveUSDResponse>, Error>}
476
+ * A result object from React Query including:
477
+ * - data: The user's formatted portfolio summary (or undefined if not loaded)
478
+ * - isLoading: Boolean loading state
479
+ * - isError: Boolean error state
480
+ * - error: Error if thrown in fetching
481
+ *
482
+ * @example
483
+ * const { data, isLoading, error } = useUserFormattedSummary({ spokeProvider, address });
484
+ */
485
+ declare function useUserFormattedSummary(params?: UseUserFormattedSummaryParams): UseQueryResult<FormatUserSummaryResponse<FormatReserveUSDResponse>, Error>;
486
+
405
487
  /**
406
488
  * Hook for fetching a quote for an intent-based swap.
407
489
  *
@@ -495,12 +577,12 @@ declare function useSwap(spokeProvider: SpokeProvider | undefined): UseMutationR
495
577
  declare const useStatus: (intent_tx_hash: Hex) => UseQueryResult<Result<SolverIntentStatusResponse, SolverErrorResponse> | undefined>;
496
578
 
497
579
  /**
498
- * Hook for checking token allowance for money market operations.
580
+ * Hook for checking token allowance for swap operations.
499
581
  *
500
- * This hook verifies if the user has approved enough tokens for a specific money market action
501
- * (borrow/repay). It automatically queries and tracks the allowance status.
582
+ * This hook verifies if the user has approved enough tokens for a specific swap action.
583
+ * It automatically queries and tracks the allowance status.
502
584
  *
503
- * @param {CreateIntentParams} params - The parameters for the intent to check allowance for.
585
+ * @param {CreateIntentParams | CreateLimitOrderParams} params - The parameters for the intent to check allowance for.
504
586
  * @param {SpokeProvider} spokeProvider - The spoke provider to use for allowance checks
505
587
  *
506
588
  * @returns {UseQueryResult<boolean, Error>} A React Query result containing:
@@ -510,22 +592,22 @@ declare const useStatus: (intent_tx_hash: Hex) => UseQueryResult<Result<SolverIn
510
592
  *
511
593
  * @example
512
594
  * ```typescript
513
- * const { data: hasAllowed, isLoading } = useMMAllowance(params, spokeProvider);
595
+ * const { data: hasAllowed, isLoading } = useSwapAllowance(params, spokeProvider);
514
596
  * ```
515
597
  */
516
- declare function useSwapAllowance(params: CreateIntentParams | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
598
+ declare function useSwapAllowance(params: CreateIntentParams | CreateLimitOrderParams | undefined, spokeProvider: SpokeProvider | undefined): UseQueryResult<boolean, Error>;
517
599
 
518
600
  interface UseApproveReturn$1 {
519
601
  approve: ({ params }: {
520
- params: CreateIntentParams;
602
+ params: CreateIntentParams | CreateLimitOrderParams;
521
603
  }) => Promise<boolean>;
522
604
  isLoading: boolean;
523
605
  error: Error | null;
524
606
  resetError: () => void;
525
607
  }
526
608
  /**
527
- * Hook for approving token spending for money market actions
528
- * @param token The token to approve spending for
609
+ * Hook for approving token spending for swap actions
610
+ * @param params The parameters for the intent to approve spending for
529
611
  * @param spokeProvider The spoke provider instance for the chain
530
612
  * @returns Object containing approve function, loading state, error state and reset function
531
613
  * @example
@@ -536,7 +618,7 @@ interface UseApproveReturn$1 {
536
618
  * await approve({ amount: "100", action: "supply" });
537
619
  * ```
538
620
  */
539
- declare function useSwapApprove(params: CreateIntentParams | undefined, spokeProvider: SpokeProvider | undefined): UseApproveReturn$1;
621
+ declare function useSwapApprove(params: CreateIntentParams | CreateLimitOrderParams | undefined, spokeProvider: SpokeProvider | undefined): UseApproveReturn$1;
540
622
 
541
623
  type CancelIntentParams = {
542
624
  intent: Intent;
@@ -564,169 +646,284 @@ type CancelIntentResult = Result<TxReturnType<SpokeProvider, boolean>>;
564
646
  */
565
647
  declare function useCancelSwap(spokeProvider: SpokeProvider | undefined): UseMutationResult<CancelIntentResult, Error, CancelIntentParams>;
566
648
 
649
+ type CreateLimitOrderResult = Result<[
650
+ SolverExecutionResponse,
651
+ Intent,
652
+ IntentDeliveryInfo
653
+ ], IntentError<IntentErrorCode>>;
567
654
  /**
568
- * Hook for fetching intent details by intent created transaction hash from the backend API.
569
- *
570
- * This hook provides access to intent data associated with the transaction hash from when
571
- * the intent was created on the hub chain, including intent details, events, and transaction
572
- * information. The data is automatically fetched and cached using React Query.
655
+ * Hook for creating a limit order intent (no deadline, must be cancelled manually by user).
656
+ * Uses React Query's useMutation for better state management and caching.
573
657
  *
574
- * @param {string | undefined} txHash - The intent created transaction hash from the hub chain to fetch intent for. If undefined, the query will be disabled.
658
+ * Limit orders remain active until manually cancelled by the user. Unlike swaps, limit orders
659
+ * do not have a deadline (deadline is automatically set to 0n).
575
660
  *
576
- * @returns {UseQueryResult<IntentResponse | undefined>} A query result object containing:
577
- * - data: The intent response data when available
578
- * - isLoading: Boolean indicating if the request is in progress
579
- * - error: Error object if the request failed
580
- * - refetch: Function to manually trigger a data refresh
661
+ * @param {SpokeProvider} spokeProvider - The spoke provider to use for creating the limit order
662
+ * @returns {UseMutationResult} Mutation result object containing mutation function and state
581
663
  *
582
664
  * @example
583
665
  * ```typescript
584
- * const { data: intent, isLoading, error } = useIntentByTxHash('0x123...');
666
+ * const { mutateAsync: createLimitOrder, isPending } = useCreateLimitOrder(spokeProvider);
667
+ *
668
+ * const handleCreateLimitOrder = async () => {
669
+ * const result = await createLimitOrder({
670
+ * inputToken: '0x...',
671
+ * outputToken: '0x...',
672
+ * inputAmount: 1000000000000000000n,
673
+ * minOutputAmount: 900000000000000000n,
674
+ * allowPartialFill: false,
675
+ * srcChain: '0xa4b1.arbitrum',
676
+ * dstChain: '0x89.polygon',
677
+ * srcAddress: '0x...',
678
+ * dstAddress: '0x...',
679
+ * solver: '0x0000000000000000000000000000000000000000',
680
+ * data: '0x'
681
+ * });
585
682
  *
586
- * if (isLoading) return <div>Loading intent...</div>;
587
- * if (error) return <div>Error: {error.message}</div>;
588
- * if (intent) {
589
- * console.log('Intent found:', intent.intentHash);
590
- * }
683
+ * if (result.ok) {
684
+ * const [solverExecutionResponse, intent, intentDeliveryInfo] = result.value;
685
+ * console.log('Limit order created:', intent);
686
+ * console.log('Intent hash:', solverExecutionResponse.intent_hash);
687
+ * }
688
+ * };
591
689
  * ```
592
- *
593
- * @remarks
594
- * - Intents are only created on the hub chain, so the transaction hash must be from the hub chain
595
- * - The query is disabled when txHash is undefined or empty
596
- * - Uses React Query for efficient caching and state management
597
- * - Automatically handles error states and loading indicators
598
690
  */
599
- declare const useBackendIntentByTxHash: (txHash: string | undefined, refetchInterval?: number) => UseQueryResult<IntentResponse | undefined>;
691
+ declare function useCreateLimitOrder(spokeProvider: SpokeProvider | undefined): UseMutationResult<CreateLimitOrderResult, Error, CreateLimitOrderParams>;
600
692
 
693
+ type CancelLimitOrderParams = {
694
+ intent: Intent;
695
+ spokeProvider: SpokeProvider;
696
+ timeout?: number;
697
+ };
698
+ type CancelLimitOrderResult = Result<[string, string], IntentError<IntentErrorCode>>;
601
699
  /**
602
- * Hook for fetching intent details by intent hash from the backend API.
603
- *
604
- * This hook provides access to intent data using the intent hash directly,
605
- * including intent details, events, and transaction information. The data is automatically
606
- * fetched and cached using React Query.
700
+ * Hook for canceling a limit order intent and submitting it to the Relayer API.
701
+ * Uses React Query's useMutation for better state management and caching.
607
702
  *
608
- * @param {string | undefined} intentHash - The intent hash to fetch intent for. If undefined, the query will be disabled.
703
+ * This hook wraps cancelLimitOrder which cancels the intent on the spoke chain,
704
+ * submits it to the relayer API, and waits for execution on the destination/hub chain.
609
705
  *
610
- * @returns {UseQueryResult<IntentResponse | undefined>} A query result object containing:
611
- * - data: The intent response data when available
612
- * - isLoading: Boolean indicating if the request is in progress
613
- * - error: Error object if the request failed
614
- * - refetch: Function to manually trigger a data refresh
706
+ * @returns {UseMutationResult} Mutation result object containing mutation function and state
615
707
  *
616
708
  * @example
617
709
  * ```typescript
618
- * const { data: intent, isLoading, error } = useIntentByHash('0xabc...');
710
+ * const { mutateAsync: cancelLimitOrder, isPending } = useCancelLimitOrder();
711
+ *
712
+ * const handleCancelLimitOrder = async () => {
713
+ * const result = await cancelLimitOrder({
714
+ * intent: intentObject,
715
+ * spokeProvider,
716
+ * timeout: 60000 // optional, defaults to 60 seconds
717
+ * });
718
+ *
719
+ * if (result.ok) {
720
+ * const [cancelTxHash, dstTxHash] = result.value;
721
+ * console.log('Cancel transaction hash:', cancelTxHash);
722
+ * console.log('Destination transaction hash:', dstTxHash);
723
+ * }
724
+ * };
725
+ * ```
726
+ */
727
+ declare function useCancelLimitOrder(): UseMutationResult<CancelLimitOrderResult, Error, CancelLimitOrderParams>;
728
+
729
+ type UseBackendIntentByTxHashParams = {
730
+ params: {
731
+ txHash: string | undefined;
732
+ };
733
+ queryOptions?: UseQueryOptions<IntentResponse | undefined, Error>;
734
+ };
735
+ /**
736
+ * React hook for fetching intent details from the backend API using a transaction hash.
737
+ *
738
+ * @param {UseBackendIntentByTxHashParams | undefined} params - Parameters for the query:
739
+ * - params: { txHash: string | undefined }
740
+ * - `txHash`: Transaction hash used to retrieve the associated intent; query is disabled if undefined or empty.
741
+ * - queryOptions (optional): React Query options to customize request behavior (e.g., caching, retry, refetchInterval, etc.).
742
+ *
743
+ * @returns {UseQueryResult<IntentResponse | undefined, Error>} React Query result object, including:
744
+ * - `data`: The intent response or undefined if unavailable,
745
+ * - `isLoading`: Loading state,
746
+ * - `error`: Error (if request failed),
747
+ * - `refetch`: Function to refetch the data.
748
+ *
749
+ * @example
750
+ * const { data: intent, isLoading, error } = useBackendIntentByTxHash({
751
+ * params: { txHash: '0x123...' },
752
+ * });
619
753
  *
620
754
  * if (isLoading) return <div>Loading intent...</div>;
621
755
  * if (error) return <div>Error: {error.message}</div>;
622
756
  * if (intent) {
623
757
  * console.log('Intent found:', intent.intentHash);
624
- * console.log('Open status:', intent.open);
625
758
  * }
626
- * ```
627
759
  *
628
760
  * @remarks
629
- * - The query is disabled when intentHash is undefined or empty
630
- * - Uses React Query for efficient caching and state management
631
- * - Automatically handles error states and loading indicators
761
+ * - Intents are only created on the hub chain, so `txHash` must originate from there.
762
+ * - Query is disabled if `params` is undefined, or if `params.params.txHash` is undefined or an empty string.
763
+ * - Default refetch interval is 1 second. Uses React Query for state management, caching, and retries.
632
764
  */
633
- declare const useBackendIntentByHash: (intentHash: string | undefined) => UseQueryResult<IntentResponse | undefined>;
765
+ declare const useBackendIntentByTxHash: (params: UseBackendIntentByTxHashParams | undefined) => UseQueryResult<IntentResponse | undefined, Error>;
634
766
 
767
+ type UseBackendIntentByHashParams = {
768
+ params: {
769
+ intentHash: string | undefined;
770
+ };
771
+ queryOptions?: UseQueryOptions<IntentResponse | undefined, Error>;
772
+ };
635
773
  /**
636
- * Hook for fetching the solver orderbook from the backend API.
774
+ * React hook to fetch intent details from the backend API using an intent hash.
637
775
  *
638
- * This hook provides access to the solver orderbook data, including intent states
639
- * and intent data for all available intents. The data is automatically fetched
640
- * and cached using React Query with pagination support.
776
+ * @param {UseBackendIntentByHashParams | undefined} params - Parameters for the query:
777
+ * - params: { intentHash: string | undefined }
778
+ * - `intentHash`: The hash identifying the intent to fetch (disables query if undefined or empty).
779
+ * - queryOptions (optional): Options to customize React Query (e.g., staleTime, enabled).
641
780
  *
642
- * @param {Object} params - Pagination parameters for the orderbook
643
- * @param {string} params.offset - The offset for pagination (number as string)
644
- * @param {string} params.limit - The limit for pagination (number as string)
645
- *
646
- * @returns {UseQueryResult<OrderbookResponse | undefined>} A query result object containing:
647
- * - data: The orderbook response data when available
648
- * - isLoading: Boolean indicating if the request is in progress
649
- * - error: Error object if the request failed
650
- * - refetch: Function to manually trigger a data refresh
781
+ * @returns {UseQueryResult<IntentResponse | undefined, Error>} React Query result containing intent response data, loading, error, and refetch states.
651
782
  *
652
783
  * @example
653
- * ```typescript
654
- * const { data: orderbook, isLoading, error } = useOrderbook({
655
- * offset: '0',
656
- * limit: '10'
784
+ * const { data: intent, isLoading, error } = useBackendIntentByHash({
785
+ * params: { intentHash: '0xabc...' },
657
786
  * });
658
787
  *
659
- * if (isLoading) return <div>Loading orderbook...</div>;
788
+ * if (isLoading) return <div>Loading intent...</div>;
660
789
  * if (error) return <div>Error: {error.message}</div>;
661
- * if (orderbook) {
662
- * console.log('Total intents:', orderbook.total);
663
- * console.log('Intents:', orderbook.data);
790
+ * if (intent) {
791
+ * console.log('Intent found:', intent.intentHash);
664
792
  * }
665
- * ```
666
793
  *
667
794
  * @remarks
668
- * - The query is disabled when params are undefined or invalid
669
- * - Uses React Query for efficient caching and state management
670
- * - Automatically handles error states and loading indicators
671
- * - Stale time of 30 seconds for real-time orderbook data
672
- * - Supports pagination through offset and limit parameters
795
+ * - Returns `undefined` data if no intentHash is provided or query is disabled.
796
+ * - Query is cached and managed using React Query.
797
+ * - Use `queryOptions` to customize caching, retry and fetch behavior.
673
798
  */
674
- declare const useBackendOrderbook: (params: {
799
+ declare const useBackendIntentByHash: (params: UseBackendIntentByHashParams | undefined) => UseQueryResult<IntentResponse | undefined, Error>;
800
+
801
+ type BackendPaginationParams = {
675
802
  offset: string;
676
803
  limit: string;
677
- } | undefined) => UseQueryResult<OrderbookResponse | undefined>;
804
+ };
678
805
 
806
+ type GetUserIntentsParams = {
807
+ userAddress: Address$1;
808
+ startDate?: number;
809
+ endDate?: number;
810
+ };
811
+ type UseBackendUserIntentsParams = {
812
+ params?: GetUserIntentsParams;
813
+ queryOptions?: UseQueryOptions<UserIntentsResponse | undefined, Error>;
814
+ pagination?: BackendPaginationParams;
815
+ };
679
816
  /**
680
- * Hook for fetching money market position for a specific user from the backend API.
817
+ * React hook for fetching user-created intents from the backend API for a given user address,
818
+ * with optional support for a date filtering range.
819
+ *
820
+ * @param {UseBackendUserIntentsParams} args - Query configuration.
821
+ * @param {GetUserIntentsParams | undefined} args.params - User intent filter parameters.
822
+ * @param {Address} args.params.userAddress - The wallet address of the user (required).
823
+ * @param {number} [args.params.startDate] - Include intents created after this timestamp (ms).
824
+ * @param {number} [args.params.endDate] - Include intents created before this timestamp (ms).
825
+ * @param {UseQueryOptions<UserIntentsResponse | undefined, Error>} [args.queryOptions] - Optional React Query options.
826
+ * @param {BackendPaginationParams} [args.pagination] - (currently ignored) Pagination options.
827
+ *
828
+ * @returns {UseQueryResult<UserIntentsResponse | undefined, Error>} React Query result:
829
+ * - `data`: The user intent response, or undefined if unavailable.
830
+ * - `isLoading`: `true` if loading.
831
+ * - `error`: An Error instance if any occurred.
832
+ * - `refetch`: Function to refetch data.
681
833
  *
682
- * This hook provides access to a user's money market positions, including their
683
- * aToken balances, variable debt token balances, and associated reserve information.
684
- * The data is automatically fetched and cached using React Query.
834
+ * @example
835
+ * const { data: userIntents, isLoading, error } = useBackendUserIntents({
836
+ * params: { userAddress: "0x123..." }
837
+ * });
685
838
  *
686
- * @param {string | undefined} userAddress - The user's wallet address. If undefined, the query will be disabled.
839
+ * @example
840
+ * const { data } = useBackendUserIntents({
841
+ * params: {
842
+ * userAddress: "0xabc...",
843
+ * startDate: Date.now() - 1_000_000,
844
+ * endDate: Date.now(),
845
+ * },
846
+ * });
687
847
  *
688
- * @returns {UseQueryResult<MoneyMarketPosition | undefined>} A query result object containing:
689
- * - data: The money market position data when available
690
- * - isLoading: Boolean indicating if the request is in progress
691
- * - error: Error object if the request failed
692
- * - refetch: Function to manually trigger a data refresh
848
+ * @remarks
849
+ * The query is disabled if `params` or `params.userAddress` is missing or empty. Uses React Query for
850
+ * cache/state management and auto-retries failed requests three times by default.
851
+ */
852
+ declare const useBackendUserIntents: ({ params, queryOptions, }: UseBackendUserIntentsParams) => UseQueryResult<UserIntentsResponse | undefined, Error>;
853
+
854
+ type UseBackendOrderbookParams = {
855
+ queryOptions?: UseQueryOptions<OrderbookResponse | undefined, Error>;
856
+ pagination?: BackendPaginationParams;
857
+ };
858
+ /**
859
+ * Hook for fetching the solver orderbook from the backend API.
693
860
  *
694
- * @example
695
- * ```typescript
696
- * const { data: position, isLoading, error } = useMoneyMarketPosition('0x123...');
861
+ * @param {UseBackendOrderbookParams | undefined} params - Optional parameters:
862
+ * - `pagination`: Pagination configuration (see `BackendPaginationParams`), including
863
+ * `offset` and `limit` (both required for fetch to be enabled).
864
+ * - `queryOptions`: Optional React Query options to override default behavior.
697
865
  *
698
- * if (isLoading) return <div>Loading position...</div>;
699
- * if (error) return <div>Error: {error.message}</div>;
700
- * if (position) {
701
- * console.log('User address:', position.userAddress);
702
- * console.log('Positions:', position.positions);
703
- * }
704
- * ```
866
+ * @returns {UseQueryResult<OrderbookResponse | undefined, Error>} React Query result object:
867
+ * - `data`: The orderbook response, or undefined if unavailable.
868
+ * - `isLoading`: Loading state.
869
+ * - `error`: Error instance if the query failed.
870
+ * - `refetch`: Function to re-trigger the query.
871
+ *
872
+ * @example
873
+ * const { data, isLoading, error } = useBackendOrderbook({
874
+ * pagination: { offset: '0', limit: '10' },
875
+ * queryOptions: { staleTime: 60000 },
876
+ * });
705
877
  *
706
878
  * @remarks
707
- * - The query is disabled when userAddress is undefined or empty
708
- * - Uses React Query for efficient caching and state management
709
- * - Automatically handles error states and loading indicators
710
- * - Includes user's aToken and debt token balances across all reserves
879
+ * - Query is disabled if `params?.pagination`, `offset`, or `limit` are missing/empty.
880
+ * - Caches and manages server state using React Query.
881
+ * - Default `staleTime` is 30 seconds to support near-real-time updates.
711
882
  */
712
- declare const useBackendMoneyMarketPosition: (userAddress: string | undefined) => UseQueryResult<MoneyMarketPosition | undefined>;
883
+ declare const useBackendOrderbook: (params: UseBackendOrderbookParams | undefined) => UseQueryResult<OrderbookResponse | undefined>;
713
884
 
885
+ type UseBackendMoneyMarketPositionParams = {
886
+ userAddress: string | undefined;
887
+ queryOptions?: UseQueryOptions<MoneyMarketPosition | undefined, Error>;
888
+ };
714
889
  /**
715
- * Hook for fetching all money market assets from the backend API.
890
+ * React hook for fetching a user's money market position from the backend API.
716
891
  *
717
- * This hook provides access to all available money market assets, including
718
- * their reserve information, liquidity rates, borrow rates, and market statistics.
719
- * The data is automatically fetched and cached using React Query.
892
+ * @param {UseBackendMoneyMarketPositionParams | undefined} params - Parameters object:
893
+ * - userAddress: The user's wallet address to fetch positions for. If undefined or empty, the query is disabled.
894
+ * - queryOptions: (Optional) React Query options to customize behavior (e.g., staleTime, enabled).
720
895
  *
721
- * @returns {UseQueryResult<MoneyMarketAsset[]>} A query result object containing:
722
- * - data: Array of money market asset data when available
723
- * - isLoading: Boolean indicating if the request is in progress
724
- * - error: Error object if the request failed
725
- * - refetch: Function to manually trigger a data refresh
896
+ * @returns {UseQueryResult<MoneyMarketPosition | undefined, Error>} - React Query result object with:
897
+ * - data: The user's money market position data, or undefined if not available.
898
+ * - isLoading: Loading state.
899
+ * - error: An Error instance if fetching failed.
900
+ * - refetch: Function to manually trigger a refetch.
726
901
  *
727
902
  * @example
728
- * ```typescript
729
- * const { data: assets, isLoading, error } = useAllMoneyMarketAssets();
903
+ * const { data, isLoading, error } = useBackendMoneyMarketPosition({
904
+ * userAddress: '0xabc...',
905
+ * queryOptions: { staleTime: 60000 },
906
+ * });
907
+ */
908
+ declare const useBackendMoneyMarketPosition: (params: UseBackendMoneyMarketPositionParams | undefined) => UseQueryResult<MoneyMarketPosition | undefined, Error>;
909
+
910
+ type UseBackendAllMoneyMarketAssetsParams = {
911
+ queryOptions?: UseQueryOptions<MoneyMarketAsset[], Error>;
912
+ };
913
+ /**
914
+ * React hook to fetch all money market assets from the backend API.
915
+ *
916
+ * @param {UseBackendAllMoneyMarketAssetsParams | undefined} params - Optional parameters:
917
+ * - `queryOptions` (optional): React Query options to override default behavior (e.g., caching, retry, etc).
918
+ *
919
+ * @returns {UseQueryResult<MoneyMarketAsset[], Error>} React Query result object:
920
+ * - `data`: Array of all money market asset data when available.
921
+ * - `isLoading`: Boolean indicating if the request is in progress.
922
+ * - `error`: Error object if the request failed.
923
+ * - `refetch`: Function to manually trigger a data refresh.
924
+ *
925
+ * @example
926
+ * const { data: assets, isLoading, error } = useBackendAllMoneyMarketAssets();
730
927
  *
731
928
  * if (isLoading) return <div>Loading assets...</div>;
732
929
  * if (error) return <div>Error: {error.message}</div>;
@@ -736,35 +933,39 @@ declare const useBackendMoneyMarketPosition: (userAddress: string | undefined) =
736
933
  * console.log(`${asset.symbol}: ${asset.liquidityRate} liquidity rate`);
737
934
  * });
738
935
  * }
739
- * ```
740
936
  *
741
937
  * @remarks
742
- * - Uses React Query for efficient caching and state management
743
- * - Automatically handles error states and loading indicators
744
- * - Returns comprehensive asset information including rates and statistics
745
- * - No parameters required - fetches all available assets
938
+ * - No required parameters fetches all available money market assets from backend.
939
+ * - Uses React Query for caching, retries, and loading/error state management.
940
+ * - Supports overriding React Query config via `queryOptions`.
746
941
  */
747
- declare const useBackendAllMoneyMarketAssets: () => UseQueryResult<MoneyMarketAsset[]>;
942
+ declare const useBackendAllMoneyMarketAssets: (params: UseBackendAllMoneyMarketAssetsParams | undefined) => UseQueryResult<MoneyMarketAsset[], Error>;
748
943
 
944
+ type UseBackendMoneyMarketAssetParams = {
945
+ params: {
946
+ reserveAddress: string | undefined;
947
+ };
948
+ queryOptions?: UseQueryOptions<MoneyMarketAsset | undefined, Error>;
949
+ };
749
950
  /**
750
- * Hook for fetching specific money market asset details from the backend API.
751
- *
752
- * This hook provides access to detailed information for a specific money market asset,
753
- * including reserve information, liquidity rates, borrow rates, and market statistics.
754
- * The data is automatically fetched and cached using React Query.
951
+ * React hook to fetch a specific money market asset from the backend API.
755
952
  *
756
- * @param {string | undefined} reserveAddress - The reserve contract address. If undefined, the query will be disabled.
953
+ * @param params - The hook input parameter object (may be undefined):
954
+ * - `params`: An object containing:
955
+ * - `reserveAddress` (string | undefined): Reserve contract address to fetch asset details. Disables query if undefined or empty.
956
+ * - `queryOptions` (optional): React Query options for advanced configuration (e.g. caching, staleTime, retry, etc.).
757
957
  *
758
- * @returns {UseQueryResult<MoneyMarketAsset | undefined>} A query result object containing:
759
- * - data: The money market asset data when available
760
- * - isLoading: Boolean indicating if the request is in progress
761
- * - error: Error object if the request failed
762
- * - refetch: Function to manually trigger a data refresh
958
+ * @returns A React Query result object: {@link UseQueryResult} for {@link MoneyMarketAsset} or `undefined` on error or if disabled,
959
+ * including:
960
+ * - `data`: The money market asset (when available) or `undefined`.
961
+ * - `isLoading`: Whether the query is running.
962
+ * - `error`: An error encountered by the query (if any).
963
+ * - `refetch`: Function to manually refetch the asset.
763
964
  *
764
965
  * @example
765
- * ```typescript
766
- * const { data: asset, isLoading, error } = useMoneyMarketAsset('0xabc...');
767
- *
966
+ * const { data: asset, isLoading, error } = useBackendMoneyMarketAsset({
967
+ * params: { reserveAddress: '0xabc...' },
968
+ * });
768
969
  * if (isLoading) return <div>Loading asset...</div>;
769
970
  * if (error) return <div>Error: {error.message}</div>;
770
971
  * if (asset) {
@@ -772,39 +973,40 @@ declare const useBackendAllMoneyMarketAssets: () => UseQueryResult<MoneyMarketAs
772
973
  * console.log('Liquidity rate:', asset.liquidityRate);
773
974
  * console.log('Variable borrow rate:', asset.variableBorrowRate);
774
975
  * }
775
- * ```
776
976
  *
777
977
  * @remarks
778
- * - The query is disabled when reserveAddress is undefined or empty
779
- * - Uses React Query for efficient caching and state management
780
- * - Automatically handles error states and loading indicators
781
- * - Returns comprehensive asset information for the specified reserve
978
+ * - Query is disabled if `params`, `params.params`, or `params.params.reserveAddress` is missing or empty.
979
+ * - Uses React Query for caching and background-state management.
980
+ * - Loading and error handling are managed automatically.
782
981
  */
783
- declare const useBackendMoneyMarketAsset: (reserveAddress: string | undefined) => UseQueryResult<MoneyMarketAsset | undefined>;
982
+ declare const useBackendMoneyMarketAsset: (params: UseBackendMoneyMarketAssetParams | undefined) => UseQueryResult<MoneyMarketAsset | undefined, Error>;
784
983
 
984
+ type UseBackendMoneyMarketAssetBorrowersParams = {
985
+ params: {
986
+ reserveAddress: string | undefined;
987
+ };
988
+ pagination: BackendPaginationParams;
989
+ queryOptions?: UseQueryOptions<MoneyMarketAssetBorrowers | undefined, Error>;
990
+ };
785
991
  /**
786
- * Hook for fetching borrowers for a specific money market asset from the backend API.
992
+ * React hook for fetching borrowers for a specific money market asset from the backend API with pagination.
787
993
  *
788
- * This hook provides access to the list of borrowers for a specific money market asset,
789
- * with pagination support. The data is automatically fetched and cached using React Query.
790
- *
791
- * @param {Object} params - Parameters for fetching asset borrowers
792
- * @param {string | undefined} params.reserveAddress - The reserve contract address. If undefined, the query will be disabled.
793
- * @param {string} params.offset - The offset for pagination (number as string)
794
- * @param {string} params.limit - The limit for pagination (number as string)
994
+ * @param {UseBackendMoneyMarketAssetBorrowersParams | undefined} params - Query parameters:
995
+ * - `params`: Object containing:
996
+ * - `reserveAddress`: Reserve contract address for which to fetch borrowers, or `undefined` to disable query.
997
+ * - `pagination`: Pagination controls with `offset` and `limit` (both required as strings).
998
+ * - `queryOptions` (optional): React Query options to override defaults (e.g. `staleTime`, `enabled`, etc.).
795
999
  *
796
- * @returns {UseQueryResult<MoneyMarketAssetBorrowers | undefined>} A query result object containing:
797
- * - data: The asset borrowers data when available
798
- * - isLoading: Boolean indicating if the request is in progress
799
- * - error: Error object if the request failed
800
- * - refetch: Function to manually trigger a data refresh
1000
+ * @returns {UseQueryResult<MoneyMarketAssetBorrowers | undefined, Error>} React Query result object including:
1001
+ * - `data`: The money market asset borrowers data, or `undefined` if not available.
1002
+ * - `isLoading`: Boolean indicating whether the query is loading.
1003
+ * - `error`: An Error instance if the request failed.
1004
+ * - `refetch`: Function to manually trigger a data refresh.
801
1005
  *
802
1006
  * @example
803
- * ```typescript
804
- * const { data: borrowers, isLoading, error } = useMoneyMarketAssetBorrowers({
805
- * reserveAddress: '0xabc...',
806
- * offset: '0',
807
- * limit: '20'
1007
+ * const { data: borrowers, isLoading, error } = useBackendMoneyMarketAssetBorrowers({
1008
+ * params: { reserveAddress: '0xabc...' },
1009
+ * pagination: { offset: '0', limit: '20' }
808
1010
  * });
809
1011
  *
810
1012
  * if (isLoading) return <div>Loading borrowers...</div>;
@@ -813,43 +1015,40 @@ declare const useBackendMoneyMarketAsset: (reserveAddress: string | undefined) =
813
1015
  * console.log('Total borrowers:', borrowers.total);
814
1016
  * console.log('Borrowers:', borrowers.borrowers);
815
1017
  * }
816
- * ```
817
1018
  *
818
1019
  * @remarks
819
- * - The query is disabled when reserveAddress is undefined or empty
820
- * - Uses React Query for efficient caching and state management
821
- * - Automatically handles error states and loading indicators
822
- * - Supports pagination through offset and limit parameters
1020
+ * - The query is disabled if `reserveAddress`, `offset`, or `limit` are not provided.
1021
+ * - Uses React Query for caching, retries, and auto error/loading management.
1022
+ * - Pagination is handled via `pagination.offset` and `pagination.limit`.
823
1023
  */
824
- declare const useBackendMoneyMarketAssetBorrowers: (params: {
825
- reserveAddress: string | undefined;
826
- offset: string;
827
- limit: string;
828
- }) => UseQueryResult<MoneyMarketAssetBorrowers | undefined>;
1024
+ declare const useBackendMoneyMarketAssetBorrowers: (params: UseBackendMoneyMarketAssetBorrowersParams | undefined) => UseQueryResult<MoneyMarketAssetBorrowers | undefined, Error>;
829
1025
 
1026
+ type UseBackendMoneyMarketAssetSuppliersParams = {
1027
+ params: {
1028
+ reserveAddress: string | undefined;
1029
+ };
1030
+ pagination: BackendPaginationParams;
1031
+ queryOptions?: UseQueryOptions<MoneyMarketAssetSuppliers | undefined, Error>;
1032
+ };
830
1033
  /**
831
- * Hook for fetching suppliers for a specific money market asset from the backend API.
1034
+ * React hook for fetching suppliers for a specific money market asset from the backend API, with pagination support.
832
1035
  *
833
- * This hook provides access to the list of suppliers for a specific money market asset,
834
- * with pagination support. The data is automatically fetched and cached using React Query.
1036
+ * @param {UseBackendMoneyMarketAssetSuppliersParams | undefined} params - Hook parameters:
1037
+ * - `params`: Object containing:
1038
+ * - `reserveAddress`: The reserve contract address to query, or undefined to disable the query.
1039
+ * - `pagination`: Backend pagination controls (`offset` and `limit` as strings).
1040
+ * - `queryOptions` (optional): React Query options to override defaults.
835
1041
  *
836
- * @param {Object} params - Parameters for fetching asset suppliers
837
- * @param {string | undefined} params.reserveAddress - The reserve contract address. If undefined, the query will be disabled.
838
- * @param {string} params.offset - The offset for pagination (number as string)
839
- * @param {string} params.limit - The limit for pagination (number as string)
840
- *
841
- * @returns {UseQueryResult<MoneyMarketAssetSuppliers | undefined>} A query result object containing:
842
- * - data: The asset suppliers data when available
843
- * - isLoading: Boolean indicating if the request is in progress
844
- * - error: Error object if the request failed
845
- * - refetch: Function to manually trigger a data refresh
1042
+ * @returns {UseQueryResult<MoneyMarketAssetSuppliers | undefined, Error>} - Query result object with:
1043
+ * - `data`: The asset suppliers data when available.
1044
+ * - `isLoading`: Indicates if the request is in progress.
1045
+ * - `error`: Error object if the request failed.
1046
+ * - `refetch`: Function to trigger a manual data refresh.
846
1047
  *
847
1048
  * @example
848
- * ```typescript
849
- * const { data: suppliers, isLoading, error } = useMoneyMarketAssetSuppliers({
850
- * reserveAddress: '0xabc...',
851
- * offset: '0',
852
- * limit: '20'
1049
+ * const { data: suppliers, isLoading, error } = useBackendMoneyMarketAssetSuppliers({
1050
+ * params: { reserveAddress: '0xabc...' },
1051
+ * pagination: { offset: '0', limit: '20' }
853
1052
  * });
854
1053
  *
855
1054
  * if (isLoading) return <div>Loading suppliers...</div>;
@@ -858,20 +1057,18 @@ declare const useBackendMoneyMarketAssetBorrowers: (params: {
858
1057
  * console.log('Total suppliers:', suppliers.total);
859
1058
  * console.log('Suppliers:', suppliers.suppliers);
860
1059
  * }
861
- * ```
862
1060
  *
863
1061
  * @remarks
864
- * - The query is disabled when reserveAddress is undefined or empty
865
- * - Uses React Query for efficient caching and state management
866
- * - Automatically handles error states and loading indicators
867
- * - Supports pagination through offset and limit parameters
1062
+ * - The query is disabled if `reserveAddress`, `offset`, or `limit` are not provided.
1063
+ * - Uses React Query for efficient caching, automatic retries, and error/loading handling.
1064
+ * - Pagination is handled via `pagination.offset` and `pagination.limit`.
868
1065
  */
869
- declare const useBackendMoneyMarketAssetSuppliers: (params: {
870
- reserveAddress: string | undefined;
871
- offset: string;
872
- limit: string;
873
- }) => UseQueryResult<MoneyMarketAssetSuppliers | undefined>;
1066
+ declare const useBackendMoneyMarketAssetSuppliers: (params: UseBackendMoneyMarketAssetSuppliersParams | undefined) => UseQueryResult<MoneyMarketAssetSuppliers | undefined, Error>;
874
1067
 
1068
+ type UseBackendAllMoneyMarketBorrowersParams = {
1069
+ pagination: BackendPaginationParams;
1070
+ queryOptions?: UseQueryOptions<MoneyMarketBorrowers | undefined, Error>;
1071
+ };
875
1072
  /**
876
1073
  * Hook for fetching all money market borrowers from the backend API.
877
1074
  *
@@ -910,10 +1107,7 @@ declare const useBackendMoneyMarketAssetSuppliers: (params: {
910
1107
  * - Supports pagination through offset and limit parameters
911
1108
  * - Returns borrowers across all money market assets
912
1109
  */
913
- declare const useBackendAllMoneyMarketBorrowers: (params: {
914
- offset: string;
915
- limit: string;
916
- } | undefined) => UseQueryResult<MoneyMarketBorrowers | undefined>;
1110
+ declare const useBackendAllMoneyMarketBorrowers: (params: UseBackendAllMoneyMarketBorrowersParams | undefined) => UseQueryResult<MoneyMarketBorrowers | undefined>;
917
1111
 
918
1112
  /**
919
1113
  * Hook for checking token allowance for bridge operations.
@@ -1015,7 +1209,7 @@ declare function useBridge(spokeProvider: SpokeProvider | undefined): UseMutatio
1015
1209
  * }
1016
1210
  * ```
1017
1211
  */
1018
- declare function useGetBridgeableAmount(from: XToken$1 | undefined, to: XToken$1 | undefined): UseQueryResult<bigint, Error>;
1212
+ declare function useGetBridgeableAmount(from: XToken | undefined, to: XToken | undefined): UseQueryResult<bigint, Error>;
1019
1213
 
1020
1214
  /**
1021
1215
  /**
@@ -1050,7 +1244,7 @@ declare function useGetBridgeableAmount(from: XToken$1 | undefined, to: XToken$1
1050
1244
  * }
1051
1245
  * ```
1052
1246
  */
1053
- declare function useGetBridgeableTokens(from: SpokeChainId | undefined, to: SpokeChainId | undefined, token: string | undefined): UseQueryResult<XToken$1[], Error>;
1247
+ declare function useGetBridgeableTokens(from: SpokeChainId | undefined, to: SpokeChainId | undefined, token: string | undefined): UseQueryResult<XToken[], Error>;
1054
1248
 
1055
1249
  /**
1056
1250
  * Hook for executing stake transactions to stake SODA tokens and receive xSODA shares.
@@ -1474,11 +1668,11 @@ declare const MIGRATION_MODE_ICX_SODA = "icxsoda";
1474
1668
  declare const MIGRATION_MODE_BNUSD = "bnusd";
1475
1669
  type MigrationMode = typeof MIGRATION_MODE_ICX_SODA | typeof MIGRATION_MODE_BNUSD;
1476
1670
  interface MigrationIntentParams {
1477
- token: XToken | undefined;
1671
+ token: XToken$1 | undefined;
1478
1672
  amount: string | undefined;
1479
1673
  sourceAddress: string | undefined;
1480
1674
  migrationMode?: MigrationMode;
1481
- toToken?: XToken;
1675
+ toToken?: XToken$1;
1482
1676
  destinationAddress?: string;
1483
1677
  }
1484
1678
 
@@ -1562,4 +1756,4 @@ interface SodaxProviderProps {
1562
1756
  }
1563
1757
  declare const SodaxProvider: ({ children, testnet, config, rpcConfig }: SodaxProviderProps) => ReactElement;
1564
1758
 
1565
- export { MIGRATION_MODE_BNUSD, MIGRATION_MODE_ICX_SODA, type MigrationIntentParams, type MigrationMode, SodaxProvider, useAToken, 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, useMigrate, useMigrationAllowance, useMigrationApprove, useQuote, useRepay, useRequestTrustline, useReservesData, useReservesUsdFormat, useSodaxContext, useSpokeProvider, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarTrustlineCheck, useSupply, useSwap, useSwapAllowance, useSwapApprove, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserReservesData, useWithdraw };
1759
+ export { type BackendPaginationParams, MIGRATION_MODE_BNUSD, MIGRATION_MODE_ICX_SODA, type MigrationIntentParams, type MigrationMode, SodaxProvider, type UseATokenParams, type UseBorrowParams, type UseMMAllowanceParams, type UseMMApproveParams, type UseRepayParams, type UseReservesDataParams, type UseReservesUsdFormatParams, type UseSupplyParams, type UseUserFormattedSummaryParams, type UseUserReservesDataParams, type UseWithdrawParams, useAToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBorrow, useBridge, useBridgeAllowance, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useConvertedAssets, useCreateLimitOrder, useDeriveUserWalletAddress, useEstimateGas, useGetBridgeableAmount, useGetBridgeableTokens, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useMMAllowance, useMMApprove, useMigrate, useMigrationAllowance, useMigrationApprove, useQuote, useRepay, useRequestTrustline, useReservesData, useReservesUsdFormat, useSodaxContext, useSpokeProvider, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarTrustlineCheck, useSupply, useSwap, useSwapAllowance, useSwapApprove, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserFormattedSummary, useUserReservesData, useWithdraw };