@aave/react 4.0.0-next.1 → 4.0.0-next.11

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 (46) hide show
  1. package/README.md +8 -4
  2. package/dist/chunk-7FNJZJRF.js +2 -0
  3. package/dist/chunk-7FNJZJRF.js.map +1 -0
  4. package/dist/chunk-IESN2WLA.js +2 -0
  5. package/dist/chunk-IESN2WLA.js.map +1 -0
  6. package/dist/ethers.cjs +2 -0
  7. package/dist/ethers.cjs.map +1 -0
  8. package/dist/ethers.d.cts +93 -0
  9. package/dist/ethers.d.ts +93 -0
  10. package/dist/ethers.js +2 -0
  11. package/dist/ethers.js.map +1 -0
  12. package/dist/index.cjs +2 -0
  13. package/dist/index.cjs.map +1 -0
  14. package/dist/index.d.cts +2806 -0
  15. package/dist/index.d.ts +2806 -0
  16. package/dist/index.js +2 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/misc-BUJSXsyz.d.ts +375 -0
  19. package/dist/misc-CB94S1RB.d.cts +375 -0
  20. package/dist/privy.cjs +2 -0
  21. package/dist/privy.cjs.map +1 -0
  22. package/dist/privy.d.cts +72 -0
  23. package/dist/privy.d.ts +72 -0
  24. package/dist/privy.js +2 -0
  25. package/dist/privy.js.map +1 -0
  26. package/dist/thirdweb.cjs +2 -0
  27. package/dist/thirdweb.cjs.map +1 -0
  28. package/dist/thirdweb.d.cts +69 -0
  29. package/dist/thirdweb.d.ts +69 -0
  30. package/dist/thirdweb.js +2 -0
  31. package/dist/thirdweb.js.map +1 -0
  32. package/dist/utils.cjs +2 -0
  33. package/dist/utils.cjs.map +1 -0
  34. package/dist/utils.d.cts +1 -0
  35. package/dist/utils.d.ts +1 -0
  36. package/dist/utils.js +2 -0
  37. package/dist/utils.js.map +1 -0
  38. package/dist/viem/index.cjs +2 -0
  39. package/dist/viem/index.cjs.map +1 -0
  40. package/dist/viem/index.d.cts +87 -0
  41. package/dist/viem/index.d.ts +87 -0
  42. package/dist/viem/index.js +2 -0
  43. package/dist/viem/index.js.map +1 -0
  44. package/dist/writes-BXnwYgAQ.d.cts +123 -0
  45. package/dist/writes-BXnwYgAQ.d.ts +123 -0
  46. package/package.json +7 -7
