@aave/client 4.0.0-next.3 → 4.0.0-next.31
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.
- package/README.md +6 -3
- package/dist/{AaveClient-L3v8kWvn.d.cts → AaveClient-1SYnTlsS.d.cts} +3 -1
- package/dist/{AaveClient-CgHY2iS9.d.ts → AaveClient-DGbooMqK.d.ts} +3 -1
- package/dist/actions/index.cjs +1 -1
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +245 -171
- package/dist/actions/index.d.ts +245 -171
- package/dist/actions/index.js +1 -1
- package/dist/chunk-35WSRP27.js +2 -0
- package/dist/chunk-35WSRP27.js.map +1 -0
- package/dist/chunk-BU2KVGJB.js +2 -0
- package/dist/chunk-BU2KVGJB.js.map +1 -0
- package/dist/ethers.cjs +1 -1
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +47 -13
- package/dist/ethers.d.ts +47 -13
- package/dist/ethers.js +1 -1
- package/dist/ethers.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{options-vB2peXdE.d.cts → options-BX6n3sbh.d.cts} +17 -1
- package/dist/{options-vB2peXdE.d.ts → options-BX6n3sbh.d.ts} +17 -1
- package/dist/privy.cjs +1 -2
- package/dist/privy.cjs.map +1 -1
- package/dist/privy.d.cts +49 -12
- package/dist/privy.d.ts +49 -12
- package/dist/privy.js +1 -1
- package/dist/privy.js.map +1 -1
- package/dist/testing.d.ts +3842 -0
- package/dist/testing.js +546 -0
- package/dist/testing.js.map +1 -0
- package/dist/thirdweb.cjs +1 -2
- package/dist/thirdweb.cjs.map +1 -1
- package/dist/thirdweb.d.cts +55 -15
- package/dist/thirdweb.d.ts +55 -15
- package/dist/thirdweb.js +1 -2
- package/dist/thirdweb.js.map +1 -1
- package/dist/{types-Bu63z0x6.d.cts → types-4gDcMKeo.d.cts} +9 -5
- package/dist/{types-Bu63z0x6.d.ts → types-4gDcMKeo.d.ts} +9 -5
- package/dist/viem.cjs +1 -2
- package/dist/viem.cjs.map +1 -1
- package/dist/viem.d.cts +57 -17
- package/dist/viem.d.ts +57 -17
- package/dist/viem.js +1 -1
- package/package.json +10 -11
- package/dist/chunk-2URLJFKP.js +0 -3
- package/dist/chunk-2URLJFKP.js.map +0 -1
- package/dist/chunk-BQFM5RT3.js +0 -2
- package/dist/chunk-BQFM5RT3.js.map +0 -1
- package/dist/chunk-BQNVAUS6.js +0 -3
- package/dist/chunk-BQNVAUS6.js.map +0 -1
- package/dist/test-utils.cjs +0 -3
- package/dist/test-utils.cjs.map +0 -1
- package/dist/test-utils.d.cts +0 -49
- package/dist/test-utils.d.ts +0 -49
- package/dist/test-utils.js +0 -3
- package/dist/test-utils.js.map +0 -1
package/dist/actions/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UnexpectedError, TimeoutError } from '@aave/core';
|
|
2
|
-
import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, ChainRequest, Chain,
|
|
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, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, TokenSwapQuoteRequest, TokenSwapQuoteResult, 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, 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-
|
|
5
|
-
import { C as CurrencyQueryOptions, R as RequestPolicyOptions,
|
|
4
|
+
import { A as AaveClient } from '../AaveClient-1SYnTlsS.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-
|
|
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,
|
|
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,
|
|
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, {
|
|
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
|
|
105
|
+
* @param request - The chains request parameters.
|
|
80
106
|
* @returns Array of supported chains.
|
|
81
107
|
*/
|
|
82
|
-
declare function chains(client: AaveClient,
|
|
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<
|
|
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,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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,
|
|
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
|
-
*
|
|
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,
|
|
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,
|
|
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,
|
|
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:
|
|
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,10 @@ 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:
|
|
290
|
+
declare function supplyApyHistory(client: AaveClient, request: SupplyApyHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ApySample[], UnexpectedError>;
|
|
262
291
|
|
|
263
292
|
/**
|
|
264
293
|
* Fetches a specific spoke.
|
|
@@ -319,28 +348,28 @@ declare function spokePositionManagers(client: AaveClient, request: SpokePositio
|
|
|
319
348
|
declare function spokeUserPositionManagers(client: AaveClient, request: SpokeUserPositionManagersRequest): ResultAsync<PaginatedSpokeUserPositionManagerResult, UnexpectedError>;
|
|
320
349
|
|
|
321
350
|
/**
|
|
322
|
-
* @internal
|
|
323
351
|
* Fetches a swap quote for the specified trade parameters.
|
|
324
352
|
*
|
|
325
353
|
* ```ts
|
|
326
|
-
* const result = await
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
354
|
+
* const result = await tokenSwapQuote(client, {
|
|
355
|
+
* market: {
|
|
356
|
+
* chainId: chainId(1),
|
|
357
|
+
* buy: { erc20: evmAddress('0xA0b86a33E6...') },
|
|
358
|
+
* sell: { erc20: evmAddress('0x6B175474E...') },
|
|
359
|
+
* amount: bigDecimal('1000'),
|
|
360
|
+
* kind: SwapKind.Sell,
|
|
361
|
+
* user: evmAddress('0x742d35cc...'),
|
|
362
|
+
* },
|
|
333
363
|
* });
|
|
334
364
|
* ```
|
|
335
365
|
*
|
|
336
366
|
* @param client - Aave client.
|
|
337
367
|
* @param request - The swap quote request parameters.
|
|
338
368
|
* @param options - The query options.
|
|
339
|
-
* @returns The swap quote including pricing and cost information.
|
|
369
|
+
* @returns The swap quote including pricing and cost information and plan to start executing the swap.
|
|
340
370
|
*/
|
|
341
|
-
declare function
|
|
371
|
+
declare function tokenSwapQuote(client: AaveClient, request: TokenSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<TokenSwapQuoteResult, UnexpectedError>;
|
|
342
372
|
/**
|
|
343
|
-
* @internal
|
|
344
373
|
* Fetches the list of tokens available for swapping on a specific chain.
|
|
345
374
|
*
|
|
346
375
|
* ```ts
|
|
@@ -351,63 +380,126 @@ declare function swapQuote(client: AaveClient, request: SwapQuoteRequest, option
|
|
|
351
380
|
*
|
|
352
381
|
* @param client - Aave client.
|
|
353
382
|
* @param request - The swappable tokens request parameters.
|
|
383
|
+
* @param options - The query options.
|
|
354
384
|
* @returns The list of tokens available for swapping.
|
|
355
385
|
*/
|
|
356
|
-
declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest): ResultAsync<Token[], UnexpectedError>;
|
|
386
|
+
declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<Token[], UnexpectedError>;
|
|
357
387
|
/**
|
|
358
|
-
* @internal
|
|
359
388
|
* Prepares a swap for the specified trade parameters.
|
|
360
389
|
*
|
|
361
390
|
* ```ts
|
|
362
|
-
* const result = await
|
|
391
|
+
* const result = await prepareTokenSwap(client, {
|
|
392
|
+
* quoteId: quote.quoteId,
|
|
393
|
+
* }).andThen(order => {
|
|
394
|
+
* return signSwapTypedDataWith(wallet, order.data)
|
|
395
|
+
* .andThen((signature) =>
|
|
396
|
+
* swap({ intent: { quoteId: order.newQuoteId, signature } }),
|
|
397
|
+
* );
|
|
398
|
+
* });
|
|
399
|
+
* ```
|
|
400
|
+
*
|
|
401
|
+
* @param client - Aave client.
|
|
402
|
+
* @param request - The prepare swap request parameters.
|
|
403
|
+
* @returns The prepared swap result containing details of the swap.
|
|
404
|
+
*/
|
|
405
|
+
declare function prepareTokenSwap(client: AaveClient, request: PrepareTokenSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
406
|
+
/**
|
|
407
|
+
* Fetches a supply swap quote for swapping deposited funds.
|
|
408
|
+
*
|
|
409
|
+
* ```ts
|
|
410
|
+
* const result = await supplySwapQuote(client, {
|
|
363
411
|
* market: {
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
* sell: { erc20: evmAddress('0x6B175474E...') },
|
|
412
|
+
* sellPosition: userSupplyItemId('position_123'),
|
|
413
|
+
* buyReserve: reserveId('reserve_456'),
|
|
367
414
|
* amount: bigDecimal('1000'),
|
|
368
|
-
* kind: SwapKind.SELL,
|
|
369
415
|
* user: evmAddress('0x742d35cc...'),
|
|
370
416
|
* },
|
|
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
417
|
* });
|
|
401
418
|
* ```
|
|
402
419
|
*
|
|
403
420
|
* @param client - Aave client.
|
|
404
|
-
* @param request - The
|
|
421
|
+
* @param request - The supply swap request parameters.
|
|
405
422
|
* @param options - The query options.
|
|
406
|
-
* @returns The
|
|
423
|
+
* @returns The supply swap result with quote, approvals, and preview.
|
|
424
|
+
*/
|
|
425
|
+
declare function supplySwapQuote(client: AaveClient, request: SupplySwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError>;
|
|
426
|
+
/**
|
|
427
|
+
* Fetches a borrow swap quote for swapping debt positions.
|
|
428
|
+
*
|
|
429
|
+
* ```ts
|
|
430
|
+
* const result = await borrowSwapQuote(client, {
|
|
431
|
+
* market: {
|
|
432
|
+
* sellPosition: userBorrowItemId('position_123'),
|
|
433
|
+
* buyReserve: reserveId('reserve_456'),
|
|
434
|
+
* amount: bigDecimal('1000'),
|
|
435
|
+
* user: evmAddress('0x742d35cc...'),
|
|
436
|
+
* },
|
|
437
|
+
* });
|
|
438
|
+
* ```
|
|
439
|
+
*
|
|
440
|
+
* @param client - Aave client.
|
|
441
|
+
* @param request - The borrow swap request parameters.
|
|
442
|
+
* @param options - The query options.
|
|
443
|
+
* @returns The borrow swap result with quote, approvals, and preview.
|
|
444
|
+
*/
|
|
445
|
+
declare function borrowSwapQuote(client: AaveClient, request: BorrowSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError>;
|
|
446
|
+
/**
|
|
447
|
+
* Fetches a repay with supply quote for repaying debt using collateral.
|
|
448
|
+
*
|
|
449
|
+
* ```ts
|
|
450
|
+
* const result = await repayWithSupplyQuote(client, {
|
|
451
|
+
* market: {
|
|
452
|
+
* sellPosition: userSupplyItemId('collateral_123'),
|
|
453
|
+
* buyPosition: userBorrowItemId('debt_456'),
|
|
454
|
+
* amount: bigDecimal('1000'),
|
|
455
|
+
* user: evmAddress('0x742d35cc...'),
|
|
456
|
+
* },
|
|
457
|
+
* });
|
|
458
|
+
* ```
|
|
459
|
+
*
|
|
460
|
+
* @param client - Aave client.
|
|
461
|
+
* @param request - The repay with supply request parameters.
|
|
462
|
+
* @param options - The query options.
|
|
463
|
+
* @returns The repay with supply result with quote, approvals, and preview.
|
|
407
464
|
*/
|
|
408
|
-
declare function
|
|
465
|
+
declare function repayWithSupplyQuote(client: AaveClient, request: RepayWithSupplyQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError>;
|
|
466
|
+
/**
|
|
467
|
+
* Fetches a withdraw swap quote for withdrawing deposits and swapping on the fly.
|
|
468
|
+
*
|
|
469
|
+
* ```ts
|
|
470
|
+
* const result = await withdrawSwapQuote(client, {
|
|
471
|
+
* market: {
|
|
472
|
+
* position: userSupplyItemId('position_123'),
|
|
473
|
+
* buyReserve: reserveId('reserve_456'),
|
|
474
|
+
* amount: bigDecimal('1000'),
|
|
475
|
+
* user: evmAddress('0x742d35cc...'),
|
|
476
|
+
* },
|
|
477
|
+
* });
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @param client - Aave client.
|
|
481
|
+
* @param request - The withdraw swap request parameters.
|
|
482
|
+
* @param options - The query options.
|
|
483
|
+
* @returns The withdraw swap result with quote, approvals, and preview.
|
|
484
|
+
*/
|
|
485
|
+
declare function withdrawSwapQuote(client: AaveClient, request: WithdrawSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError>;
|
|
486
|
+
/**
|
|
487
|
+
* Prepares a position swap by obtaining the typed data for signing.
|
|
488
|
+
*
|
|
489
|
+
* ```ts
|
|
490
|
+
* const result = await preparePositionSwap(client, {
|
|
491
|
+
* quoteId: quote.quoteId,
|
|
492
|
+
* adapterContractSignature: signature('0x456...'),
|
|
493
|
+
* positionManagerSignature: signature('0x789...'),
|
|
494
|
+
* });
|
|
495
|
+
* ```
|
|
496
|
+
*
|
|
497
|
+
* @param client - Aave client.
|
|
498
|
+
* @param request - The position swap request with quote ID and signatures.
|
|
499
|
+
* @returns The position swap result with intent data for execution.
|
|
500
|
+
*/
|
|
501
|
+
declare function preparePositionSwap(client: AaveClient, request: PreparePositionSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
409
502
|
/**
|
|
410
|
-
* @internal
|
|
411
503
|
* Fetches the status of a specific swap.
|
|
412
504
|
*
|
|
413
505
|
* ```ts
|
|
@@ -421,10 +513,9 @@ declare function prepareSwap(client: AaveClient, request: PrepareSwapRequest, op
|
|
|
421
513
|
* @param options - The query options.
|
|
422
514
|
* @returns The current status of the swap.
|
|
423
515
|
*/
|
|
424
|
-
declare function swapStatus(client: AaveClient, request: SwapStatusRequest,
|
|
516
|
+
declare function swapStatus(client: AaveClient, request: SwapStatusRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<SwapStatus, UnexpectedError>;
|
|
425
517
|
type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
|
|
426
518
|
/**
|
|
427
|
-
* @internal
|
|
428
519
|
* Waits for a swap to reach a final outcome (cancelled, expired, or fulfilled).
|
|
429
520
|
*
|
|
430
521
|
* ```ts
|
|
@@ -451,17 +542,13 @@ type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
|
|
|
451
542
|
*/
|
|
452
543
|
declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt) => ResultAsync<SwapOutcome, TimeoutError | UnexpectedError>;
|
|
453
544
|
/**
|
|
454
|
-
* @internal
|
|
455
545
|
* Executes a swap for the specified request parameters.
|
|
456
546
|
*
|
|
457
547
|
* ```ts
|
|
458
548
|
* const result = await swap(client, {
|
|
459
549
|
* intent: {
|
|
460
|
-
* quoteId:
|
|
461
|
-
* signature:
|
|
462
|
-
* value: signature('0x456...'),
|
|
463
|
-
* deadline: 1234567890,
|
|
464
|
-
* },
|
|
550
|
+
* quoteId: quote.quoteId,
|
|
551
|
+
* signature: signature('0x456...'),
|
|
465
552
|
* },
|
|
466
553
|
* }).andThen((plan) => {
|
|
467
554
|
* switch (plan.__typename) {
|
|
@@ -469,16 +556,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
|
|
|
469
556
|
* return sendTransaction(plan.transaction)
|
|
470
557
|
* .map(() => plan.orderReceipt);
|
|
471
558
|
*
|
|
472
|
-
* case 'SwapApprovalRequired':
|
|
473
|
-
* return sendTransaction(plan.transaction)
|
|
474
|
-
* .andThen(() => sendTransaction(plan.originalTransaction))
|
|
475
|
-
* .map(() => plan.originalTransaction.orderReceipt);
|
|
476
|
-
*
|
|
477
559
|
* case 'SwapReceipt':
|
|
478
|
-
* return okAsync(plan
|
|
479
|
-
*
|
|
480
|
-
* case 'InsufficientBalanceError':
|
|
481
|
-
* return errAsync(new Error(`Insufficient balance: ${plan.required.value} required.`));
|
|
560
|
+
* return okAsync(plan);
|
|
482
561
|
* }
|
|
483
562
|
* });
|
|
484
563
|
*
|
|
@@ -494,9 +573,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
|
|
|
494
573
|
* @param request - The swap request parameters.
|
|
495
574
|
* @returns The swap execution plan containing transaction details or receipt.
|
|
496
575
|
*/
|
|
497
|
-
declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<
|
|
576
|
+
declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<SwapTransactionRequest | SwapReceipt, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
498
577
|
/**
|
|
499
|
-
* @internal
|
|
500
578
|
* Prepares a swap cancellation for the specified swap ID.
|
|
501
579
|
*
|
|
502
580
|
* ```ts
|
|
@@ -511,7 +589,6 @@ declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<Swa
|
|
|
511
589
|
*/
|
|
512
590
|
declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCancelRequest): ResultAsync<PrepareSwapCancelResult, UnexpectedError>;
|
|
513
591
|
/**
|
|
514
|
-
* @internal
|
|
515
592
|
* Executes a swap cancellation for the specified request parameters.
|
|
516
593
|
*
|
|
517
594
|
* ```ts
|
|
@@ -526,8 +603,7 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
|
|
|
526
603
|
* }).andThen((plan) => {
|
|
527
604
|
* switch (plan.__typename) {
|
|
528
605
|
* case 'TransactionRequest':
|
|
529
|
-
* return sendTransaction(plan)
|
|
530
|
-
* .map(() => ({ success: true }));
|
|
606
|
+
* return sendTransaction(plan);
|
|
531
607
|
*
|
|
532
608
|
* case 'SwapCancelled':
|
|
533
609
|
* return okAsync(plan);
|
|
@@ -541,7 +617,6 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
|
|
|
541
617
|
*/
|
|
542
618
|
declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): ResultAsync<CancelSwapExecutionPlan, UnexpectedError>;
|
|
543
619
|
/**
|
|
544
|
-
* @internal
|
|
545
620
|
* Fetches the user's swap history for a specific chain.
|
|
546
621
|
*
|
|
547
622
|
* ```ts
|
|
@@ -557,7 +632,7 @@ declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): Res
|
|
|
557
632
|
* @param options - The query options.
|
|
558
633
|
* @returns The paginated list of user swaps with their status information.
|
|
559
634
|
*/
|
|
560
|
-
declare function userSwaps(client: AaveClient, request: UserSwapsRequest,
|
|
635
|
+
declare function userSwaps(client: AaveClient, request: UserSwapsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedUserSwapsResult, UnexpectedError>;
|
|
561
636
|
|
|
562
637
|
/**
|
|
563
638
|
* Creates a transaction to borrow from a market.
|
|
@@ -724,12 +799,12 @@ declare function withdraw(client: AaveClient, request: WithdrawRequest): ResultA
|
|
|
724
799
|
*/
|
|
725
800
|
declare function renounceSpokeUserPositionManager(client: AaveClient, request: RenounceSpokeUserPositionManagerRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
726
801
|
/**
|
|
727
|
-
* Creates a transaction to update user dynamic config
|
|
802
|
+
* Creates a transaction to update user position conditions (dynamic config and/or risk premium).
|
|
728
803
|
*
|
|
729
804
|
* ```ts
|
|
730
|
-
* const result = await
|
|
731
|
-
*
|
|
732
|
-
*
|
|
805
|
+
* const result = await updateUserPositionConditions(client, {
|
|
806
|
+
* userPositionId: userPositionId('SGVsbG8h'),
|
|
807
|
+
* update: UserPositionConditionsUpdate.AllDynamicConfig,
|
|
733
808
|
* }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
|
|
734
809
|
*
|
|
735
810
|
* if (result.isErr()) {
|
|
@@ -742,33 +817,10 @@ declare function renounceSpokeUserPositionManager(client: AaveClient, request: R
|
|
|
742
817
|
*
|
|
743
818
|
*
|
|
744
819
|
* @param client - Aave client.
|
|
745
|
-
* @param request - The update user
|
|
820
|
+
* @param request - The update user position conditions request parameters.
|
|
746
821
|
* @returns The transaction data.
|
|
747
822
|
*/
|
|
748
|
-
declare function
|
|
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>;
|
|
823
|
+
declare function updateUserPositionConditions(client: AaveClient, request: UpdateUserPositionConditionsRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
772
824
|
/**
|
|
773
825
|
* Creates a transaction to liquidate a user's position.
|
|
774
826
|
*
|
|
@@ -859,23 +911,27 @@ declare function setSpokeUserPositionManager(client: AaveClient, request: SetSpo
|
|
|
859
911
|
* @param options - The query options.
|
|
860
912
|
* @returns The preview result showing position changes.
|
|
861
913
|
*/
|
|
862
|
-
declare function preview(client: AaveClient, request: PreviewRequest,
|
|
914
|
+
declare function preview(client: AaveClient, request: PreviewRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PreviewUserPosition, UnexpectedError>;
|
|
863
915
|
/**
|
|
864
|
-
*
|
|
916
|
+
* Updates the collateral status of user's supplies.
|
|
865
917
|
*
|
|
866
918
|
* ```ts
|
|
867
|
-
* const result = await
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
919
|
+
* const result = await setUserSuppliesAsCollateral(client, {
|
|
920
|
+
* changes: [
|
|
921
|
+
* {
|
|
922
|
+
* reserve: reserveId('SGVsbG8h'),
|
|
923
|
+
* enableCollateral: true
|
|
924
|
+
* }
|
|
925
|
+
* ],
|
|
926
|
+
* sender: evmAddress('0x456...')
|
|
871
927
|
* });
|
|
872
928
|
* ```
|
|
873
929
|
*
|
|
874
930
|
* @param client - Aave client.
|
|
875
|
-
* @param request - The
|
|
876
|
-
* @returns The transaction request to
|
|
931
|
+
* @param request - The request parameters.
|
|
932
|
+
* @returns The transaction request to update collateral status.
|
|
877
933
|
*/
|
|
878
|
-
declare function
|
|
934
|
+
declare function setUserSuppliesAsCollateral(client: AaveClient, request: SetUserSuppliesAsCollateralRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
879
935
|
/**
|
|
880
936
|
* Fetches paginated list of activities.
|
|
881
937
|
*
|
|
@@ -894,7 +950,7 @@ declare function setUserSupplyAsCollateral(client: AaveClient, request: SetUserS
|
|
|
894
950
|
* @param options - The query options.
|
|
895
951
|
* @returns The paginated list of activities.
|
|
896
952
|
*/
|
|
897
|
-
declare function activities(client: AaveClient, request: ActivitiesRequest,
|
|
953
|
+
declare function activities(client: AaveClient, request: ActivitiesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedActivitiesResult, UnexpectedError>;
|
|
898
954
|
|
|
899
955
|
/**
|
|
900
956
|
* Fetches all user supply positions across the specified spoke.
|
|
@@ -916,7 +972,7 @@ declare function activities(client: AaveClient, request: ActivitiesRequest, opti
|
|
|
916
972
|
* @param options - The query options.
|
|
917
973
|
* @returns The user's supply positions.
|
|
918
974
|
*/
|
|
919
|
-
declare function userSupplies(client: AaveClient, request: UserSuppliesRequest,
|
|
975
|
+
declare function userSupplies(client: AaveClient, request: UserSuppliesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserSupplyItem[], UnexpectedError>;
|
|
920
976
|
/**
|
|
921
977
|
* Fetches all user borrow positions across the specified spoke.
|
|
922
978
|
*
|
|
@@ -937,8 +993,8 @@ declare function userSupplies(client: AaveClient, request: UserSuppliesRequest,
|
|
|
937
993
|
* @param options - The query options.
|
|
938
994
|
* @returns The user's borrow positions.
|
|
939
995
|
*/
|
|
940
|
-
declare function userBorrows(client: AaveClient, request: UserBorrowsRequest,
|
|
941
|
-
type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions>;
|
|
996
|
+
declare function userBorrows(client: AaveClient, request: UserBorrowsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserBorrowItem[], UnexpectedError>;
|
|
997
|
+
type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions>;
|
|
942
998
|
/**
|
|
943
999
|
* Fetches a user's summary across all positions.
|
|
944
1000
|
*
|
|
@@ -956,8 +1012,8 @@ type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOp
|
|
|
956
1012
|
* @param options - The query options.
|
|
957
1013
|
* @returns The user's financial summary.
|
|
958
1014
|
*/
|
|
959
|
-
declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
|
|
960
|
-
type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
|
|
1015
|
+
declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, requestPolicy, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
|
|
1016
|
+
type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions;
|
|
961
1017
|
/**
|
|
962
1018
|
* Fetches all user positions across specified chains.
|
|
963
1019
|
*
|
|
@@ -976,7 +1032,7 @@ type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
|
|
|
976
1032
|
* @param options - The query options.
|
|
977
1033
|
* @returns The user's positions across all specified chains.
|
|
978
1034
|
*/
|
|
979
|
-
declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
|
|
1035
|
+
declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
|
|
980
1036
|
/**
|
|
981
1037
|
* Fetches a specific user position by ID.
|
|
982
1038
|
*
|
|
@@ -991,7 +1047,7 @@ declare function userPositions(client: AaveClient, request: UserPositionsRequest
|
|
|
991
1047
|
* @param options - The query options.
|
|
992
1048
|
* @returns The specific user position or null if not found.
|
|
993
1049
|
*/
|
|
994
|
-
declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
|
|
1050
|
+
declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
|
|
995
1051
|
/**
|
|
996
1052
|
* Fetches all user balances across specified chains.
|
|
997
1053
|
*
|
|
@@ -1009,7 +1065,7 @@ declare function userPosition(client: AaveClient, request: UserPositionRequest,
|
|
|
1009
1065
|
* @param options - The query options.
|
|
1010
1066
|
* @returns The user's balances across all specified chains.
|
|
1011
1067
|
**/
|
|
1012
|
-
declare function userBalances(client: AaveClient, request: UserBalancesRequest,
|
|
1068
|
+
declare function userBalances(client: AaveClient, request: UserBalancesRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserBalance[], UnexpectedError>;
|
|
1013
1069
|
/**
|
|
1014
1070
|
* Fetches user summary history over time.
|
|
1015
1071
|
*
|
|
@@ -1028,6 +1084,24 @@ declare function userBalances(client: AaveClient, request: UserBalancesRequest,
|
|
|
1028
1084
|
* @param options - The query options.
|
|
1029
1085
|
* @returns The user summary history items.
|
|
1030
1086
|
*/
|
|
1031
|
-
declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest,
|
|
1087
|
+
declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserSummaryHistoryItem[], UnexpectedError>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Fetches the risk premium breakdown for a user position or spoke.
|
|
1090
|
+
*
|
|
1091
|
+
* ```ts
|
|
1092
|
+
* const result = await userRiskPremiumBreakdown(client, {
|
|
1093
|
+
* query: {
|
|
1094
|
+
* userPositionId: userPositionId('SGVsbG8h'),
|
|
1095
|
+
* },
|
|
1096
|
+
* user: evmAddress('0x742d35cc…'),
|
|
1097
|
+
* });
|
|
1098
|
+
* ```
|
|
1099
|
+
*
|
|
1100
|
+
* @param client - Aave client.
|
|
1101
|
+
* @param request - The user risk premium breakdown request parameters.
|
|
1102
|
+
* @param options - The query options.
|
|
1103
|
+
* @returns Array of risk premium breakdown items.
|
|
1104
|
+
*/
|
|
1105
|
+
declare function userRiskPremiumBreakdown(client: AaveClient, request: UserRiskPremiumBreakdownRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserRiskPremiumBreakdownItem[], UnexpectedError>;
|
|
1032
1106
|
|
|
1033
|
-
export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, cancelSwap, chain, chains, exchangeRate, hasProcessedKnownTransaction, hub, hubAssets, hubs, liquidatePosition,
|
|
1107
|
+
export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, borrowSwapQuote, cancelSwap, chain, chains, 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, userPosition, userPositions, userRiskPremiumBreakdown, userSummary, userSummaryHistory, userSupplies, userSwaps, waitForSwapOutcome, withdraw, withdrawSwapQuote };
|