@aave/client 4.0.0-next.4 → 4.0.0-next.41

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 (63) hide show
  1. package/README.md +6 -3
  2. package/dist/{AaveClient-CgHY2iS9.d.ts → AaveClient-BPNG2Fua.d.ts} +5 -7
  3. package/dist/{AaveClient-L3v8kWvn.d.cts → AaveClient-CYavo882.d.cts} +5 -7
  4. package/dist/actions/index.cjs +1 -1
  5. package/dist/actions/index.cjs.map +1 -1
  6. package/dist/actions/index.d.cts +289 -171
  7. package/dist/actions/index.d.ts +289 -171
  8. package/dist/actions/index.js +1 -1
  9. package/dist/chunk-N4LXBTGY.js +2 -0
  10. package/dist/chunk-N4LXBTGY.js.map +1 -0
  11. package/dist/chunk-TO3PPVNH.js +2 -0
  12. package/dist/chunk-TO3PPVNH.js.map +1 -0
  13. package/dist/chunk-XT6Q6AZR.js +2 -0
  14. package/dist/chunk-XT6Q6AZR.js.map +1 -0
  15. package/dist/ethers.cjs +1 -1
  16. package/dist/ethers.cjs.map +1 -1
  17. package/dist/ethers.d.cts +45 -11
  18. package/dist/ethers.d.ts +45 -11
  19. package/dist/ethers.js +1 -1
  20. package/dist/ethers.js.map +1 -1
  21. package/dist/index.cjs +2 -2
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +21 -4
  24. package/dist/index.d.ts +21 -4
  25. package/dist/index.js +2 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/{options-vB2peXdE.d.cts → options-BX6n3sbh.d.cts} +17 -1
  28. package/dist/{options-vB2peXdE.d.ts → options-BX6n3sbh.d.ts} +17 -1
  29. package/dist/privy.cjs +1 -2
  30. package/dist/privy.cjs.map +1 -1
  31. package/dist/privy.d.cts +49 -12
  32. package/dist/privy.d.ts +49 -12
  33. package/dist/privy.js +1 -1
  34. package/dist/privy.js.map +1 -1
  35. package/dist/testing.d.ts +3838 -0
  36. package/dist/testing.js +546 -0
  37. package/dist/testing.js.map +1 -0
  38. package/dist/thirdweb.cjs +1 -2
  39. package/dist/thirdweb.cjs.map +1 -1
  40. package/dist/thirdweb.d.cts +52 -16
  41. package/dist/thirdweb.d.ts +52 -16
  42. package/dist/thirdweb.js +1 -2
  43. package/dist/thirdweb.js.map +1 -1
  44. package/dist/{types-Bu63z0x6.d.cts → types-4gDcMKeo.d.cts} +9 -5
  45. package/dist/{types-Bu63z0x6.d.ts → types-4gDcMKeo.d.ts} +9 -5
  46. package/dist/viem.cjs +1 -2
  47. package/dist/viem.cjs.map +1 -1
  48. package/dist/viem.d.cts +57 -17
  49. package/dist/viem.d.ts +57 -17
  50. package/dist/viem.js +1 -1
  51. package/package.json +10 -11
  52. package/dist/chunk-2URLJFKP.js +0 -3
  53. package/dist/chunk-2URLJFKP.js.map +0 -1
  54. package/dist/chunk-IFRZEVIE.js +0 -3
  55. package/dist/chunk-IFRZEVIE.js.map +0 -1
  56. package/dist/chunk-UXJVSHNC.js +0 -2
  57. package/dist/chunk-UXJVSHNC.js.map +0 -1
  58. package/dist/test-utils.cjs +0 -3
  59. package/dist/test-utils.cjs.map +0 -1
  60. package/dist/test-utils.d.cts +0 -50
  61. package/dist/test-utils.d.ts +0 -50
  62. package/dist/test-utils.js +0 -3
  63. package/dist/test-utils.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { UnexpectedError, TimeoutError } from '@aave/core';