@@ -0,0 +1,2806 @@
1
+ import { AaveClient, CurrencyQueryOptions, TimeWindowQueryOptions, UnexpectedError, ValidationError, ActivitiesRequest, PaginatedActivitiesResult } from '@aave/client';
2
+ export * from '@aave/client';
3
+ import React, { ReactNode } from 'react';
4
+ import { a as UseAsyncTask, C as CancelOperation, S as SendTransactionError, P as PendingTransactionError, b as PendingTransaction, T as TransactionHandler } from './writes-BXnwYgAQ.js';
5
+ export { A as AsyncTaskError, c as AsyncTaskIdle, d as AsyncTaskLoading, e as AsyncTaskState, f as AsyncTaskSuccess, g as TransactionHandlerOptions, U as UseSendTransactionResult } from './writes-BXnwYgAQ.js';
6
+ import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, HubSummaryHistoryRequest, HubSummarySample, PermitRequest, PermitTypedDataResponse, AssetRequest, Asset, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, AssetBorrowHistoryRequest, AssetBorrowSample, ProtocolHistoryRequest, ProtocolHistorySample, ReserveRequest, Reserve, ReservesRequest, BorrowApyHistoryRequest, ApySample, SupplyApyHistoryRequest, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, SwapQuoteRequest, SwapQuote, SwappableTokensRequest, Token, UserSwapsRequest, PaginatedUserSwapsResult, PrepareSwapRequest, SwapByIntentTypedData, SwapByIntentWithApprovalRequired, SwapTransactionRequest, SwapApprovalRequired, ERC20PermitSignature, SwapReceipt, InsufficientBalanceError, CancelSwapTypedData, TransactionRequest, PrepareSwapCancelRequest, SwapCancelled, SupplyRequest, BorrowRequest, RepayRequest, WithdrawRequest, RenounceSpokeUserPositionManagerRequest, UpdateUserPositionConditionsRequest, SetUserSuppliesAsCollateralRequest, LiquidatePositionRequest, SetSpokeUserPositionManagerRequest, PreviewRequest, PreviewUserPosition, UserSuppliesRequest, UserSupplyItem, UserBorrowsRequest, UserBorrowItem, UserSummaryRequest, UserSummary, UserPositionsRequest, UserPosition, UserPositionRequest, UserBalancesRequest, UserBalance, UserRiskPremiumBreakdownRequest, UserRiskPremiumBreakdownItem, UserSummaryHistoryRequest, UserSummaryHistoryItem } from '@aave/graphql';
7
+ import { Prettify, ResultAsync, ResultAwareError, TxHash } from '@aave/types';
8
+ import { S as Suspendable, a as SuspenseResult, P as Pausable, b as PausableSuspenseResult, R as ReadResult, c as PausableReadResult, d as Selector } from './misc-BUJSXsyz.js';
9
+ export { e as UseChainArgs, f as UseChainsArgs, i as UseExchangeRateArgs, U as UseNetworkFee, l as UseNetworkFeeArgs, k as UseNetworkFeeRequestQuery, u as useChain, g as useChains, j as useExchangeRate, h as useExchangeRateAction } from './misc-BUJSXsyz.js';
10
+ import { UnexpectedError as UnexpectedError$1, SigningError, CancelError, TimeoutError, TransactionError, ValidationError as ValidationError$1 } from '@aave/core';
11
+ import { UserPositionQueryOptions } from '@aave/client/actions';
12
+
13
+ /**
14
+ * <AaveProvider> props
15
+ */
16
+ type AaveProviderProps = {
17
+ /**
18
+ * The children to render
19
+ */
20
+ children: ReactNode;
21
+ /**
22
+ * The Aave client instance to use
23
+ */
24
+ client: AaveClient;
25
+ };
26
+ /**
27
+ * Manages the internal state of the Aave SDK.
28
+ *
29
+ * ```tsx
30
+ * import { AaveProvider, AaveClient, production } from '@aave/react';
31
+ *
32
+ * const client = AaveClient.create({
33
+ * environment: production,
34
+ * });
35
+ *
36
+ * function App() {
37
+ * return (
38
+ * <AaveProvider client={client}>
39
+ * // ...
40
+ * </AaveProvider>
41
+ * );
42
+ * }
43
+ * ```
44
+ */
45
+ declare function AaveProvider({ children, client }: AaveProviderProps): React.JSX.Element;
46
+
47
+ /**
48
+ * @internal
49
+ */
50
+ declare function useAaveClient(): AaveClient;
51
+
52
+ type UseHubArgs = Prettify<HubRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
53
+ /**
54
+ * Fetch a specific hub by ID or by address and chain ID.
55
+ *
56
+ * This signature supports React Suspense:
57
+ *
58
+ * ```tsx
59
+ * const { data } = useHub({
60
+ * query: { hubId: hubId('SGVsbG8h') },
61
+ * suspense: true,
62
+ * });
63
+ * // data will be Hub | null
64
+ * ```
65
+ */
66
+ declare function useHub(args: UseHubArgs & Suspendable): SuspenseResult<Hub | null>;
67
+ /**
68
+ * Fetch a specific hub by ID or by address and chain ID.
69
+ *
70
+ * Pausable suspense mode.
71
+ *
72
+ * ```tsx
73
+ * const { data } = useHub({
74
+ * query: { hubId: hubId('SGVsbG8h') },
75
+ * suspense: true,
76
+ * pause: true,
77
+ * });
78
+ * ```
79
+ */
80
+ declare function useHub(args: Pausable<UseHubArgs> & Suspendable): PausableSuspenseResult<Hub | null>;
81
+ /**
82
+ * Fetch a specific hub by ID or by address and chain ID.
83
+ *
84
+ * ```tsx
85
+ * const { data, error, loading } = useHub({
86
+ * query: { hubId: hubId('SGVsbG8h') },
87
+ * });
88
+ * // data will be Hub | null
89
+ * ```
90
+ */
91
+ declare function useHub(args: UseHubArgs): ReadResult<Hub | null>;
92
+ /**
93
+ * Fetch a specific hub by ID or by address and chain ID.
94
+ *
95
+ * Pausable loading state mode.
96
+ *
97
+ * ```tsx
98
+ * const { data, error, loading, paused } = useHub({
99
+ * query: { hubId: hubId('SGVsbG8h') },
100
+ * pause: true,
101
+ * });
102
+ * ```
103
+ */
104
+ declare function useHub(args: Pausable<UseHubArgs>): PausableReadResult<Hub | null>;
105
+ type UseHubsArgs = Prettify<HubsRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
106
+ /**
107
+ * Fetch multiple hubs based on specified criteria.
108
+ *
109
+ * This signature supports React Suspense:
110
+ *
111
+ * ```tsx
112
+ * const { data } = useHubs({
113
+ * query: { chainIds: [chainId(1)] },
114
+ * suspense: true,
115
+ * });
116
+ * ```
117
+ */
118
+ declare function useHubs(args: UseHubsArgs & Suspendable): SuspenseResult<Hub[]>;
119
+ /**
120
+ * Fetch multiple hubs based on specified criteria.
121
+ *
122
+ * Pausable suspense mode.
123
+ *
124
+ * ```tsx
125
+ * const { data } = useHubs({
126
+ * query: { chainIds: [chainId(1)] },
127
+ * suspense: true,
128
+ * pause: true,
129
+ * });
130
+ * ```
131
+ */
132
+ declare function useHubs(args: Pausable<UseHubsArgs> & Suspendable): PausableSuspenseResult<Hub[]>;
133
+ /**
134
+ * Fetch multiple hubs based on specified criteria.
135
+ *
136
+ * ```tsx
137
+ * const { data, error, loading } = useHubs({
138
+ * query: { chainIds: [chainId(1)] },
139
+ * });
140
+ * ```
141
+ */
142
+ declare function useHubs(args: UseHubsArgs): ReadResult<Hub[]>;
143
+ /**
144
+ * Fetch multiple hubs based on specified criteria.
145
+ *
146
+ * Pausable loading state mode.
147
+ *
148
+ * ```tsx
149
+ * const { data, error, loading, paused } = useHubs({
150
+ * query: { chainIds: [chainId(1)] },
151
+ * pause: true,
152
+ * });
153
+ * ```
154
+ */
155
+ declare function useHubs(args: Pausable<UseHubsArgs>): PausableReadResult<Hub[]>;
156
+ type UseHubAssetsArgs = Prettify<HubAssetsRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
157
+ /**
158
+ * Fetch hub assets for a specific hub by ID or by address and chain ID.
159
+ *
160
+ * This signature supports React Suspense:
161
+ *
162
+ * ```tsx
163
+ * const { data } = useHubAssets({
164
+ * query: { hubId: hubId('SGVsbG8h') },
165
+ * user: evmAddress('0x456...'), // optional
166
+ * suspense: true,
167
+ * });
168
+ * ```
169
+ */
170
+ declare function useHubAssets(args: UseHubAssetsArgs & Suspendable): SuspenseResult<HubAsset[]>;
171
+ /**
172
+ * Fetch hub assets for a specific hub by ID or by address and chain ID.
173
+ *
174
+ * Pausable suspense mode.
175
+ *
176
+ * ```tsx
177
+ * const { data } = useHubAssets({
178
+ * query: { hubId: hubId('SGVsbG8h') },
179
+ * user: evmAddress('0x456...'), // optional
180
+ * suspense: true,
181
+ * pause: true,
182
+ * });
183
+ * ```
184
+ */
185
+ declare function useHubAssets(args: Pausable<UseHubAssetsArgs> & Suspendable): PausableSuspenseResult<HubAsset[]>;
186
+ /**
187
+ * Fetch hub assets for a specific hub by ID or by address and chain ID.
188
+ *
189
+ * ```tsx
190
+ * const { data, error, loading } = useHubAssets({
191
+ * query: { hubId: hubId('SGVsbG8h') },
192
+ * user: evmAddress('0x456...'), // optional
193
+ * });
194
+ * ```
195
+ */
196
+ declare function useHubAssets(args: UseHubAssetsArgs): ReadResult<HubAsset[]>;
197
+ /**
198
+ * Fetch hub assets for a specific hub by ID or by address and chain ID.
199
+ *
200
+ * Pausable loading state mode.
201
+ *
202
+ * ```tsx
203
+ * const { data, error, loading, paused } = useHubAssets({
204
+ * query: { hubId: hubId('SGVsbG8h') },
205
+ * user: evmAddress('0x456...'), // optional
206
+ * pause: true,
207
+ * });
208
+ * ```
209
+ */
210
+ declare function useHubAssets(args: Pausable<UseHubAssetsArgs>): PausableReadResult<HubAsset[]>;
211
+ type UseHubSummaryHistoryArgs = HubSummaryHistoryRequest;
212
+ /**
213
+ * Fetch historical summary data for a specific hub.
214
+ *
215
+ * This signature supports React Suspense:
216
+ *
217
+ * ```tsx
218
+ * const { data } = useHubSummaryHistory({
219
+ * query: { hubId: hubId('SGVsbG8h') },
220
+ * currency: Currency.Usd,
221
+ * window: TimeWindow.LastWeek,
222
+ * suspense: true,
223
+ * });
224
+ * ```
225
+ */
226
+ declare function useHubSummaryHistory(args: UseHubSummaryHistoryArgs & Suspendable): SuspenseResult<HubSummarySample[]>;
227
+ /**
228
+ * Fetch historical summary data for a specific hub.
229
+ *
230
+ * Pausable suspense mode.
231
+ *
232
+ * ```tsx
233
+ * const { data } = useHubSummaryHistory({
234
+ * query: { hubId: hubId('SGVsbG8h') },
235
+ * suspense: true,
236
+ * pause: true,
237
+ * });
238
+ * ```
239
+ */
240
+ declare function useHubSummaryHistory(args: Pausable<UseHubSummaryHistoryArgs> & Suspendable): PausableSuspenseResult<HubSummarySample[]>;
241
+ /**
242
+ * Fetch historical summary data for a specific hub.
243
+ *
244
+ * ```tsx
245
+ * const { data, error, loading } = useHubSummaryHistory({
246
+ * query: { hubId: hubId('SGVsbG8h') },
247
+ * currency: Currency.Usd,
248
+ * window: TimeWindow.LastWeek,
249
+ * });
250
+ * ```
251
+ */
252
+ declare function useHubSummaryHistory(args: UseHubSummaryHistoryArgs): ReadResult<HubSummarySample[]>;
253
+ /**
254
+ * Fetch historical summary data for a specific hub.
255
+ *
256
+ * Pausable loading state mode.
257
+ *
258
+ * ```tsx
259
+ * const { data, error, loading, paused } = useHubSummaryHistory({
260
+ * query: { hubId: hubId('SGVsbG8h') },
261
+ * pause: true,
262
+ * });
263
+ * ```
264
+ */
265
+ declare function useHubSummaryHistory(args: Pausable<UseHubSummaryHistoryArgs>): PausableReadResult<HubSummarySample[]>;
266
+ /**
267
+ * Low-level hook to execute a {@link hubs} action directly.
268
+ *
269
+ * @experimental This hook is experimental and may be subject to breaking changes.
270
+ * @remarks
271
+ * This hook **does not** actively watch for updated data on the hubs.
272
+ * Use this hook to retrieve data on demand as part of a larger workflow
273
+ * (e.g., in an event handler in order to move to the next step).
274
+ *
275
+ * ```ts
276
+ * const [execute, { called, data, error, loading }] = useHubsAction();
277
+ *
278
+ * // …
279
+ *
280
+ * const result = await execute({
281
+ * query: {
282
+ * chainIds: [chainId(1)]
283
+ * }
284
+ * });
285
+ *
286
+ * if (result.isOk()) {
287
+ * console.log(result.value); // Hub[]
288
+ * } else {
289
+ * console.error(result.error);
290
+ * }
291
+ * ```
292
+ */
293
+ declare function useHubsAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<HubsRequest, Hub[], UnexpectedError>;
294
+
295
+ /**
296
+ * @internal
297
+ */
298
+ declare function usePermitTypedDataAction(): UseAsyncTask<PermitRequest, PermitTypedDataResponse, UnexpectedError>;
299
+
300
+ type UseAssetArgs = Prettify<AssetRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
301
+ /**
302
+ * Fetch information about a specific asset (ERC20 token) in the protocol by ID or by token.
303
+ *
304
+ * This signature supports React Suspense:
305
+ *
306
+ * ```tsx
307
+ * const { data } = useAsset({
308
+ * query: { assetId: assetId('SGVsbG8h') },
309
+ * suspense: true,
310
+ * });
311
+ * // data will be Asset | null
312
+ * ```
313
+ */
314
+ declare function useAsset(args: UseAssetArgs & Suspendable): SuspenseResult<Asset | null>;
315
+ /**
316
+ * Fetch information about a specific asset (ERC20 token) in the protocol by ID or by token.
317
+ *
318
+ * Pausable suspense mode.
319
+ *
320
+ * ```tsx
321
+ * const { data } = useAsset({
322
+ * query: { assetId: assetId('SGVsbG8h') },
323
+ * suspense: true,
324
+ * pause: true,
325
+ * });
326
+ * ```
327
+ */
328
+ declare function useAsset(args: Pausable<UseAssetArgs> & Suspendable): PausableSuspenseResult<Asset | null>;
329
+ /**
330
+ * Fetch information about a specific asset (ERC20 token) in the protocol by ID or by token.
331
+ *
332
+ * ```tsx
333
+ * const { data, error, loading } = useAsset({
334
+ * query: { assetId: assetId('SGVsbG8h') },
335
+ * });
336
+ * // data will be Asset | null
337
+ * ```
338
+ */
339
+ declare function useAsset(args: UseAssetArgs): ReadResult<Asset | null>;
340
+ /**
341
+ * Fetch information about a specific asset (ERC20 token) in the protocol by ID or by token.
342
+ *
343
+ * Pausable loading state mode.
344
+ *
345
+ * ```tsx
346
+ * const { data, error, loading, paused } = useAsset({
347
+ * query: { assetId: assetId('SGVsbG8h') },
348
+ * pause: true,
349
+ * });
350
+ * ```
351
+ */
352
+ declare function useAsset(args: Pausable<UseAssetArgs>): PausableReadResult<Asset | null>;
353
+ type UseAssetPriceHistoryArgs = AssetPriceHistoryRequest;
354
+ /**
355
+ * Fetch historical price data for a specific asset.
356
+ *
357
+ * This signature supports React Suspense:
358
+ *
359
+ * ```tsx
360
+ * const { data } = useAssetPriceHistory({
361
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
362
+ * currency: Currency.Usd,
363
+ * window: TimeWindow.LastWeek,
364
+ * suspense: true,
365
+ * });
366
+ * ```
367
+ */
368
+ declare function useAssetPriceHistory(args: UseAssetPriceHistoryArgs & Suspendable): SuspenseResult<AssetPriceSample[]>;
369
+ /**
370
+ * Fetch historical price data for a specific asset.
371
+ *
372
+ * Pausable suspense mode.
373
+ *
374
+ * ```tsx
375
+ * const { data } = useAssetPriceHistory({
376
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
377
+ * suspense: true,
378
+ * pause: true,
379
+ * });
380
+ * ```
381
+ */
382
+ declare function useAssetPriceHistory(args: Pausable<UseAssetPriceHistoryArgs> & Suspendable): PausableSuspenseResult<AssetPriceSample[]>;
383
+ /**
384
+ * Fetch historical price data for a specific asset.
385
+ *
386
+ * ```tsx
387
+ * const { data, error, loading } = useAssetPriceHistory({
388
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
389
+ * currency: Currency.Usd,
390
+ * window: TimeWindow.LastWeek,
391
+ * });
392
+ * ```
393
+ */
394
+ declare function useAssetPriceHistory(args: UseAssetPriceHistoryArgs): ReadResult<AssetPriceSample[]>;
395
+ /**
396
+ * Fetch historical price data for a specific asset.
397
+ *
398
+ * Pausable loading state mode.
399
+ *
400
+ * ```tsx
401
+ * const { data, error, loading, paused } = useAssetPriceHistory({
402
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
403
+ * pause: true,
404
+ * });
405
+ * ```
406
+ */
407
+ declare function useAssetPriceHistory(args: Pausable<UseAssetPriceHistoryArgs>): PausableReadResult<AssetPriceSample[]>;
408
+ type UseAssetSupplyHistoryArgs = AssetSupplyHistoryRequest;
409
+ /**
410
+ * Fetch historical supply data for a specific asset.
411
+ *
412
+ * This signature supports React Suspense:
413
+ *
414
+ * ```tsx
415
+ * const { data } = useAssetSupplyHistory({
416
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
417
+ * window: TimeWindow.LastWeek,
418
+ * suspense: true,
419
+ * });
420
+ * ```
421
+ */
422
+ declare function useAssetSupplyHistory(args: UseAssetSupplyHistoryArgs & Suspendable): SuspenseResult<AssetSupplySample[]>;
423
+ /**
424
+ * Fetch historical supply data for a specific asset.
425
+ *
426
+ * Pausable suspense mode.
427
+ *
428
+ * ```tsx
429
+ * const { data } = useAssetSupplyHistory({
430
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
431
+ * suspense: true,
432
+ * pause: true,
433
+ * });
434
+ * ```
435
+ */
436
+ declare function useAssetSupplyHistory(args: Pausable<UseAssetSupplyHistoryArgs> & Suspendable): PausableSuspenseResult<AssetSupplySample[]>;
437
+ /**
438
+ * Fetch historical supply data for a specific asset.
439
+ *
440
+ * ```tsx
441
+ * const { data, error, loading } = useAssetSupplyHistory({
442
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
443
+ * window: TimeWindow.LastWeek,
444
+ * });
445
+ * ```
446
+ */
447
+ declare function useAssetSupplyHistory(args: UseAssetSupplyHistoryArgs): ReadResult<AssetSupplySample[]>;
448
+ /**
449
+ * Fetch historical supply data for a specific asset.
450
+ *
451
+ * Pausable loading state mode.
452
+ *
453
+ * ```tsx
454
+ * const { data, error, loading, paused } = useAssetSupplyHistory({
455
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
456
+ * pause: true,
457
+ * });
458
+ * ```
459
+ */
460
+ declare function useAssetSupplyHistory(args: Pausable<UseAssetSupplyHistoryArgs>): PausableReadResult<AssetSupplySample[]>;
461
+ type UseAssetBorrowHistoryArgs = AssetBorrowHistoryRequest;
462
+ /**
463
+ * Fetch historical borrow data for a specific asset.
464
+ *
465
+ * This signature supports React Suspense:
466
+ *
467
+ * ```tsx
468
+ * const { data } = useAssetBorrowHistory({
469
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
470
+ * window: TimeWindow.LastWeek,
471
+ * suspense: true,
472
+ * });
473
+ * ```
474
+ */
475
+ declare function useAssetBorrowHistory(args: UseAssetBorrowHistoryArgs & Suspendable): SuspenseResult<AssetBorrowSample[]>;
476
+ /**
477
+ * Fetch historical borrow data for a specific asset.
478
+ *
479
+ * Pausable suspense mode.
480
+ *
481
+ * ```tsx
482
+ * const { data } = useAssetBorrowHistory({
483
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
484
+ * suspense: true,
485
+ * pause: true,
486
+ * });
487
+ * ```
488
+ */
489
+ declare function useAssetBorrowHistory(args: Pausable<UseAssetBorrowHistoryArgs> & Suspendable): PausableSuspenseResult<AssetBorrowSample[]>;
490
+ /**
491
+ * Fetch historical borrow data for a specific asset.
492
+ *
493
+ * ```tsx
494
+ * const { data, error, loading } = useAssetBorrowHistory({
495
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
496
+ * window: TimeWindow.LastWeek,
497
+ * });
498
+ * ```
499
+ */
500
+ declare function useAssetBorrowHistory(args: UseAssetBorrowHistoryArgs): ReadResult<AssetBorrowSample[]>;
501
+ /**
502
+ * Fetch historical borrow data for a specific asset.
503
+ *
504
+ * Pausable loading state mode.
505
+ *
506
+ * ```tsx
507
+ * const { data, error, loading, paused } = useAssetBorrowHistory({
508
+ * token: { chainId: chainId(1), address: evmAddress('0x123...') },
509
+ * pause: true,
510
+ * });
511
+ * ```
512
+ */
513
+ declare function useAssetBorrowHistory(args: Pausable<UseAssetBorrowHistoryArgs>): PausableReadResult<AssetBorrowSample[]>;
514
+ type UseProtocolHistoryArgs = ProtocolHistoryRequest;
515
+ /**
516
+ * Fetch historical protocol-wide data (deposits, borrows, earnings).
517
+ *
518
+ * This signature supports React Suspense:
519
+ *
520
+ * ```tsx
521
+ * const { data } = useProtocolHistory({
522
+ * currency: Currency.Usd,
523
+ * window: TimeWindow.LastWeek,
524
+ * suspense: true,
525
+ * });
526
+ * ```
527
+ */
528
+ declare function useProtocolHistory(args: UseProtocolHistoryArgs & Suspendable): SuspenseResult<ProtocolHistorySample[]>;
529
+ /**
530
+ * Fetch historical protocol-wide data (deposits, borrows, earnings).
531
+ *
532
+ * Pausable suspense mode.
533
+ *
534
+ * ```tsx
535
+ * const { data } = useProtocolHistory({
536
+ * currency: Currency.Usd,
537
+ * window: TimeWindow.LastWeek,
538
+ * suspense: true,
539
+ * pause: true,
540
+ * });
541
+ * ```
542
+ */
543
+ declare function useProtocolHistory(args: Pausable<UseProtocolHistoryArgs> & Suspendable): PausableSuspenseResult<ProtocolHistorySample[]>;
544
+ /**
545
+ * Fetch historical protocol-wide data (deposits, borrows, earnings).
546
+ *
547
+ * ```tsx
548
+ * const { data, error, loading } = useProtocolHistory({
549
+ * currency: Currency.Usd,
550
+ * window: TimeWindow.LastWeek,
551
+ * });
552
+ * ```
553
+ */
554
+ declare function useProtocolHistory(args: UseProtocolHistoryArgs): ReadResult<ProtocolHistorySample[]>;
555
+ /**
556
+ * Fetch historical protocol-wide data (deposits, borrows, earnings).
557
+ *
558
+ * Pausable loading state mode.
559
+ *
560
+ * ```tsx
561
+ * const { data, error, loading, paused } = useProtocolHistory({
562
+ * currency: Currency.Usd,
563
+ * window: TimeWindow.LastWeek,
564
+ * pause: true,
565
+ * });
566
+ * ```
567
+ */
568
+ declare function useProtocolHistory(args: Pausable<UseProtocolHistoryArgs>): PausableReadResult<ProtocolHistorySample[]>;
569
+
570
+ type UseReserveArgs = Prettify<ReserveRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
571
+ /**
572
+ * Fetch a specific reserve by reserve ID, spoke, and chain.
573
+ *
574
+ * This signature supports React Suspense:
575
+ *
576
+ * ```tsx
577
+ * const { data } = useReserve({
578
+ * reserve: reserveId('SGVsbG8h'),
579
+ * user: evmAddress('0xabc...'),
580
+ * suspense: true,
581
+ * });
582
+ * // data will be Reserve | null
583
+ * ```
584
+ */
585
+ declare function useReserve(args: UseReserveArgs & Suspendable): SuspenseResult<Reserve | null>;
586
+ /**
587
+ * Fetch a specific reserve by reserve ID, spoke, and chain.
588
+ *
589
+ * Pausable suspense mode.
590
+ *
591
+ * ```tsx
592
+ * const { data } = useReserve({
593
+ * reserve: reserveId('SGVsbG8h'),
594
+ * suspense: true,
595
+ * pause: true,
596
+ * });
597
+ * ```
598
+ */
599
+ declare function useReserve(args: Pausable<UseReserveArgs> & Suspendable): PausableSuspenseResult<Reserve | null>;
600
+ /**
601
+ * Fetch a specific reserve by reserve ID, spoke, and chain.
602
+ *
603
+ * ```tsx
604
+ * const { data, error, loading } = useReserve({
605
+ * reserve: reserveId('SGVsbG8h'),
606
+ * user: evmAddress('0xabc...'),
607
+ * });
608
+ * // data will be Reserve | null
609
+ * ```
610
+ */
611
+ declare function useReserve(args: UseReserveArgs): ReadResult<Reserve | null>;
612
+ /**
613
+ * Fetch a specific reserve by reserve ID, spoke, and chain.
614
+ *
615
+ * Pausable loading state mode.
616
+ *
617
+ * ```tsx
618
+ * const { data, error, loading, paused } = useReserve({
619
+ * reserve: reserveId('SGVsbG8h'),
620
+ * pause: true,
621
+ * });
622
+ * ```
623
+ */
624
+ declare function useReserve(args: Pausable<UseReserveArgs>): PausableReadResult<Reserve | null>;
625
+ /**
626
+ * Low-level hook to execute a {@link reserve} action directly.
627
+ *
628
+ * @experimental This hook is experimental and may be subject to breaking changes.
629
+ * @remarks
630
+ * This hook **does not** actively watch for updated data on the reserve.
631
+ * Use this hook to retrieve data on demand as part of a larger workflow
632
+ * (e.g., in an event handler in order to move to the next step).
633
+ *
634
+ * ```ts
635
+ * const [execute, { called, data, error, loading }] = useReserveAction();
636
+ *
637
+ * // …
638
+ *
639
+ * const result = await execute({
640
+ * reserve: reserveId('SGVsbG8h'),
641
+ * });
642
+ *
643
+ * if (result.isOk()) {
644
+ * console.log(result.value); // Reserve | null
645
+ * } else {
646
+ * console.error(result.error);
647
+ * }
648
+ * ```
649
+ */
650
+ declare function useReserveAction(options?: Required<CurrencyQueryOptions> & TimeWindowQueryOptions): UseAsyncTask<ReserveRequest, Reserve | null, UnexpectedError>;
651
+ type UseReservesArgs<T = Reserve[]> = Prettify<ReservesRequest & CurrencyQueryOptions & TimeWindowQueryOptions & {
652
+ /**
653
+ * A function that maps the full list of reserves
654
+ * into a derived or narrowed value.
655
+ *
656
+ * Example: pick a single reserve based on a criteria.
657
+ *
658
+ * @experimental This is experimental and may be subject to breaking changes.
659
+ */
660
+ selector?: Selector<Reserve[], T>;
661
+ }>;
662
+ /**
663
+ * Fetch reserves based on specified criteria.
664
+ *
665
+ * This signature supports React Suspense:
666
+ *
667
+ * ```tsx
668
+ * const { data } = useReserves({
669
+ * query: {
670
+ * spoke: {
671
+ * address: evmAddress('0x123...'),
672
+ * chainId: chainId(1)
673
+ * }
674
+ * },
675
+ * filter: ReservesRequestFilter.All,
676
+ * orderBy: { name: 'ASC' },
677
+ * suspense: true,
678
+ * });
679
+ * ```
680
+ *
681
+ * **Reserves with Highest Supply APY**
682
+ * ```tsx
683
+ * const { data } = useReserves({
684
+ * query: {
685
+ * spoke: {
686
+ * address: evmAddress('0x123...'),
687
+ * chainId: chainId(1)
688
+ * }
689
+ * },
690
+ * suspense: true,
691
+ * selector: pickHighestSupplyApyReserve,
692
+ * });
693
+ * ```
694
+ *
695
+ * **Reserves with Lowest Borrow APY**
696
+ * ```tsx
697
+ * const { data } = useReserves({
698
+ * query: {
699
+ * spoke: {
700
+ * address: evmAddress('0x123...'),
701
+ * chainId: chainId(1)
702
+ * }
703
+ * },
704
+ * suspense: true,
705
+ * selector: pickLowestBorrowApyReserve,
706
+ * });
707
+ * ```
708
+ */
709
+ declare function useReserves<T = Reserve[]>(args: UseReservesArgs<T> & Suspendable): SuspenseResult<T>;
710
+ /**
711
+ * Fetch reserves based on specified criteria.
712
+ *
713
+ * Pausable suspense mode.
714
+ *
715
+ * ```tsx
716
+ * const { data } = useReserves({
717
+ * query: {
718
+ * spoke: {
719
+ * address: evmAddress('0x123...'),
720
+ * chainId: chainId(1)
721
+ * }
722
+ * },
723
+ * suspense: true,
724
+ * pause: true,
725
+ * });
726
+ * ```
727
+ */
728
+ declare function useReserves<T = Reserve[]>(args: Pausable<UseReservesArgs<T>> & Suspendable): PausableSuspenseResult<T>;
729
+ /**
730
+ * Fetch reserves based on specified criteria.
731
+ *
732
+ * ```tsx
733
+ * const { data, error, loading } = useReserves({
734
+ * query: {
735
+ * spoke: {
736
+ * address: evmAddress('0x123...'),
737
+ * chainId: chainId(1)
738
+ * }
739
+ * },
740
+ * filter: ReservesRequestFilter.All,
741
+ * orderBy: { name: 'ASC' },
742
+ * });
743
+ * ```
744
+ *
745
+ * **Reserves with Highest Supply APY**
746
+ * ```tsx
747
+ * const { data } = useReserves({
748
+ * query: {
749
+ * spoke: {
750
+ * address: evmAddress('0x123...'),
751
+ * chainId: chainId(1)
752
+ * }
753
+ * },
754
+ * selector: pickHighestSupplyApyReserve,
755
+ * });
756
+ * ```
757
+ *
758
+ * **Reserves with Lowest Borrow APY**
759
+ * ```tsx
760
+ * const { data } = useReserves({
761
+ * query: {
762
+ * spoke: {
763
+ * address: evmAddress('0x123...'),
764
+ * chainId: chainId(1)
765
+ * }
766
+ * },
767
+ * selector: pickLowestBorrowApyReserve,
768
+ * });
769
+ * ```
770
+ */
771
+ declare function useReserves<T = Reserve[]>(args: UseReservesArgs<T>): ReadResult<T>;
772
+ /**
773
+ * Fetch reserves based on specified criteria.
774
+ *
775
+ * Pausable loading state mode.
776
+ *
777
+ * ```tsx
778
+ * const { data, error, loading, paused } = useReserves({
779
+ * query: {
780
+ * spoke: {
781
+ * address: evmAddress('0x123...'),
782
+ * chainId: chainId(1)
783
+ * }
784
+ * },
785
+ * pause: true,
786
+ * });
787
+ * ```
788
+ */
789
+ declare function useReserves<T = Reserve[]>(args: Pausable<UseReservesArgs<T>>): PausableReadResult<T>;
790
+ /**
791
+ * Low-level hook to execute a {@link reserves} action directly.
792
+ *
793
+ * @experimental This hook is experimental and may be subject to breaking changes.
794
+ * @remarks
795
+ * This hook **does not** actively watch for updated data on the reserves.
796
+ * Use this hook to retrieve data on demand as part of a larger workflow
797
+ * (e.g., in an event handler in order to move to the next step).
798
+ *
799
+ * ```ts
800
+ * const [execute, { called, data, error, loading }] = useReservesAction();
801
+ *
802
+ * // …
803
+ *
804
+ * const result = await execute({
805
+ * query: {
806
+ * spoke: {
807
+ * address: evmAddress('0x1234…'),
808
+ * chainId: chainId(1)
809
+ * }
810
+ * }
811
+ * });
812
+ *
813
+ * if (result.isOk()) {
814
+ * console.log(result.value); // Reserve[]
815
+ * } else {
816
+ * console.error(result.error);
817
+ * }
818
+ * ```
819
+ *
820
+ * **Reserves with Highest Supply APY**
821
+ * ```ts
822
+ * const [execute, { called, data, error, loading }] = useReservesAction();
823
+ *
824
+ * // …
825
+ *
826
+ * const result = await execute(…).map(pickHighestSupplyApyReserve);
827
+ *
828
+ * if (result.isOk()) {
829
+ * console.log(result.value); // Reserve | null
830
+ * } else {
831
+ * console.error(result.error);
832
+ * }
833
+ * ```
834
+ *
835
+ * **Reserves with Lowest Borrow APY**
836
+ * ```ts
837
+ * const [execute, { called, data, error, loading }] = useReservesAction();
838
+ *
839
+ * // …
840
+ *
841
+ * const result = await execute(…).map(pickLowestBorrowApyReserve);
842
+ *
843
+ * if (result.isOk()) {
844
+ * console.log(result.value); // Reserve | null
845
+ * } else {
846
+ * console.error(result.error);
847
+ * }
848
+ * ```
849
+ */
850
+ declare function useReservesAction(options?: Required<CurrencyQueryOptions> & TimeWindowQueryOptions): UseAsyncTask<ReservesRequest, Reserve[], UnexpectedError>;
851
+ type UseBorrowApyHistoryArgs = BorrowApyHistoryRequest;
852
+ /**
853
+ * Fetch borrow APY history for a specific reserve over time.
854
+ *
855
+ * This signature supports React Suspense:
856
+ *
857
+ * ```tsx
858
+ * const { data } = useBorrowApyHistory({
859
+ * reserve: reserveId('SGVsbG8h'),
860
+ * window: TimeWindow.LastWeek,
861
+ * suspense: true,
862
+ * });
863
+ * ```
864
+ */
865
+ declare function useBorrowApyHistory(args: UseBorrowApyHistoryArgs & Suspendable): SuspenseResult<ApySample[]>;
866
+ /**
867
+ * Fetch borrow APY history for a specific reserve over time.
868
+ *
869
+ * Pausable suspense mode.
870
+ *
871
+ * ```tsx
872
+ * const { data } = useBorrowApyHistory({
873
+ * reserve: reserveId('SGVsbG8h'),
874
+ * window: TimeWindow.LastWeek,
875
+ * suspense: true,
876
+ * pause: true,
877
+ * });
878
+ * ```
879
+ */
880
+ declare function useBorrowApyHistory(args: Pausable<UseBorrowApyHistoryArgs> & Suspendable): PausableSuspenseResult<ApySample[]>;
881
+ /**
882
+ * Fetch borrow APY history for a specific reserve over time.
883
+ *
884
+ * ```tsx
885
+ * const { data, error, loading } = useBorrowApyHistory({
886
+ * reserve: reserveId('SGVsbG8h'),
887
+ * window: TimeWindow.LastWeek,
888
+ * });
889
+ * ```
890
+ */
891
+ declare function useBorrowApyHistory(args: UseBorrowApyHistoryArgs): ReadResult<ApySample[]>;
892
+ /**
893
+ * Fetch borrow APY history for a specific reserve over time.
894
+ *
895
+ * Pausable loading state mode.
896
+ *
897
+ * ```tsx
898
+ * const { data, error, loading, paused } = useBorrowApyHistory({
899
+ * reserve: reserveId('SGVsbG8h'),
900
+ * window: TimeWindow.LastWeek,
901
+ * pause: true,
902
+ * });
903
+ * ```
904
+ */
905
+ declare function useBorrowApyHistory(args: Pausable<UseBorrowApyHistoryArgs>): PausableReadResult<ApySample[]>;
906
+ type UseSupplyApyHistoryArgs = SupplyApyHistoryRequest;
907
+ /**
908
+ * Fetch supply APY history for a specific reserve over time.
909
+ *
910
+ * This signature supports React Suspense:
911
+ *
912
+ * ```tsx
913
+ * const { data } = useSupplyApyHistory({
914
+ * reserve: reserveId('SGVsbG8h'),
915
+ * window: TimeWindow.LastWeek,
916
+ * suspense: true,
917
+ * });
918
+ * ```
919
+ */
920
+ declare function useSupplyApyHistory(args: UseSupplyApyHistoryArgs & Suspendable): SuspenseResult<ApySample[]>;
921
+ /**
922
+ * Fetch supply APY history for a specific reserve over time.
923
+ *
924
+ * Pausable suspense mode.
925
+ *
926
+ * ```tsx
927
+ * const { data } = useSupplyApyHistory({
928
+ * reserve: reserveId('SGVsbG8h'),
929
+ * window: TimeWindow.LastWeek,
930
+ * suspense: true,
931
+ * pause: true,
932
+ * });
933
+ * ```
934
+ */
935
+ declare function useSupplyApyHistory(args: Pausable<UseSupplyApyHistoryArgs> & Suspendable): PausableSuspenseResult<ApySample[]>;
936
+ /**
937
+ * Fetch supply APY history for a specific reserve over time.
938
+ *
939
+ * ```tsx
940
+ * const { data, error, loading } = useSupplyApyHistory({
941
+ * reserve: reserveId('SGVsbG8h'),
942
+ * window: TimeWindow.LastWeek,
943
+ * });
944
+ * ```
945
+ */
946
+ declare function useSupplyApyHistory(args: UseSupplyApyHistoryArgs): ReadResult<ApySample[]>;
947
+ /**
948
+ * Fetch supply APY history for a specific reserve over time.
949
+ *
950
+ * Pausable loading state mode.
951
+ *
952
+ * ```tsx
953
+ * const { data, error, loading, paused } = useSupplyApyHistory({
954
+ * reserve: reserveId('SGVsbG8h'),
955
+ * window: TimeWindow.LastWeek,
956
+ * pause: true,
957
+ * });
958
+ * ```
959
+ */
960
+ declare function useSupplyApyHistory(args: Pausable<UseSupplyApyHistoryArgs>): PausableReadResult<ApySample[]>;
961
+
962
+ type UseSpokeArgs = SpokeRequest;
963
+ /**
964
+ * Fetch a specific spoke.
965
+ *
966
+ * This signature supports React Suspense:
967
+ *
968
+ * ```tsx
969
+ * const { data } = useSpoke({
970
+ * query: { spokeId: spokeId('SGVsbG8h') },
971
+ * suspense: true,
972
+ * });
973
+ * // data will be Spoke | null
974
+ * ```
975
+ */
976
+ declare function useSpoke(args: UseSpokeArgs & Suspendable): SuspenseResult<Spoke | null>;
977
+ /**
978
+ * Fetch a specific spoke.
979
+ *
980
+ * Pausable suspense mode.
981
+ *
982
+ * ```tsx
983
+ * const { data } = useSpoke({
984
+ * query: { spokeId: spokeId('SGVsbG8h') },
985
+ * suspense: true,
986
+ * pause: true,
987
+ * });
988
+ * ```
989
+ */
990
+ declare function useSpoke(args: Pausable<UseSpokeArgs> & Suspendable): PausableSuspenseResult<Spoke | null>;
991
+ /**
992
+ * Fetch a specific spoke.
993
+ *
994
+ * ```tsx
995
+ * const { data, error, loading } = useSpoke({
996
+ * query: { spokeId: spokeId('SGVsbG8h') },
997
+ * });
998
+ * // data will be Spoke | null
999
+ * ```
1000
+ */
1001
+ declare function useSpoke(args: UseSpokeArgs): ReadResult<Spoke | null>;
1002
+ /**
1003
+ * Fetch a specific spoke.
1004
+ *
1005
+ * Pausable loading state mode.
1006
+ *
1007
+ * ```tsx
1008
+ * const { data, error, loading, paused } = useSpoke({
1009
+ * query: { spokeId: spokeId('SGVsbG8h') },
1010
+ * pause: true,
1011
+ * });
1012
+ * ```
1013
+ */
1014
+ declare function useSpoke(args: Pausable<UseSpokeArgs>): PausableReadResult<Spoke | null>;
1015
+ type UseSpokesArgs = SpokesRequest;
1016
+ /**
1017
+ * Fetch spokes based on specified criteria.
1018
+ *
1019
+ * This signature supports React Suspense:
1020
+ *
1021
+ * ```tsx
1022
+ * const { data } = useSpokes({
1023
+ * query: { chainIds: [chainId(1)] },
1024
+ * suspense: true,
1025
+ * });
1026
+ * ```
1027
+ */
1028
+ declare function useSpokes(args: UseSpokesArgs & Suspendable): SuspenseResult<Spoke[]>;
1029
+ /**
1030
+ * Fetch spokes based on specified criteria.
1031
+ *
1032
+ * Pausable suspense mode.
1033
+ *
1034
+ * ```tsx
1035
+ * const { data } = useSpokes({
1036
+ * query: { chainIds: [chainId(1)] },
1037
+ * suspense: true,
1038
+ * pause: true,
1039
+ * });
1040
+ * ```
1041
+ */
1042
+ declare function useSpokes(args: Pausable<UseSpokesArgs> & Suspendable): PausableSuspenseResult<Spoke[]>;
1043
+ /**
1044
+ * Fetch spokes based on specified criteria.
1045
+ *
1046
+ * ```tsx
1047
+ * const { data, error, loading } = useSpokes({
1048
+ * query: { chainIds: [chainId(1)] },
1049
+ * });
1050
+ * ```
1051
+ */
1052
+ declare function useSpokes(args: UseSpokesArgs): ReadResult<Spoke[]>;
1053
+ /**
1054
+ * Fetch spokes based on specified criteria.
1055
+ *
1056
+ * Pausable loading state mode.
1057
+ *
1058
+ * ```tsx
1059
+ * const { data, error, loading, paused } = useSpokes({
1060
+ * query: { chainIds: [chainId(1)] },
1061
+ * pause: true,
1062
+ * });
1063
+ * ```
1064
+ */
1065
+ declare function useSpokes(args: Pausable<UseSpokesArgs>): PausableReadResult<Spoke[]>;
1066
+ type UseSpokePositionManagersArgs = SpokePositionManagersRequest;
1067
+ /**
1068
+ * Fetches all the positions manager for a specific spoke.
1069
+ *
1070
+ * This signature supports React Suspense:
1071
+ *
1072
+ * ```tsx
1073
+ * const { data } = useSpokePositionManagers({
1074
+ * spoke: spokeId('SGVsbG8h'),
1075
+ * suspense: true,
1076
+ * });
1077
+ * ```
1078
+ */
1079
+ declare function useSpokePositionManagers(args: UseSpokePositionManagersArgs & Suspendable): SuspenseResult<PaginatedSpokePositionManagerResult>;
1080
+ /**
1081
+ * Fetches all the positions manager for a specific spoke.
1082
+ *
1083
+ * Pausable suspense mode.
1084
+ *
1085
+ * ```tsx
1086
+ * const { data } = useSpokePositionManagers({
1087
+ * spoke: spokeId('SGVsbG8h'),
1088
+ * suspense: true,
1089
+ * pause: true,
1090
+ * });
1091
+ * ```
1092
+ */
1093
+ declare function useSpokePositionManagers(args: Pausable<UseSpokePositionManagersArgs> & Suspendable): PausableSuspenseResult<PaginatedSpokePositionManagerResult>;
1094
+ /**
1095
+ * Fetches all the positions manager for a specific spoke.
1096
+ *
1097
+ * ```tsx
1098
+ * const { data, error, loading } = useSpokePositionManagers({
1099
+ * spoke: spokeId('SGVsbG8h'),
1100
+ * });
1101
+ * ```
1102
+ */
1103
+ declare function useSpokePositionManagers(args: UseSpokePositionManagersArgs): ReadResult<PaginatedSpokePositionManagerResult>;
1104
+ /**
1105
+ * Fetches all the positions manager for a specific spoke.
1106
+ *
1107
+ * Pausable loading state mode.
1108
+ *
1109
+ * ```tsx
1110
+ * const { data, error, loading, paused } = useSpokePositionManagers({
1111
+ * spoke: spokeId('SGVsbG8h'),
1112
+ * pause: true,
1113
+ * });
1114
+ * ```
1115
+ */
1116
+ declare function useSpokePositionManagers(args: Pausable<UseSpokePositionManagersArgs>): PausableReadResult<PaginatedSpokePositionManagerResult>;
1117
+ type UseSpokeUserPositionManagersArgs = SpokeUserPositionManagersRequest;
1118
+ /**
1119
+ * Fetches all the position managers of a user for a specific spoke
1120
+ *
1121
+ * This signature supports React Suspense:
1122
+ *
1123
+ * ```tsx
1124
+ * const { data } = useSpokeUserPositionManagers({
1125
+ * spoke: spokeId('SGVsbG8h'),
1126
+ * user: evmAddress('0x123...'),
1127
+ * suspense: true,
1128
+ * });
1129
+ * ```
1130
+ */
1131
+ declare function useSpokeUserPositionManagers(args: UseSpokeUserPositionManagersArgs & Suspendable): SuspenseResult<PaginatedSpokeUserPositionManagerResult>;
1132
+ /**
1133
+ * Fetches all the position managers of a user for a specific spoke
1134
+ *
1135
+ * Pausable suspense mode.
1136
+ *
1137
+ * ```tsx
1138
+ * const { data } = useSpokeUserPositionManagers({
1139
+ * spoke: spokeId('SGVsbG8h'),
1140
+ * user: evmAddress('0x123...'),
1141
+ * suspense: true,
1142
+ * pause: true,
1143
+ * });
1144
+ * ```
1145
+ */
1146
+ declare function useSpokeUserPositionManagers(args: Pausable<UseSpokeUserPositionManagersArgs> & Suspendable): PausableSuspenseResult<PaginatedSpokeUserPositionManagerResult>;
1147
+ /**
1148
+ * Fetches all the position managers of a user for a specific spoke
1149
+ *
1150
+ * ```tsx
1151
+ * const { data, error, loading } = useSpokeUserPositionManagers({
1152
+ * spoke: spokeId('SGVsbG8h'),
1153
+ * user: evmAddress('0x123...'),
1154
+ * });
1155
+ * ```
1156
+ */
1157
+ declare function useSpokeUserPositionManagers(args: UseSpokeUserPositionManagersArgs): ReadResult<PaginatedSpokeUserPositionManagerResult>;
1158
+ /**
1159
+ * Fetches all the position managers of a user for a specific spoke
1160
+ *
1161
+ * Pausable loading state mode.
1162
+ *
1163
+ * ```tsx
1164
+ * const { data, error, loading, paused } = useSpokeUserPositionManagers({
1165
+ * spoke: spokeId('SGVsbG8h'),
1166
+ * user: evmAddress('0x123...'),
1167
+ * pause: true,
1168
+ * });
1169
+ * ```
1170
+ */
1171
+ declare function useSpokeUserPositionManagers(args: Pausable<UseSpokeUserPositionManagersArgs>): PausableReadResult<PaginatedSpokeUserPositionManagerResult>;
1172
+
1173
+ type UseSwapQuoteArgs = Prettify<SwapQuoteRequest & CurrencyQueryOptions>;
1174
+ /**
1175
+ * @internal
1176
+ * Fetch a swap quote for the specified trade parameters.
1177
+ *
1178
+ * This signature supports React Suspense:
1179
+ *
1180
+ * ```tsx
1181
+ * const { data } = useSwapQuote({
1182
+ * chainId: chainId(1),
1183
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1184
+ * sell: { erc20: evmAddress('0x6B175474E...') },
1185
+ * amount: bigDecimal('1000'),
1186
+ * kind: SwapKind.SELL,
1187
+ * suspense: true,
1188
+ * });
1189
+ * ```
1190
+ */
1191
+ declare function useSwapQuote(args: UseSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
1192
+ /**
1193
+ * @internal
1194
+ * Fetch a swap quote for the specified trade parameters.
1195
+ *
1196
+ * Pausable suspense mode.
1197
+ *
1198
+ * ```tsx
1199
+ * const { data } = useSwapQuote({
1200
+ * chainId: chainId(1),
1201
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1202
+ * sell: { erc20: evmAddress('0x6B175474E...') },
1203
+ * amount: bigDecimal('1000'),
1204
+ * kind: SwapKind.SELL,
1205
+ * from: evmAddress('0x742d35cc...'),
1206
+ * suspense: true,
1207
+ * pause: true,
1208
+ * });
1209
+ * ```
1210
+ */
1211
+ declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
1212
+ /**
1213
+ * @internal
1214
+ * Fetch a swap quote for the specified trade parameters.
1215
+ *
1216
+ * ```tsx
1217
+ * const { data, error, loading } = useSwapQuote({
1218
+ * chainId: chainId(1),
1219
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1220
+ * sell: { erc20: evmAddress('0x6B175474E...') },
1221
+ * amount: bigDecimal('1000'),
1222
+ * kind: SwapKind.SELL,
1223
+ * });
1224
+ * ```
1225
+ */
1226
+ declare function useSwapQuote(args: UseSwapQuoteArgs): ReadResult<SwapQuote>;
1227
+ /**
1228
+ * @internal
1229
+ * Fetch a swap quote for the specified trade parameters.
1230
+ *
1231
+ * Pausable loading state mode.
1232
+ *
1233
+ * ```tsx
1234
+ * const { data, error, loading, paused } = useSwapQuote({
1235
+ * chainId: chainId(1),
1236
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1237
+ * sell: { erc20: evmAddress('0x6B175474E...') },
1238
+ * amount: bigDecimal('1000'),
1239
+ * kind: SwapKind.SELL,
1240
+ * from: evmAddress('0x742d35cc...'),
1241
+ * pause: true,
1242
+ * });
1243
+ * ```
1244
+ */
1245
+ declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs>): PausableReadResult<SwapQuote>;
1246
+ /**
1247
+ * @internal
1248
+ * Low-level hook to execute a swap quote action directly.
1249
+ *
1250
+ * @experimental This hook is experimental and may be subject to breaking changes.
1251
+ * @remarks
1252
+ * This hook **does not** actively watch for updated data on the swap quote.
1253
+ * Use this hook to retrieve quotes on demand as part of a larger workflow
1254
+ * (e.g., in an event handler to get a fresh quote before executing a swap).
1255
+ *
1256
+ * ```ts
1257
+ * const [getQuote, { called, data, error, loading }] = useSwapQuoteAction();
1258
+ *
1259
+ * // …
1260
+ *
1261
+ * const result = await getQuote({
1262
+ * chainId: chainId(1),
1263
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1264
+ * sell: { erc20: evmAddress('0x6B175474E...') },
1265
+ * amount: bigDecimal('1000'),
1266
+ * kind: SwapKind.SELL,
1267
+ * });
1268
+ *
1269
+ * if (result.isOk()) {
1270
+ * console.log('Swap quote:', result.value);
1271
+ * } else {
1272
+ * console.error(result.error);
1273
+ * }
1274
+ * ```
1275
+ */
1276
+ declare function useSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<SwapQuoteRequest, SwapQuote, UnexpectedError$1>;
1277
+ type UseSwappableTokensArgs = SwappableTokensRequest;
1278
+ /**
1279
+ * @internal
1280
+ * Fetch the list of tokens available for swapping on a specific chain.
1281
+ *
1282
+ * This signature supports React Suspense:
1283
+ *
1284
+ * ```tsx
1285
+ * const { data } = useSwappableTokens({
1286
+ * query: { chainIds: [chainId(1)] },
1287
+ * suspense: true,
1288
+ * });
1289
+ * ```
1290
+ */
1291
+ declare function useSwappableTokens(args: UseSwappableTokensArgs & Suspendable): SuspenseResult<Token[]>;
1292
+ /**
1293
+ * @internal
1294
+ * Fetch the list of tokens available for swapping on a specific chain.
1295
+ *
1296
+ * Pausable suspense mode.
1297
+ *
1298
+ * ```tsx
1299
+ * const { data } = useSwappableTokens({
1300
+ * query: { chainIds: [chainId(1)] },
1301
+ * suspense: true,
1302
+ * pause: true,
1303
+ * });
1304
+ * ```
1305
+ */
1306
+ declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs> & Suspendable): PausableSuspenseResult<Token[]>;
1307
+ /**
1308
+ * @internal
1309
+ * Fetch the list of tokens available for swapping on a specific chain.
1310
+ *
1311
+ * ```tsx
1312
+ * const { data, error, loading } = useSwappableTokens({
1313
+ * query: { chainIds: [chainId(1)] },
1314
+ * });
1315
+ * ```
1316
+ */
1317
+ declare function useSwappableTokens(args: UseSwappableTokensArgs): ReadResult<Token[]>;
1318
+ /**
1319
+ * @internal
1320
+ * Fetch the list of tokens available for swapping on a specific chain.
1321
+ *
1322
+ * Pausable loading state mode.
1323
+ *
1324
+ * ```tsx
1325
+ * const { data, error, loading, paused } = useSwappableTokens({
1326
+ * query: { chainIds: [chainId(1)] },
1327
+ * pause: true,
1328
+ * });
1329
+ * ```
1330
+ */
1331
+ declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs>): PausableReadResult<Token[]>;
1332
+ type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions>;
1333
+ /**
1334
+ * @internal
1335
+ * Fetch the user's swap history for a specific chain.
1336
+ *
1337
+ * This signature supports React Suspense:
1338
+ *
1339
+ * ```tsx
1340
+ * const { data } = useUserSwaps({
1341
+ * chainId: chainId(1),
1342
+ * user: evmAddress('0x742d35cc...'),
1343
+ * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1344
+ * suspense: true,
1345
+ * });
1346
+ * ```
1347
+ */
1348
+ declare function useUserSwaps(args: UseUserSwapsArgs & Suspendable): SuspenseResult<PaginatedUserSwapsResult>;
1349
+ /**
1350
+ * @internal
1351
+ * Fetch the user's swap history for a specific chain.
1352
+ *
1353
+ * Pausable suspense mode.
1354
+ *
1355
+ * ```tsx
1356
+ * const { data } = useUserSwaps({
1357
+ * chainId: chainId(1),
1358
+ * user: evmAddress('0x742d35cc...'),
1359
+ * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1360
+ * suspense: true,
1361
+ * pause: true,
1362
+ * });
1363
+ * ```
1364
+ */
1365
+ declare function useUserSwaps(args: Pausable<UseUserSwapsArgs> & Suspendable): PausableSuspenseResult<PaginatedUserSwapsResult>;
1366
+ /**
1367
+ * @internal
1368
+ * Fetch the user's swap history for a specific chain.
1369
+ *
1370
+ * ```tsx
1371
+ * const { data, error, loading } = useUserSwaps({
1372
+ * chainId: chainId(1),
1373
+ * user: evmAddress('0x742d35cc...'),
1374
+ * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1375
+ * });
1376
+ * ```
1377
+ */
1378
+ declare function useUserSwaps(args: UseUserSwapsArgs): ReadResult<PaginatedUserSwapsResult>;
1379
+ /**
1380
+ * @internal
1381
+ * Fetch the user's swap history for a specific chain.
1382
+ *
1383
+ * Pausable loading state mode.
1384
+ *
1385
+ * ```tsx
1386
+ * const { data, error, loading, paused } = useUserSwaps({
1387
+ * chainId: chainId(1),
1388
+ * user: evmAddress('0x742d35cc...'),
1389
+ * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1390
+ * pause: true,
1391
+ * });
1392
+ * ```
1393
+ */
1394
+ declare function useUserSwaps(args: Pausable<UseUserSwapsArgs>): PausableReadResult<PaginatedUserSwapsResult>;
1395
+ type UseSwapTokensRequest = Prettify<PrepareSwapRequest & CurrencyQueryOptions>;
1396
+ type SwapIntent = SwapByIntentTypedData | SwapByIntentWithApprovalRequired | SwapTransactionRequest | SwapApprovalRequired;
1397
+ type SwapHandlerOptions = {
1398
+ cancel: CancelOperation;
1399
+ };
1400
+ type SwapHandler = (intent: SwapIntent, options: SwapHandlerOptions) => ResultAsync<ERC20PermitSignature | SwapReceipt, SendTransactionError | PendingTransactionError>;
1401
+ /**
1402
+ * @internal
1403
+ * Orchestrate the swap execution plan.
1404
+ *
1405
+ * ```tsx
1406
+ * const [sendTransaction, sending] = useSendTransaction(wallet);
1407
+ * const [signSwapByIntentWith, signing] = useSignSwapByIntentWith(wallet);
1408
+ *
1409
+ * const [swap, swapping] = useSwapTokens((plan) => {
1410
+ * switch (plan.__typename) {
1411
+ * case 'SwapByIntentTypedData':
1412
+ * return signSwapByIntentWith(plan);
1413
+ *
1414
+ * case 'SwapApprovalRequired':
1415
+ * case 'SwapByIntentWithApprovalRequired':
1416
+ * return sendTransaction(plan.transaction);
1417
+ *
1418
+ * case 'SwapTransactionRequest':
1419
+ * return sendTransaction(plan.transaction);
1420
+ * }
1421
+ * });
1422
+ *
1423
+ * const result = await swap({
1424
+ * market: {
1425
+ * chainId: chainId(1),
1426
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1427
+ * sell: { erc20: evmAddress('0x6B175474E...') },
1428
+ * amount: bigDecimal('1000'),
1429
+ * kind: SwapKind.SELL,
1430
+ * user: evmAddress('0x742d35cc...'),
1431
+ * },
1432
+ * });
1433
+ *
1434
+ * if (result.isErr()) {
1435
+ * console.error(result.error);
1436
+ * return;
1437
+ * }
1438
+ *
1439
+ * // result.value: SwapReceipt
1440
+ * ```
1441
+ */
1442
+ declare function useSwapTokens(handler: SwapHandler): UseAsyncTask<PrepareSwapRequest, SwapReceipt, SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1443
+ type CancelSwapHandler = (data: CancelSwapTypedData | TransactionRequest) => ResultAsync<ERC20PermitSignature | PendingTransaction, SigningError | UnexpectedError$1>;
1444
+ declare class CannotCancelSwapError extends ResultAwareError {
1445
+ name: "CannotCancelSwapError";
1446
+ }
1447
+ type CancelSwapError = CancelError | CannotCancelSwapError | SigningError | TimeoutError | TransactionError | UnexpectedError$1;
1448
+ /**
1449
+ * @internal
1450
+ * Executes the complete swap cancellation workflow combining preparation and execution.
1451
+ *
1452
+ * ```tsx
1453
+ * const [sendTransaction] = useSendTransaction(wallet);
1454
+ * const [signSwapCancelWith] = useSignSwapCancelWith(wallet);
1455
+ *
1456
+ * const [cancelSwap, {loading, error}] = useCancelSwap((plan: CancelSwapTypedData | TransactionRequest) => {
1457
+ * switch (plan.__typename) {
1458
+ * case 'TransactionRequest':
1459
+ * return sendTransaction(plan);
1460
+ *
1461
+ * case 'CancelSwapTypedData':
1462
+ * return signSwapCancelWith(plan);
1463
+ * }
1464
+ * });
1465
+ *
1466
+ * const result = await cancelSwap({
1467
+ * id: swapId('123...'),
1468
+ * });
1469
+ *
1470
+ * if (result.isErr()) {
1471
+ * console.error(result.error);
1472
+ * return;
1473
+ * }
1474
+ *
1475
+ * // result.value: SwapCancelled
1476
+ * console.log('Swap cancelled:', result.value);
1477
+ * ```
1478
+ */
1479
+ declare function useCancelSwap(handler: CancelSwapHandler): UseAsyncTask<PrepareSwapCancelRequest, SwapCancelled, CancelSwapError>;
1480
+
1481
+ /**
1482
+ * A hook that provides a way to supply assets to an Aave reserve.
1483
+ *
1484
+ * ```ts
1485
+ * const [sendTransaction] = useSendTransaction(wallet);
1486
+ * const [supply, { loading, error }] = useSupply((plan, { cancel }) => {
1487
+ * switch (plan.__typename) {
1488
+ * case 'TransactionRequest':
1489
+ * return sendTransaction(plan);
1490
+ * case 'Erc20ApprovalRequired':
1491
+ * case 'PreContractActionRequired':
1492
+ * return sendTransaction(plan.transaction);
1493
+ * }
1494
+ * });
1495
+ *
1496
+ * // …
1497
+ *
1498
+ * const result = await supply({ ... });
1499
+ *
1500
+ * if (result.isErr()) {
1501
+ * switch (result.error.name) {
1502
+ * case 'CancelError':
1503
+ * // The user cancelled the operation
1504
+ * return;
1505
+ *
1506
+ * case 'SigningError':
1507
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1508
+ * break;
1509
+ *
1510
+ * case 'TimeoutError':
1511
+ * console.error(`Transaction timed out: ${result.error.message}`);
1512
+ * break;
1513
+ *
1514
+ * case 'TransactionError':
1515
+ * console.error(`Transaction failed: ${result.error.message}`);
1516
+ * break;
1517
+ *
1518
+ * case 'ValidationError':
1519
+ * console.error(`Insufficient balance: ${result.error.cause.required.value} required.`);
1520
+ * break;
1521
+ *
1522
+ * case 'UnexpectedError':
1523
+ * console.error(result.error.message);
1524
+ * break;
1525
+ * }
1526
+ * return;
1527
+ * }
1528
+ *
1529
+ * console.log('Transaction sent with hash:', result.value);
1530
+ * ```
1531
+ *
1532
+ * @param handler - The handler that will be used to handle the transactions.
1533
+ */
1534
+ declare function useSupply(handler: TransactionHandler): UseAsyncTask<SupplyRequest, TxHash, SendTransactionError | PendingTransactionError | ValidationError$1<InsufficientBalanceError>>;
1535
+ /**
1536
+ * A hook that provides a way to borrow assets from an Aave reserve.
1537
+ *
1538
+ * ```ts
1539
+ * const [sendTransaction] = useSendTransaction(wallet);
1540
+ * const [borrow, { loading, error }] = useBorrow((plan, { cancel }) => {
1541
+ * switch (plan.__typename) {
1542
+ * case 'TransactionRequest':
1543
+ * return sendTransaction(plan);
1544
+ * case 'Erc20ApprovalRequired':
1545
+ * case 'PreContractActionRequired':
1546
+ * return sendTransaction(plan.transaction);
1547
+ * }
1548
+ * });
1549
+ *
1550
+ * // …
1551
+ *
1552
+ * const result = await borrow({ ... });
1553
+ *
1554
+ * if (result.isErr()) {
1555
+ * switch (result.error.name) {
1556
+ * case 'CancelError':
1557
+ * // The user cancelled the operation
1558
+ * return;
1559
+ *
1560
+ * case 'SigningError':
1561
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1562
+ * break;
1563
+ *
1564
+ * case 'TimeoutError':
1565
+ * console.error(`Transaction timed out: ${result.error.message}`);
1566
+ * break;
1567
+ *
1568
+ * case 'TransactionError':
1569
+ * console.error(`Transaction failed: ${result.error.message}`);
1570
+ * break;
1571
+ *
1572
+ * case 'ValidationError':
1573
+ * console.error(`Insufficient balance: ${result.error.cause.required.value} required.`);
1574
+ * break;
1575
+ *
1576
+ * case 'UnexpectedError':
1577
+ * console.error(result.error.message);
1578
+ * break;
1579
+ * }
1580
+ * return;
1581
+ * }
1582
+ *
1583
+ * console.log('Transaction sent with hash:', result.value);
1584
+ * ```
1585
+ *
1586
+ * @param handler - The handler that will be used to handle the transactions.
1587
+ */
1588
+ declare function useBorrow(handler: TransactionHandler): UseAsyncTask<BorrowRequest, TxHash, SendTransactionError | PendingTransactionError | ValidationError$1<InsufficientBalanceError>>;
1589
+ /**
1590
+ * A hook that provides a way to repay borrowed assets to an Aave reserve.
1591
+ *
1592
+ * ```ts
1593
+ * const [sendTransaction] = useSendTransaction(wallet);
1594
+ * const [repay, { loading, error }] = useRepay((plan, { cancel }) => {
1595
+ * switch (plan.__typename) {
1596
+ * case 'TransactionRequest':
1597
+ * return sendTransaction(plan);
1598
+ * case 'Erc20ApprovalRequired':
1599
+ * case 'PreContractActionRequired':
1600
+ * return sendTransaction(plan.transaction);
1601
+ * }
1602
+ * });
1603
+ *
1604
+ * // …
1605
+ *
1606
+ * const result = await repay({ ... });
1607
+ *
1608
+ * if (result.isErr()) {
1609
+ * switch (result.error.name) {
1610
+ * case 'CancelError':
1611
+ * // The user cancelled the operation
1612
+ * return;
1613
+ *
1614
+ * case 'SigningError':
1615
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1616
+ * break;
1617
+ *
1618
+ * case 'TimeoutError':
1619
+ * console.error(`Transaction timed out: ${result.error.message}`);
1620
+ * break;
1621
+ *
1622
+ * case 'TransactionError':
1623
+ * console.error(`Transaction failed: ${result.error.message}`);
1624
+ * break;
1625
+ *
1626
+ * case 'ValidationError':
1627
+ * console.error(`Insufficient balance: ${result.error.cause.required.value} required.`);
1628
+ * break;
1629
+ *
1630
+ * case 'UnexpectedError':
1631
+ * console.error(result.error.message);
1632
+ * break;
1633
+ * }
1634
+ * return;
1635
+ * }
1636
+ *
1637
+ * console.log('Transaction sent with hash:', result.value);
1638
+ * ```
1639
+ *
1640
+ * @param handler - The handler that will be used to handle the transactions.
1641
+ */
1642
+ declare function useRepay(handler: TransactionHandler): UseAsyncTask<RepayRequest, TxHash, SendTransactionError | PendingTransactionError | ValidationError$1<InsufficientBalanceError>>;
1643
+ /**
1644
+ * A hook that provides a way to withdraw supplied assets from an Aave reserve.
1645
+ *
1646
+ * ```ts
1647
+ * const [sendTransaction] = useSendTransaction(wallet);
1648
+ * const [withdraw, { loading, error }] = useWithdraw((plan, { cancel }) => {
1649
+ * switch (plan.__typename) {
1650
+ * case 'TransactionRequest':
1651
+ * return sendTransaction(plan);
1652
+ * case 'Erc20ApprovalRequired':
1653
+ * case 'PreContractActionRequired':
1654
+ * return sendTransaction(plan.transaction);
1655
+ * }
1656
+ * });
1657
+ *
1658
+ * // …
1659
+ *
1660
+ * const result = await withdraw({ ... });
1661
+ *
1662
+ * if (result.isErr()) {
1663
+ * switch (result.error.name) {
1664
+ * case 'CancelError':
1665
+ * // The user cancelled the operation
1666
+ * return;
1667
+ *
1668
+ * case 'SigningError':
1669
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1670
+ * break;
1671
+ *
1672
+ * case 'TimeoutError':
1673
+ * console.error(`Transaction timed out: ${result.error.message}`);
1674
+ * break;
1675
+ *
1676
+ * case 'TransactionError':
1677
+ * console.error(`Transaction failed: ${result.error.message}`);
1678
+ * break;
1679
+ *
1680
+ * case 'ValidationError':
1681
+ * console.error(`Insufficient balance: ${result.error.cause.required.value} required.`);
1682
+ * break;
1683
+ *
1684
+ * case 'UnexpectedError':
1685
+ * console.error(result.error.message);
1686
+ * break;
1687
+ * }
1688
+ * return;
1689
+ * }
1690
+ *
1691
+ * console.log('Transaction sent with hash:', result.value);
1692
+ * ```
1693
+ *
1694
+ * @param handler - The handler that will be used to handle the transactions.
1695
+ */
1696
+ declare function useWithdraw(handler: TransactionHandler): UseAsyncTask<WithdrawRequest, TxHash, SendTransactionError | PendingTransactionError | ValidationError$1<InsufficientBalanceError>>;
1697
+ /**
1698
+ * A hook that provides a way to renounce a position manager of a user for a specific spoke.
1699
+ *
1700
+ * ```ts
1701
+ * const [sendTransaction] = useSendTransaction(wallet);
1702
+ * const [renounceSpokeUserPositionManager, { loading, error }] = useRenounceSpokeUserPositionManager(sendTransaction);
1703
+ *
1704
+ * // …
1705
+ *
1706
+ * const result = await renounceSpokeUserPositionManager({ ... });
1707
+ *
1708
+ * if (result.isErr()) {
1709
+ * switch (result.error.name) {
1710
+ * case 'CancelError':
1711
+ * // The user cancelled the operation
1712
+ * return;
1713
+ *
1714
+ * case 'SigningError':
1715
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1716
+ * break;
1717
+ *
1718
+ * case 'TimeoutError':
1719
+ * console.error(`Transaction timed out: ${result.error.message}`);
1720
+ * break;
1721
+ *
1722
+ * case 'TransactionError':
1723
+ * console.error(`Transaction failed: ${result.error.message}`);
1724
+ * break;
1725
+ *
1726
+ * case 'UnexpectedError':
1727
+ * console.error(result.error.message);
1728
+ * break;
1729
+ * }
1730
+ * return;
1731
+ * }
1732
+ *
1733
+ * console.log('Transaction sent with hash:', result.value);
1734
+ * ```
1735
+ *
1736
+ * @param handler - The handler that will be used to handle the transaction.
1737
+ */
1738
+ declare function useRenounceSpokeUserPositionManager(handler: TransactionHandler): UseAsyncTask<RenounceSpokeUserPositionManagerRequest, TxHash, SendTransactionError | PendingTransactionError>;
1739
+ /**
1740
+ * Hook for updating user position conditions (dynamic config and/or risk premium).
1741
+ *
1742
+ * ```ts
1743
+ * const [sendTransaction] = useSendTransaction(wallet);
1744
+ * const [update, { loading, error }] = useUpdateUserPositionConditions((transaction, { cancel }) => {
1745
+ * return sendTransaction(transaction);
1746
+ * });
1747
+ *
1748
+ * // …
1749
+ *
1750
+ * const result = await update({
1751
+ * userPositionId: userPosition.id,
1752
+ * update: UserPositionConditionsUpdate.AllDynamicConfig,
1753
+ * });
1754
+ *
1755
+ * if (result.isErr()) {
1756
+ * switch (result.error.name) {
1757
+ * case 'CancelError':
1758
+ * // The user cancelled the operation
1759
+ * return;
1760
+ *
1761
+ * case 'SigningError':
1762
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1763
+ * break;
1764
+ *
1765
+ * case 'TimeoutError':
1766
+ * console.error(`Transaction timed out: ${result.error.message}`);
1767
+ * break;
1768
+ *
1769
+ * case 'TransactionError':
1770
+ * console.error(`Transaction failed: ${result.error.message}`);
1771
+ * break;
1772
+ *
1773
+ * case 'UnexpectedError':
1774
+ * console.error(result.error.message);
1775
+ * break;
1776
+ * }
1777
+ * return;
1778
+ * }
1779
+ *
1780
+ * console.log('Transaction sent with hash:', result.value);
1781
+ * ```
1782
+ *
1783
+ * @param handler - The handler that will be used to handle the transaction.
1784
+ */
1785
+ declare function useUpdateUserPositionConditions(handler: TransactionHandler): UseAsyncTask<UpdateUserPositionConditionsRequest, TxHash, SendTransactionError | PendingTransactionError>;
1786
+ /**
1787
+ * Hook for updating the collateral status of user's supplies.
1788
+ *
1789
+ * ```ts
1790
+ * const [sendTransaction] = useSendTransaction(wallet);
1791
+ * const [setUserSuppliesAsCollateral, { loading, error }] = useSetUserSuppliesAsCollateral((transaction, { cancel }) => {
1792
+ * return sendTransaction(transaction);
1793
+ * });
1794
+ *
1795
+ * const result = await setUserSuppliesAsCollateral({
1796
+ * changes: [
1797
+ * {
1798
+ * reserve: reserve.id,
1799
+ * enableCollateral: true
1800
+ * }
1801
+ * ],
1802
+ * sender: evmAddress('0x456...')
1803
+ * });
1804
+ *
1805
+ * if (result.isErr()) {
1806
+ * switch (result.error.name) {
1807
+ * case 'CancelError':
1808
+ * // The user cancelled the operation
1809
+ * return;
1810
+ *
1811
+ * case 'SigningError':
1812
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1813
+ * break;
1814
+ *
1815
+ * case 'TimeoutError':
1816
+ * console.error(`Transaction timed out: ${result.error.message}`);
1817
+ * break;
1818
+ *
1819
+ * case 'TransactionError':
1820
+ * console.error(`Transaction failed: ${result.error.message}`);
1821
+ * break;
1822
+ *
1823
+ * case 'UnexpectedError':
1824
+ * console.error(result.error.message);
1825
+ * break;
1826
+ * }
1827
+ * return;
1828
+ * }
1829
+ *
1830
+ * console.log('Transaction sent with hash:', result.value);
1831
+ * ```
1832
+ *
1833
+ * @param handler - The handler that will be used to handle the transaction.
1834
+ */
1835
+ declare function useSetUserSuppliesAsCollateral(handler: TransactionHandler): UseAsyncTask<SetUserSuppliesAsCollateralRequest, TxHash, SendTransactionError | PendingTransactionError>;
1836
+ /**
1837
+ * A hook that provides a way to liquidate a user's position.
1838
+ *
1839
+ * ```ts
1840
+ * const [sendTransaction] = useSendTransaction(wallet);
1841
+ * const [liquidatePosition, { loading, error }] = useLiquidatePosition((plan, { cancel }) => {
1842
+ * switch (plan.__typename) {
1843
+ * case 'TransactionRequest':
1844
+ * return sendTransaction(plan);
1845
+ * case 'Erc20ApprovalRequired':
1846
+ * case 'PreContractActionRequired':
1847
+ * return sendTransaction(plan.transaction);
1848
+ * }
1849
+ * });
1850
+ *
1851
+ * // …
1852
+ *
1853
+ * const result = await liquidatePosition({
1854
+ * collateral: reserveId('SGVsbG8h'),
1855
+ * debt: reserveId('Q2lhbyE= '),
1856
+ * amount: amount,
1857
+ * liquidator: liquidator,
1858
+ * borrower: borrower,
1859
+ * });
1860
+ *
1861
+ * if (result.isErr()) {
1862
+ * switch (result.error.name) {
1863
+ * case 'CancelError':
1864
+ * // The user cancelled the operation
1865
+ * return;
1866
+ *
1867
+ * case 'SigningError':
1868
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1869
+ * break;
1870
+ *
1871
+ * case 'TimeoutError':
1872
+ * console.error(`Transaction timed out: ${result.error.message}`);
1873
+ * break;
1874
+ *
1875
+ * case 'TransactionError':
1876
+ * console.error(`Transaction failed: ${result.error.message}`);
1877
+ * break;
1878
+ *
1879
+ * case 'ValidationError':
1880
+ * console.error(`Insufficient balance: ${result.error.cause.required.value} required.`);
1881
+ * break;
1882
+ *
1883
+ * case 'UnexpectedError':
1884
+ * console.error(result.error.message);
1885
+ * break;
1886
+ * }
1887
+ * return;
1888
+ * }
1889
+ *
1890
+ * console.log('Transaction sent with hash:', result.value);
1891
+ * ```
1892
+ *
1893
+ * @param handler - The handler that will be used to handle the transactions.
1894
+ */
1895
+ declare function useLiquidatePosition(handler: TransactionHandler): UseAsyncTask<LiquidatePositionRequest, TxHash, SendTransactionError | PendingTransactionError | ValidationError$1<InsufficientBalanceError>>;
1896
+ /**
1897
+ * A hook that provides a way to set or remove a position manager for a user on a specific spoke.
1898
+ *
1899
+ * **Position managers** can perform transactions on behalf of other users, including:
1900
+ * - Supply assets
1901
+ * - Borrow assets
1902
+ * - Withdraw assets
1903
+ * - Enable/disable collateral
1904
+ *
1905
+ * The `signature` parameter is an **ERC712 signature** that must be signed by the **user**
1906
+ * (the account granting permissions) to authorize the position manager. The signature contains:
1907
+ * - `value`: The actual cryptographic signature
1908
+ * - `deadline`: Unix timestamp when the authorization expires
1909
+ *
1910
+ * ```ts
1911
+ * const [sendTransaction] = useSendTransaction(wallet);
1912
+ * const [setSpokeUserPositionManager, { loading, error }] = useSetSpokeUserPositionManager((transaction, { cancel }) => {
1913
+ * return sendTransaction(transaction);
1914
+ * });
1915
+ *
1916
+ * const result = await setSpokeUserPositionManager({
1917
+ * spoke: spokeId('SGVsbG8h'),
1918
+ * manager: evmAddress('0x9abc…'), // Address that will become the position manager
1919
+ * approve: true, // true to approve, false to remove the manager
1920
+ * user: evmAddress('0xdef0…'), // User granting the permission (must sign the signature)
1921
+ * signature: {
1922
+ * value: '0x1234...', // ERC712 signature signed by the user
1923
+ * deadline: 1735689600, // Unix timestamp when signature expires
1924
+ * },
1925
+ * });
1926
+ *
1927
+ * if (result.isErr()) {
1928
+ * switch (result.error.name) {
1929
+ * case 'CancelError':
1930
+ * // The user cancelled the operation
1931
+ * return;
1932
+ *
1933
+ * case 'SigningError':
1934
+ * console.error(`Failed to sign the transaction: ${result.error.message}`);
1935
+ * break;
1936
+ *
1937
+ * case 'TimeoutError':
1938
+ * console.error(`Transaction timed out: ${result.error.message}`);
1939
+ * break;
1940
+ *
1941
+ * case 'TransactionError':
1942
+ * console.error(`Transaction failed: ${result.error.message}`);
1943
+ * break;
1944
+ *
1945
+ * case 'UnexpectedError':
1946
+ * console.error(result.error.message);
1947
+ * break;
1948
+ * }
1949
+ * return;
1950
+ * }
1951
+ *
1952
+ * console.log('Transaction sent with hash:', result.value);
1953
+ * ```
1954
+ *
1955
+ * @param handler - The handler that will be used to handle the transaction.
1956
+ */
1957
+ declare function useSetSpokeUserPositionManager(handler: TransactionHandler): UseAsyncTask<SetSpokeUserPositionManagerRequest, TxHash, SendTransactionError | PendingTransactionError>;
1958
+ /**
1959
+ * Preview the impact of a potential action on a user's position.
1960
+ *
1961
+ * ```tsx
1962
+ * const [getPreview, previewing] = usePreviewAction();
1963
+ *
1964
+ * const loading = previewing.loading;
1965
+ * const error = previewing.error;
1966
+ *
1967
+ * // …
1968
+ *
1969
+ * const result = await getPreview({
1970
+ * action: {
1971
+ * supply: {
1972
+ * reserve: reserveId('SGVsbG8h'),
1973
+ * amount: {
1974
+ * erc20: {
1975
+ * value: '1000',
1976
+ * },
1977
+ * },
1978
+ * sender: evmAddress('0x9abc…'),
1979
+ * },
1980
+ * },
1981
+ * });
1982
+ *
1983
+ * if (result.isErr()) {
1984
+ * console.error(result.error);
1985
+ * return;
1986
+ * }
1987
+ *
1988
+ * console.log('Preview result:', result.value);
1989
+ * ```
1990
+ */
1991
+ declare function usePreviewAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<PreviewRequest, PreviewUserPosition, UnexpectedError>;
1992
+ type UsePreviewArgs = Prettify<PreviewRequest & CurrencyQueryOptions>;
1993
+ /**
1994
+ * Fetch a preview of the impact of a potential action on a user's position.
1995
+ *
1996
+ * This signature supports React Suspense:
1997
+ *
1998
+ * ```tsx
1999
+ * const { data } = usePreview({
2000
+ * action: {
2001
+ * supply: {
2002
+ * reserve: reserveId('SGVsbG8h'),
2003
+ * amount: {
2004
+ * erc20: {
2005
+ * currency: evmAddress('0x5678…'),
2006
+ * value: '1000',
2007
+ * },
2008
+ * },
2009
+ * supplier: evmAddress('0x9abc…'),
2010
+ * },
2011
+ * },
2012
+ * suspense: true,
2013
+ * });
2014
+ * ```
2015
+ */
2016
+ declare function usePreview(args: UsePreviewArgs & Suspendable): SuspenseResult<PreviewUserPosition>;
2017
+ /**
2018
+ * Fetch a preview of the impact of a potential action on a user's position.
2019
+ *
2020
+ * Pausable suspense mode.
2021
+ *
2022
+ * ```tsx
2023
+ * const { data } = usePreview({
2024
+ * action: {
2025
+ * supply: {
2026
+ * reserve: reserveId('SGVsbG8h'),
2027
+ * amount: {
2028
+ * erc20: {
2029
+ * currency: evmAddress('0x5678…'),
2030
+ * value: '1000',
2031
+ * },
2032
+ * },
2033
+ * supplier: evmAddress('0x9abc…'),
2034
+ * },
2035
+ * },
2036
+ * suspense: true,
2037
+ * pause: true,
2038
+ * });
2039
+ * ```
2040
+ */
2041
+ declare function usePreview(args: Pausable<UsePreviewArgs> & Suspendable): PausableSuspenseResult<PreviewUserPosition>;
2042
+ /**
2043
+ * Fetch a preview of the impact of a potential action on a user's position.
2044
+ *
2045
+ * ```tsx
2046
+ * const { data, error, loading } = usePreview({
2047
+ * action: {
2048
+ * supply: {
2049
+ * reserve: reserveId('SGVsbG8h'),
2050
+ * amount: {
2051
+ * erc20: {
2052
+ * currency: evmAddress('0x5678…'),
2053
+ * value: '1000',
2054
+ * },
2055
+ * },
2056
+ * supplier: evmAddress('0x9abc…'),
2057
+ * },
2058
+ * },
2059
+ * });
2060
+ * ```
2061
+ */
2062
+ declare function usePreview(args: UsePreviewArgs): ReadResult<PreviewUserPosition>;
2063
+ /**
2064
+ * Fetch a preview of the impact of a potential action on a user's position.
2065
+ *
2066
+ * Pausable loading state mode.
2067
+ *
2068
+ * ```tsx
2069
+ * const { data, error, loading, paused } = usePreview({
2070
+ * action: {
2071
+ * supply: {
2072
+ * reserve: reserveId('SGVsbG8h'),
2073
+ * amount: {
2074
+ * erc20: {
2075
+ * currency: evmAddress('0x5678…'),
2076
+ * value: '1000',
2077
+ * },
2078
+ * },
2079
+ * supplier: evmAddress('0x9abc…'),
2080
+ * },
2081
+ * },
2082
+ * pause: true,
2083
+ * });
2084
+ * ```
2085
+ */
2086
+ declare function usePreview(args: Pausable<UsePreviewArgs>): PausableReadResult<PreviewUserPosition>;
2087
+ type UseActivitiesArgs = Prettify<ActivitiesRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
2088
+ /**
2089
+ * Fetch paginated list of activities.
2090
+ *
2091
+ * This signature supports React Suspense:
2092
+ *
2093
+ * ```tsx
2094
+ * const { data } = useActivities({
2095
+ * query: {
2096
+ * chainId: chainId(1),
2097
+ * },
2098
+ * user: evmAddress('0x742d35cc…'),
2099
+ * suspense: true,
2100
+ * });
2101
+ *
2102
+ * // data.items: ActivityItem[]
2103
+ * ```
2104
+ */
2105
+ declare function useActivities(args: UseActivitiesArgs & Suspendable): SuspenseResult<PaginatedActivitiesResult>;
2106
+ /**
2107
+ * Fetch paginated list of activities.
2108
+ *
2109
+ * Pausable suspense mode.
2110
+ *
2111
+ * ```tsx
2112
+ * const { data } = useActivities({
2113
+ * query: {
2114
+ * chainId: chainId(1),
2115
+ * },
2116
+ * user: evmAddress('0x742d35cc…'),
2117
+ * suspense: true,
2118
+ * pause: true,
2119
+ * });
2120
+ *
2121
+ * // data?.items: ActivityItem[] | undefined
2122
+ * ```
2123
+ */
2124
+ declare function useActivities(args: Pausable<UseActivitiesArgs> & Suspendable): PausableSuspenseResult<PaginatedActivitiesResult>;
2125
+ /**
2126
+ * Fetch paginated list of activities.
2127
+ *
2128
+ * ```tsx
2129
+ * const { data, error, loading } = useActivities({
2130
+ * query: {
2131
+ * chainId: chainId(1),
2132
+ * },
2133
+ * user: evmAddress('0x742d35cc…'),
2134
+ * });
2135
+ * ```
2136
+ */
2137
+ declare function useActivities(args: UseActivitiesArgs): ReadResult<PaginatedActivitiesResult>;
2138
+ /**
2139
+ * Fetch paginated list of activities.
2140
+ *
2141
+ * Pausable loading state mode.
2142
+ *
2143
+ * ```tsx
2144
+ * const { data, error, loading } = useActivities({
2145
+ * query: {
2146
+ * chainId: chainId(1),
2147
+ * },
2148
+ * user: evmAddress('0x742d35cc…'),
2149
+ * pause: true,
2150
+ * });
2151
+ *
2152
+ * // data?.items: ActivityItem[] | undefined
2153
+ * // error: UnexpectedError | undefined
2154
+ * // loading: boolean | undefined
2155
+ * ```
2156
+ */
2157
+ declare function useActivities(args: Pausable<UseActivitiesArgs>): PausableReadResult<PaginatedActivitiesResult>;
2158
+ /**
2159
+ * Low-level hook to execute a {@link activities} action directly.
2160
+ *
2161
+ * @experimental This hook is experimental and may be subject to breaking changes.
2162
+ * @remarks
2163
+ * This hook does not actively watch for updates. Use it to fetch activities on demand
2164
+ * (e.g., in an event handler when paginating or refining filters).
2165
+ *
2166
+ * @param options - The query options.
2167
+ * @returns The user history.
2168
+ */
2169
+ declare function useActivitiesAction(options?: Required<CurrencyQueryOptions> & TimeWindowQueryOptions): UseAsyncTask<ActivitiesRequest, PaginatedActivitiesResult, UnexpectedError>;
2170
+
2171
+ type UseUserSuppliesArgs = Prettify<UserSuppliesRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
2172
+ /**
2173
+ * Fetch all user supply positions.
2174
+ *
2175
+ * This signature supports React Suspense:
2176
+ *
2177
+ * ```tsx
2178
+ * const { data } = useUserSupplies({
2179
+ * query: {
2180
+ * userSpoke: {
2181
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2182
+ * user: evmAddress('0x742d35cc…'),
2183
+ * },
2184
+ * },
2185
+ * orderBy: { name: 'ASC' },
2186
+ * suspense: true,
2187
+ * });
2188
+ * ```
2189
+ */
2190
+ declare function useUserSupplies(args: UseUserSuppliesArgs & Suspendable): SuspenseResult<UserSupplyItem[]>;
2191
+ /**
2192
+ * Fetch all user supply positions.
2193
+ *
2194
+ * Pausable suspense mode.
2195
+ *
2196
+ * ```tsx
2197
+ * const { data } = useUserSupplies({
2198
+ * query: {
2199
+ * userSpoke: {
2200
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2201
+ * user: evmAddress('0x742d35cc…'),
2202
+ * },
2203
+ * },
2204
+ * orderBy: { name: 'ASC' },
2205
+ * suspense: true,
2206
+ * pause: true,
2207
+ * });
2208
+ *
2209
+ * // data?.length: number | undefined
2210
+ * ```
2211
+ */
2212
+ declare function useUserSupplies(args: Pausable<UseUserSuppliesArgs> & Suspendable): PausableSuspenseResult<UserSupplyItem[]>;
2213
+ /**
2214
+ * Fetch all user supply positions.
2215
+ *
2216
+ * ```tsx
2217
+ * const { data, error, loading } = useUserSupplies({
2218
+ * query: {
2219
+ * userSpoke: {
2220
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2221
+ * user: evmAddress('0x742d35cc…'),
2222
+ * },
2223
+ * },
2224
+ * orderBy: { name: 'ASC' },
2225
+ * });
2226
+ * ```
2227
+ */
2228
+ declare function useUserSupplies(args: UseUserSuppliesArgs): ReadResult<UserSupplyItem[]>;
2229
+ /**
2230
+ * Fetch all user supply positions.
2231
+ *
2232
+ * Pausable loading state mode.
2233
+ *
2234
+ * ```tsx
2235
+ * const { data, error, loading, paused } = useUserSupplies({
2236
+ * query: {
2237
+ * userSpoke: {
2238
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2239
+ * user: evmAddress('0x742d35cc…'),
2240
+ * },
2241
+ * },
2242
+ * orderBy: { name: 'ASC' },
2243
+ * pause: true,
2244
+ * });
2245
+ *
2246
+ * // data?.length: number | undefined
2247
+ * // error: UnexpectedError | undefined
2248
+ * // loading: boolean | undefined
2249
+ * // paused: boolean
2250
+ * ```
2251
+ */
2252
+ declare function useUserSupplies(args: Pausable<UseUserSuppliesArgs>): PausableReadResult<UserSupplyItem[]>;
2253
+ /**
2254
+ * Low-level hook to execute a {@link userSupplies} action directly.
2255
+ *
2256
+ * @experimental This hook is experimental and may be subject to breaking changes.
2257
+ * @remarks
2258
+ * This hook **does not** actively watch for updated data on user supplies.
2259
+ * Use this hook to retrieve data on demand as part of a larger workflow
2260
+ * (e.g., in an event handler in order to move to the next step).
2261
+ *
2262
+ * ```ts
2263
+ * const [execute, { called, data, error, loading }] = useUserSuppliesAction();
2264
+ *
2265
+ * // …
2266
+ *
2267
+ * const result = await execute({
2268
+ * query: {
2269
+ * userSpoke: {
2270
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2271
+ * user: evmAddress('0x742d35cc…'),
2272
+ * },
2273
+ * },
2274
+ * orderBy: { name: 'ASC' },
2275
+ * });
2276
+ *
2277
+ * if (result.isOk()) {
2278
+ * console.log(result.value); // UserSupplyItem[]
2279
+ * } else {
2280
+ * console.error(result.error);
2281
+ * }
2282
+ * ```
2283
+ */
2284
+ declare function useUserSuppliesAction(options?: Required<CurrencyQueryOptions> & TimeWindowQueryOptions): UseAsyncTask<UserSuppliesRequest, UserSupplyItem[], UnexpectedError>;
2285
+ type UseUserBorrowsArgs = Prettify<UserBorrowsRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
2286
+ /**
2287
+ * Fetch all user borrow positions.
2288
+ *
2289
+ * This signature supports React Suspense:
2290
+ *
2291
+ * ```tsx
2292
+ * const { data } = useUserBorrows({
2293
+ * query: {
2294
+ * userSpoke: {
2295
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2296
+ * user: evmAddress('0x742d35cc…'),
2297
+ * },
2298
+ * },
2299
+ * orderBy: { name: 'ASC' },
2300
+ * suspense: true,
2301
+ * });
2302
+ * ```
2303
+ */
2304
+ declare function useUserBorrows(args: UseUserBorrowsArgs & Suspendable): SuspenseResult<UserBorrowItem[]>;
2305
+ /**
2306
+ * Fetch all user borrow positions.
2307
+ *
2308
+ * Pausable suspense mode.
2309
+ *
2310
+ * ```tsx
2311
+ * const { data } = useUserBorrows({
2312
+ * query: {
2313
+ * userSpoke: {
2314
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2315
+ * user: evmAddress('0x742d35cc…'),
2316
+ * },
2317
+ * },
2318
+ * orderBy: { name: 'ASC' },
2319
+ * suspense: true,
2320
+ * pause: true,
2321
+ * });
2322
+ * ```
2323
+ */
2324
+ declare function useUserBorrows(args: Pausable<UseUserBorrowsArgs> & Suspendable): PausableSuspenseResult<UserBorrowItem[]>;
2325
+ /**
2326
+ * Fetch all user borrow positions.
2327
+ *
2328
+ * ```tsx
2329
+ * const { data, error, loading } = useUserBorrows({
2330
+ * query: {
2331
+ * userSpoke: {
2332
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2333
+ * user: evmAddress('0x742d35cc…'),
2334
+ * },
2335
+ * },
2336
+ * orderBy: { name: 'ASC' },
2337
+ * });
2338
+ * ```
2339
+ */
2340
+ declare function useUserBorrows(args: UseUserBorrowsArgs): ReadResult<UserBorrowItem[]>;
2341
+ /**
2342
+ * Fetch all user borrow positions.
2343
+ *
2344
+ * Pausable loading state mode.
2345
+ *
2346
+ * ```tsx
2347
+ * const { data, error, loading, paused } = useUserBorrows({
2348
+ * query: {
2349
+ * userSpoke: {
2350
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2351
+ * user: evmAddress('0x742d35cc…'),
2352
+ * },
2353
+ * },
2354
+ * orderBy: { name: 'ASC' },
2355
+ * pause: true,
2356
+ * });
2357
+ * ```
2358
+ */
2359
+ declare function useUserBorrows(args: Pausable<UseUserBorrowsArgs>): PausableReadResult<UserBorrowItem[]>;
2360
+ /**
2361
+ * Low-level hook to execute a {@link userBorrows} action directly.
2362
+ *
2363
+ * @experimental This hook is experimental and may be subject to breaking changes.
2364
+ * @remarks
2365
+ * This hook **does not** actively watch for updated data on user borrows.
2366
+ * Use this hook to retrieve data on demand as part of a larger workflow
2367
+ * (e.g., in an event handler in order to move to the next step).
2368
+ *
2369
+ * ```ts
2370
+ * const [execute, { called, data, error, loading }] = useUserBorrowsAction();
2371
+ *
2372
+ * // …
2373
+ *
2374
+ * const result = await execute({
2375
+ * query: {
2376
+ * userSpoke: {
2377
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2378
+ * user: evmAddress('0x742d35cc…'),
2379
+ * },
2380
+ * },
2381
+ * orderBy: { name: 'ASC' },
2382
+ * });
2383
+ *
2384
+ * if (result.isOk()) {
2385
+ * console.log(result.value); // UserBorrowItem[]
2386
+ * } else {
2387
+ * console.error(result.error);
2388
+ * }
2389
+ * ```
2390
+ */
2391
+ declare function useUserBorrowsAction(options?: Required<CurrencyQueryOptions> & TimeWindowQueryOptions): UseAsyncTask<UserBorrowsRequest, UserBorrowItem[], UnexpectedError>;
2392
+ type UseUserSummaryArgs = Prettify<UserSummaryRequest & TimeWindowQueryOptions & CurrencyQueryOptions>;
2393
+ /**
2394
+ * Fetch a user's financial summary.
2395
+ *
2396
+ * This signature supports React Suspense:
2397
+ *
2398
+ * ```tsx
2399
+ * const { data } = useUserSummary({
2400
+ * user: evmAddress('0x742d35cc…'),
2401
+ * filter: {
2402
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2403
+ * },
2404
+ * suspense: true,
2405
+ * });
2406
+ * ```
2407
+ */
2408
+ declare function useUserSummary(args: UseUserSummaryArgs & Suspendable): SuspenseResult<UserSummary>;
2409
+ /**
2410
+ * Fetch a user's financial summary.
2411
+ *
2412
+ * Pausable suspense mode.
2413
+ *
2414
+ * ```tsx
2415
+ * const { data } = useUserSummary({
2416
+ * user: evmAddress('0x742d35cc…'),
2417
+ * filter: {
2418
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2419
+ * },
2420
+ * suspense: true,
2421
+ * pause: true,
2422
+ * });
2423
+ * ```
2424
+ */
2425
+ declare function useUserSummary(args: Pausable<UseUserSummaryArgs> & Suspendable): PausableSuspenseResult<UserSummary>;
2426
+ /**
2427
+ * Fetch a user's financial summary.
2428
+ *
2429
+ * ```tsx
2430
+ * const { data, error, loading } = useUserSummary({
2431
+ * user: evmAddress('0x742d35cc…'),
2432
+ * filter: {
2433
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2434
+ * },
2435
+ * });
2436
+ * ```
2437
+ */
2438
+ declare function useUserSummary(args: UseUserSummaryArgs): ReadResult<UserSummary>;
2439
+ /**
2440
+ * Fetch a user's financial summary.
2441
+ *
2442
+ * Pausable loading state mode.
2443
+ *
2444
+ * ```tsx
2445
+ * const { data, error, loading, paused } = useUserSummary({
2446
+ * user: evmAddress('0x742d35cc…'),
2447
+ * filter: {
2448
+ * spoke: { address: evmAddress('0x87870bca…'), chainId: chainId(1) },
2449
+ * },
2450
+ * pause: true,
2451
+ * });
2452
+ * ```
2453
+ */
2454
+ declare function useUserSummary(args: Pausable<UseUserSummaryArgs>): PausableReadResult<UserSummary>;
2455
+ type UseUserPositionsArgs = Prettify<UserPositionsRequest & UserPositionQueryOptions>;
2456
+ /**
2457
+ * Fetch all user positions across specified chains.
2458
+ *
2459
+ * This signature supports React Suspense:
2460
+ *
2461
+ * ```tsx
2462
+ * const { data } = useUserPositions({
2463
+ * user: evmAddress('0x742d35cc…'),
2464
+ * chainIds: [chainId(1), chainId(137)],
2465
+ * orderBy: { balance: 'DESC' },
2466
+ * suspense: true,
2467
+ * });
2468
+ * ```
2469
+ */
2470
+ declare function useUserPositions(args: UseUserPositionsArgs & Suspendable): SuspenseResult<UserPosition[]>;
2471
+ /**
2472
+ * Fetch all user positions across specified chains.
2473
+ *
2474
+ * Pausable suspense mode.
2475
+ *
2476
+ * ```tsx
2477
+ * const { data } = useUserPositions({
2478
+ * user: evmAddress('0x742d35cc…'),
2479
+ * chainIds: [chainId(1), chainId(137)],
2480
+ * orderBy: { balance: 'DESC' },
2481
+ * suspense: true,
2482
+ * pause: true,
2483
+ * });
2484
+ * ```
2485
+ */
2486
+ declare function useUserPositions(args: Pausable<UseUserPositionsArgs> & Suspendable): PausableSuspenseResult<UserPosition[]>;
2487
+ /**
2488
+ * Fetch all user positions across specified chains.
2489
+ *
2490
+ * ```tsx
2491
+ * const { data, error, loading } = useUserPositions({
2492
+ * user: evmAddress('0x742d35cc…'),
2493
+ * chainIds: [chainId(1), chainId(137)],
2494
+ * orderBy: { balance: 'DESC' },
2495
+ * });
2496
+ * ```
2497
+ */
2498
+ declare function useUserPositions(args: UseUserPositionsArgs): ReadResult<UserPosition[]>;
2499
+ /**
2500
+ * Fetch all user positions across specified chains.
2501
+ *
2502
+ * Pausable loading state mode.
2503
+ *
2504
+ * ```tsx
2505
+ * const { data, error, loading, paused } = useUserPositions({
2506
+ * user: evmAddress('0x742d35cc…'),
2507
+ * chainIds: [chainId(1), chainId(137)],
2508
+ * orderBy: { balance: 'DESC' },
2509
+ * pause: true,
2510
+ * });
2511
+ * ```
2512
+ */
2513
+ declare function useUserPositions(args: Pausable<UseUserPositionsArgs>): PausableReadResult<UserPosition[]>;
2514
+ /**
2515
+ * Low-level hook to execute a {@link userPositions} action directly.
2516
+ *
2517
+ * @experimental This hook is experimental and may be subject to breaking changes.
2518
+ * @remarks
2519
+ * This hook **does not** actively watch for updated data on user positions.
2520
+ * Use this hook to retrieve data on demand as part of a larger workflow
2521
+ * (e.g., in an event handler in order to move to the next step).
2522
+ *
2523
+ * ```ts
2524
+ * const [execute, { called, data, error, loading }] = useUserPositionsAction();
2525
+ *
2526
+ * // …
2527
+ *
2528
+ * const result = await execute({
2529
+ * user: evmAddress('0x742d35cc…'),
2530
+ * filter: {
2531
+ * chainIds: [chainId(1), chainId(137)]
2532
+ * },
2533
+ * orderBy: { balance: 'DESC' },
2534
+ * });
2535
+ *
2536
+ * if (result.isOk()) {
2537
+ * console.log(result.value); // UserPosition[]
2538
+ * } else {
2539
+ * console.error(result.error);
2540
+ * }
2541
+ * ```
2542
+ */
2543
+ declare function useUserPositionsAction(options?: UserPositionQueryOptions): UseAsyncTask<UserPositionsRequest, UserPosition[], UnexpectedError>;
2544
+ type UseUserPositionArgs = Prettify<UserPositionRequest & UserPositionQueryOptions>;
2545
+ /**
2546
+ * Fetch a specific user position by ID.
2547
+ *
2548
+ * This signature supports React Suspense:
2549
+ *
2550
+ * ```tsx
2551
+ * const { data } = useUserPosition({
2552
+ * id: userPositionId('SGVsbG8h'),
2553
+ * user: evmAddress('0x742d35cc…'),
2554
+ * suspense: true,
2555
+ * });
2556
+ * ```
2557
+ */
2558
+ declare function useUserPosition(args: UseUserPositionArgs & Suspendable): SuspenseResult<UserPosition>;
2559
+ /**
2560
+ * Fetch a specific user position by ID.
2561
+ *
2562
+ * Pausable suspense mode.
2563
+ *
2564
+ * ```tsx
2565
+ * const { data } = useUserPosition({
2566
+ * id: userPositionId('SGVsbG8h'),
2567
+ * user: evmAddress('0x742d35cc…'),
2568
+ * suspense: true,
2569
+ * pause: true,
2570
+ * });
2571
+ * ```
2572
+ */
2573
+ declare function useUserPosition(args: Pausable<UseUserPositionArgs> & Suspendable): PausableSuspenseResult<UserPosition>;
2574
+ /**
2575
+ * Fetch a specific user position by ID.
2576
+ *
2577
+ * ```tsx
2578
+ * const { data, error, loading } = useUserPosition({
2579
+ * id: userPositionId('SGVsbG8h'),
2580
+ * user: evmAddress('0x742d35cc…'),
2581
+ * });
2582
+ * ```
2583
+ */
2584
+ declare function useUserPosition(args: UseUserPositionArgs): ReadResult<UserPosition>;
2585
+ /**
2586
+ * Fetch a specific user position by ID.
2587
+ *
2588
+ * Pausable loading state mode.
2589
+ *
2590
+ * ```tsx
2591
+ * const { data, error, loading, paused } = useUserPosition({
2592
+ * id: userPositionId('SGVsbG8h'),
2593
+ * user: evmAddress('0x742d35cc…'),
2594
+ * pause: true,
2595
+ * });
2596
+ * ```
2597
+ */
2598
+ declare function useUserPosition(args: Pausable<UseUserPositionArgs>): PausableReadResult<UserPosition>;
2599
+ type UseUserBalancesArgs = Prettify<UserBalancesRequest & CurrencyQueryOptions>;
2600
+ /**
2601
+ * Fetch all user balances across specified chains.
2602
+ *
2603
+ * This signature supports React Suspense:
2604
+ *
2605
+ * ```tsx
2606
+ * const { data } = useUserBalances({
2607
+ * user: evmAddress('0x742d35cc…'),
2608
+ * chainIds: [chainId(1), chainId(137)],
2609
+ * suspense: true,
2610
+ * });
2611
+ * ```
2612
+ */
2613
+ declare function useUserBalances(args: UseUserBalancesArgs & Suspendable): SuspenseResult<UserBalance[]>;
2614
+ /**
2615
+ * Fetch all user balances across specified chains.
2616
+ *
2617
+ * Pausable suspense mode.
2618
+ *
2619
+ * ```tsx
2620
+ * const { data } = useUserBalances({
2621
+ * user: evmAddress('0x742d35cc…'),
2622
+ * chainIds: [chainId(1), chainId(137)],
2623
+ * suspense: true,
2624
+ * pause: true,
2625
+ * });
2626
+ * ```
2627
+ */
2628
+ declare function useUserBalances(args: Pausable<UseUserBalancesArgs> & Suspendable): PausableSuspenseResult<UserBalance[]>;
2629
+ /**
2630
+ * Fetch all user balances across specified chains.
2631
+ *
2632
+ * ```tsx
2633
+ * const { data, error, loading } = useUserBalances({
2634
+ * user: evmAddress('0x742d35cc…'),
2635
+ * chainIds: [chainId(1), chainId(137)],
2636
+ * });
2637
+ * ```
2638
+ */
2639
+ declare function useUserBalances(args: UseUserBalancesArgs): ReadResult<UserBalance[]>;
2640
+ /**
2641
+ * Fetch all user balances across specified chains.
2642
+ *
2643
+ * Pausable loading state mode.
2644
+ *
2645
+ * ```tsx
2646
+ * const { data, error, loading, paused } = useUserBalances({
2647
+ * user: evmAddress('0x742d35cc…'),
2648
+ * chainIds: [chainId(1), chainId(137)],
2649
+ * pause: true,
2650
+ * });
2651
+ * ```
2652
+ */
2653
+ declare function useUserBalances(args: Pausable<UseUserBalancesArgs>): PausableReadResult<UserBalance[]>;
2654
+ type UseUserRiskPremiumBreakdownArgs = UserRiskPremiumBreakdownRequest;
2655
+ /**
2656
+ * Fetch the risk premium breakdown for a user position or spoke.
2657
+ *
2658
+ * This signature supports React Suspense:
2659
+ *
2660
+ * ```tsx
2661
+ * const { data } = useUserRiskPremiumBreakdown({
2662
+ * query: {
2663
+ * userPositionId: userPositionId('SGVsbG8h'),
2664
+ * },
2665
+ * user: evmAddress('0x742d35cc…'),
2666
+ * suspense: true,
2667
+ * });
2668
+ * ```
2669
+ */
2670
+ declare function useUserRiskPremiumBreakdown(args: UseUserRiskPremiumBreakdownArgs & Suspendable): SuspenseResult<UserRiskPremiumBreakdownItem[]>;
2671
+ /**
2672
+ * Fetch the risk premium breakdown for a user position or spoke.
2673
+ *
2674
+ * Pausable suspense mode.
2675
+ *
2676
+ * ```tsx
2677
+ * const { data } = useUserRiskPremiumBreakdown({
2678
+ * query: {
2679
+ * userPositionId: userPositionId('SGVsbG8h'),
2680
+ * },
2681
+ * user: evmAddress('0x742d35cc…'),
2682
+ * suspense: true,
2683
+ * pause: true,
2684
+ * });
2685
+ * ```
2686
+ */
2687
+ declare function useUserRiskPremiumBreakdown(args: Pausable<UseUserRiskPremiumBreakdownArgs> & Suspendable): PausableSuspenseResult<UserRiskPremiumBreakdownItem[]>;
2688
+ /**
2689
+ * Fetch the risk premium breakdown for a user position or spoke.
2690
+ *
2691
+ * ```tsx
2692
+ * const { data, error, loading } = useUserRiskPremiumBreakdown({
2693
+ * query: {
2694
+ * userPositionId: userPositionId('SGVsbG8h'),
2695
+ * },
2696
+ * user: evmAddress('0x742d35cc…'),
2697
+ * });
2698
+ * ```
2699
+ */
2700
+ declare function useUserRiskPremiumBreakdown(args: UseUserRiskPremiumBreakdownArgs): ReadResult<UserRiskPremiumBreakdownItem[]>;
2701
+ /**
2702
+ * Fetch the risk premium breakdown for a user position or spoke.
2703
+ *
2704
+ * Pausable loading state mode.
2705
+ *
2706
+ * ```tsx
2707
+ * const { data, error, loading, paused } = useUserRiskPremiumBreakdown({
2708
+ * query: {
2709
+ * userPositionId: userPositionId('SGVsbG8h'),
2710
+ * },
2711
+ * user: evmAddress('0x742d35cc…'),
2712
+ * pause: true,
2713
+ * });
2714
+ * ```
2715
+ */
2716
+ declare function useUserRiskPremiumBreakdown(args: Pausable<UseUserRiskPremiumBreakdownArgs>): PausableReadResult<UserRiskPremiumBreakdownItem[]>;
2717
+ /**
2718
+ * Low-level hook to execute a {@link userBalances} action directly.
2719
+ *
2720
+ * @experimental This hook is experimental and may be subject to breaking changes.
2721
+ * @remarks
2722
+ * This hook **does not** actively watch for updated data on user balances.
2723
+ * Use this hook to retrieve data on demand as part of a larger workflow
2724
+ * (e.g., in an event handler in order to move to the next step).
2725
+ *
2726
+ * ```ts
2727
+ * const [execute, { called, data, error, loading }] = useUserBalancesAction();
2728
+ *
2729
+ * // …
2730
+ *
2731
+ * const result = await execute({
2732
+ * user: evmAddress('0x742d35cc…'),
2733
+ * filter: {
2734
+ * chainIds: [chainId(1), chainId(137)]
2735
+ * },
2736
+ * });
2737
+ *
2738
+ * if (result.isOk()) {
2739
+ * console.log(result.value); // UserBalance[]
2740
+ * } else {
2741
+ * console.error(result.error);
2742
+ * }
2743
+ * ```
2744
+ */
2745
+ declare function useUserBalancesAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<UserBalancesRequest, UserBalance[], UnexpectedError>;
2746
+ type UseUserSummaryHistoryArgs = Prettify<UserSummaryHistoryRequest & CurrencyQueryOptions>;
2747
+ /**
2748
+ * Fetch user summary history over time.
2749
+ *
2750
+ * This signature supports React Suspense:
2751
+ *
2752
+ * ```tsx
2753
+ * const { data } = useUserSummaryHistory({
2754
+ * user: evmAddress('0x742d35cc…'),
2755
+ * window: TimeWindow.LastWeek,
2756
+ * filter: { chainIds: [chainId(1)] },
2757
+ * suspense: true,
2758
+ * });
2759
+ * ```
2760
+ */
2761
+ declare function useUserSummaryHistory(args: UseUserSummaryHistoryArgs & Suspendable): SuspenseResult<UserSummaryHistoryItem[]>;
2762
+ /**
2763
+ * Fetch user summary history over time.
2764
+ *
2765
+ * Pausable suspense mode.
2766
+ *
2767
+ * ```tsx
2768
+ * const { data } = useUserSummaryHistory({
2769
+ * user: evmAddress('0x742d35cc…'),
2770
+ * window: TimeWindow.LastWeek,
2771
+ * filter: { chainIds: [chainId(1)] },
2772
+ * suspense: true,
2773
+ * pause: true,
2774
+ * });
2775
+ * ```
2776
+ */
2777
+ declare function useUserSummaryHistory(args: Pausable<UseUserSummaryHistoryArgs> & Suspendable): PausableSuspenseResult<UserSummaryHistoryItem[]>;
2778
+ /**
2779
+ * Fetch user summary history over time.
2780
+ *
2781
+ * ```tsx
2782
+ * const { data, error, loading } = useUserSummaryHistory({
2783
+ * user: evmAddress('0x742d35cc…'),
2784
+ * window: TimeWindow.LastWeek,
2785
+ * filter: { chainIds: [chainId(1)] },
2786
+ * });
2787
+ * ```
2788
+ */
2789
+ declare function useUserSummaryHistory(args: UseUserSummaryHistoryArgs): ReadResult<UserSummaryHistoryItem[]>;
2790
+ /**
2791
+ * Fetch user summary history over time.
2792
+ *
2793
+ * Pausable loading state mode.
2794
+ *
2795
+ * ```tsx
2796
+ * const { data, error, loading, paused } = useUserSummaryHistory({
2797
+ * user: evmAddress('0x742d35cc…'),
2798
+ * window: TimeWindow.LastWeek,
2799
+ * filter: { chainIds: [chainId(1)] },
2800
+ * pause: true,
2801
+ * });
2802
+ * ```
2803
+ */
2804
+ declare function useUserSummaryHistory(args: Pausable<UseUserSummaryHistoryArgs>): PausableReadResult<UserSummaryHistoryItem[]>;
2805
+
2806
+ export { AaveProvider, type AaveProviderProps, type CancelSwapError, type CancelSwapHandler, CannotCancelSwapError, SendTransactionError, type SwapHandler, type SwapHandlerOptions, type SwapIntent, type UseActivitiesArgs, type UseAssetArgs, type UseAssetBorrowHistoryArgs, type UseAssetPriceHistoryArgs, type UseAssetSupplyHistoryArgs, UseAsyncTask, type UseBorrowApyHistoryArgs, type UseHubArgs, type UseHubAssetsArgs, type UseHubSummaryHistoryArgs, type UseHubsArgs, type UsePreviewArgs, type UseProtocolHistoryArgs, type UseReserveArgs, type UseReservesArgs, type UseSpokeArgs, type UseSpokePositionManagersArgs, type UseSpokeUserPositionManagersArgs, type UseSpokesArgs, type UseSupplyApyHistoryArgs, type UseSwapQuoteArgs, type UseSwapTokensRequest, type UseSwappableTokensArgs, type UseUserBalancesArgs, type UseUserBorrowsArgs, type UseUserPositionArgs, type UseUserPositionsArgs, type UseUserRiskPremiumBreakdownArgs, type UseUserSummaryArgs, type UseUserSummaryHistoryArgs, type UseUserSuppliesArgs, type UseUserSwapsArgs, useAaveClient, useActivities, useActivitiesAction, useAsset, useAssetBorrowHistory, useAssetPriceHistory, useAssetSupplyHistory, useBorrow, useBorrowApyHistory, useCancelSwap, useHub, useHubAssets, useHubSummaryHistory, useHubs, useHubsAction, useLiquidatePosition, usePermitTypedDataAction, usePreview, usePreviewAction, useProtocolHistory, useRenounceSpokeUserPositionManager, useRepay, useReserve, useReserveAction, useReserves, useReservesAction, useSetSpokeUserPositionManager, useSetUserSuppliesAsCollateral, useSpoke, useSpokePositionManagers, useSpokeUserPositionManagers, useSpokes, useSupply, useSupplyApyHistory, useSwapQuote, useSwapQuoteAction, useSwapTokens, useSwappableTokens, useUpdateUserPositionConditions, useUserBalances, useUserBalancesAction, useUserBorrows, useUserBorrowsAction, useUserPosition, useUserPositions, useUserPositionsAction, useUserRiskPremiumBreakdown, useUserSummary, useUserSummaryHistory, useUserSupplies, useUserSuppliesAction, useUserSwaps, useWithdraw };