@aave/client 4.0.0-next.5 → 4.0.0-next.51
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-CgHY2iS9.d.ts → AaveClient-CGksa0-v.d.cts} +14 -17
- package/dist/{AaveClient-L3v8kWvn.d.cts → AaveClient-DpWiYPGY.d.ts} +14 -17
- package/dist/actions/index.cjs +1 -1
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.d.cts +313 -180
- package/dist/actions/index.d.ts +313 -180
- package/dist/actions/index.js +1 -1
- package/dist/chunk-CMTDTGTS.js +2 -0
- package/dist/chunk-CMTDTGTS.js.map +1 -0
- package/dist/chunk-N4LXBTGY.js +2 -0
- package/dist/chunk-N4LXBTGY.js.map +1 -0
- package/dist/chunk-RM3HEVPN.js +2 -0
- package/dist/chunk-RM3HEVPN.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 +21 -4
- package/dist/index.d.ts +21 -4
- package/dist/index.js +2 -2
- 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 +3844 -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 +51 -16
- package/dist/thirdweb.d.ts +51 -16
- package/dist/thirdweb.js +1 -2
- package/dist/thirdweb.js.map +1 -1
- package/dist/types-BzGr7R2Y.d.cts +33 -0
- package/dist/types-BzGr7R2Y.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 +13 -12
- package/dist/chunk-OE7CG3QU.js +0 -3
- package/dist/chunk-OE7CG3QU.js.map +0 -1
- package/dist/chunk-UXJVSHNC.js +0 -2
- package/dist/chunk-UXJVSHNC.js.map +0 -1
- package/dist/test-utils.d.ts +0 -132
- package/dist/test-utils.js +0 -3
- package/dist/test-utils.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, HubsRequest, HubAssetsRequest, HubAsset, ChainRequest, Chain,
|
|
1
|
+
import { UnexpectedError, ValidationError, TimeoutError } from '@aave/core';
|
|
2
|
+
import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, HubSummaryHistoryRequest, HubSummarySample, HubAssetInterestRateModelRequest, HubAssetInterestRateModelPoint, ChainRequest, Chain, ChainsRequest, HasProcessedKnownTransactionRequest, ExchangeRateRequest, ExchangeAmount, AssetRequest, Asset, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, AssetBorrowHistoryRequest, AssetBorrowSample, ProtocolHistoryRequest, ProtocolHistorySample, ReserveRequest, Reserve, ReservesRequest, BorrowApyHistoryRequest, ApySample, SupplyApyHistoryRequest, UserClaimableRewardsRequest, UserClaimableReward, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, TokenSwapQuoteRequest, TokenSwapQuoteResult, InsufficientLiquidityError, SwappableTokensRequest, Token, PrepareTokenSwapRequest, PrepareSwapOrder, InsufficientBalanceError, SupplySwapQuoteRequest, PositionSwapByIntentApprovalsRequired, BorrowSwapQuoteRequest, RepayWithSupplyQuoteRequest, WithdrawSwapQuoteRequest, PreparePositionSwapRequest, SwapStatusRequest, SwapStatus, SwapCancelled, SwapExpired, SwapFulfilled, SwapReceipt, SwapRequest, SwapTransactionRequest, PrepareSwapCancelRequest, PrepareSwapCancelResult, CancelSwapRequest, CancelSwapExecutionPlan, UserSwapsRequest, PaginatedUserSwapsResult, BorrowRequest, ExecutionPlan, SupplyRequest, RepayRequest, WithdrawRequest, RenounceSpokeUserPositionManagerRequest, TransactionRequest, UpdateUserPositionConditionsRequest, LiquidatePositionRequest, SetSpokeUserPositionManagerRequest, PreviewRequest, PreviewUserPosition, SetUserSuppliesAsCollateralRequest, ClaimRewardsRequest, ActivitiesRequest, PaginatedActivitiesResult, UserSuppliesRequest, UserSupplyItem, UserBorrowsRequest, UserBorrowItem, UserSummaryRequest, UserSummary, UserPositionsRequest, UserPosition, UserPositionRequest, UserBalancesRequest, UserBalance, UserSummaryHistoryRequest, UserSummaryHistoryItem, UserRiskPremiumBreakdownRequest, UserRiskPremiumBreakdownItem } from '@aave/graphql';
|
|
3
3
|
import { ResultAsync, Prettify } from '@aave/types';
|
|
4
|
-
import { A as AaveClient } from '../AaveClient-
|
|
5
|
-
import { C as CurrencyQueryOptions, R as RequestPolicyOptions,
|
|
4
|
+
import { A as AaveClient } from '../AaveClient-CGksa0-v.cjs';
|
|
5
|
+
import { C as CurrencyQueryOptions, T as TimeWindowQueryOptions, R as RequestPolicyOptions, B as BatchOptions } from '../options-BX6n3sbh.cjs';
|
|
6
|
+
import '../types-BzGr7R2Y.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.
|
|
@@ -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,39 @@ 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>;
|
|
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,21 +97,30 @@ declare function hubAssets(client: AaveClient, request: HubAssetsRequest, option
|
|
|
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>;
|
|
103
|
+
declare function chain(client: AaveClient, request: ChainRequest, { batch, requestPolicy, }?: BatchOptions & RequestPolicyOptions): ResultAsync<Chain | null, UnexpectedError>;
|
|
71
104
|
/**
|
|
72
105
|
* Fetches the list of supported chains.
|
|
73
106
|
*
|
|
74
107
|
* ```ts
|
|
75
|
-
* const chains = await chains(client, {
|
|
108
|
+
* const chains = await chains(client, {
|
|
109
|
+
* query: { filter: ChainsFilter.ALL }
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* ```ts
|
|
114
|
+
* const chains = await chains(client, {
|
|
115
|
+
* query: { chainIds: [chainId(1), chainId(137)] }
|
|
116
|
+
* });
|
|
76
117
|
* ```
|
|
77
118
|
*
|
|
78
119
|
* @param client - Aave client.
|
|
79
|
-
* @param
|
|
120
|
+
* @param request - The chains request parameters.
|
|
80
121
|
* @returns Array of supported chains.
|
|
81
122
|
*/
|
|
82
|
-
declare function chains(client: AaveClient,
|
|
123
|
+
declare function chains(client: AaveClient, request: ChainsRequest): ResultAsync<Chain[], UnexpectedError>;
|
|
83
124
|
/**
|
|
84
125
|
* Check if a transaction has been processed by the Aave API.
|
|
85
126
|
*
|
|
@@ -100,31 +141,10 @@ declare function hasProcessedKnownTransaction(client: AaveClient, request: HasPr
|
|
|
100
141
|
*
|
|
101
142
|
* @param client - Aave client.
|
|
102
143
|
* @param request - The exchange rate request parameters.
|
|
144
|
+
* @param options - The query options.
|
|
103
145
|
* @returns The exchange rate information as a fiat amount.
|
|
104
146
|
*/
|
|
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>;
|
|
147
|
+
declare function exchangeRate(client: AaveClient, request: ExchangeRateRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ExchangeAmount, UnexpectedError>;
|
|
128
148
|
|
|
129
149
|
/**
|
|
130
150
|
* Fetches information about a specific asset (ERC20 token) in the protocol by ID or by token.
|
|
@@ -140,13 +160,15 @@ declare function permitTypedData(client: AaveClient, request: PermitRequest): Re
|
|
|
140
160
|
* @param options - The query options including currency and time window.
|
|
141
161
|
* @returns The asset data, or null if not found.
|
|
142
162
|
*/
|
|
143
|
-
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>;
|
|
144
164
|
/**
|
|
145
165
|
* Fetches historical price data for a specific asset.
|
|
146
166
|
*
|
|
147
167
|
* ```ts
|
|
148
168
|
* const result = await assetPriceHistory(client, {
|
|
149
|
-
*
|
|
169
|
+
* query: {
|
|
170
|
+
* token: { chainId: chainId(1), address: evmAddress('0x123…') },
|
|
171
|
+
* },
|
|
150
172
|
* currency: Currency.Usd,
|
|
151
173
|
* window: TimeWindow.LastWeek,
|
|
152
174
|
* });
|
|
@@ -163,33 +185,53 @@ declare function assetPriceHistory(client: AaveClient, request: AssetPriceHistor
|
|
|
163
185
|
*
|
|
164
186
|
* ```ts
|
|
165
187
|
* const result = await assetSupplyHistory(client, {
|
|
166
|
-
*
|
|
188
|
+
* query: {
|
|
189
|
+
* token: { chainId: chainId(1), address: evmAddress('0x123…') },
|
|
190
|
+
* },
|
|
167
191
|
* window: TimeWindow.LastWeek,
|
|
168
192
|
* });
|
|
169
193
|
* ```
|
|
170
194
|
*
|
|
171
195
|
* @param client - Aave client.
|
|
172
196
|
* @param request - The asset supply history request parameters.
|
|
173
|
-
* @param options - The query options.
|
|
197
|
+
* @param options - The query options including currency and time window.
|
|
174
198
|
* @returns Array of asset supply samples over time.
|
|
175
199
|
*/
|
|
176
|
-
declare function assetSupplyHistory(client: AaveClient, request: AssetSupplyHistoryRequest,
|
|
200
|
+
declare function assetSupplyHistory(client: AaveClient, request: AssetSupplyHistoryRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<AssetSupplySample[], UnexpectedError>;
|
|
177
201
|
/**
|
|
178
202
|
* Fetches historical borrow data for a specific asset.
|
|
179
203
|
*
|
|
180
204
|
* ```ts
|
|
181
205
|
* const result = await assetBorrowHistory(client, {
|
|
182
|
-
*
|
|
206
|
+
* query: {
|
|
207
|
+
* token: { chainId: chainId(1), address: evmAddress('0x123…') },
|
|
208
|
+
* },
|
|
183
209
|
* window: TimeWindow.LastWeek,
|
|
184
210
|
* });
|
|
185
211
|
* ```
|
|
186
212
|
*
|
|
187
213
|
* @param client - Aave client.
|
|
188
214
|
* @param request - The asset borrow history request parameters.
|
|
189
|
-
* @param options - The query options.
|
|
215
|
+
* @param options - The query options including currency and time window.
|
|
190
216
|
* @returns Array of asset borrow samples over time.
|
|
191
217
|
*/
|
|
192
|
-
declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHistoryRequest,
|
|
218
|
+
declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHistoryRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<AssetBorrowSample[], UnexpectedError>;
|
|
219
|
+
/**
|
|
220
|
+
* Fetches historical protocol-wide data (deposits, borrows, earnings).
|
|
221
|
+
*
|
|
222
|
+
* ```ts
|
|
223
|
+
* const result = await protocolHistory(client, {
|
|
224
|
+
* currency: Currency.Usd,
|
|
225
|
+
* window: TimeWindow.LastWeek,
|
|
226
|
+
* });
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* @param client - Aave client.
|
|
230
|
+
* @param request - The protocol history request parameters.
|
|
231
|
+
* @param options - The query options.
|
|
232
|
+
* @returns Array of protocol history samples over time.
|
|
233
|
+
*/
|
|
234
|
+
declare function protocolHistory(client: AaveClient, request: ProtocolHistoryRequest, options?: Required<RequestPolicyOptions>): ResultAsync<ProtocolHistorySample[], UnexpectedError>;
|
|
193
235
|
|
|
194
236
|
/**
|
|
195
237
|
* Fetches a specific reserve by reserve ID, spoke, and chain.
|
|
@@ -206,7 +248,7 @@ declare function assetBorrowHistory(client: AaveClient, request: AssetBorrowHist
|
|
|
206
248
|
* @param options - The query options.
|
|
207
249
|
* @returns The reserve data, or null if not found.
|
|
208
250
|
*/
|
|
209
|
-
declare function reserve(client: AaveClient, request: ReserveRequest,
|
|
251
|
+
declare function reserve(client: AaveClient, request: ReserveRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Reserve | null, UnexpectedError>;
|
|
210
252
|
/**
|
|
211
253
|
* Fetches reserves based on specified criteria.
|
|
212
254
|
*
|
|
@@ -228,7 +270,7 @@ declare function reserve(client: AaveClient, request: ReserveRequest, options?:
|
|
|
228
270
|
* @param options - The query options.
|
|
229
271
|
* @returns Array of reserves matching the criteria.
|
|
230
272
|
*/
|
|
231
|
-
declare function reserves(client: AaveClient, request: ReservesRequest,
|
|
273
|
+
declare function reserves(client: AaveClient, request: ReservesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<Reserve[], UnexpectedError>;
|
|
232
274
|
/**
|
|
233
275
|
* Fetches borrow APY history for a specific reserve over time.
|
|
234
276
|
*
|
|
@@ -241,9 +283,10 @@ declare function reserves(client: AaveClient, request: ReservesRequest, options?
|
|
|
241
283
|
*
|
|
242
284
|
* @param client - Aave client.
|
|
243
285
|
* @param request - The borrow APY history request parameters.
|
|
286
|
+
* @param options - The query options.
|
|
244
287
|
* @returns The borrow APY history samples.
|
|
245
288
|
*/
|
|
246
|
-
declare function borrowApyHistory(client: AaveClient, request:
|
|
289
|
+
declare function borrowApyHistory(client: AaveClient, request: BorrowApyHistoryRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<ApySample[], UnexpectedError>;
|
|
247
290
|
/**
|
|
248
291
|
* Fetches supply APY history for a specific reserve over time.
|
|
249
292
|
*
|
|
@@ -256,9 +299,33 @@ declare function borrowApyHistory(client: AaveClient, request: BorrowAPYHistoryR
|
|
|
256
299
|
*
|
|
257
300
|
* @param client - Aave client.
|
|
258
301
|
* @param request - The supply APY history request parameters.
|
|
302
|
+
* @param options - The query options.
|
|
259
303
|
* @returns The supply APY history samples.
|
|
260
304
|
*/
|
|
261
|
-
declare function supplyApyHistory(client: AaveClient, request:
|
|
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
|
+
* });
|
|
314
|
+
*
|
|
315
|
+
* if (result.isErr()) {
|
|
316
|
+
* // Handle error
|
|
317
|
+
* return;
|
|
318
|
+
* }
|
|
319
|
+
*
|
|
320
|
+
* // result.value: UserClaimableReward[]
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* @param client - Aave client.
|
|
324
|
+
* @param request - The user claimable rewards request parameters.
|
|
325
|
+
* @param options - The query options.
|
|
326
|
+
* @returns Array of claimable rewards.
|
|
327
|
+
*/
|
|
328
|
+
declare function userClaimableRewards(client: AaveClient, request: UserClaimableRewardsRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserClaimableReward[], UnexpectedError>;
|
|
262
329
|
|
|
263
330
|
/**
|
|
264
331
|
* Fetches a specific spoke.
|
|
@@ -319,28 +386,28 @@ declare function spokePositionManagers(client: AaveClient, request: SpokePositio
|
|
|
319
386
|
declare function spokeUserPositionManagers(client: AaveClient, request: SpokeUserPositionManagersRequest): ResultAsync<PaginatedSpokeUserPositionManagerResult, UnexpectedError>;
|
|
320
387
|
|
|
321
388
|
/**
|
|
322
|
-
* @internal
|
|
323
389
|
* Fetches a swap quote for the specified trade parameters.
|
|
324
390
|
*
|
|
325
391
|
* ```ts
|
|
326
|
-
* const result = await
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
392
|
+
* const result = await tokenSwapQuote(client, {
|
|
393
|
+
* market: {
|
|
394
|
+
* chainId: chainId(1),
|
|
395
|
+
* buy: { erc20: evmAddress('0xA0b86a33E6...') },
|
|
396
|
+
* sell: { erc20: evmAddress('0x6B175474E...') },
|
|
397
|
+
* amount: bigDecimal('1000'),
|
|
398
|
+
* kind: SwapKind.Sell,
|
|
399
|
+
* user: evmAddress('0x742d35cc...'),
|
|
400
|
+
* },
|
|
333
401
|
* });
|
|
334
402
|
* ```
|
|
335
403
|
*
|
|
336
404
|
* @param client - Aave client.
|
|
337
405
|
* @param request - The swap quote request parameters.
|
|
338
406
|
* @param options - The query options.
|
|
339
|
-
* @returns The swap quote including pricing and cost information.
|
|
407
|
+
* @returns The swap quote including pricing and cost information and plan to start executing the swap.
|
|
340
408
|
*/
|
|
341
|
-
declare function
|
|
409
|
+
declare function tokenSwapQuote(client: AaveClient, request: TokenSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<TokenSwapQuoteResult, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
342
410
|
/**
|
|
343
|
-
* @internal
|
|
344
411
|
* Fetches the list of tokens available for swapping on a specific chain.
|
|
345
412
|
*
|
|
346
413
|
* ```ts
|
|
@@ -351,63 +418,126 @@ declare function swapQuote(client: AaveClient, request: SwapQuoteRequest, option
|
|
|
351
418
|
*
|
|
352
419
|
* @param client - Aave client.
|
|
353
420
|
* @param request - The swappable tokens request parameters.
|
|
421
|
+
* @param options - The query options.
|
|
354
422
|
* @returns The list of tokens available for swapping.
|
|
355
423
|
*/
|
|
356
|
-
declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest): ResultAsync<Token[], UnexpectedError>;
|
|
424
|
+
declare function swappableTokens(client: AaveClient, request: SwappableTokensRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<Token[], UnexpectedError>;
|
|
357
425
|
/**
|
|
358
|
-
* @internal
|
|
359
426
|
* Prepares a swap for the specified trade parameters.
|
|
360
427
|
*
|
|
361
428
|
* ```ts
|
|
362
|
-
* const result = await
|
|
429
|
+
* const result = await prepareTokenSwap(client, {
|
|
430
|
+
* quoteId: quote.quoteId,
|
|
431
|
+
* }).andThen(order => {
|
|
432
|
+
* return signTypedDataWith(wallet, order.data)
|
|
433
|
+
* .andThen((signature) =>
|
|
434
|
+
* swap({ intent: { quoteId: order.newQuoteId, signature } }),
|
|
435
|
+
* );
|
|
436
|
+
* });
|
|
437
|
+
* ```
|
|
438
|
+
*
|
|
439
|
+
* @param client - Aave client.
|
|
440
|
+
* @param request - The prepare swap request parameters.
|
|
441
|
+
* @returns The prepared swap result containing details of the swap.
|
|
442
|
+
*/
|
|
443
|
+
declare function prepareTokenSwap(client: AaveClient, request: PrepareTokenSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
444
|
+
/**
|
|
445
|
+
* Fetches a supply swap quote for swapping deposited funds.
|
|
446
|
+
*
|
|
447
|
+
* ```ts
|
|
448
|
+
* const result = await supplySwapQuote(client, {
|
|
363
449
|
* market: {
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
* sell: { erc20: evmAddress('0x6B175474E...') },
|
|
450
|
+
* sellPosition: userSupplyItemId('position_123'),
|
|
451
|
+
* buyReserve: reserveId('reserve_456'),
|
|
367
452
|
* amount: bigDecimal('1000'),
|
|
368
|
-
* kind: SwapKind.SELL,
|
|
369
453
|
* user: evmAddress('0x742d35cc...'),
|
|
370
454
|
* },
|
|
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
455
|
* });
|
|
401
456
|
* ```
|
|
402
457
|
*
|
|
403
458
|
* @param client - Aave client.
|
|
404
|
-
* @param request - The
|
|
459
|
+
* @param request - The supply swap request parameters.
|
|
405
460
|
* @param options - The query options.
|
|
406
|
-
* @returns The
|
|
461
|
+
* @returns The supply swap result with quote, approvals, and preview.
|
|
462
|
+
*/
|
|
463
|
+
declare function supplySwapQuote(client: AaveClient, request: SupplySwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
464
|
+
/**
|
|
465
|
+
* Fetches a borrow swap quote for swapping debt positions.
|
|
466
|
+
*
|
|
467
|
+
* ```ts
|
|
468
|
+
* const result = await borrowSwapQuote(client, {
|
|
469
|
+
* market: {
|
|
470
|
+
* sellPosition: userBorrowItemId('position_123'),
|
|
471
|
+
* buyReserve: reserveId('reserve_456'),
|
|
472
|
+
* amount: bigDecimal('1000'),
|
|
473
|
+
* user: evmAddress('0x742d35cc...'),
|
|
474
|
+
* },
|
|
475
|
+
* });
|
|
476
|
+
* ```
|
|
477
|
+
*
|
|
478
|
+
* @param client - Aave client.
|
|
479
|
+
* @param request - The borrow swap request parameters.
|
|
480
|
+
* @param options - The query options.
|
|
481
|
+
* @returns The borrow swap result with quote, approvals, and preview.
|
|
482
|
+
*/
|
|
483
|
+
declare function borrowSwapQuote(client: AaveClient, request: BorrowSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
484
|
+
/**
|
|
485
|
+
* Fetches a repay with supply quote for repaying debt using collateral.
|
|
486
|
+
*
|
|
487
|
+
* ```ts
|
|
488
|
+
* const result = await repayWithSupplyQuote(client, {
|
|
489
|
+
* market: {
|
|
490
|
+
* sellPosition: userSupplyItemId('collateral_123'),
|
|
491
|
+
* buyPosition: userBorrowItemId('debt_456'),
|
|
492
|
+
* amount: bigDecimal('1000'),
|
|
493
|
+
* user: evmAddress('0x742d35cc...'),
|
|
494
|
+
* },
|
|
495
|
+
* });
|
|
496
|
+
* ```
|
|
497
|
+
*
|
|
498
|
+
* @param client - Aave client.
|
|
499
|
+
* @param request - The repay with supply request parameters.
|
|
500
|
+
* @param options - The query options.
|
|
501
|
+
* @returns The repay with supply result with quote, approvals, and preview.
|
|
407
502
|
*/
|
|
408
|
-
declare function
|
|
503
|
+
declare function repayWithSupplyQuote(client: AaveClient, request: RepayWithSupplyQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
504
|
+
/**
|
|
505
|
+
* Fetches a withdraw swap quote for withdrawing deposits and swapping on the fly.
|
|
506
|
+
*
|
|
507
|
+
* ```ts
|
|
508
|
+
* const result = await withdrawSwapQuote(client, {
|
|
509
|
+
* market: {
|
|
510
|
+
* position: userSupplyItemId('position_123'),
|
|
511
|
+
* buyReserve: reserveId('reserve_456'),
|
|
512
|
+
* amount: bigDecimal('1000'),
|
|
513
|
+
* user: evmAddress('0x742d35cc...'),
|
|
514
|
+
* },
|
|
515
|
+
* });
|
|
516
|
+
* ```
|
|
517
|
+
*
|
|
518
|
+
* @param client - Aave client.
|
|
519
|
+
* @param request - The withdraw swap request parameters.
|
|
520
|
+
* @param options - The query options.
|
|
521
|
+
* @returns The withdraw swap result with quote, approvals, and preview.
|
|
522
|
+
*/
|
|
523
|
+
declare function withdrawSwapQuote(client: AaveClient, request: WithdrawSwapQuoteRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PositionSwapByIntentApprovalsRequired, UnexpectedError | ValidationError<InsufficientLiquidityError>>;
|
|
524
|
+
/**
|
|
525
|
+
* Prepares a position swap by obtaining the typed data for signing.
|
|
526
|
+
*
|
|
527
|
+
* ```ts
|
|
528
|
+
* const result = await preparePositionSwap(client, {
|
|
529
|
+
* quoteId: quote.quoteId,
|
|
530
|
+
* adapterContractSignature: signature('0x456...'),
|
|
531
|
+
* positionManagerSignature: signature('0x789...'),
|
|
532
|
+
* });
|
|
533
|
+
* ```
|
|
534
|
+
*
|
|
535
|
+
* @param client - Aave client.
|
|
536
|
+
* @param request - The position swap request with quote ID and signatures.
|
|
537
|
+
* @returns The position swap result with intent data for execution.
|
|
538
|
+
*/
|
|
539
|
+
declare function preparePositionSwap(client: AaveClient, request: PreparePositionSwapRequest): ResultAsync<PrepareSwapOrder, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
409
540
|
/**
|
|
410
|
-
* @internal
|
|
411
541
|
* Fetches the status of a specific swap.
|
|
412
542
|
*
|
|
413
543
|
* ```ts
|
|
@@ -421,10 +551,9 @@ declare function prepareSwap(client: AaveClient, request: PrepareSwapRequest, op
|
|
|
421
551
|
* @param options - The query options.
|
|
422
552
|
* @returns The current status of the swap.
|
|
423
553
|
*/
|
|
424
|
-
declare function swapStatus(client: AaveClient, request: SwapStatusRequest,
|
|
554
|
+
declare function swapStatus(client: AaveClient, request: SwapStatusRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<SwapStatus | null, UnexpectedError>;
|
|
425
555
|
type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
|
|
426
556
|
/**
|
|
427
|
-
* @internal
|
|
428
557
|
* Waits for a swap to reach a final outcome (cancelled, expired, or fulfilled).
|
|
429
558
|
*
|
|
430
559
|
* ```ts
|
|
@@ -451,17 +580,13 @@ type SwapOutcome = SwapCancelled | SwapExpired | SwapFulfilled;
|
|
|
451
580
|
*/
|
|
452
581
|
declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt) => ResultAsync<SwapOutcome, TimeoutError | UnexpectedError>;
|
|
453
582
|
/**
|
|
454
|
-
* @internal
|
|
455
583
|
* Executes a swap for the specified request parameters.
|
|
456
584
|
*
|
|
457
585
|
* ```ts
|
|
458
586
|
* const result = await swap(client, {
|
|
459
587
|
* intent: {
|
|
460
|
-
* quoteId:
|
|
461
|
-
* signature:
|
|
462
|
-
* value: signature('0x456...'),
|
|
463
|
-
* deadline: 1234567890,
|
|
464
|
-
* },
|
|
588
|
+
* quoteId: quote.quoteId,
|
|
589
|
+
* signature: signature('0x456...'),
|
|
465
590
|
* },
|
|
466
591
|
* }).andThen((plan) => {
|
|
467
592
|
* switch (plan.__typename) {
|
|
@@ -469,16 +594,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
|
|
|
469
594
|
* return sendTransaction(plan.transaction)
|
|
470
595
|
* .map(() => plan.orderReceipt);
|
|
471
596
|
*
|
|
472
|
-
* case 'SwapApprovalRequired':
|
|
473
|
-
* return sendTransaction(plan.transaction)
|
|
474
|
-
* .andThen(() => sendTransaction(plan.originalTransaction))
|
|
475
|
-
* .map(() => plan.originalTransaction.orderReceipt);
|
|
476
|
-
*
|
|
477
597
|
* case 'SwapReceipt':
|
|
478
|
-
* return okAsync(plan
|
|
479
|
-
*
|
|
480
|
-
* case 'InsufficientBalanceError':
|
|
481
|
-
* return errAsync(new Error(`Insufficient balance: ${plan.required.value} required.`));
|
|
598
|
+
* return okAsync(plan);
|
|
482
599
|
* }
|
|
483
600
|
* });
|
|
484
601
|
*
|
|
@@ -494,9 +611,8 @@ declare function waitForSwapOutcome(client: AaveClient): (receipt: SwapReceipt)
|
|
|
494
611
|
* @param request - The swap request parameters.
|
|
495
612
|
* @returns The swap execution plan containing transaction details or receipt.
|
|
496
613
|
*/
|
|
497
|
-
declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<
|
|
614
|
+
declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<SwapTransactionRequest | SwapReceipt, ValidationError<InsufficientBalanceError> | UnexpectedError>;
|
|
498
615
|
/**
|
|
499
|
-
* @internal
|
|
500
616
|
* Prepares a swap cancellation for the specified swap ID.
|
|
501
617
|
*
|
|
502
618
|
* ```ts
|
|
@@ -511,7 +627,6 @@ declare function swap(client: AaveClient, request: SwapRequest): ResultAsync<Swa
|
|
|
511
627
|
*/
|
|
512
628
|
declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCancelRequest): ResultAsync<PrepareSwapCancelResult, UnexpectedError>;
|
|
513
629
|
/**
|
|
514
|
-
* @internal
|
|
515
630
|
* Executes a swap cancellation for the specified request parameters.
|
|
516
631
|
*
|
|
517
632
|
* ```ts
|
|
@@ -526,8 +641,7 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
|
|
|
526
641
|
* }).andThen((plan) => {
|
|
527
642
|
* switch (plan.__typename) {
|
|
528
643
|
* case 'TransactionRequest':
|
|
529
|
-
* return sendTransaction(plan)
|
|
530
|
-
* .map(() => ({ success: true }));
|
|
644
|
+
* return sendTransaction(plan);
|
|
531
645
|
*
|
|
532
646
|
* case 'SwapCancelled':
|
|
533
647
|
* return okAsync(plan);
|
|
@@ -541,7 +655,6 @@ declare function prepareSwapCancel(client: AaveClient, request: PrepareSwapCance
|
|
|
541
655
|
*/
|
|
542
656
|
declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): ResultAsync<CancelSwapExecutionPlan, UnexpectedError>;
|
|
543
657
|
/**
|
|
544
|
-
* @internal
|
|
545
658
|
* Fetches the user's swap history for a specific chain.
|
|
546
659
|
*
|
|
547
660
|
* ```ts
|
|
@@ -557,7 +670,7 @@ declare function cancelSwap(client: AaveClient, request: CancelSwapRequest): Res
|
|
|
557
670
|
* @param options - The query options.
|
|
558
671
|
* @returns The paginated list of user swaps with their status information.
|
|
559
672
|
*/
|
|
560
|
-
declare function userSwaps(client: AaveClient, request: UserSwapsRequest,
|
|
673
|
+
declare function userSwaps(client: AaveClient, request: UserSwapsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedUserSwapsResult, UnexpectedError>;
|
|
561
674
|
|
|
562
675
|
/**
|
|
563
676
|
* Creates a transaction to borrow from a market.
|
|
@@ -578,7 +691,7 @@ declare function userSwaps(client: AaveClient, request: UserSwapsRequest, option
|
|
|
578
691
|
* return;
|
|
579
692
|
* }
|
|
580
693
|
*
|
|
581
|
-
* // result.value:
|
|
694
|
+
* // result.value: TransactionReceipt
|
|
582
695
|
* ```
|
|
583
696
|
*
|
|
584
697
|
* @param client - Aave client.
|
|
@@ -610,7 +723,7 @@ declare function borrow(client: AaveClient, request: BorrowRequest): ResultAsync
|
|
|
610
723
|
* return;
|
|
611
724
|
* }
|
|
612
725
|
*
|
|
613
|
-
* // result.value:
|
|
726
|
+
* // result.value: TransactionReceipt
|
|
614
727
|
* ```
|
|
615
728
|
*
|
|
616
729
|
* @param client - Aave client.
|
|
@@ -639,7 +752,7 @@ declare function supply(client: AaveClient, request: SupplyRequest): ResultAsync
|
|
|
639
752
|
* return;
|
|
640
753
|
* }
|
|
641
754
|
*
|
|
642
|
-
* // result.value:
|
|
755
|
+
* // result.value: TransactionReceipt
|
|
643
756
|
* ```
|
|
644
757
|
*
|
|
645
758
|
* @param client - Aave client.
|
|
@@ -666,7 +779,7 @@ declare function repay(client: AaveClient, request: RepayRequest): ResultAsync<E
|
|
|
666
779
|
* return;
|
|
667
780
|
* }
|
|
668
781
|
*
|
|
669
|
-
* // result.value:
|
|
782
|
+
* // result.value: TransactionReceipt
|
|
670
783
|
* ```
|
|
671
784
|
*
|
|
672
785
|
* **Withdraw specific amount:**
|
|
@@ -714,7 +827,7 @@ declare function withdraw(client: AaveClient, request: WithdrawRequest): ResultA
|
|
|
714
827
|
* return;
|
|
715
828
|
* }
|
|
716
829
|
*
|
|
717
|
-
* // result.value:
|
|
830
|
+
* // result.value: TransactionReceipt
|
|
718
831
|
* ```
|
|
719
832
|
*
|
|
720
833
|
*
|
|
@@ -724,35 +837,12 @@ declare function withdraw(client: AaveClient, request: WithdrawRequest): ResultA
|
|
|
724
837
|
*/
|
|
725
838
|
declare function renounceSpokeUserPositionManager(client: AaveClient, request: RenounceSpokeUserPositionManagerRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
726
839
|
/**
|
|
727
|
-
* Creates a transaction to update user dynamic config
|
|
728
|
-
*
|
|
729
|
-
* ```ts
|
|
730
|
-
* const result = await updateUserDynamicConfig(client, {
|
|
731
|
-
* sender: evmAddress('0x9abc…'),
|
|
732
|
-
* spoke: spokeId('SGVsbG8h'),
|
|
733
|
-
* }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
|
|
734
|
-
*
|
|
735
|
-
* if (result.isErr()) {
|
|
736
|
-
* // Handle error
|
|
737
|
-
* return;
|
|
738
|
-
* }
|
|
739
|
-
*
|
|
740
|
-
* // result.value: TxHash
|
|
741
|
-
* ```
|
|
742
|
-
*
|
|
743
|
-
*
|
|
744
|
-
* @param client - Aave client.
|
|
745
|
-
* @param request - The update user dynamic config request parameters.
|
|
746
|
-
* @returns The transaction data.
|
|
747
|
-
*/
|
|
748
|
-
declare function updateUserDynamicConfig(client: AaveClient, request: UpdateUserDynamicConfigRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
749
|
-
/**
|
|
750
|
-
* Creates a transaction to update user risk premium for a specific spoke.
|
|
840
|
+
* Creates a transaction to update user position conditions (dynamic config and/or risk premium).
|
|
751
841
|
*
|
|
752
842
|
* ```ts
|
|
753
|
-
* const result = await
|
|
754
|
-
*
|
|
755
|
-
*
|
|
843
|
+
* const result = await updateUserPositionConditions(client, {
|
|
844
|
+
* userPositionId: userPositionId('SGVsbG8h'),
|
|
845
|
+
* update: UserPositionConditionsUpdate.AllDynamicConfig,
|
|
756
846
|
* }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
|
|
757
847
|
*
|
|
758
848
|
* if (result.isErr()) {
|
|
@@ -760,15 +850,15 @@ declare function updateUserDynamicConfig(client: AaveClient, request: UpdateUser
|
|
|
760
850
|
* return;
|
|
761
851
|
* }
|
|
762
852
|
*
|
|
763
|
-
* // result.value:
|
|
853
|
+
* // result.value: TransactionReceipt
|
|
764
854
|
* ```
|
|
765
855
|
*
|
|
766
856
|
*
|
|
767
857
|
* @param client - Aave client.
|
|
768
|
-
* @param request - The update user
|
|
858
|
+
* @param request - The update user position conditions request parameters.
|
|
769
859
|
* @returns The transaction data.
|
|
770
860
|
*/
|
|
771
|
-
declare function
|
|
861
|
+
declare function updateUserPositionConditions(client: AaveClient, request: UpdateUserPositionConditionsRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
772
862
|
/**
|
|
773
863
|
* Creates a transaction to liquidate a user's position.
|
|
774
864
|
*
|
|
@@ -777,7 +867,7 @@ declare function updateUserRiskPremium(client: AaveClient, request: UpdateUserRi
|
|
|
777
867
|
* collateral: reserveId('SGVsbG8h'),
|
|
778
868
|
* debt: reserveId('Q2lhbyE= '),
|
|
779
869
|
* amount: {
|
|
780
|
-
* exact: bigDecimal('1000'),
|
|
870
|
+
* exact: { value: bigDecimal('1000') },
|
|
781
871
|
* },
|
|
782
872
|
* liquidator: evmAddress('0x9abc…'),
|
|
783
873
|
* user: evmAddress('0xdef0…'),
|
|
@@ -788,7 +878,7 @@ declare function updateUserRiskPremium(client: AaveClient, request: UpdateUserRi
|
|
|
788
878
|
* return;
|
|
789
879
|
* }
|
|
790
880
|
*
|
|
791
|
-
* // result.value:
|
|
881
|
+
* // result.value: TransactionReceipt
|
|
792
882
|
* ```
|
|
793
883
|
*
|
|
794
884
|
* @param client - Aave client.
|
|
@@ -827,7 +917,7 @@ declare function liquidatePosition(client: AaveClient, request: LiquidatePositio
|
|
|
827
917
|
* return;
|
|
828
918
|
* }
|
|
829
919
|
*
|
|
830
|
-
* // result.value:
|
|
920
|
+
* // result.value: TransactionReceipt
|
|
831
921
|
* ```
|
|
832
922
|
*
|
|
833
923
|
* @param client - Aave client.
|
|
@@ -859,23 +949,48 @@ declare function setSpokeUserPositionManager(client: AaveClient, request: SetSpo
|
|
|
859
949
|
* @param options - The query options.
|
|
860
950
|
* @returns The preview result showing position changes.
|
|
861
951
|
*/
|
|
862
|
-
declare function preview(client: AaveClient, request: PreviewRequest,
|
|
952
|
+
declare function preview(client: AaveClient, request: PreviewRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<PreviewUserPosition, UnexpectedError>;
|
|
863
953
|
/**
|
|
864
|
-
*
|
|
954
|
+
* Updates the collateral status of user's supplies.
|
|
865
955
|
*
|
|
866
956
|
* ```ts
|
|
867
|
-
* const result = await
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
957
|
+
* const result = await setUserSuppliesAsCollateral(client, {
|
|
958
|
+
* changes: [
|
|
959
|
+
* {
|
|
960
|
+
* reserve: reserveId('SGVsbG8h'),
|
|
961
|
+
* enableCollateral: true
|
|
962
|
+
* }
|
|
963
|
+
* ],
|
|
964
|
+
* sender: evmAddress('0x456...')
|
|
871
965
|
* });
|
|
872
966
|
* ```
|
|
873
967
|
*
|
|
874
968
|
* @param client - Aave client.
|
|
875
|
-
* @param request - The
|
|
876
|
-
* @returns The transaction request to
|
|
969
|
+
* @param request - The request parameters.
|
|
970
|
+
* @returns The transaction request to update collateral status.
|
|
877
971
|
*/
|
|
878
|
-
declare function
|
|
972
|
+
declare function setUserSuppliesAsCollateral(client: AaveClient, request: SetUserSuppliesAsCollateralRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
973
|
+
/**
|
|
974
|
+
* Creates a transaction to claim rewards.
|
|
975
|
+
*
|
|
976
|
+
* ```ts
|
|
977
|
+
* const result = await claimRewards(client, {
|
|
978
|
+
* ids: [rewardId('abc123')],
|
|
979
|
+
* });
|
|
980
|
+
*
|
|
981
|
+
* if (result.isErr()) {
|
|
982
|
+
* // Handle error
|
|
983
|
+
* return;
|
|
984
|
+
* }
|
|
985
|
+
*
|
|
986
|
+
* // result.value: TransactionRequest
|
|
987
|
+
* ```
|
|
988
|
+
*
|
|
989
|
+
* @param client - Aave client.
|
|
990
|
+
* @param request - The claim rewards request parameters.
|
|
991
|
+
* @returns The transaction request to claim rewards.
|
|
992
|
+
*/
|
|
993
|
+
declare function claimRewards(client: AaveClient, request: ClaimRewardsRequest): ResultAsync<TransactionRequest, UnexpectedError>;
|
|
879
994
|
/**
|
|
880
995
|
* Fetches paginated list of activities.
|
|
881
996
|
*
|
|
@@ -894,7 +1009,7 @@ declare function setUserSupplyAsCollateral(client: AaveClient, request: SetUserS
|
|
|
894
1009
|
* @param options - The query options.
|
|
895
1010
|
* @returns The paginated list of activities.
|
|
896
1011
|
*/
|
|
897
|
-
declare function activities(client: AaveClient, request: ActivitiesRequest,
|
|
1012
|
+
declare function activities(client: AaveClient, request: ActivitiesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<PaginatedActivitiesResult, UnexpectedError>;
|
|
898
1013
|
|
|
899
1014
|
/**
|
|
900
1015
|
* Fetches all user supply positions across the specified spoke.
|
|
@@ -916,7 +1031,7 @@ declare function activities(client: AaveClient, request: ActivitiesRequest, opti
|
|
|
916
1031
|
* @param options - The query options.
|
|
917
1032
|
* @returns The user's supply positions.
|
|
918
1033
|
*/
|
|
919
|
-
declare function userSupplies(client: AaveClient, request: UserSuppliesRequest,
|
|
1034
|
+
declare function userSupplies(client: AaveClient, request: UserSuppliesRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserSupplyItem[], UnexpectedError>;
|
|
920
1035
|
/**
|
|
921
1036
|
* Fetches all user borrow positions across the specified spoke.
|
|
922
1037
|
*
|
|
@@ -937,8 +1052,8 @@ declare function userSupplies(client: AaveClient, request: UserSuppliesRequest,
|
|
|
937
1052
|
* @param options - The query options.
|
|
938
1053
|
* @returns The user's borrow positions.
|
|
939
1054
|
*/
|
|
940
|
-
declare function userBorrows(client: AaveClient, request: UserBorrowsRequest,
|
|
941
|
-
type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions>;
|
|
1055
|
+
declare function userBorrows(client: AaveClient, request: UserBorrowsRequest, { currency, timeWindow, requestPolicy, }?: CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions): ResultAsync<UserBorrowItem[], UnexpectedError>;
|
|
1056
|
+
type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions>;
|
|
942
1057
|
/**
|
|
943
1058
|
* Fetches a user's summary across all positions.
|
|
944
1059
|
*
|
|
@@ -956,8 +1071,8 @@ type UserSummaryQueryOptions = Prettify<CurrencyQueryOptions & TimeWindowQueryOp
|
|
|
956
1071
|
* @param options - The query options.
|
|
957
1072
|
* @returns The user's financial summary.
|
|
958
1073
|
*/
|
|
959
|
-
declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
|
|
960
|
-
type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
|
|
1074
|
+
declare function userSummary(client: AaveClient, request: UserSummaryRequest, { currency, timeWindow, requestPolicy, }?: UserSummaryQueryOptions): ResultAsync<UserSummary, UnexpectedError>;
|
|
1075
|
+
type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions & RequestPolicyOptions;
|
|
961
1076
|
/**
|
|
962
1077
|
* Fetches all user positions across specified chains.
|
|
963
1078
|
*
|
|
@@ -976,7 +1091,7 @@ type UserPositionQueryOptions = CurrencyQueryOptions & TimeWindowQueryOptions;
|
|
|
976
1091
|
* @param options - The query options.
|
|
977
1092
|
* @returns The user's positions across all specified chains.
|
|
978
1093
|
*/
|
|
979
|
-
declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
|
|
1094
|
+
declare function userPositions(client: AaveClient, request: UserPositionsRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition[], UnexpectedError>;
|
|
980
1095
|
/**
|
|
981
1096
|
* Fetches a specific user position by ID.
|
|
982
1097
|
*
|
|
@@ -991,7 +1106,7 @@ declare function userPositions(client: AaveClient, request: UserPositionsRequest
|
|
|
991
1106
|
* @param options - The query options.
|
|
992
1107
|
* @returns The specific user position or null if not found.
|
|
993
1108
|
*/
|
|
994
|
-
declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
|
|
1109
|
+
declare function userPosition(client: AaveClient, request: UserPositionRequest, { currency, timeWindow, requestPolicy, }?: UserPositionQueryOptions): ResultAsync<UserPosition | null, UnexpectedError>;
|
|
995
1110
|
/**
|
|
996
1111
|
* Fetches all user balances across specified chains.
|
|
997
1112
|
*
|
|
@@ -1009,7 +1124,7 @@ declare function userPosition(client: AaveClient, request: UserPositionRequest,
|
|
|
1009
1124
|
* @param options - The query options.
|
|
1010
1125
|
* @returns The user's balances across all specified chains.
|
|
1011
1126
|
**/
|
|
1012
|
-
declare function userBalances(client: AaveClient, request: UserBalancesRequest,
|
|
1127
|
+
declare function userBalances(client: AaveClient, request: UserBalancesRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserBalance[], UnexpectedError>;
|
|
1013
1128
|
/**
|
|
1014
1129
|
* Fetches user summary history over time.
|
|
1015
1130
|
*
|
|
@@ -1028,6 +1143,24 @@ declare function userBalances(client: AaveClient, request: UserBalancesRequest,
|
|
|
1028
1143
|
* @param options - The query options.
|
|
1029
1144
|
* @returns The user summary history items.
|
|
1030
1145
|
*/
|
|
1031
|
-
declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest,
|
|
1146
|
+
declare function userSummaryHistory(client: AaveClient, request: UserSummaryHistoryRequest, { currency, requestPolicy, }?: CurrencyQueryOptions & RequestPolicyOptions): ResultAsync<UserSummaryHistoryItem[], UnexpectedError>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Fetches the risk premium breakdown for a user position or spoke.
|
|
1149
|
+
*
|
|
1150
|
+
* ```ts
|
|
1151
|
+
* const result = await userRiskPremiumBreakdown(client, {
|
|
1152
|
+
* query: {
|
|
1153
|
+
* userPositionId: userPositionId('SGVsbG8h'),
|
|
1154
|
+
* },
|
|
1155
|
+
* user: evmAddress('0x742d35cc…'),
|
|
1156
|
+
* });
|
|
1157
|
+
* ```
|
|
1158
|
+
*
|
|
1159
|
+
* @param client - Aave client.
|
|
1160
|
+
* @param request - The user risk premium breakdown request parameters.
|
|
1161
|
+
* @param options - The query options.
|
|
1162
|
+
* @returns Array of risk premium breakdown items.
|
|
1163
|
+
*/
|
|
1164
|
+
declare function userRiskPremiumBreakdown(client: AaveClient, request: UserRiskPremiumBreakdownRequest, { requestPolicy, }?: RequestPolicyOptions): ResultAsync<UserRiskPremiumBreakdownItem[], UnexpectedError>;
|
|
1032
1165
|
|
|
1033
|
-
export { type SwapOutcome, type UserPositionQueryOptions, type UserSummaryQueryOptions, activities, asset, assetBorrowHistory, assetPriceHistory, assetSupplyHistory, borrow, borrowApyHistory, cancelSwap, chain, chains, exchangeRate, hasProcessedKnownTransaction, hub, hubAssets, hubs, liquidatePosition,
|
|
1166
|
+
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, supply, supplyApyHistory, supplySwapQuote, swap, swapStatus, swappableTokens, tokenSwapQuote, updateUserPositionConditions, userBalances, userBorrows, userClaimableRewards, userPosition, userPositions, userRiskPremiumBreakdown, userSummary, userSummaryHistory, userSupplies, userSwaps, waitForSwapOutcome, withdraw, withdrawSwapQuote };
|