@aave/client 4.0.0-next.8 → 4.0.0
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/dist/{AaveClient-CgHY2iS9.d.ts → AaveClient-C7hQU3qX.d.ts} +14 -17
- package/dist/{AaveClient-L3v8kWvn.d.cts → AaveClient-wwfQOLJS.d.cts} +14 -17
- package/dist/actions/index.cjs +1 -1
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +485 -144
- package/dist/actions/index.d.ts +485 -144
- package/dist/actions/index.js +1 -1
- package/dist/chunk-HH6OAH2K.js +2 -0
- package/dist/chunk-HH6OAH2K.js.map +1 -0
- package/dist/chunk-N4LXBTGY.js +2 -0
- package/dist/chunk-N4LXBTGY.js.map +1 -0
- package/dist/chunk-SXZ2BGUZ.js +2 -0
- package/dist/chunk-SXZ2BGUZ.js.map +1 -0
- package/dist/ethers.cjs +1 -1
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +45 -11
- package/dist/ethers.d.ts +45 -11
- 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 +20 -3
- package/dist/index.d.ts +20 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -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 +3675 -29
- package/dist/testing.js +52 -289
- package/dist/testing.js.map +1 -1
- package/dist/thirdweb.cjs +1 -2
- package/dist/thirdweb.cjs.map +1 -1
- package/dist/thirdweb.d.cts +49 -20
- package/dist/thirdweb.d.ts +49 -20
- package/dist/thirdweb.js +1 -2
- package/dist/thirdweb.js.map +1 -1
- package/dist/types-XProSTZ7.d.cts +33 -0
- package/dist/types-XProSTZ7.d.ts +33 -0
- package/dist/viem.cjs +1 -2
- package/dist/viem.cjs.map +1 -1
- package/dist/viem.d.cts +51 -23
- package/dist/viem.d.ts +51 -23
- package/dist/viem.js +1 -1
- package/package.json +7 -6
- package/dist/chunk-3VL3Y3IZ.js +0 -2
- package/dist/chunk-3VL3Y3IZ.js.map +0 -1
- package/dist/chunk-X2C2UEY7.js +0 -3
- package/dist/chunk-X2C2UEY7.js.map +0 -1
- package/dist/types-Bu63z0x6.d.cts +0 -21
- package/dist/types-Bu63z0x6.d.ts +0 -21
package/dist/actions/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UnexpectedError, TimeoutError } from '@aave/core';
|
|
2
|
-
import { HubRequest, Hub,
|
|
1
|
+
import { UnexpectedError, ValidationError, TimeoutError } from '@aave/core';
|
|
2
|
+
import { HubRequest, Hub, HubAssetInterestRateModelRequest, HubAssetInterestRateModelPoint, HubAssetsRequest, HubAsset, HubSummaryHistoryRequest, HubSummarySample, HubsRequest, ChainRequest, Chain, ChainsRequest, ExchangeRateRequest, ExchangeAmount, HasProcessedKnownTransactionRequest, AssetRequest, Asset, AssetBorrowHistoryRequest, AssetBorrowSample, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, ProtocolHistoryRequest, ProtocolHistorySample, BorrowApyHistoryRequest, ApySample, ReserveRequest, Reserve, ReservesRequest, SupplyApyHistoryRequest, UserClaimableRewardsRequest, UserClaimableReward, SpokeRequest, Spoke, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, SpokesRequest, SwapCancelled, SwapExpired, SwapFulfilled, BorrowSwapQuoteRequest, PositionSwapByIntentApprovalsRequired, InsufficientLiquidityError, CancelSwapRequest, CancelSwapExecutionPlan, PreparePositionSwapRequest, PrepareSwapOrder, InsufficientBalanceError, PrepareSwapCancelRequest, PrepareSwapCancelResult, PrepareTokenSwapRequest, RepayWithSupplyQuoteRequest, SupplySwapQuoteRequest, SwapRequest, SwapTransactionRequest, SwapReceipt, SwapStatusRequest, SwapStatus, SwappableTokensRequest, Token, TokenSwapQuoteRequest, TokenSwapQuoteResult, UserSwapsRequest, PaginatedUserSwapsResult, WithdrawSwapQuoteRequest, ActivitiesRequest, PaginatedActivitiesResult, BorrowRequest, ExecutionPlan, ClaimRewardsRequest, TransactionRequest, LiquidatePositionRequest, PreviewRequest, PreviewUserPosition, RenounceSpokeUserPositionManagerRequest, RepayRequest, SetSpokeUserPositionManagerRequest, SetUserSuppliesAsCollateralRequest, SupplyRequest, UpdateUserPositionConditionsRequest, WithdrawRequest, UserBalancesRequest, UserBalance, UserBorrowsRequest, UserBorrowItem, UserPositionRequest, UserPosition, UserPositionsRequest, UserRiskPremiumBreakdownRequest, UserRiskPremiumBreakdownItem, UserSummaryRequest, UserSummary, UserSummaryHistoryRequest, UserSummaryHistoryItem, UserSuppliesRequest, UserSupplyItem, StableVaultRequest, StableVault, StableVaultAssignRateRequest, StableVaultClaimStatusRequest, StableVaultClaimStatus, StableVaultClaimSurplusRequest, StableVaultDepositRequest, StableVaultDepositExecutionPlan, StableVaultMovementsRequest, PaginatedStableVaultMovementsResult, StableVaultRateUsersRequest, PaginatedStableVaultRateUsersResult, StableVaultUnassignRateRequest, StableVaultUserPositionsRequest, StableVaultUserPosition, StableVaultWithdrawRequest, StableVaultWithdrawExecutionPlan, StableVaultWithdrawRedeemRequest, StableVaultWithdrawRedeemExecutionPlan, StableVaultsRequest } from '@aave/graphql';
|
|
3
3
|
import { ResultAsync, Prettify } from '@aave/types';
|
|
4
|
-
import { A as AaveClient } from '../AaveClient-
|
|
4
|
+
import { A as AaveClient } from '../AaveClient-wwfQOLJS.cjs';
|
|
5
5
|
import { C as CurrencyQueryOptions, T as TimeWindowQueryOptions, R as RequestPolicyOptions, B as BatchOptions } from '../options-BX6n3sbh.cjs';
|
|
6
|
+
import '../types-XProSTZ7.cjs';
|
|
6
7
|
import '@urql/core';
|
|
7
|
-
import '../types-Bu63z0x6.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Fetches a specific hub by ID or by address and chain ID.
|
|
@@ -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, { currency, timeWindow, }?:
|
|
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,39 @@ declare function hubs(client: AaveClient, request: HubsRequest, { currency, time
|
|
|
52
52
|
* @param options - The query options.
|
|
53
53
|
* @returns The hub assets array.
|
|
54
54
|
*/
|
|
55
|
-
declare function hubAssets(client: AaveClient, request: HubAssetsRequest, { currency, timeWindow, }?:
|
|
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>;
|
|
73
|
+
/**
|
|
74
|
+
* Fetches the interest rate model for a specific hub asset.
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* const result = await hubAssetInterestRateModel(client, {
|
|
78
|
+
* query: { hubAssetId: hubAssetId('...') },
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @param client - Aave client.
|
|
83
|
+
* @param request - The hub asset interest rate model request parameters.
|
|
84
|
+
* @param options - The query options.
|
|
85
|
+
* @returns Array of interest rate model points.
|
|
86
|
+
*/
|
|
87
|
+
declare function hubAssetInterestRateModel(client: AaveClient, request: HubAssetInterestRateModelRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<HubAssetInterestRateModelPoint[], UnexpectedError>;
|
|
56
88
|
|
|
57
89
|
/**
|
|
58
90
|
* Fetches a specific chain by chain ID.
|
|
@@ -65,13 +97,10 @@ declare function hubAssets(client: AaveClient, request: HubAssetsRequest, { curr
|
|
|
65
97
|
*
|
|
66
98
|
* @param client - Aave client.
|
|
67
99
|
* @param request - The chain request parameters.
|
|
100
|
+
* @param options - The query options.
|
|
68
101
|
* @returns The chain data, or null if not found.
|
|
69
102
|
*/
|
|
70
|
-
declare function chain(client: AaveClient, request: ChainRequest): ResultAsync<Chain | null, UnexpectedError>;
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
declare function chain(client: AaveClient, request: ChainRequest, options: BatchOptions): ResultAsync<Chain | null, UnexpectedError>;
|
|
103
|
+
declare function chain(client: AaveClient, request: ChainRequest, { batch, requestPolicy, }?: BatchOptions & RequestPolicyOptions): ResultAsync<Chain | null, UnexpectedError>;
|
|
75
104
|
/**
|
|
76
105
|
* Fetches the list of supported chains.
|
|
77
106
|
*
|
|
@@ -112,31 +141,10 @@ declare function hasProcessedKnownTransaction(client: AaveClient, request: HasPr
|
|
|
112
141
|
*
|
|
113
142
|
* @param client - Aave client.
|
|
114
143
|
* @param request - The exchange rate request parameters.
|
|
144
|
+
* @param options - The query options.
|
|
115
145
|
* @returns The exchange rate information as a fiat amount.
|
|
116
146
|
*/
|
|
117
|
-
declare function exchangeRate(client: AaveClient, request: ExchangeRateRequest): ResultAsync<ExchangeAmount, UnexpectedError>;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Generates EIP-712 typed data for permit signatures.
|
|
121
|
-
*
|
|
122
|
-
* ```ts
|
|
123
|
-
* const result = await permitTypedData(client, {
|
|
124
|
-
* spender: evmAddress('0x87870bca…'),
|
|
125
|
-
* currency: evmAddress('0xa0b86991c431c924b2047c7094daf21b77e…'),
|
|
126
|
-
* amount: '1000.5',
|
|
127
|
-
* });
|
|
128
|
-
*
|
|
129
|
-
* if (result.isOk()) {
|
|
130
|
-
* // Use the typed data to create a signature
|
|
131
|
-
* const signature = await wallet.signTypedData(result.value);
|
|
132
|
-
* }
|
|
133
|
-
* ```
|
|
134
|
-
*
|
|
135
|
-
* @param client - Aave client.
|
|
136
|
-
* @param request - The permit request parameters.
|
|
137
|
-
* @returns The EIP-712 typed data for permit signature.
|
|
138
|
-
*/
|
|
139
|
-
declare function permitTypedData(client: AaveClient, request: PermitRequest): ResultAsync<PermitTypedDataResponse, UnexpectedError>;
|
|
147
|
+
declare function exchangeRate(client: AaveClient, request: ExchangeRateRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ExchangeAmount, UnexpectedError>;
|
|
140
148
|
|
|
141
149
|
/**
|
|
142
150
|
* Fetches information about a specific asset (ERC20 token) in the protocol by ID or by token.
|
|
@@ -152,13 +160,15 @@ declare function permitTypedData(client: AaveClient, request: PermitRequest): Re
|
|
|
152
160
|
* @param options - The query options including currency and time window.
|
|
153
161
|
* @returns The asset data, or null if not found.
|
|
154
162
|
*/
|
|
155
|
-
declare function asset(client: AaveClient, request: AssetRequest,
|
|
163
|
+
declare function asset(client: AaveClient, request: AssetRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Asset | null, UnexpectedError>;
|
|
156
164
|
/**
|
|
157
165
|
* Fetches historical price data for a specific asset.
|
|
158
166
|
*
|
|
159
167
|
* ```ts
|
|
160
168
|
* const result = await assetPriceHistory(client, {
|
|
161
|
-
*
|
|
169
|
+
* query: {
|
|
170
|
+
* token: { chainId: chainId(1), address: evmAddress('0x123…') },
|
|
171
|
+
* },
|
|
162
172
|
* currency: Currency.Usd,
|
|
163
173
|
* window: TimeWindow.LastWeek,
|
|
164
174
|
* });
|
|
@@ -175,33 +185,37 @@ declare function assetPriceHistory(client: AaveClient, request: AssetPriceHistor
|
|
|
175
185
|
*
|
|
176
186
|
* ```ts
|
|
177
187
|
* const result = await assetSupplyHistory(client, {
|
|
178
|
-
*
|
|
188
|
+
* query: {
|
|
189
|
+
* token: { chainId: chainId(1), address: evmAddress('0x123…') },
|
|
190
|
+
* },
|
|
179
191
|
* window: TimeWindow.LastWeek,
|
|
180
192
|
* });
|
|
181
193
|
* ```
|
|
182
194
|
*
|
|
183
195
|
* @param client - Aave client.
|
|
184
196
|
* @param request - The asset supply history request parameters.
|
|
185
|
-
* @param options - The query options.
|
|
197
|
+
* @param options - The query options including currency and time window.
|
|
186
198
|
* @returns Array of asset supply samples over time.
|
|
187
199
|
*/
|
|
188
|
-
declare function assetSupplyHistory(client: AaveClient, request: AssetSupplyHistoryRequest,
|
|
200
|
+
declare function assetSupplyHistory(client: AaveClient, request: AssetSupplyHistoryRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<AssetSupplySample[], UnexpectedError>;
|
|
189
201
|
/**
|
|
190
202
|
* Fetches historical borrow data for a specific asset.
|
|
191
203
|
*
|
|
192
204
|
* ```ts
|
|
193
205
|
* const result = await assetBorrowHistory(client, {
|
|
194
|
-
*
|
|
206
|
+
* query: {
|
|
207
|
+
* token: { chainId: chainId(1), address: evmAddress('0x123…') },
|
|
208
|
+
* },
|
|
195
209
|
* window: TimeWindow.LastWeek,
|
|
196
210
|
* });
|
|
197
211
|
* ```
|
|
198
212
|
*
|
|
199
213
|
* @param client - Aave client.
|
|
200
214
|
* @param request - The asset borrow history request parameters.
|
|
201
|
-
* @param options - The query options.
|
|
215
|
+
* @param options - The query options including currency and time window.
|
|
202
216
|
* @returns Array of asset borrow samples over time.
|
|
203
217
|
*/
|
|
204
|
-
declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHistoryRequest,
|
|
218
|
+
declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHistoryRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<AssetBorrowSample[], UnexpectedError>;
|
|
205
219
|
/**
|
|
206
220
|
* Fetches historical protocol-wide data (deposits, borrows, earnings).
|
|
207
221
|
*
|
|
@@ -234,7 +248,7 @@ declare function protocolHistory(client: AaveClient, request: ProtocolHistoryReq
|
|
|
234
248
|
* @param options - The query options.
|
|
235
249
|
* @returns The reserve data, or null if not found.
|
|
236
250
|
*/
|
|
237
|
-
declare function reserve(client: AaveClient, request: ReserveRequest, { currency, timeWindow, }?:
|
|
251
|
+
declare function reserve(client: AaveClient, request: ReserveRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Reserve | null, UnexpectedError>;
|
|
238
252
|
/**
|
|
239
253
|
* Fetches reserves based on specified criteria.
|
|
240
254
|
*
|
|
@@ -256,7 +270,7 @@ declare function reserve(client: AaveClient, request: ReserveRequest, { currency
|
|
|
256
270
|
* @param options - The query options.
|
|
257
271
|
* @returns Array of reserves matching the criteria.
|
|
258
272
|
*/
|
|
259
|
-
declare function reserves(client: AaveClient, request: ReservesRequest, { currency, timeWindow, }?:
|
|
273
|
+
declare function reserves(client: AaveClient, request: ReservesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Reserve[], UnexpectedError>;
|
|
260
274
|
/**
|
|
261
275
|
* Fetches borrow APY history for a specific reserve over time.
|
|
262
276
|
*
|
|
@@ -269,9 +283,10 @@ declare function reserves(client: AaveClient, request: ReservesRequest, { curren
|
|
|
269
283
|
*
|
|
270
284
|
* @param client - Aave client.
|
|
271
285
|
* @param request - The borrow APY history request parameters.
|
|
286
|
+
* @param options - The query options.
|
|
272
287
|
* @returns The borrow APY history samples.
|
|
273
288
|
*/
|
|
274
|
-
declare function borrowApyHistory(client: AaveClient, request: BorrowApyHistoryRequest): ResultAsync<ApySample[], UnexpectedError>;
|
|
289
|
+
declare function borrowApyHistory(client: AaveClient, request: BorrowApyHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ApySample[], UnexpectedError>;
|
|
275
290
|
/**
|
|
276
291
|
* Fetches supply APY history for a specific reserve over time.
|
|
277
292
|
*
|
|
@@ -284,9 +299,34 @@ declare function borrowApyHistory(client: AaveClient, request: BorrowApyHistoryR
|
|
|
284
299
|
*
|
|
285
300
|
* @param client - Aave client.
|
|
286
301
|
* @param request - The supply APY history request parameters.
|
|
302
|
+
* @param options - The query options.
|
|
287
303
|
* @returns The supply APY history samples.
|
|
288
304
|
*/
|
|
289
|
-
declare function supplyApyHistory(client: AaveClient, request: SupplyApyHistoryRequest): ResultAsync<ApySample[], UnexpectedError>;
|
|
305
|
+
declare function supplyApyHistory(client: AaveClient, request: SupplyApyHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ApySample[], UnexpectedError>;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Fetches all claimable rewards for a user.
|
|
309
|
+
*
|
|
310
|
+
* ```ts
|
|
311
|
+
* const result = await userClaimableRewards(client, {
|
|
312
|
+
* user: evmAddress('0x742d35cc…'),
|
|
313
|
+
* chainId: chainId(1),
|
|
314
|
+
* });
|
|
315
|
+
*
|
|
316
|
+
* if (result.isErr()) {
|
|
317
|
+
* // Handle error
|
|
318
|
+
* return;
|
|
319
|
+
* }
|
|
320
|
+
*
|
|
321
|
+
* // result.value: UserClaimableReward[]
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @param client - Aave client.
|
|
325
|
+
* @param request - The user claimable rewards request parameters.
|
|
326
|
+
* @param options - The query options.
|
|
327
|
+
* @returns Array of claimable rewards.
|
|
328
|
+
*/
|
|
329
|
+
declare function userClaimableRewards(client: AaveClient, request: UserClaimableRewardsRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserClaimableReward[], UnexpectedError>;
|
|
290
330
|
|
|
291
331
|
/**
|
|
292
332
|
* Fetches a specific spoke.
|
|
@@ -347,28 +387,28 @@ declare function spokePositionManagers(client: AaveClient, request: SpokePositio
|
|
|
347
387
|
declare function spokeUserPositionManagers(client: AaveClient, request: SpokeUserPositionManagersRequest): ResultAsync<PaginatedSpokeUserPositionManagerResult, UnexpectedError>;
|
|
348
388
|
|
|
349
389
|
/**
|
|
350
|
-
* @internal
|
|
351
390
|
* Fetches a swap quote for the specified trade parameters.
|
|
352
391
|
*
|
|
353
392
|
* ```ts
|
|
354
|
-
* const result = await
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
393
|
+
* const result = await tokenSwapQuote(client, {
|
|
394
|
+
* market: {
|
|
395
|
+
* chainId: chainId(1),
|
|
396
|
+
* buy: { erc20: evmAddress('0xA0b86a33E6...') },
|
|
397
|
+
* sell: { erc20: evmAddress('0x6B175474E...') },
|
|
398
|
+
* amount: bigDecimal('1000'),
|
|
399
|
+
* kind: SwapKind.Sell,
|
|
400
|
+
* user: evmAddress('0x742d35cc...'),
|
|
401
|
+
* },
|
|
361
402
|
* });
|
|
362
403
|
* ```
|
|
363
404
|
*
|
|
364
405
|
* @param client - Aave client.
|
|
365
406
|
* @param request - The swap quote request parameters.
|
|
366
407
|
* @param options - The query options.
|
|
367
|
-
* @returns The swap quote including pricing and cost information.
|
|
408
|
+
* @returns The swap quote including pricing and cost information and plan to start executing the swap.
|
|
368
409
|
*/
|
|
369
|
-
declare function
|
|
410
|
+
declare function tokenSwapQuote(client: AaveClient, request: TokenSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<TokenSwapQuoteResult, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
370
411
|
/**
|
|
371
|
-
* @internal
|
|
372
412
|
* Fetches the list of tokens available for swapping on a specific chain.
|
|
373
413
|
*
|
|
374
414
|
* ```ts
|
|
@@ -379,63 +419,126 @@ declare function swapQuote(client: AaveClient, request: SwapQuoteRequest, option
|
|
|
379
419
|
*
|
|
380
420
|
* @param client - Aave client.
|
|
381
421
|
* @param request - The swappable tokens request parameters.
|
|
422
|
+
* @param options - The query options.
|
|
382
423
|
* @returns The list of tokens available for swapping.
|
|
383
424
|
*/
|
|
384
|
-
declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest): ResultAsync<Token[], UnexpectedError>;
|
|
425
|
+
declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<Token[], UnexpectedError>;
|
|
385
426
|
/**
|
|
386
|
-
* @internal
|
|
387
427
|
* Prepares a swap for the specified trade parameters.
|
|
388
428
|
*
|
|
389
429
|
* ```ts
|
|
390
|
-
* const result = await
|
|
430
|
+
* const result = await prepareTokenSwap(client, {
|
|
431
|
+
* quoteId: quote.quoteId,
|
|
432
|
+
* }).andThen(order => {
|
|
433
|
+
* return signTypedDataWith(wallet, order.data)
|
|
434
|
+
* .andThen((signature) =>
|
|
435
|
+
* swap({ intent: { quoteId: order.newQuoteId, signature } }),
|
|
436
|
+
* );
|
|
437
|
+
* });
|
|
438
|
+
* ```
|
|
439
|
+
*
|
|
440
|
+
* @param client - Aave client.
|
|
441
|
+
* @param request - The prepare swap request parameters.
|
|
442
|
+
* @returns The prepared swap result containing details of the swap.
|
|
443
|
+
*/
|
|
444
|
+
declare function prepareTokenSwap(client: AaveClient, request: PrepareTokenSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
445
|
+
/**
|
|
446
|
+
* Fetches a supply swap quote for swapping deposited funds.
|
|
447
|
+
*
|
|
448
|
+
* ```ts
|
|
449
|
+
* const result = await supplySwapQuote(client, {
|
|
391
450
|
* market: {
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* sell: { erc20: evmAddress('0x6B175474E...') },
|
|
451
|
+
* sellPosition: userSupplyItemId('position_123'),
|
|
452
|
+
* buyReserve: reserveId('reserve_456'),
|
|
395
453
|
* amount: bigDecimal('1000'),
|
|
396
|
-
* kind: SwapKind.SELL,
|
|
397
454
|
* user: evmAddress('0x742d35cc...'),
|
|
398
455
|
* },
|
|
399
|
-
* }).andThen(plan => {
|
|
400
|
-
* switch (plan.__typename) {
|
|
401
|
-
* case 'SwapByIntent':
|
|
402
|
-
* return signSwapByIntentWith(plan.data)
|
|
403
|
-
* .andThen((signature) => swap({ intent: { quoteId: quote.quoteId, signature } }))
|
|
404
|
-
* .andThen((plan) => {
|
|
405
|
-
* // …
|
|
406
|
-
* });
|
|
407
|
-
* );
|
|
408
|
-
*
|
|
409
|
-
* case 'SwapByIntentWithApprovalRequired':
|
|
410
|
-
* return sendTransaction(plan.transaction)
|
|
411
|
-
* .andThen(signSwapByIntentWith(plan.data))
|
|
412
|
-
* .andThen((signature) => swap({ intent: { quoteId: quote.quoteId, signature } }))
|
|
413
|
-
* .andThen((plan) => {
|
|
414
|
-
* // …
|
|
415
|
-
* });
|
|
416
|
-
* );
|
|
417
|
-
*
|
|
418
|
-
* case 'SwapByTransaction':
|
|
419
|
-
* return swap({ transaction: { quoteId: quote.quoteId } })
|
|
420
|
-
* .andThen((plan) => {
|
|
421
|
-
* // …
|
|
422
|
-
* });
|
|
423
|
-
* );
|
|
424
|
-
*
|
|
425
|
-
* case 'InsufficientBalanceError':
|
|
426
|
-
* return errAsync(new Error(`Insufficient balance: ${plan.required.value} required.`));
|
|
427
|
-
* }
|
|
428
456
|
* });
|
|
429
457
|
* ```
|
|
430
458
|
*
|
|
431
459
|
* @param client - Aave client.
|
|
432
|
-
* @param request - The
|
|
460
|
+
* @param request - The supply swap request parameters.
|
|
433
461
|
* @param options - The query options.
|
|
434
|
-
* @returns The
|
|
462
|
+
* @returns The supply swap result with quote, approvals, and preview.
|
|
463
|
+
*/
|
|
464
|
+
declare function supplySwapQuote(client: AaveClient, request: SupplySwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
465
|
+
/**
|
|
466
|
+
* Fetches a borrow swap quote for swapping debt positions.
|
|
467
|
+
*
|
|
468
|
+
* ```ts
|
|
469
|
+
* const result = await borrowSwapQuote(client, {
|
|
470
|
+
* market: {
|
|
471
|
+
* sellPosition: userBorrowItemId('position_123'),
|
|
472
|
+
* buyReserve: reserveId('reserve_456'),
|
|
473
|
+
* amount: bigDecimal('1000'),
|
|
474
|
+
* user: evmAddress('0x742d35cc...'),
|
|
475
|
+
* },
|
|
476
|
+
* });
|
|
477
|
+
* ```
|
|
478
|
+
*
|
|
479
|
+
* @param client - Aave client.
|
|
480
|
+
* @param request - The borrow swap request parameters.
|
|
481
|
+
* @param options - The query options.
|
|
482
|
+
* @returns The borrow swap result with quote, approvals, and preview.
|
|
483
|
+
*/
|
|
484
|
+
declare function borrowSwapQuote(client: AaveClient, request: BorrowSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
485
|
+
/**
|
|
486
|
+
* Fetches a repay with supply quote for repaying debt using collateral.
|
|
487
|
+
*
|
|
488
|
+
* ```ts
|
|
489
|
+
* const result = await repayWithSupplyQuote(client, {
|
|
490
|
+
* market: {
|
|
491
|
+
* sellPosition: userSupplyItemId('collateral_123'),
|
|
492
|
+
* buyPosition: userBorrowItemId('debt_456'),
|
|
493
|
+
* amount: bigDecimal('1000'),
|
|
494
|
+
* user: evmAddress('0x742d35cc...'),
|
|
495
|
+
* },
|
|
496
|
+
* });
|
|
497
|
+
* ```
|
|
498
|
+
*
|
|
499
|
+
* @param client - Aave client.
|
|
500
|
+
* @param request - The repay with supply request parameters.
|
|
501
|
+
* @param options - The query options.
|
|
502
|
+
* @returns The repay with supply result with quote, approvals, and preview.
|
|
435
503
|
*/
|
|
436
|
-
declare function
|
|
504
|
+
declare function repayWithSupplyQuote(client: AaveClient, request: RepayWithSupplyQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
505
|
+
/**
|
|
506
|
+
* Fetches a withdraw swap quote for withdrawing deposits and swapping on the fly.
|
|
507
|
+
*
|
|
508
|
+
* ```ts
|
|
509
|
+
* const result = await withdrawSwapQuote(client, {
|
|
510
|
+
* market: {
|
|
511
|
+
* position: userSupplyItemId('position_123'),
|
|
512
|
+
* buyReserve: reserveId('reserve_456'),
|
|
513
|
+
* amount: bigDecimal('1000'),
|
|
514
|
+
* user: evmAddress('0x742d35cc...'),
|
|
515
|
+
* },
|
|
516
|
+
* });
|
|
517
|
+
* ```
|
|
518
|
+
*
|
|
519
|
+
* @param client - Aave client.
|
|
520
|
+
* @param request - The withdraw swap request parameters.
|
|
521
|
+
* @param options - The query options.
|
|
522
|
+
* @returns The withdraw swap result with quote, approvals, and preview.
|
|
523
|
+
*/
|
|
524
|
+
declare function withdrawSwapQuote(client: AaveClient, request: WithdrawSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
525
|
+
/**
|
|
526
|
+
* Prepares a position swap by obtaining the typed data for signing.
|
|
527
|
+
*
|
|
528
|
+
* ```ts
|
|
529
|
+
* const result = await preparePositionSwap(client, {
|
|
530
|
+
* quoteId: quote.quoteId,
|
|
531
|
+
* adapterContractSignature: signature('0x456...'),
|
|
532
|
+
* positionManagerSignature: signature('0x789...'),
|
|
533
|
+
* });
|
|
534
|
+
* ```
|
|
535
|
+
*
|
|
536
|
+
* @param client - Aave client.
|
|
537
|
+
* @param request - The position swap request with quote ID and signatures.
|
|
538
|
+
* @returns The position swap result with intent data for execution.
|
|
539
|
+
*/
|
|
540
|
+
declare function preparePositionSwap(client: AaveClient, request: PreparePositionSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
437
541
|
/**
|
|
438
|
-
* @internal
|
|
439
542
|
* Fetches the status of a specific swap.
|
|
440
543
|
*
|
|
441
544
|
* ```ts
|
|
@@ -449,10 +552,9 @@ declare function prepareSwap(client: AaveClient, request: PrepareSwapRequest, op
|
|
|
449
552
|
* @param options - The query options.
|
|
450
553
|
* @returns The current status of the swap.
|
|
451
554
|
*/
|
|
452
|
-
declare function swapStatus(client: AaveClient, request: SwapStatusRequest,
|
|
555
|
+
declare function swapStatus(client: AaveClient, request: SwapStatusRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<SwapStatus | null, UnexpectedError>;
|
|
453
556
|
type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
|
|
454
557
|
/**
|
|
455
|
-
* @internal
|
|
456
558
|
* Waits for a swap to reach a final outcome (cancelled, expired, or fulfilled).
|
|
457
559
|
*
|
|
458
560
|
* ```ts
|
|
@@ -479,17 +581,13 @@ type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
|
|
|
479
581
|
*/
|
|
480
582
|
declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt) => ResultAsync<SwapOutcome, TimeoutError | UnexpectedError>;
|
|
481
583
|
/**
|
|
482
|
-
* @internal
|
|
483
584
|
* Executes a swap for the specified request parameters.
|
|
484
585
|
*
|
|
485
586
|
* ```ts
|
|
486
587
|
* const result = await swap(client, {
|
|
487
588
|
* intent: {
|
|
488
|
-
* quoteId:
|
|
489
|
-
* signature:
|
|
490
|
-
* value: signature('0x456...'),
|
|
491
|
-
* deadline: 1234567890,
|
|
492
|
-
* },
|
|
589
|
+
* quoteId: quote.quoteId,
|
|
590
|
+
* signature: signature('0x456...'),
|
|
493
591
|
* },
|
|
494
592
|
* }).andThen((plan) => {
|
|
495
593
|
* switch (plan.__typename) {
|
|
@@ -497,16 +595,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
|
|
|
497
595
|
* return sendTransaction(plan.transaction)
|
|
498
596
|
* .map(() => plan.orderReceipt);
|
|
499
597
|
*
|
|
500
|
-
* case 'SwapApprovalRequired':
|
|
501
|
-
* return sendTransaction(plan.transaction)
|
|
502
|
-
* .andThen(() => sendTransaction(plan.originalTransaction))
|
|
503
|
-
* .map(() => plan.originalTransaction.orderReceipt);
|
|
504
|
-
*
|
|
505
598
|
* case 'SwapReceipt':
|
|
506
|
-
* return okAsync(plan
|
|
507
|
-
*
|
|
508
|
-
* case 'InsufficientBalanceError':
|
|
509
|
-
* return errAsync(new Error(`Insufficient balance: ${plan.required.value} required.`));
|
|
599
|
+
* return okAsync(plan);
|
|
510
600
|
* }
|
|
511
601
|
* });
|
|
512
602
|
*
|
|
@@ -522,9 +612,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
|
|
|
522
612
|
* @param request - The swap request parameters.
|
|
523
613
|
* @returns The swap execution plan containing transaction details or receipt.
|
|
524
614
|
*/
|
|
525
|
-
declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<
|
|
615
|
+
declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<SwapTransactionRequest | SwapReceipt, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
526
616
|
/**
|
|
527
|
-
* @internal
|
|
528
617
|
* Prepares a swap cancellation for the specified swap ID.
|
|
529
618
|
*
|
|
530
619
|
* ```ts
|
|
@@ -539,7 +628,6 @@ declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<Swa
|
|
|
539
628
|
*/
|
|
540
629
|
declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCancelRequest): ResultAsync<PrepareSwapCancelResult, UnexpectedError>;
|
|
541
630
|
/**
|
|
542
|
-
* @internal
|
|
543
631
|
* Executes a swap cancellation for the specified request parameters.
|
|
544
632
|
*
|
|
545
633
|
* ```ts
|
|
@@ -554,8 +642,7 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
|
|
|
554
642
|
* }).andThen((plan) => {
|
|
555
643
|
* switch (plan.__typename) {
|
|
556
644
|
* case 'TransactionRequest':
|
|
557
|
-
* return sendTransaction(plan)
|
|
558
|
-
* .map(() => ({ success: true }));
|
|
645
|
+
* return sendTransaction(plan);
|
|
559
646
|
*
|
|
560
647
|
* case 'SwapCancelled':
|
|
561
648
|
* return okAsync(plan);
|
|
@@ -569,7 +656,6 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
|
|
|
569
656
|
*/
|
|
570
657
|
declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): ResultAsync<CancelSwapExecutionPlan, UnexpectedError>;
|
|
571
658
|
/**
|
|
572
|
-
* @internal
|
|
573
659
|
* Fetches the user's swap history for a specific chain.
|
|
574
660
|
*
|
|
575
661
|
* ```ts
|
|
@@ -585,7 +671,7 @@ declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): Res
|
|
|
585
671
|
* @param options - The query options.
|
|
586
672
|
* @returns The paginated list of user swaps with their status information.
|
|
587
673
|
*/
|
|
588
|
-
declare function userSwaps(client: AaveClient, request: UserSwapsRequest,
|
|
674
|
+
declare function userSwaps(client: AaveClient, request: UserSwapsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedUserSwapsResult, UnexpectedError>;
|
|
589
675
|
|
|
590
676
|
/**
|
|
591
677
|
* Creates a transaction to borrow from a market.
|
|
@@ -606,7 +692,7 @@ declare function userSwaps(client: AaveClient, request: UserSwapsRequest, option
|
|
|
606
692
|
* return;
|
|
607
693
|
* }
|
|
608
694
|
*
|
|
609
|
-
* // result.value:
|
|
695
|
+
* // result.value: TransactionReceipt
|
|
610
696
|
* ```
|
|
611
697
|
*
|
|
612
698
|
* @param client - Aave client.
|
|
@@ -638,7 +724,7 @@ declare function borrow(client: AaveClient, request: BorrowRequest): ResultAsync
|
|
|
638
724
|
* return;
|
|
639
725
|
* }
|
|
640
726
|
*
|
|
641
|
-
* // result.value:
|
|
727
|
+
* // result.value: TransactionReceipt
|
|
642
728
|
* ```
|
|
643
729
|
*
|
|
644
730
|
* @param client - Aave client.
|
|
@@ -667,7 +753,7 @@ declare function supply(client: AaveClient, request: SupplyRequest): ResultAsync
|
|
|
667
753
|
* return;
|
|
668
754
|
* }
|
|
669
755
|
*
|
|
670
|
-
* // result.value:
|
|
756
|
+
* // result.value: TransactionReceipt
|
|
671
757
|
* ```
|
|
672
758
|
*
|
|
673
759
|
* @param client - Aave client.
|
|
@@ -694,7 +780,7 @@ declare function repay(client: AaveClient, request: RepayRequest): ResultAsync<E
|
|
|
694
780
|
* return;
|
|
695
781
|
* }
|
|
696
782
|
*
|
|
697
|
-
* // result.value:
|
|
783
|
+
* // result.value: TransactionReceipt
|
|
698
784
|
* ```
|
|
699
785
|
*
|
|
700
786
|
* **Withdraw specific amount:**
|
|
@@ -742,7 +828,7 @@ declare function withdraw(client: AaveClient, request: WithdrawRequest): ResultA
|
|
|
742
828
|
* return;
|
|
743
829
|
* }
|
|
744
830
|
*
|
|
745
|
-
* // result.value:
|
|
831
|
+
* // result.value: TransactionReceipt
|
|
746
832
|
* ```
|
|
747
833
|
*
|
|
748
834
|
*
|
|
@@ -757,8 +843,7 @@ declare function renounceSpokeUserPositionManager(client: AaveClient, request: R
|
|
|
757
843
|
* ```ts
|
|
758
844
|
* const result = await updateUserPositionConditions(client, {
|
|
759
845
|
* userPositionId: userPositionId('SGVsbG8h'),
|
|
760
|
-
*
|
|
761
|
-
* riskPremium: true,
|
|
846
|
+
* update: UserPositionConditionsUpdate.AllDynamicConfig,
|
|
762
847
|
* }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
|
|
763
848
|
*
|
|
764
849
|
* if (result.isErr()) {
|
|
@@ -766,7 +851,7 @@ declare function renounceSpokeUserPositionManager(client: AaveClient, request: R
|
|
|
766
851
|
* return;
|
|
767
852
|
* }
|
|
768
853
|
*
|
|
769
|
-
* // result.value:
|
|
854
|
+
* // result.value: TransactionReceipt
|
|
770
855
|
* ```
|
|
771
856
|
*
|
|
772
857
|
*
|
|
@@ -783,7 +868,7 @@ declare function updateUserPositionConditions(client: AaveClient, request: Updat
|
|
|
783
868
|
* collateral: reserveId('SGVsbG8h'),
|
|
784
869
|
* debt: reserveId('Q2lhbyE= '),
|
|
785
870
|
* amount: {
|
|
786
|
-
* exact: bigDecimal('1000'),
|
|
871
|
+
* exact: { value: bigDecimal('1000') },
|
|
787
872
|
* },
|
|
788
873
|
* liquidator: evmAddress('0x9abc…'),
|
|
789
874
|
* user: evmAddress('0xdef0…'),
|
|
@@ -794,7 +879,7 @@ declare function updateUserPositionConditions(client: AaveClient, request: Updat
|
|
|
794
879
|
* return;
|
|
795
880
|
* }
|
|
796
881
|
*
|
|
797
|
-
* // result.value:
|
|
882
|
+
* // result.value: TransactionReceipt
|
|
798
883
|
* ```
|
|
799
884
|
*
|
|
800
885
|
* @param client - Aave client.
|
|
@@ -833,7 +918,7 @@ declare function liquidatePosition(client: AaveClient, request: LiquidatePositio
|
|
|
833
918
|
* return;
|
|
834
919
|
* }
|
|
835
920
|
*
|
|
836
|
-
* // result.value:
|
|
921
|
+
* // result.value: TransactionReceipt
|
|
837
922
|
* ```
|
|
838
923
|
*
|
|
839
924
|
* @param client - Aave client.
|
|
@@ -865,7 +950,7 @@ declare function setSpokeUserPositionManager(client: AaveClient, request: SetSpo
|
|
|
865
950
|
* @param options - The query options.
|
|
866
951
|
* @returns The preview result showing position changes.
|
|
867
952
|
*/
|
|
868
|
-
declare function preview(client: AaveClient, request: PreviewRequest,
|
|
953
|
+
declare function preview(client: AaveClient, request: PreviewRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PreviewUserPosition, UnexpectedError>;
|
|
869
954
|
/**
|
|
870
955
|
* Updates the collateral status of user's supplies.
|
|
871
956
|
*
|
|
@@ -886,6 +971,29 @@ declare function preview(client: AaveClient, request: PreviewRequest, options?:
|
|
|
886
971
|
* @returns The transaction request to update collateral status.
|
|
887
972
|
*/
|
|
888
973
|
declare function setUserSuppliesAsCollateral(client: AaveClient, request: SetUserSuppliesAsCollateralRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
974
|
+
/**
|
|
975
|
+
* Creates a transaction to claim rewards.
|
|
976
|
+
*
|
|
977
|
+
* ```ts
|
|
978
|
+
* const result = await claimRewards(client, {
|
|
979
|
+
* ids: [rewardId('abc123')],
|
|
980
|
+
* chainId: chainId(1),
|
|
981
|
+
* user: evmAddress('0x9abc…'),
|
|
982
|
+
* });
|
|
983
|
+
*
|
|
984
|
+
* if (result.isErr()) {
|
|
985
|
+
* // Handle error
|
|
986
|
+
* return;
|
|
987
|
+
* }
|
|
988
|
+
*
|
|
989
|
+
* // result.value: TransactionRequest
|
|
990
|
+
* ```
|
|
991
|
+
*
|
|
992
|
+
* @param client - Aave client.
|
|
993
|
+
* @param request - The claim rewards request parameters.
|
|
994
|
+
* @returns The transaction request to claim rewards.
|
|
995
|
+
*/
|
|
996
|
+
declare function claimRewards(client: AaveClient, request: ClaimRewardsRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
889
997
|
/**
|
|
890
998
|
* Fetches paginated list of activities.
|
|
891
999
|
*
|
|
@@ -904,7 +1012,7 @@ declare function setUserSuppliesAsCollateral(client: AaveClient, request: SetUse
|
|
|
904
1012
|
* @param options - The query options.
|
|
905
1013
|
* @returns The paginated list of activities.
|
|
906
1014
|
*/
|
|
907
|
-
declare function activities(client: AaveClient, request: ActivitiesRequest,
|
|
1015
|
+
declare function activities(client: AaveClient, request: ActivitiesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedActivitiesResult, UnexpectedError>;
|
|
908
1016
|
|
|
909
1017
|
/**
|
|
910
1018
|
* Fetches all user supply positions across the specified spoke.
|
|
@@ -926,7 +1034,7 @@ declare function activities(client: AaveClient, request: ActivitiesRequest, opti
|
|
|
926
1034
|
* @param options - The query options.
|
|
927
1035
|
* @returns The user's supply positions.
|
|
928
1036
|
*/
|
|
929
|
-
declare function userSupplies(client: AaveClient, request: UserSuppliesRequest, { currency, timeWindow, }?:
|
|
1037
|
+
declare function userSupplies(client: AaveClient, request: UserSuppliesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserSupplyItem[], UnexpectedError>;
|
|
930
1038
|
/**
|
|
931
1039
|
* Fetches all user borrow positions across the specified spoke.
|
|
932
1040
|
*
|
|
@@ -947,8 +1055,8 @@ declare function userSupplies(client: AaveClient, request: UserSuppliesRequest,
|
|
|
947
1055
|
* @param options - The query options.
|
|
948
1056
|
* @returns The user's borrow positions.
|
|
949
1057
|
*/
|
|
950
|
-
declare function userBorrows(client: AaveClient, request: UserBorrowsRequest, { currency, timeWindow, }?:
|
|
951
|
-
type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions>;
|
|
1058
|
+
declare function userBorrows(client: AaveClient, request: UserBorrowsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserBorrowItem[], UnexpectedError>;
|
|
1059
|
+
type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions>;
|
|
952
1060
|
/**
|
|
953
1061
|
* Fetches a user's summary across all positions.
|
|
954
1062
|
*
|
|
@@ -966,8 +1074,8 @@ type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOp
|
|
|
966
1074
|
* @param options - The query options.
|
|
967
1075
|
* @returns The user's financial summary.
|
|
968
1076
|
*/
|
|
969
|
-
declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
|
|
970
|
-
type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
|
|
1077
|
+
declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, requestPolicy, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
|
|
1078
|
+
type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions;
|
|
971
1079
|
/**
|
|
972
1080
|
* Fetches all user positions across specified chains.
|
|
973
1081
|
*
|
|
@@ -986,7 +1094,7 @@ type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
|
|
|
986
1094
|
* @param options - The query options.
|
|
987
1095
|
* @returns The user's positions across all specified chains.
|
|
988
1096
|
*/
|
|
989
|
-
declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
|
|
1097
|
+
declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
|
|
990
1098
|
/**
|
|
991
1099
|
* Fetches a specific user position by ID.
|
|
992
1100
|
*
|
|
@@ -1001,7 +1109,7 @@ declare function userPositions(client: AaveClient, request: UserPositionsRequest
|
|
|
1001
1109
|
* @param options - The query options.
|
|
1002
1110
|
* @returns The specific user position or null if not found.
|
|
1003
1111
|
*/
|
|
1004
|
-
declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
|
|
1112
|
+
declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
|
|
1005
1113
|
/**
|
|
1006
1114
|
* Fetches all user balances across specified chains.
|
|
1007
1115
|
*
|
|
@@ -1019,7 +1127,7 @@ declare function userPosition(client: AaveClient, request: UserPositionRequest,
|
|
|
1019
1127
|
* @param options - The query options.
|
|
1020
1128
|
* @returns The user's balances across all specified chains.
|
|
1021
1129
|
**/
|
|
1022
|
-
declare function userBalances(client: AaveClient, request: UserBalancesRequest,
|
|
1130
|
+
declare function userBalances(client: AaveClient, request: UserBalancesRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserBalance[], UnexpectedError>;
|
|
1023
1131
|
/**
|
|
1024
1132
|
* Fetches user summary history over time.
|
|
1025
1133
|
*
|
|
@@ -1038,6 +1146,239 @@ declare function userBalances(client: AaveClient, request: UserBalancesRequest,
|
|
|
1038
1146
|
* @param options - The query options.
|
|
1039
1147
|
* @returns The user summary history items.
|
|
1040
1148
|
*/
|
|
1041
|
-
declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest,
|
|
1149
|
+
declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserSummaryHistoryItem[], UnexpectedError>;
|
|
1150
|
+
/**
|
|
1151
|
+
* Fetches the risk premium breakdown for a user position or spoke.
|
|
1152
|
+
*
|
|
1153
|
+
* ```ts
|
|
1154
|
+
* const result = await userRiskPremiumBreakdown(client, {
|
|
1155
|
+
* query: {
|
|
1156
|
+
* userPositionId: userPositionId('SGVsbG8h'),
|
|
1157
|
+
* },
|
|
1158
|
+
* user: evmAddress('0x742d35cc…'),
|
|
1159
|
+
* });
|
|
1160
|
+
* ```
|
|
1161
|
+
*
|
|
1162
|
+
* @param client - Aave client.
|
|
1163
|
+
* @param request - The user risk premium breakdown request parameters.
|
|
1164
|
+
* @param options - The query options.
|
|
1165
|
+
* @returns Array of risk premium breakdown items.
|
|
1166
|
+
*/
|
|
1167
|
+
declare function userRiskPremiumBreakdown(client: AaveClient, request: UserRiskPremiumBreakdownRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserRiskPremiumBreakdownItem[], UnexpectedError>;
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Fetches a stable vault by ID.
|
|
1171
|
+
*
|
|
1172
|
+
* ```ts
|
|
1173
|
+
* const result = await stableVault(client, {
|
|
1174
|
+
* id: stableVaultId('vault-123'),
|
|
1175
|
+
* });
|
|
1176
|
+
* ```
|
|
1177
|
+
*
|
|
1178
|
+
* @param client - Aave client.
|
|
1179
|
+
* @param request - The stable vault request parameters.
|
|
1180
|
+
* @param options - The query options.
|
|
1181
|
+
* @returns The stable vault data, or null if not found.
|
|
1182
|
+
*/
|
|
1183
|
+
declare function stableVault(client: AaveClient, request: StableVaultRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<StableVault | null, UnexpectedError>;
|
|
1184
|
+
/**
|
|
1185
|
+
* Fetches all stable vaults managed by a given admin address.
|
|
1186
|
+
*
|
|
1187
|
+
* ```ts
|
|
1188
|
+
* const result = await stableVaults(client, {
|
|
1189
|
+
* adminAddress: evmAddress('0x1234…'),
|
|
1190
|
+
* });
|
|
1191
|
+
* ```
|
|
1192
|
+
*
|
|
1193
|
+
* @param client - Aave client.
|
|
1194
|
+
* @param request - The stable vaults request parameters.
|
|
1195
|
+
* @param options - The query options.
|
|
1196
|
+
* @returns Array of stable vaults.
|
|
1197
|
+
*/
|
|
1198
|
+
declare function stableVaults(client: AaveClient, request: StableVaultsRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<StableVault[], UnexpectedError>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Fetches paginated list of users assigned to a specific boosted rate tier.
|
|
1201
|
+
*
|
|
1202
|
+
* ```ts
|
|
1203
|
+
* const result = await stableVaultRateUsers(client, {
|
|
1204
|
+
* vaultId: stableVaultId('vault-123'),
|
|
1205
|
+
* rateId: boostedRateId('gold'),
|
|
1206
|
+
* pageSize: 10,
|
|
1207
|
+
* });
|
|
1208
|
+
* ```
|
|
1209
|
+
*
|
|
1210
|
+
* @param client - Aave client.
|
|
1211
|
+
* @param request - The rate users request parameters.
|
|
1212
|
+
* @param options - The query options.
|
|
1213
|
+
* @returns Paginated list of user addresses.
|
|
1214
|
+
*/
|
|
1215
|
+
declare function stableVaultRateUsers(client: AaveClient, request: StableVaultRateUsersRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<PaginatedStableVaultRateUsersResult, UnexpectedError>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Creates a transaction to assign users to a boosted rate tier.
|
|
1218
|
+
*
|
|
1219
|
+
* ```ts
|
|
1220
|
+
* const result = await stableVaultAssignRate(client, {
|
|
1221
|
+
* vaultId: stableVaultId('vault-123'),
|
|
1222
|
+
* rateId: boostedRateId('gold'),
|
|
1223
|
+
* users: [evmAddress('0x1234…')],
|
|
1224
|
+
* }).andThen(sendWith(wallet));
|
|
1225
|
+
* ```
|
|
1226
|
+
*
|
|
1227
|
+
* @param client - Aave client.
|
|
1228
|
+
* @param request - The assign rate request parameters.
|
|
1229
|
+
* @param options - The query options.
|
|
1230
|
+
* @returns The transaction data.
|
|
1231
|
+
*/
|
|
1232
|
+
declare function stableVaultAssignRate(client: AaveClient, request: StableVaultAssignRateRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
1233
|
+
/**
|
|
1234
|
+
* Creates a transaction to remove users from a boosted rate tier.
|
|
1235
|
+
*
|
|
1236
|
+
* ```ts
|
|
1237
|
+
* const result = await stableVaultUnassignRate(client, {
|
|
1238
|
+
* vaultId: stableVaultId('vault-123'),
|
|
1239
|
+
* rateId: boostedRateId('gold'),
|
|
1240
|
+
* users: [evmAddress('0x1234…')],
|
|
1241
|
+
* }).andThen(sendWith(wallet));
|
|
1242
|
+
* ```
|
|
1243
|
+
*
|
|
1244
|
+
* @param client - Aave client.
|
|
1245
|
+
* @param request - The unassign rate request parameters.
|
|
1246
|
+
* @param options - The query options.
|
|
1247
|
+
* @returns The transaction data.
|
|
1248
|
+
*/
|
|
1249
|
+
declare function stableVaultUnassignRate(client: AaveClient, request: StableVaultUnassignRateRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
1250
|
+
/**
|
|
1251
|
+
* Creates a transaction to claim accumulated surplus from a stable vault.
|
|
1252
|
+
*
|
|
1253
|
+
* ```ts
|
|
1254
|
+
* const result = await stableVaultClaimSurplus(client, {
|
|
1255
|
+
* vaultId: stableVaultId('vault-123'),
|
|
1256
|
+
* claims: [{ address: evmAddress('0xUSDC…'), value: bigDecimal('1000') }],
|
|
1257
|
+
* }).andThen(sendWith(wallet));
|
|
1258
|
+
* ```
|
|
1259
|
+
*
|
|
1260
|
+
* @param client - Aave client.
|
|
1261
|
+
* @param request - The claim surplus request parameters.
|
|
1262
|
+
* @param options - The query options.
|
|
1263
|
+
* @returns The transaction data.
|
|
1264
|
+
*/
|
|
1265
|
+
declare function stableVaultClaimSurplus(client: AaveClient, request: StableVaultClaimSurplusRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
1266
|
+
/**
|
|
1267
|
+
* Fetches paginated cross-chain fund movements for a stable vault.
|
|
1268
|
+
*
|
|
1269
|
+
* ```ts
|
|
1270
|
+
* const result = await stableVaultMovements(client, {
|
|
1271
|
+
* vaultId: stableVaultId('vault-123'),
|
|
1272
|
+
* pageSize: 10,
|
|
1273
|
+
* });
|
|
1274
|
+
* ```
|
|
1275
|
+
*
|
|
1276
|
+
* @param client - Aave client.
|
|
1277
|
+
* @param request - The movements request parameters.
|
|
1278
|
+
* @param options - The query options.
|
|
1279
|
+
* @returns Paginated list of token movement records.
|
|
1280
|
+
*/
|
|
1281
|
+
declare function stableVaultMovements(client: AaveClient, request: StableVaultMovementsRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<PaginatedStableVaultMovementsResult, UnexpectedError>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Creates a transaction to deposit into a stable vault.
|
|
1284
|
+
*
|
|
1285
|
+
* ```ts
|
|
1286
|
+
* const result = await stableVaultDeposit(client, {
|
|
1287
|
+
* vault: { id: stableVaultId('vault-123') },
|
|
1288
|
+
* user: evmAddress('0x1234…'),
|
|
1289
|
+
* amount: {
|
|
1290
|
+
* address: evmAddress('0xUSDC…'),
|
|
1291
|
+
* value: { exact: bigDecimal('1000') },
|
|
1292
|
+
* },
|
|
1293
|
+
* });
|
|
1294
|
+
* ```
|
|
1295
|
+
*
|
|
1296
|
+
* @param client - Aave client.
|
|
1297
|
+
* @param request - The deposit request parameters.
|
|
1298
|
+
* @returns The transaction data, approval requirements, or insufficient balance error.
|
|
1299
|
+
*/
|
|
1300
|
+
declare function stableVaultDeposit(client: AaveClient, request: StableVaultDepositRequest): ResultAsync<StableVaultDepositExecutionPlan, UnexpectedError>;
|
|
1301
|
+
/**
|
|
1302
|
+
* Creates a transaction to request a withdrawal from a stable vault.
|
|
1303
|
+
*
|
|
1304
|
+
* Withdrawals may be instant if sufficient liquidity exists, or deferred
|
|
1305
|
+
* if funds must be bridged from earning chains.
|
|
1306
|
+
*
|
|
1307
|
+
* ```ts
|
|
1308
|
+
* const result = await stableVaultWithdraw(client, {
|
|
1309
|
+
* vault: { id: stableVaultId('vault-123') },
|
|
1310
|
+
* user: evmAddress('0x1234…'),
|
|
1311
|
+
* amount: {
|
|
1312
|
+
* address: evmAddress('0xUSDC…'),
|
|
1313
|
+
* value: { exact: bigDecimal('500') },
|
|
1314
|
+
* },
|
|
1315
|
+
* });
|
|
1316
|
+
* ```
|
|
1317
|
+
*
|
|
1318
|
+
* @param client - Aave client.
|
|
1319
|
+
* @param request - The withdraw request parameters.
|
|
1320
|
+
* @returns The withdraw execution plan with either an instant transaction or a deferred claim.
|
|
1321
|
+
*/
|
|
1322
|
+
declare function stableVaultWithdraw(client: AaveClient, request: StableVaultWithdrawRequest): ResultAsync<StableVaultWithdrawExecutionPlan, UnexpectedError>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Redeems a deferred withdrawal claim once funds become available.
|
|
1325
|
+
*
|
|
1326
|
+
* ```ts
|
|
1327
|
+
* const result = await stableVaultWithdrawRedeem(client, {
|
|
1328
|
+
* claimId: stableVaultWithdrawClaimId('claim-456'),
|
|
1329
|
+
* }).andThen(sendWith(wallet));
|
|
1330
|
+
* ```
|
|
1331
|
+
*
|
|
1332
|
+
* @param client - Aave client.
|
|
1333
|
+
* @param request - The redeem request with the claim ID.
|
|
1334
|
+
* @returns The redeem execution plan.
|
|
1335
|
+
*/
|
|
1336
|
+
declare function stableVaultWithdrawRedeem(client: AaveClient, request: StableVaultWithdrawRedeemRequest): ResultAsync<StableVaultWithdrawRedeemExecutionPlan, UnexpectedError>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Checks the status of a deferred withdrawal claim.
|
|
1339
|
+
*
|
|
1340
|
+
* ```ts
|
|
1341
|
+
* const result = await stableVaultClaimStatus(client, {
|
|
1342
|
+
* claimId: stableVaultWithdrawClaimId('claim-456'),
|
|
1343
|
+
* });
|
|
1344
|
+
* ```
|
|
1345
|
+
*
|
|
1346
|
+
* @param client - Aave client.
|
|
1347
|
+
* @param request - The claim status request parameters.
|
|
1348
|
+
* @param options - The query options.
|
|
1349
|
+
* @returns The claim status (READY, PENDING, or UNKNOWN).
|
|
1350
|
+
*/
|
|
1351
|
+
declare function stableVaultClaimStatus(client: AaveClient, request: StableVaultClaimStatusRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<StableVaultClaimStatus, UnexpectedError>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Fetches all stable vault positions for a given user.
|
|
1354
|
+
*
|
|
1355
|
+
* ```ts
|
|
1356
|
+
* const result = await stableVaultUserPositions(client, {
|
|
1357
|
+
* user: evmAddress('0x1234…'),
|
|
1358
|
+
* });
|
|
1359
|
+
* ```
|
|
1360
|
+
*
|
|
1361
|
+
* @param client - Aave client.
|
|
1362
|
+
* @param request - The user positions request parameters.
|
|
1363
|
+
* @param options - The query options.
|
|
1364
|
+
* @returns Array of stable vault positions with principal, interests, and APY.
|
|
1365
|
+
*/
|
|
1366
|
+
declare function stableVaultUserPositions(client: AaveClient, request: StableVaultUserPositionsRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<StableVaultUserPosition[], UnexpectedError>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Waits for a deferred withdrawal claim to become ready for redemption.
|
|
1369
|
+
*
|
|
1370
|
+
* Polls the claim status until it reaches `READY`, then resolves.
|
|
1371
|
+
*
|
|
1372
|
+
* ```ts
|
|
1373
|
+
* const result = await waitForStableVaultWithdrawClaim(client, {
|
|
1374
|
+
* claimId: plan.claimId,
|
|
1375
|
+
* });
|
|
1376
|
+
* ```
|
|
1377
|
+
*
|
|
1378
|
+
* @param client - Aave client configured with polling settings.
|
|
1379
|
+
* @param request - The claim status request with the claim ID.
|
|
1380
|
+
* @returns Resolves when the claim is ready, or rejects with a TimeoutError.
|
|
1381
|
+
*/
|
|
1382
|
+
declare function waitForStableVaultWithdrawClaim(client: AaveClient, request: StableVaultClaimStatusRequest): ResultAsync<void, TimeoutError | UnexpectedError>;
|
|
1042
1383
|
|
|
1043
|
-
export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, cancelSwap, chain, chains, exchangeRate, hasProcessedKnownTransaction, hub, hubAssets, hubs, liquidatePosition,
|
|
1384
|
+
export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, borrowSwapQuote, cancelSwap, chain, chains, claimRewards, exchangeRate, hasProcessedKnownTransaction, hub, hubAssetInterestRateModel, hubAssets, hubSummaryHistory, hubs, liquidatePosition, preparePositionSwap, prepareSwapCancel, prepareTokenSwap, preview, protocolHistory, renounceSpokeUserPositionManager, repay, repayWithSupplyQuote, reserve, reserves, setSpokeUserPositionManager, setUserSuppliesAsCollateral, spoke, spokePositionManagers, spokeUserPositionManagers, spokes, stableVault, stableVaultAssignRate, stableVaultClaimStatus, stableVaultClaimSurplus, stableVaultDeposit, stableVaultMovements, stableVaultRateUsers, stableVaultUnassignRate, stableVaultUserPositions, stableVaultWithdraw, stableVaultWithdrawRedeem, stableVaults, supply, supplyApyHistory, supplySwapQuote, swap, swapStatus, swappableTokens, tokenSwapQuote, updateUserPositionConditions, userBalances, userBorrows, userClaimableRewards, userPosition, userPositions, userRiskPremiumBreakdown, userSummary, userSummaryHistory, userSupplies, userSwaps, waitForStableVaultWithdrawClaim, waitForSwapOutcome, withdraw, withdrawSwapQuote };
|