2
- import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, ChainRequest, Chain, ChainsFilter, HasProcessedKnownTransactionRequest, ExchangeRateRequest, FiatAmount, PermitRequest, PermitTypedDataResponse, AssetRequest, Asset, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, AssetBorrowHistoryRequest, AssetBorrowSample, ReserveRequest, Reserve, ReservesRequest, BorrowAPYHistoryRequest, APYSample, SupplyAPYHistoryRequest, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, SwapQuoteRequest, SwapQuote, SwappableTokensRequest, Token, PrepareSwapRequest, PrepareSwapResult, SwapStatusRequest, SwapStatus, SwapCancelled, SwapExpired, SwapFulfilled, SwapReceipt, SwapRequest, SwapExecutionPlan, PrepareSwapCancelRequest, PrepareSwapCancelResult, CancelSwapRequest, CancelSwapExecutionPlan, UserSwapsRequest, PaginatedUserSwapsResult, BorrowRequest, ExecutionPlan, SupplyRequest, RepayRequest, WithdrawRequest, RenounceSpokeUserPositionManagerRequest, TransactionRequest, UpdateUserDynamicConfigRequest, UpdateUserRiskPremiumRequest, LiquidatePositionRequest, SetSpokeUserPositionManagerRequest, PreviewRequest, PreviewUserPosition, SetUserSupplyAsCollateralRequest, ActivitiesRequest, PaginatedActivitiesResult, UserSuppliesRequest, UserSupplyItem, UserBorrowsRequest, UserBorrowItem, UserSummaryRequest, UserSummary, UserPositionsRequest, UserPosition, UserPositionRequest, UserBalancesRequest, UserBalance, UserSummaryHistoryRequest, UserSummaryHistoryItem } from '@aave/graphql';
1
+ import { UnexpectedError, ValidationError, TimeoutError } from '@aave/core';
2
+ import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, HubSummaryHistoryRequest, HubSummarySample, ChainRequest, Chain, ChainsRequest, HasProcessedKnownTransactionRequest, ExchangeRateRequest, ExchangeAmount, AssetRequest, Asset, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, AssetBorrowHistoryRequest, AssetBorrowSample, ProtocolHistoryRequest, ProtocolHistorySample, ReserveRequest, Reserve, ReservesRequest, BorrowApyHistoryRequest, ApySample, SupplyApyHistoryRequest, UserClaimableRewardsRequest, UserClaimableReward, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, TokenSwapQuoteRequest, TokenSwapQuoteResult, InsufficientLiquidityError, SwappableTokensRequest, Token, PrepareTokenSwapRequest, PrepareSwapOrder, InsufficientBalanceError, SupplySwapQuoteRequest, PositionSwapByIntentApprovalsRequired, BorrowSwapQuoteRequest, RepayWithSupplyQuoteRequest, WithdrawSwapQuoteRequest, PreparePositionSwapRequest, SwapStatusRequest, SwapStatus, SwapCancelled, SwapExpired, SwapFulfilled, SwapReceipt, SwapRequest, SwapTransactionRequest, PrepareSwapCancelRequest, PrepareSwapCancelResult, CancelSwapRequest, CancelSwapExecutionPlan, UserSwapsRequest, PaginatedUserSwapsResult, BorrowRequest, ExecutionPlan, SupplyRequest, RepayRequest, WithdrawRequest, RenounceSpokeUserPositionManagerRequest, TransactionRequest, UpdateUserPositionConditionsRequest, LiquidatePositionRequest, SetSpokeUserPositionManagerRequest, PreviewRequest, PreviewUserPosition, SetUserSuppliesAsCollateralRequest, ClaimRewardsRequest, ActivitiesRequest, PaginatedActivitiesResult, UserSuppliesRequest, UserSupplyItem, UserBorrowsRequest, UserBorrowItem, UserSummaryRequest, UserSummary, UserPositionsRequest, UserPosition, UserPositionRequest, UserBalancesRequest, UserBalance, UserSummaryHistoryRequest, UserSummaryHistoryItem, UserRiskPremiumBreakdownRequest, UserRiskPremiumBreakdownItem } from '@aave/graphql';
3
3
  import { ResultAsync, Prettify } from '@aave/types';
4
- import { A as AaveClient } from '../AaveClient-L3v8kWvn.cjs';
5
- import { C as CurrencyQueryOptions, R as RequestPolicyOptions, T as TimeWindowQueryOptions } from '../options-vB2peXdE.cjs';
4
+ import { A as AaveClient } from '../AaveClient-CYavo882.cjs';
5
+ import { C as CurrencyQueryOptions, T as TimeWindowQueryOptions, R as RequestPolicyOptions, B as BatchOptions } from '../options-BX6n3sbh.cjs';
6
6
  import '@urql/core';
7
- import '../types-Bu63z0x6.cjs';
7
+ import '../types-4gDcMKeo.cjs';
8
8
 
9
9
  /**
10
10
  * Fetches a specific hub by ID or by address and chain ID.
@@ -20,7 +20,7 @@ import '../types-Bu63z0x6.cjs';
20
20
  * @param options - The query options.
21
21
  * @returns The hub data, or null if not found.
22
22
  */
23
- declare function hub(client: AaveClient, request: HubRequest, options?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<Hub | null, UnexpectedError>;
23
+ declare function hub(client: AaveClient, request: HubRequest, options?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Hub | null, UnexpectedError>;
24
24
  /**
25
25
  * Fetches multiple hubs based on specified criteria.
26
26
  *
@@ -37,7 +37,7 @@ declare function hub(client: AaveClient, request: HubRequest, options?: Currency
37
37
  * @param options - The query options.
38
38
  * @returns Array of hub data.
39
39
  */
40
- declare function hubs(client: AaveClient, request: HubsRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<Hub[], UnexpectedError>;
40
+ declare function hubs(client: AaveClient, request: HubsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Hub[], UnexpectedError>;
41
41
  /**
42
42
  * Fetches hub assets for a specific hub by ID or by address and chain ID.
43
43
  *
@@ -52,7 +52,24 @@ declare function hubs(client: AaveClient, request: HubsRequest, options?: Requir
52
52
  * @param options - The query options.
53
53
  * @returns The hub assets array.
54
54
  */
55
- declare function hubAssets(client: AaveClient, request: HubAssetsRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<HubAsset[], UnexpectedError>;
55
+ declare function hubAssets(client: AaveClient, request: HubAssetsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<HubAsset[], UnexpectedError>;
56
+ /**
57
+ * Fetches historical summary data for a specific hub.
58
+ *
59
+ * ```ts
60
+ * const result = await hubSummaryHistory(client, {
61
+ * query: { hubId: hubId('SGVsbG8h') },
62
+ * currency: Currency.Usd,
63
+ * window: TimeWindow.LastWeek,
64
+ * });
65
+ * ```
66
+ *
67
+ * @param client - Aave client.
68
+ * @param request - The hub summary history request parameters.
69
+ * @param options - The query options.
70
+ * @returns Array of hub summary samples over time.
71
+ */
72
+ declare function hubSummaryHistory(client: AaveClient, request: HubSummaryHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<HubSummarySample[], UnexpectedError>;
56
73
 
57
74
  /**
58
75
  * Fetches a specific chain by chain ID.
@@ -65,21 +82,30 @@ declare function hubAssets(client: AaveClient, request: HubAssetsRequest, option
65
82
  *
66
83
  * @param client - Aave client.
67
84
  * @param request - The chain request parameters.
85
+ * @param options - The query options.
68
86
  * @returns The chain data, or null if not found.
69
87
  */
70
- declare function chain(client: AaveClient, request: ChainRequest): ResultAsync<Chain | null, UnexpectedError>;
88
+ declare function chain(client: AaveClient, request: ChainRequest, { batch, requestPolicy, }?: BatchOptions & RequestPolicyOptions): ResultAsync<Chain | null, UnexpectedError>;
71
89
  /**
72
90
  * Fetches the list of supported chains.
73
91
  *
74
92
  * ```ts
75
- * const chains = await chains(client, { filter: ChainsFilter.ALL });
93
+ * const chains = await chains(client, {
94
+ * query: { filter: ChainsFilter.ALL }
95
+ * });
96
+ * ```
97
+ *
98
+ * ```ts
99
+ * const chains = await chains(client, {
100
+ * query: { chainIds: [chainId(1), chainId(137)] }
101
+ * });
76
102
  * ```
77
103
  *
78
104
  * @param client - Aave client.
79
- * @param filter - The filter for chains.
105
+ * @param request - The chains request parameters.
80
106
  * @returns Array of supported chains.
81
107
  */
82
- declare function chains(client: AaveClient, filter?: ChainsFilter): ResultAsync<Chain[], UnexpectedError>;
108
+ declare function chains(client: AaveClient, request: ChainsRequest): ResultAsync<Chain[], UnexpectedError>;
83
109
  /**
84
110
  * Check if a transaction has been processed by the Aave API.
85
111
  *
@@ -100,31 +126,10 @@ declare function hasProcessedKnownTransaction(client: AaveClient, request: HasPr
100
126
  *
101
127
  * @param client - Aave client.
102
128
  * @param request - The exchange rate request parameters.
129
+ * @param options - The query options.
103
130
  * @returns The exchange rate information as a fiat amount.
104
131
  */
105
- declare function exchangeRate(client: AaveClient, request: ExchangeRateRequest): ResultAsync<FiatAmount, UnexpectedError>;
106
-
107
- /**
108
- * Generates EIP-712 typed data for permit signatures.
109
- *
110
- * ```ts
111
- * const result = await permitTypedData(client, {
112
- * spender: evmAddress('0x87870bca…'),
113
- * currency: evmAddress('0xa0b86991c431c924b2047c7094daf21b77e…'),
114
- * amount: '1000.5',
115
- * });
116
- *
117
- * if (result.isOk()) {
118
- * // Use the typed data to create a signature
119
- * const signature = await wallet.signTypedData(result.value);
120
- * }
121
- * ```
122
- *
123
- * @param client - Aave client.
124
- * @param request - The permit request parameters.
125
- * @returns The EIP-712 typed data for permit signature.
126
- */
127
- declare function permitTypedData(client: AaveClient, request: PermitRequest): ResultAsync<PermitTypedDataResponse, UnexpectedError>;
132
+ declare function exchangeRate(client: AaveClient, request: ExchangeRateRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ExchangeAmount, UnexpectedError>;
128
133
 
129
134
  /**
130
135
  * Fetches information about a specific asset (ERC20 token) in the protocol by ID or by token.
@@ -140,13 +145,15 @@ declare function permitTypedData(client: AaveClient, request: PermitRequest): Re
140
145
  * @param options - The query options including currency and time window.
141
146
  * @returns The asset data, or null if not found.
142
147
  */
143
- declare function asset(client: AaveClient, request: AssetRequest, options?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Asset | null, UnexpectedError>;
148
+ declare function asset(client: AaveClient, request: AssetRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Asset | null, UnexpectedError>;
144
149
  /**
145
150
  * Fetches historical price data for a specific asset.
146
151
  *
147
152
  * ```ts
148
153
  * const result = await assetPriceHistory(client, {
149
- * token: { chainId: chainId(1), address: evmAddress('0x123…') },
154
+ * query: {
155
+ * token: { chainId: chainId(1), address: evmAddress('0x123…') },
156
+ * },
150
157
  * currency: Currency.Usd,
151
158
  * window: TimeWindow.LastWeek,
152
159
  * });
@@ -163,33 +170,53 @@ declare function assetPriceHistory(client: AaveClient, request: AssetPriceHistor
163
170
  *
164
171
  * ```ts
165
172
  * const result = await assetSupplyHistory(client, {
166
- * token: { chainId: chainId(1), address: evmAddress('0x123…') },
173
+ * query: {
174
+ * token: { chainId: chainId(1), address: evmAddress('0x123…') },
175
+ * },
167
176
  * window: TimeWindow.LastWeek,
168
177
  * });
169
178
  * ```
170
179
  *
171
180
  * @param client - Aave client.
172
181
  * @param request - The asset supply history request parameters.
173
- * @param options - The query options.
182
+ * @param options - The query options including currency and time window.
174
183
  * @returns Array of asset supply samples over time.
175
184
  */
176
- declare function assetSupplyHistory(client: AaveClient, request: AssetSupplyHistoryRequest, options?: Required<RequestPolicyOptions>): ResultAsync<AssetSupplySample[], UnexpectedError>;
185
+ declare function assetSupplyHistory(client: AaveClient, request: AssetSupplyHistoryRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<AssetSupplySample[], UnexpectedError>;
177
186
  /**
178
187
  * Fetches historical borrow data for a specific asset.
179
188
  *
180
189
  * ```ts
181
190
  * const result = await assetBorrowHistory(client, {
182
- * token: { chainId: chainId(1), address: evmAddress('0x123…') },
191
+ * query: {
192
+ * token: { chainId: chainId(1), address: evmAddress('0x123…') },
193
+ * },
183
194
  * window: TimeWindow.LastWeek,
184
195
  * });
185
196
  * ```
186
197
  *
187
198
  * @param client - Aave client.
188
199
  * @param request - The asset borrow history request parameters.
189
- * @param options - The query options.
200
+ * @param options - The query options including currency and time window.
190
201
  * @returns Array of asset borrow samples over time.
191
202
  */
192
- declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHistoryRequest, options?: Required<RequestPolicyOptions>): ResultAsync<AssetBorrowSample[], UnexpectedError>;
203
+ declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHistoryRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<AssetBorrowSample[], UnexpectedError>;
204
+ /**
205
+ * Fetches historical protocol-wide data (deposits, borrows, earnings).
206
+ *
207
+ * ```ts
208
+ * const result = await protocolHistory(client, {
209
+ * currency: Currency.Usd,
210
+ * window: TimeWindow.LastWeek,
211
+ * });
212
+ * ```
213
+ *
214
+ * @param client - Aave client.
215
+ * @param request - The protocol history request parameters.
216
+ * @param options - The query options.
217
+ * @returns Array of protocol history samples over time.
218
+ */
219
+ declare function protocolHistory(client: AaveClient, request: ProtocolHistoryRequest, options?: Required<RequestPolicyOptions>): ResultAsync<ProtocolHistorySample[], UnexpectedError>;
193
220
 
194
221
  /**
195
222
  * Fetches a specific reserve by reserve ID, spoke, and chain.
@@ -206,7 +233,7 @@ declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHist
206
233
  * @param options - The query options.
207
234
  * @returns The reserve data, or null if not found.
208
235
  */
209
- declare function reserve(client: AaveClient, request: ReserveRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<Reserve | null, UnexpectedError>;
236
+ declare function reserve(client: AaveClient, request: ReserveRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Reserve | null, UnexpectedError>;
210
237
  /**
211
238
  * Fetches reserves based on specified criteria.
212
239
  *
@@ -228,7 +255,7 @@ declare function reserve(client: AaveClient, request: ReserveRequest, options?:
228
255
  * @param options - The query options.
229
256
  * @returns Array of reserves matching the criteria.
230
257
  */
231
- declare function reserves(client: AaveClient, request: ReservesRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<Reserve[], UnexpectedError>;
258
+ declare function reserves(client: AaveClient, request: ReservesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Reserve[], UnexpectedError>;
232
259
  /**
233
260
  * Fetches borrow APY history for a specific reserve over time.
234
261
  *
@@ -241,9 +268,10 @@ declare function reserves(client: AaveClient, request: ReservesRequest, options?
241
268
  *
242
269
  * @param client - Aave client.
243
270
  * @param request - The borrow APY history request parameters.
271
+ * @param options - The query options.
244
272
  * @returns The borrow APY history samples.
245
273
  */
246
- declare function borrowApyHistory(client: AaveClient, request: BorrowAPYHistoryRequest): ResultAsync<APYSample[], UnexpectedError>;
274
+ declare function borrowApyHistory(client: AaveClient, request: BorrowApyHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ApySample[], UnexpectedError>;
247
275
  /**
248
276
  * Fetches supply APY history for a specific reserve over time.
249
277
  *
@@ -256,9 +284,33 @@ declare function borrowApyHistory(client: AaveClient, request: BorrowAPYHistoryR
256
284
  *
257
285
  * @param client - Aave client.
258
286
  * @param request - The supply APY history request parameters.
287
+ * @param options - The query options.
259
288
  * @returns The supply APY history samples.
260
289
  */
261
- declare function supplyApyHistory(client: AaveClient, request: SupplyAPYHistoryRequest): ResultAsync<APYSample[], UnexpectedError>;
290
+ declare function supplyApyHistory(client: AaveClient, request: SupplyApyHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ApySample[], UnexpectedError>;
291
+
292
+ /**
293
+ * Fetches all claimable rewards for a user.
294
+ *
295
+ * ```ts
296
+ * const result = await userClaimableRewards(client, {
297
+ * user: evmAddress('0x742d35cc…'),
298
+ * });
299
+ *
300
+ * if (result.isErr()) {
301
+ * // Handle error
302
+ * return;
303
+ * }
304
+ *
305
+ * // result.value: UserClaimableReward[]
306
+ * ```
307
+ *
308
+ * @param client - Aave client.
309
+ * @param request - The user claimable rewards request parameters.
310
+ * @param options - The query options.
311
+ * @returns Array of claimable rewards.
312
+ */
313
+ declare function userClaimableRewards(client: AaveClient, request: UserClaimableRewardsRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserClaimableReward[], UnexpectedError>;
262
314
 
263
315
  /**
264
316
  * Fetches a specific spoke.
@@ -319,28 +371,28 @@ declare function spokePositionManagers(client: AaveClient, request: SpokePositio
319
371
  declare function spokeUserPositionManagers(client: AaveClient, request: SpokeUserPositionManagersRequest): ResultAsync<PaginatedSpokeUserPositionManagerResult, UnexpectedError>;
320
372
 
321
373
  /**
322
- * @internal
323
374
  * Fetches a swap quote for the specified trade parameters.
324
375
  *
325
376
  * ```ts
326
- * const result = await swapQuote(client, {
327
- * chainId: chainId(1),
328
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
329
- * sell: { erc20: evmAddress('0x6B175474E...') },
330
- * amount: bigDecimal('1000'),
331
- * kind: SwapKind.SELL,
332
- * from: evmAddress('0x742d35cc...'),
377
+ * const result = await tokenSwapQuote(client, {
378
+ * market: {
379
+ * chainId: chainId(1),
380
+ * buy: { erc20: evmAddress('0xA0b86a33E6...') },
381
+ * sell: { erc20: evmAddress('0x6B175474E...') },
382
+ * amount: bigDecimal('1000'),
383
+ * kind: SwapKind.Sell,
384
+ * user: evmAddress('0x742d35cc...'),
385
+ * },
333
386
  * });
334
387
  * ```
335
388
  *
336
389
  * @param client - Aave client.
337
390
  * @param request - The swap quote request parameters.
338
391
  * @param options - The query options.
339
- * @returns The swap quote including pricing and cost information.
392
+ * @returns The swap quote including pricing and cost information and plan to start executing the swap.
340
393
  */
341
- declare function swapQuote(client: AaveClient, request: SwapQuoteRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<SwapQuote, UnexpectedError>;
394
+ declare function tokenSwapQuote(client: AaveClient, request: TokenSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<TokenSwapQuoteResult, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
342
395
  /**
343
- * @internal
344
396
  * Fetches the list of tokens available for swapping on a specific chain.
345
397
  *
346
398
  * ```ts
@@ -351,63 +403,126 @@ declare function swapQuote(client: AaveClient, request: SwapQuoteRequest, option
351
403
  *
352
404
  * @param client - Aave client.
353
405
  * @param request - The swappable tokens request parameters.
406
+ * @param options - The query options.
354
407
  * @returns The list of tokens available for swapping.
355
408
  */
356
- declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest): ResultAsync<Token[], UnexpectedError>;
409
+ declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<Token[], UnexpectedError>;
357
410
  /**
358
- * @internal
359
411
  * Prepares a swap for the specified trade parameters.
360
412
  *
361
413
  * ```ts
362
- * const result = await prepareSwap(client, {
414
+ * const result = await prepareTokenSwap(client, {
415
+ * quoteId: quote.quoteId,
416
+ * }).andThen(order => {
417
+ * return signTypedDataWith(wallet, order.data)
418
+ * .andThen((signature) =>
419
+ * swap({ intent: { quoteId: order.newQuoteId, signature } }),
420
+ * );
421
+ * });
422
+ * ```
423
+ *
424
+ * @param client - Aave client.
425
+ * @param request - The prepare swap request parameters.
426
+ * @returns The prepared swap result containing details of the swap.
427
+ */
428
+ declare function prepareTokenSwap(client: AaveClient, request: PrepareTokenSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
429
+ /**
430
+ * Fetches a supply swap quote for swapping deposited funds.
431
+ *
432
+ * ```ts
433
+ * const result = await supplySwapQuote(client, {
363
434
  * market: {
364
- * chainId: chainId(1),
365
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
366
- * sell: { erc20: evmAddress('0x6B175474E...') },
435
+ * sellPosition: userSupplyItemId('position_123'),
436
+ * buyReserve: reserveId('reserve_456'),
367
437
  * amount: bigDecimal('1000'),
368
- * kind: SwapKind.SELL,
369
438
  * user: evmAddress('0x742d35cc...'),
370
439
  * },
371
- * }).andThen(plan => {
372
- * switch (plan.__typename) {
373
- * case 'SwapByIntent':
374
- * return signSwapByIntentWith(plan.data)
375
- * .andThen((signature) => swap({ intent: { quoteId: quote.quoteId, signature } }))
376
- * .andThen((plan) => {
377
- * // …
378
- * });
379
- * );
380
- *
381
- * case 'SwapByIntentWithApprovalRequired':
382
- * return sendTransaction(plan.transaction)
383
- * .andThen(signSwapByIntentWith(plan.data))
384
- * .andThen((signature) => swap({ intent: { quoteId: quote.quoteId, signature } }))
385
- * .andThen((plan) => {
386
- * // …
387
- * });
388
- * );
389
- *
390
- * case 'SwapByTransaction':
391
- * return swap({ transaction: { quoteId: quote.quoteId } })
392
- * .andThen((plan) => {
393
- * // …
394
- * });
395
- * );
396
- *
397
- * case 'InsufficientBalanceError':
398
- * return errAsync(new Error(`Insufficient balance: ${plan.required.value} required.`));
399
- * }
400
440
  * });
401
441
  * ```
402
442
  *
403
443
  * @param client - Aave client.
404
- * @param request - The prepare swap request parameters.
444
+ * @param request - The supply swap request parameters.
405
445
  * @param options - The query options.
406
- * @returns The prepared swap result containing details of the swap.
446
+ * @returns The supply swap result with quote, approvals, and preview.
407
447
  */
408
- declare function prepareSwap(client: AaveClient, request: PrepareSwapRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<PrepareSwapResult, UnexpectedError>;
448
+ declare function supplySwapQuote(client: AaveClient, request: SupplySwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
449
+ /**
450
+ * Fetches a borrow swap quote for swapping debt positions.
451
+ *
452
+ * ```ts
453
+ * const result = await borrowSwapQuote(client, {
454
+ * market: {
455
+ * sellPosition: userBorrowItemId('position_123'),
456
+ * buyReserve: reserveId('reserve_456'),
457
+ * amount: bigDecimal('1000'),
458
+ * user: evmAddress('0x742d35cc...'),
459
+ * },
460
+ * });
461
+ * ```
462
+ *
463
+ * @param client - Aave client.
464
+ * @param request - The borrow swap request parameters.
465
+ * @param options - The query options.
466
+ * @returns The borrow swap result with quote, approvals, and preview.
467
+ */
468
+ declare function borrowSwapQuote(client: AaveClient, request: BorrowSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
469
+ /**
470
+ * Fetches a repay with supply quote for repaying debt using collateral.
471
+ *
472
+ * ```ts
473
+ * const result = await repayWithSupplyQuote(client, {
474
+ * market: {
475
+ * sellPosition: userSupplyItemId('collateral_123'),
476
+ * buyPosition: userBorrowItemId('debt_456'),
477
+ * amount: bigDecimal('1000'),
478
+ * user: evmAddress('0x742d35cc...'),
479
+ * },
480
+ * });
481
+ * ```
482
+ *
483
+ * @param client - Aave client.
484
+ * @param request - The repay with supply request parameters.
485
+ * @param options - The query options.
486
+ * @returns The repay with supply result with quote, approvals, and preview.
487
+ */
488
+ declare function repayWithSupplyQuote(client: AaveClient, request: RepayWithSupplyQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
489
+ /**
490
+ * Fetches a withdraw swap quote for withdrawing deposits and swapping on the fly.
491
+ *
492
+ * ```ts
493
+ * const result = await withdrawSwapQuote(client, {
494
+ * market: {
495
+ * position: userSupplyItemId('position_123'),
496
+ * buyReserve: reserveId('reserve_456'),
497
+ * amount: bigDecimal('1000'),
498
+ * user: evmAddress('0x742d35cc...'),
499
+ * },
500
+ * });
501
+ * ```
502
+ *
503
+ * @param client - Aave client.
504
+ * @param request - The withdraw swap request parameters.
505
+ * @param options - The query options.
506
+ * @returns The withdraw swap result with quote, approvals, and preview.
507
+ */
508
+ declare function withdrawSwapQuote(client: AaveClient, request: WithdrawSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
509
+ /**
510
+ * Prepares a position swap by obtaining the typed data for signing.
511
+ *
512
+ * ```ts
513
+ * const result = await preparePositionSwap(client, {
514
+ * quoteId: quote.quoteId,
515
+ * adapterContractSignature: signature('0x456...'),
516
+ * positionManagerSignature: signature('0x789...'),
517
+ * });
518
+ * ```
519
+ *
520
+ * @param client - Aave client.
521
+ * @param request - The position swap request with quote ID and signatures.
522
+ * @returns The position swap result with intent data for execution.
523
+ */
524
+ declare function preparePositionSwap(client: AaveClient, request: PreparePositionSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
409
525
  /**
410
- * @internal
411
526
  * Fetches the status of a specific swap.
412
527
  *
413
528
  * ```ts
@@ -421,10 +536,9 @@ declare function prepareSwap(client: AaveClient, request: PrepareSwapRequest, op
421
536
  * @param options - The query options.
422
537
  * @returns The current status of the swap.
423
538
  */
424
- declare function swapStatus(client: AaveClient, request: SwapStatusRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<SwapStatus, UnexpectedError>;
539
+ declare function swapStatus(client: AaveClient, request: SwapStatusRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<SwapStatus, UnexpectedError>;
425
540
  type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
426
541
  /**
427
- * @internal
428
542
  * Waits for a swap to reach a final outcome (cancelled, expired, or fulfilled).
429
543
  *
430
544
  * ```ts
@@ -451,17 +565,13 @@ type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
451
565
  */
452
566
  declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt) => ResultAsync<SwapOutcome, TimeoutError | UnexpectedError>;
453
567
  /**
454
- * @internal
455
568
  * Executes a swap for the specified request parameters.
456
569
  *
457
570
  * ```ts
458
571
  * const result = await swap(client, {
459
572
  * intent: {
460
- * quoteId: swapQuoteId('123...'),
461
- * signature: {
462
- * value: signature('0x456...'),
463
- * deadline: 1234567890,
464
- * },
573
+ * quoteId: quote.quoteId,
574
+ * signature: signature('0x456...'),
465
575
  * },
466
576
  * }).andThen((plan) => {
467
577
  * switch (plan.__typename) {
@@ -469,16 +579,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
469
579
  * return sendTransaction(plan.transaction)
470
580
  * .map(() => plan.orderReceipt);
471
581
  *
472
- * case 'SwapApprovalRequired':
473
- * return sendTransaction(plan.transaction)
474
- * .andThen(() => sendTransaction(plan.originalTransaction))
475
- * .map(() => plan.originalTransaction.orderReceipt);
476
- *
477
582
  * case 'SwapReceipt':
478
- * return okAsync(plan.orderReceipt);
479
- *
480
- * case 'InsufficientBalanceError':
481
- * return errAsync(new Error(`Insufficient balance: ${plan.required.value} required.`));
583
+ * return okAsync(plan);
482
584
  * }
483
585
  * });
484
586
  *
@@ -494,9 +596,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
494
596
  * @param request - The swap request parameters.
495
597
  * @returns The swap execution plan containing transaction details or receipt.
496
598
  */
497
- declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<SwapExecutionPlan, UnexpectedError>;
599
+ declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<SwapTransactionRequest | SwapReceipt, ValidationError<InsufficientBalanceError> | UnexpectedError>;
498
600
  /**
499
- * @internal
500
601
  * Prepares a swap cancellation for the specified swap ID.
501
602
  *
502
603
  * ```ts
@@ -511,7 +612,6 @@ declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<Swa
511
612
  */
512
613
  declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCancelRequest): ResultAsync<PrepareSwapCancelResult, UnexpectedError>;
513
614
  /**
514
- * @internal
515
615
  * Executes a swap cancellation for the specified request parameters.
516
616
  *
517
617
  * ```ts
@@ -526,8 +626,7 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
526
626
  * }).andThen((plan) => {
527
627
  * switch (plan.__typename) {
528
628
  * case 'TransactionRequest':
529
- * return sendTransaction(plan)
530
- * .map(() => ({ success: true }));
629
+ * return sendTransaction(plan);
531
630
  *
532
631
  * case 'SwapCancelled':
533
632
  * return okAsync(plan);
@@ -541,7 +640,6 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
541
640
  */
542
641
  declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): ResultAsync<CancelSwapExecutionPlan, UnexpectedError>;
543
642
  /**
544
- * @internal
545
643
  * Fetches the user's swap history for a specific chain.
546
644
  *
547
645
  * ```ts
@@ -557,7 +655,7 @@ declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): Res
557
655
  * @param options - The query options.
558
656
  * @returns The paginated list of user swaps with their status information.
559
657
  */
560
- declare function userSwaps(client: AaveClient, request: UserSwapsRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<PaginatedUserSwapsResult, UnexpectedError>;
658
+ declare function userSwaps(client: AaveClient, request: UserSwapsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedUserSwapsResult, UnexpectedError>;
561
659
 
562
660
  /**
563
661
  * Creates a transaction to borrow from a market.
@@ -724,12 +822,12 @@ declare function withdraw(client: AaveClient, request: WithdrawRequest): ResultA
724
822
  */
725
823
  declare function renounceSpokeUserPositionManager(client: AaveClient, request: RenounceSpokeUserPositionManagerRequest): ResultAsync<TransactionRequest, UnexpectedError>;
726
824
  /**
727
- * Creates a transaction to update user dynamic config for a specific spoke.
825
+ * Creates a transaction to update user position conditions (dynamic config and/or risk premium).
728
826
  *
729
827
  * ```ts
730
- * const result = await updateUserDynamicConfig(client, {
731
- * sender: evmAddress('0x9abc…'),
732
- * spoke: spokeId('SGVsbG8h'),
828
+ * const result = await updateUserPositionConditions(client, {
829
+ * userPositionId: userPositionId('SGVsbG8h'),
830
+ * update: UserPositionConditionsUpdate.AllDynamicConfig,
733
831
  * }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
734
832
  *
735
833
  * if (result.isErr()) {
@@ -742,33 +840,10 @@ declare function renounceSpokeUserPositionManager(client: AaveClient, request: R
742
840
  *
743
841
  *
744
842
  * @param client - Aave client.
745
- * @param request - The update user dynamic config request parameters.
843
+ * @param request - The update user position conditions request parameters.
746
844
  * @returns The transaction data.
747
845
  */
748
- declare function updateUserDynamicConfig(client: AaveClient, request: UpdateUserDynamicConfigRequest): ResultAsync<TransactionRequest, UnexpectedError>;
749
- /**
750
- * Creates a transaction to update user risk premium for a specific spoke.
751
- *
752
- * ```ts
753
- * const result = await updateUserRiskPremium(client, {
754
- * sender: evmAddress('0x9abc…'),
755
- * spoke: spokeId('SGVsbG8h'),
756
- * }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
757
- *
758
- * if (result.isErr()) {
759
- * // Handle error
760
- * return;
761
- * }
762
- *
763
- * // result.value: TxHash
764
- * ```
765
- *
766
- *
767
- * @param client - Aave client.
768
- * @param request - The update user risk premium request parameters.
769
- * @returns The transaction data.
770
- */
771
- declare function updateUserRiskPremium(client: AaveClient, request: UpdateUserRiskPremiumRequest): ResultAsync<TransactionRequest, UnexpectedError>;
846
+ declare function updateUserPositionConditions(client: AaveClient, request: UpdateUserPositionConditionsRequest): ResultAsync<TransactionRequest, UnexpectedError>;
772
847
  /**
773
848
  * Creates a transaction to liquidate a user's position.
774
849
  *
@@ -859,23 +934,48 @@ declare function setSpokeUserPositionManager(client: AaveClient, request: SetSpo
859
934
  * @param options - The query options.
860
935
  * @returns The preview result showing position changes.
861
936
  */
862
- declare function preview(client: AaveClient, request: PreviewRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<PreviewUserPosition, UnexpectedError>;
937
+ declare function preview(client: AaveClient, request: PreviewRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PreviewUserPosition, UnexpectedError>;
863
938
  /**
864
- * Sets whether a user's supply should be used as collateral.
939
+ * Updates the collateral status of user's supplies.
865
940
  *
866
941
  * ```ts
867
- * const result = await setUserSupplyAsCollateral(client, {
868
- * reserve: reserveId('SGVsbG8h'),
869
- * sender: evmAddress('0x456...'),
870
- * enableCollateral: true
942
+ * const result = await setUserSuppliesAsCollateral(client, {
943
+ * changes: [
944
+ * {
945
+ * reserve: reserveId('SGVsbG8h'),
946
+ * enableCollateral: true
947
+ * }
948
+ * ],
949
+ * sender: evmAddress('0x456...')
950
+ * });
951
+ * ```
952
+ *
953
+ * @param client - Aave client.
954
+ * @param request - The request parameters.
955
+ * @returns The transaction request to update collateral status.
956
+ */
957
+ declare function setUserSuppliesAsCollateral(client: AaveClient, request: SetUserSuppliesAsCollateralRequest): ResultAsync<TransactionRequest, UnexpectedError>;
958
+ /**
959
+ * Creates a transaction to claim rewards.
960
+ *
961
+ * ```ts
962
+ * const result = await claimRewards(client, {
963
+ * ids: [rewardId('abc123')],
871
964
  * });
965
+ *
966
+ * if (result.isErr()) {
967
+ * // Handle error
968
+ * return;
969
+ * }
970
+ *
971
+ * // result.value: TransactionRequest
872
972
  * ```
873
973
  *
874
974
  * @param client - Aave client.
875
- * @param request - The set user supply as collateral request parameters.
876
- * @returns The transaction request to set collateral status.
975
+ * @param request - The claim rewards request parameters.
976
+ * @returns The transaction request to claim rewards.
877
977
  */
878
- declare function setUserSupplyAsCollateral(client: AaveClient, request: SetUserSupplyAsCollateralRequest): ResultAsync<TransactionRequest, UnexpectedError>;
978
+ declare function claimRewards(client: AaveClient, request: ClaimRewardsRequest): ResultAsync<TransactionRequest, UnexpectedError>;
879
979
  /**
880
980
  * Fetches paginated list of activities.
881
981
  *
@@ -894,7 +994,7 @@ declare function setUserSupplyAsCollateral(client: AaveClient, request: SetUserS
894
994
  * @param options - The query options.
895
995
  * @returns The paginated list of activities.
896
996
  */
897
- declare function activities(client: AaveClient, request: ActivitiesRequest, options?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedActivitiesResult, UnexpectedError>;
997
+ declare function activities(client: AaveClient, request: ActivitiesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedActivitiesResult, UnexpectedError>;
898
998
 
899
999
  /**
900
1000
  * Fetches all user supply positions across the specified spoke.
@@ -916,7 +1016,7 @@ declare function activities(client: AaveClient, request: ActivitiesRequest, opti
916
1016
  * @param options - The query options.
917
1017
  * @returns The user's supply positions.
918
1018
  */
919
- declare function userSupplies(client: AaveClient, request: UserSuppliesRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<UserSupplyItem[], UnexpectedError>;
1019
+ declare function userSupplies(client: AaveClient, request: UserSuppliesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserSupplyItem[], UnexpectedError>;
920
1020
  /**
921
1021
  * Fetches all user borrow positions across the specified spoke.
922
1022
  *
@@ -937,8 +1037,8 @@ declare function userSupplies(client: AaveClient, request: UserSuppliesRequest,
937
1037
  * @param options - The query options.
938
1038
  * @returns The user's borrow positions.
939
1039
  */
940
- declare function userBorrows(client: AaveClient, request: UserBorrowsRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<UserBorrowItem[], UnexpectedError>;
941
- type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions>;
1040
+ declare function userBorrows(client: AaveClient, request: UserBorrowsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserBorrowItem[], UnexpectedError>;
1041
+ type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions>;
942
1042
  /**
943
1043
  * Fetches a user's summary across all positions.
944
1044
  *
@@ -956,8 +1056,8 @@ type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOp
956
1056
  * @param options - The query options.
957
1057
  * @returns The user's financial summary.
958
1058
  */
959
- declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
960
- type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
1059
+ declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, requestPolicy, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
1060
+ type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions;
961
1061
  /**
962
1062
  * Fetches all user positions across specified chains.
963
1063
  *
@@ -976,7 +1076,7 @@ type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
976
1076
  * @param options - The query options.
977
1077
  * @returns The user's positions across all specified chains.
978
1078
  */
979
- declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
1079
+ declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
980
1080
  /**
981
1081
  * Fetches a specific user position by ID.
982
1082
  *
@@ -991,7 +1091,7 @@ declare function userPositions(client: AaveClient, request: UserPositionsRequest
991
1091
  * @param options - The query options.
992
1092
  * @returns The specific user position or null if not found.
993
1093
  */
994
- declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
1094
+ declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
995
1095
  /**
996
1096
  * Fetches all user balances across specified chains.
997
1097
  *
@@ -1009,7 +1109,7 @@ declare function userPosition(client: AaveClient, request: UserPositionRequest,
1009
1109
  * @param options - The query options.
1010
1110
  * @returns The user's balances across all specified chains.
1011
1111
  **/
1012
- declare function userBalances(client: AaveClient, request: UserBalancesRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<UserBalance[], UnexpectedError>;
1112
+ declare function userBalances(client: AaveClient, request: UserBalancesRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserBalance[], UnexpectedError>;
1013
1113
  /**
1014
1114
  * Fetches user summary history over time.
1015
1115
  *
@@ -1028,6 +1128,24 @@ declare function userBalances(client: AaveClient, request: UserBalancesRequest,
1028
1128
  * @param options - The query options.
1029
1129
  * @returns The user summary history items.
1030
1130
  */
1031
- declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest, options?: Required<CurrencyQueryOptions>): ResultAsync<UserSummaryHistoryItem[], UnexpectedError>;
1131
+ declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserSummaryHistoryItem[], UnexpectedError>;
1132
+ /**
1133
+ * Fetches the risk premium breakdown for a user position or spoke.
1134
+ *
1135
+ * ```ts
1136
+ * const result = await userRiskPremiumBreakdown(client, {
1137
+ * query: {
1138
+ * userPositionId: userPositionId('SGVsbG8h'),
1139
+ * },
1140
+ * user: evmAddress('0x742d35cc…'),
1141
+ * });
1142
+ * ```
1143
+ *
1144
+ * @param client - Aave client.
1145
+ * @param request - The user risk premium breakdown request parameters.
1146
+ * @param options - The query options.
1147
+ * @returns Array of risk premium breakdown items.
1148
+ */
1149
+ declare function userRiskPremiumBreakdown(client: AaveClient, request: UserRiskPremiumBreakdownRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserRiskPremiumBreakdownItem[], UnexpectedError>;
1032
1150
 
1033
- export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, cancelSwap, chain, chains, exchangeRate, hasProcessedKnownTransaction, hub, hubAssets, hubs, liquidatePosition, permitTypedData, prepareSwap, prepareSwapCancel, preview, renounceSpokeUserPositionManager, repay, reserve, reserves, setSpokeUserPositionManager, setUserSupplyAsCollateral, spoke, spokePositionManagers, spokeUserPositionManagers, spokes, supply, supplyApyHistory, swap, swapQuote, swapStatus, swappableTokens, updateUserDynamicConfig, updateUserRiskPremium, userBalances, userBorrows, userPosition, userPositions, userSummary, userSummaryHistory, userSupplies, userSwaps, waitForSwapOutcome, withdraw };
1151
+ export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, borrowSwapQuote, cancelSwap, chain, chains, claimRewards, exchangeRate, hasProcessedKnownTransaction, hub, hubAssets, hubSummaryHistory, hubs, liquidatePosition, preparePositionSwap, prepareSwapCancel, prepareTokenSwap, preview, protocolHistory, renounceSpokeUserPositionManager, repay, repayWithSupplyQuote, reserve, reserves, setSpokeUserPositionManager, setUserSuppliesAsCollateral, spoke, spokePositionManagers, spokeUserPositionManagers, spokes, supply, supplyApyHistory, supplySwapQuote, swap, swapStatus, swappableTokens, tokenSwapQuote, updateUserPositionConditions, userBalances, userBorrows, userClaimableRewards, userPosition, userPositions, userRiskPremiumBreakdown, userSummary, userSummaryHistory, userSupplies, userSwaps, waitForSwapOutcome, withdraw, withdrawSwapQuote };