@aave/react 4.0.0-next.13 → 4.0.0-next.15
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/{chunk-7FNJZJRF.js → chunk-YGW2LSLM.js} +2 -2
- package/dist/{chunk-7FNJZJRF.js.map → chunk-YGW2LSLM.js.map} +1 -1
- package/dist/{chunk-IESN2WLA.js → chunk-YPQBKWEA.js} +2 -2
- package/dist/chunk-YPQBKWEA.js.map +1 -0
- package/dist/ethers.cjs +1 -1
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +4 -4
- package/dist/ethers.d.ts +4 -4
- package/dist/ethers.js +1 -1
- package/dist/ethers.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -83
- package/dist/index.d.ts +40 -83
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{misc-BbkH5nn7.d.cts → misc-Bqd-LTM7.d.cts} +1 -1
- package/dist/{misc-Cza-qIHo.d.ts → misc-DrMxWliM.d.ts} +1 -1
- package/dist/privy.cjs +1 -1
- package/dist/privy.cjs.map +1 -1
- package/dist/privy.d.cts +4 -4
- package/dist/privy.d.ts +4 -4
- package/dist/privy.js +1 -1
- package/dist/privy.js.map +1 -1
- package/dist/thirdweb.cjs +1 -1
- package/dist/thirdweb.cjs.map +1 -1
- package/dist/thirdweb.d.cts +4 -4
- package/dist/thirdweb.d.ts +4 -4
- package/dist/thirdweb.js +1 -1
- package/dist/thirdweb.js.map +1 -1
- package/dist/viem/index.cjs +1 -1
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +5 -5
- package/dist/viem/index.d.ts +5 -5
- package/dist/viem/index.js +1 -1
- package/dist/viem/index.js.map +1 -1
- package/dist/{writes-K_-o9pPN.d.cts → writes-YQQTp7E5.d.cts} +4 -0
- package/dist/{writes-K_-o9pPN.d.ts → writes-YQQTp7E5.d.ts} +4 -0
- package/package.json +5 -5
- package/dist/chunk-IESN2WLA.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AaveClient, CurrencyQueryOptions, TimeWindowQueryOptions, UnexpectedError, ValidationError, ActivitiesRequest, PaginatedActivitiesResult } from '@aave/client';
|
|
2
2
|
export * from '@aave/client';
|
|
3
3
|
import React, { ReactNode } from 'react';
|
|
4
|
-
import { a as UseAsyncTask, C as CancelOperation, P as PendingTransaction, S as SendTransactionError, b as PendingTransactionError, T as TransactionHandler } from './writes-
|
|
5
|
-
export { A as AsyncTaskError, c as AsyncTaskIdle, d as AsyncTaskLoading, e as AsyncTaskState, f as AsyncTaskSuccess, g as TransactionHandlerOptions, U as UseSendTransactionResult } from './writes-
|
|
6
|
-
import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, HubSummaryHistoryRequest, HubSummarySample, PermitRequest, PermitTypedDataResponse, AssetRequest, Asset, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, AssetBorrowHistoryRequest, AssetBorrowSample, ProtocolHistoryRequest, ProtocolHistorySample, ReserveRequest, Reserve, ReservesRequest, BorrowApyHistoryRequest, ApySample, SupplyApyHistoryRequest, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult,
|
|
4
|
+
import { a as UseAsyncTask, C as CancelOperation, P as PendingTransaction, S as SendTransactionError, b as PendingTransactionError, T as TransactionHandler } from './writes-YQQTp7E5.js';
|
|
5
|
+
export { A as AsyncTaskError, c as AsyncTaskIdle, d as AsyncTaskLoading, e as AsyncTaskState, f as AsyncTaskSuccess, g as TransactionHandlerOptions, U as UseSendTransactionResult } from './writes-YQQTp7E5.js';
|
|
6
|
+
import { HubRequest, Hub, HubsRequest, HubAssetsRequest, HubAsset, HubSummaryHistoryRequest, HubSummarySample, PermitRequest, PermitTypedDataResponse, AssetRequest, Asset, AssetPriceHistoryRequest, AssetPriceSample, AssetSupplyHistoryRequest, AssetSupplySample, AssetBorrowHistoryRequest, AssetBorrowSample, ProtocolHistoryRequest, ProtocolHistorySample, ReserveRequest, Reserve, ReservesRequest, BorrowApyHistoryRequest, ApySample, SupplyApyHistoryRequest, SpokeRequest, Spoke, SpokesRequest, SpokePositionManagersRequest, PaginatedSpokePositionManagerResult, SpokeUserPositionManagersRequest, PaginatedSpokeUserPositionManagerResult, MarketOrderTokenSwapQuoteInput, SwapQuote, SwappableTokensRequest, Token, UserSwapsRequest, PaginatedUserSwapsResult, SupplySwapQuoteRequest, BorrowSwapQuoteRequest, TransactionRequest, PositionSwapApproval, SwapByIntent, SwapReceipt, InsufficientBalanceError, RepayWithSupplyQuoteRequest, WithdrawSwapQuoteRequest, TokenSwapQuoteRequest, SwapTypedData, Erc20Approval, SwapTransactionRequest, ERC20PermitSignature, PrepareSwapCancelRequest, SwapCancelled, SupplyRequest, BorrowRequest, RepayRequest, WithdrawRequest, RenounceSpokeUserPositionManagerRequest, UpdateUserPositionConditionsRequest, SetUserSuppliesAsCollateralRequest, LiquidatePositionRequest, SetSpokeUserPositionManagerRequest, PreviewRequest, PreviewUserPosition, UserSuppliesRequest, UserSupplyItem, UserBorrowsRequest, UserBorrowItem, UserSummaryRequest, UserSummary, UserPositionsRequest, UserPosition, UserPositionRequest, UserBalancesRequest, UserBalance, UserRiskPremiumBreakdownRequest, UserRiskPremiumBreakdownItem, UserSummaryHistoryRequest, UserSummaryHistoryItem } from '@aave/graphql';
|
|
7
7
|
import { Prettify, Signature, ResultAsync, ResultAwareError, TxHash } from '@aave/types';
|
|
8
|
-
import { S as Suspendable, a as SuspenseResult, P as Pausable, b as PausableSuspenseResult, R as ReadResult, c as PausableReadResult, d as Selector } from './misc-
|
|
9
|
-
export { e as UseChainArgs, f as UseChainsArgs, i as UseExchangeRateArgs, U as UseNetworkFee, l as UseNetworkFeeArgs, k as UseNetworkFeeRequestQuery, u as useChain, g as useChains, j as useExchangeRate, h as useExchangeRateAction } from './misc-
|
|
8
|
+
import { S as Suspendable, a as SuspenseResult, P as Pausable, b as PausableSuspenseResult, R as ReadResult, c as PausableReadResult, d as Selector } from './misc-DrMxWliM.js';
|
|
9
|
+
export { e as UseChainArgs, f as UseChainsArgs, i as UseExchangeRateArgs, U as UseNetworkFee, l as UseNetworkFeeArgs, k as UseNetworkFeeRequestQuery, u as useChain, g as useChains, j as useExchangeRate, h as useExchangeRateAction } from './misc-DrMxWliM.js';
|
|
10
10
|
import { UnexpectedError as UnexpectedError$1, CancelError, SigningError, TimeoutError, TransactionError, ValidationError as ValidationError$1 } from '@aave/core';
|
|
11
11
|
import { UserPositionQueryOptions } from '@aave/client/actions';
|
|
12
12
|
|
|
@@ -647,7 +647,7 @@ declare function useReserve(args: Pausable<UseReserveArgs>): PausableReadResult<
|
|
|
647
647
|
* }
|
|
648
648
|
* ```
|
|
649
649
|
*/
|
|
650
|
-
declare function useReserveAction(options?:
|
|
650
|
+
declare function useReserveAction(options?: CurrencyQueryOptions & TimeWindowQueryOptions): UseAsyncTask<ReserveRequest, Reserve | null, UnexpectedError>;
|
|
651
651
|
type UseReservesArgs<T = Reserve[]> = Prettify<ReservesRequest & CurrencyQueryOptions & TimeWindowQueryOptions & {
|
|
652
652
|
/**
|
|
653
653
|
* A function that maps the full list of reserves
|
|
@@ -847,7 +847,7 @@ declare function useReserves<T = Reserve[]>(args: Pausable<UseReservesArgs<T>>):
|
|
|
847
847
|
* }
|
|
848
848
|
* ```
|
|
849
849
|
*/
|
|
850
|
-
declare function useReservesAction(options?:
|
|
850
|
+
declare function useReservesAction(options?: CurrencyQueryOptions & TimeWindowQueryOptions): UseAsyncTask<ReservesRequest, Reserve[], UnexpectedError>;
|
|
851
851
|
type UseBorrowApyHistoryArgs = BorrowApyHistoryRequest;
|
|
852
852
|
/**
|
|
853
853
|
* Fetch borrow APY history for a specific reserve over time.
|
|
@@ -1170,15 +1170,14 @@ declare function useSpokeUserPositionManagers(args: UseSpokeUserPositionManagers
|
|
|
1170
1170
|
*/
|
|
1171
1171
|
declare function useSpokeUserPositionManagers(args: Pausable<UseSpokeUserPositionManagersArgs>): PausableReadResult<PaginatedSpokeUserPositionManagerResult>;
|
|
1172
1172
|
|
|
1173
|
-
type
|
|
1173
|
+
type UseTokenSwapQuoteArgs = Prettify<MarketOrderTokenSwapQuoteInput & CurrencyQueryOptions>;
|
|
1174
1174
|
/**
|
|
1175
|
-
* @experimental
|
|
1176
1175
|
* Fetch a swap quote for the specified trade parameters.
|
|
1177
1176
|
*
|
|
1178
1177
|
* This signature supports React Suspense:
|
|
1179
1178
|
*
|
|
1180
1179
|
* ```tsx
|
|
1181
|
-
* const { data } =
|
|
1180
|
+
* const { data } = useTokenSwapQuote({
|
|
1182
1181
|
* chainId: chainId(1),
|
|
1183
1182
|
* buy: { erc20: evmAddress('0xA0b86a33E6…') },
|
|
1184
1183
|
* sell: { erc20: evmAddress('0x6B175474E…') },
|
|
@@ -1188,15 +1187,14 @@ type UseSwapQuoteArgs = Prettify<SwapQuoteRequest & CurrencyQueryOptions>;
|
|
|
1188
1187
|
* });
|
|
1189
1188
|
* ```
|
|
1190
1189
|
*/
|
|
1191
|
-
declare function
|
|
1190
|
+
declare function useTokenSwapQuote(args: UseTokenSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
|
|
1192
1191
|
/**
|
|
1193
|
-
* @experimental
|
|
1194
1192
|
* Fetch a swap quote for the specified trade parameters.
|
|
1195
1193
|
*
|
|
1196
1194
|
* Pausable suspense mode.
|
|
1197
1195
|
*
|
|
1198
1196
|
* ```tsx
|
|
1199
|
-
* const { data } =
|
|
1197
|
+
* const { data } = useTokenSwapQuote({
|
|
1200
1198
|
* chainId: chainId(1),
|
|
1201
1199
|
* buy: { erc20: evmAddress('0xA0b86a33E6…') },
|
|
1202
1200
|
* sell: { erc20: evmAddress('0x6B175474E…') },
|
|
@@ -1208,13 +1206,12 @@ declare function useSwapQuote(args: UseSwapQuoteArgs & Suspendable): SuspenseRes
|
|
|
1208
1206
|
* });
|
|
1209
1207
|
* ```
|
|
1210
1208
|
*/
|
|
1211
|
-
declare function
|
|
1209
|
+
declare function useTokenSwapQuote(args: Pausable<UseTokenSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
|
|
1212
1210
|
/**
|
|
1213
|
-
* @experimental
|
|
1214
1211
|
* Fetch a swap quote for the specified trade parameters.
|
|
1215
1212
|
*
|
|
1216
1213
|
* ```tsx
|
|
1217
|
-
* const { data, error, loading } =
|
|
1214
|
+
* const { data, error, loading } = useTokenSwapQuote({
|
|
1218
1215
|
* chainId: chainId(1),
|
|
1219
1216
|
* buy: { erc20: evmAddress('0xA0b86a33E6…') },
|
|
1220
1217
|
* sell: { erc20: evmAddress('0x6B175474E…') },
|
|
@@ -1223,15 +1220,14 @@ declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs> & Suspendable): P
|
|
|
1223
1220
|
* });
|
|
1224
1221
|
* ```
|
|
1225
1222
|
*/
|
|
1226
|
-
declare function
|
|
1223
|
+
declare function useTokenSwapQuote(args: UseTokenSwapQuoteArgs): ReadResult<SwapQuote>;
|
|
1227
1224
|
/**
|
|
1228
|
-
* @experimental
|
|
1229
1225
|
* Fetch a swap quote for the specified trade parameters.
|
|
1230
1226
|
*
|
|
1231
1227
|
* Pausable loading state mode.
|
|
1232
1228
|
*
|
|
1233
1229
|
* ```tsx
|
|
1234
|
-
* const { data, error, loading, paused } =
|
|
1230
|
+
* const { data, error, loading, paused } = useTokenSwapQuote({
|
|
1235
1231
|
* chainId: chainId(1),
|
|
1236
1232
|
* buy: { erc20: evmAddress('0xA0b86a33E6…') },
|
|
1237
1233
|
* sell: { erc20: evmAddress('0x6B175474E…') },
|
|
@@ -1242,19 +1238,17 @@ declare function useSwapQuote(args: UseSwapQuoteArgs): ReadResult<SwapQuote>;
|
|
|
1242
1238
|
* });
|
|
1243
1239
|
* ```
|
|
1244
1240
|
*/
|
|
1245
|
-
declare function
|
|
1241
|
+
declare function useTokenSwapQuote(args: Pausable<UseTokenSwapQuoteArgs>): PausableReadResult<SwapQuote>;
|
|
1246
1242
|
/**
|
|
1247
|
-
* @experimental
|
|
1248
1243
|
* Low-level hook to execute a swap quote action directly.
|
|
1249
1244
|
*
|
|
1250
|
-
* @experimental This hook is experimental and may be subject to breaking changes.
|
|
1251
1245
|
* @remarks
|
|
1252
1246
|
* This hook **does not** actively watch for updated data on the swap quote.
|
|
1253
1247
|
* Use this hook to retrieve quotes on demand as part of a larger workflow
|
|
1254
1248
|
* (e.g., in an event handler to get a fresh quote before executing a swap).
|
|
1255
1249
|
*
|
|
1256
1250
|
* ```ts
|
|
1257
|
-
* const [getQuote, { called, data, error, loading }] =
|
|
1251
|
+
* const [getQuote, { called, data, error, loading }] = useTokenSwapQuoteAction();
|
|
1258
1252
|
*
|
|
1259
1253
|
* // …
|
|
1260
1254
|
*
|
|
@@ -1273,10 +1267,9 @@ declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs>): PausableReadRes
|
|
|
1273
1267
|
* }
|
|
1274
1268
|
* ```
|
|
1275
1269
|
*/
|
|
1276
|
-
declare function
|
|
1270
|
+
declare function useTokenSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<MarketOrderTokenSwapQuoteInput, SwapQuote, UnexpectedError$1>;
|
|
1277
1271
|
type UseSwappableTokensArgs = SwappableTokensRequest;
|
|
1278
1272
|
/**
|
|
1279
|
-
* @experimental
|
|
1280
1273
|
* Fetch the list of tokens available for swapping on a specific chain.
|
|
1281
1274
|
*
|
|
1282
1275
|
* This signature supports React Suspense:
|
|
@@ -1290,7 +1283,6 @@ type UseSwappableTokensArgs = SwappableTokensRequest;
|
|
|
1290
1283
|
*/
|
|
1291
1284
|
declare function useSwappableTokens(args: UseSwappableTokensArgs & Suspendable): SuspenseResult<Token[]>;
|
|
1292
1285
|
/**
|
|
1293
|
-
* @experimental
|
|
1294
1286
|
* Fetch the list of tokens available for swapping on a specific chain.
|
|
1295
1287
|
*
|
|
1296
1288
|
* Pausable suspense mode.
|
|
@@ -1305,7 +1297,6 @@ declare function useSwappableTokens(args: UseSwappableTokensArgs & Suspendable):
|
|
|
1305
1297
|
*/
|
|
1306
1298
|
declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs> & Suspendable): PausableSuspenseResult<Token[]>;
|
|
1307
1299
|
/**
|
|
1308
|
-
* @experimental
|
|
1309
1300
|
* Fetch the list of tokens available for swapping on a specific chain.
|
|
1310
1301
|
*
|
|
1311
1302
|
* ```tsx
|
|
@@ -1316,7 +1307,6 @@ declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs> & Sus
|
|
|
1316
1307
|
*/
|
|
1317
1308
|
declare function useSwappableTokens(args: UseSwappableTokensArgs): ReadResult<Token[]>;
|
|
1318
1309
|
/**
|
|
1319
|
-
* @experimental
|
|
1320
1310
|
* Fetch the list of tokens available for swapping on a specific chain.
|
|
1321
1311
|
*
|
|
1322
1312
|
* Pausable loading state mode.
|
|
@@ -1329,9 +1319,8 @@ declare function useSwappableTokens(args: UseSwappableTokensArgs): ReadResult<To
|
|
|
1329
1319
|
* ```
|
|
1330
1320
|
*/
|
|
1331
1321
|
declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs>): PausableReadResult<Token[]>;
|
|
1332
|
-
type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions>;
|
|
1322
|
+
type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
|
|
1333
1323
|
/**
|
|
1334
|
-
* @experimental
|
|
1335
1324
|
* Fetch the user's swap history for a specific chain.
|
|
1336
1325
|
*
|
|
1337
1326
|
* This signature supports React Suspense:
|
|
@@ -1347,7 +1336,6 @@ type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions>;
|
|
|
1347
1336
|
*/
|
|
1348
1337
|
declare function useUserSwaps(args: UseUserSwapsArgs & Suspendable): SuspenseResult<PaginatedUserSwapsResult>;
|
|
1349
1338
|
/**
|
|
1350
|
-
* @experimental
|
|
1351
1339
|
* Fetch the user's swap history for a specific chain.
|
|
1352
1340
|
*
|
|
1353
1341
|
* Pausable suspense mode.
|
|
@@ -1364,7 +1352,6 @@ declare function useUserSwaps(args: UseUserSwapsArgs & Suspendable): SuspenseRes
|
|
|
1364
1352
|
*/
|
|
1365
1353
|
declare function useUserSwaps(args: Pausable<UseUserSwapsArgs> & Suspendable): PausableSuspenseResult<PaginatedUserSwapsResult>;
|
|
1366
1354
|
/**
|
|
1367
|
-
* @experimental
|
|
1368
1355
|
* Fetch the user's swap history for a specific chain.
|
|
1369
1356
|
*
|
|
1370
1357
|
* ```tsx
|
|
@@ -1377,7 +1364,6 @@ declare function useUserSwaps(args: Pausable<UseUserSwapsArgs> & Suspendable): P
|
|
|
1377
1364
|
*/
|
|
1378
1365
|
declare function useUserSwaps(args: UseUserSwapsArgs): ReadResult<PaginatedUserSwapsResult>;
|
|
1379
1366
|
/**
|
|
1380
|
-
* @experimental
|
|
1381
1367
|
* Fetch the user's swap history for a specific chain.
|
|
1382
1368
|
*
|
|
1383
1369
|
* Pausable loading state mode.
|
|
@@ -1392,9 +1378,8 @@ declare function useUserSwaps(args: UseUserSwapsArgs): ReadResult<PaginatedUserS
|
|
|
1392
1378
|
* ```
|
|
1393
1379
|
*/
|
|
1394
1380
|
declare function useUserSwaps(args: Pausable<UseUserSwapsArgs>): PausableReadResult<PaginatedUserSwapsResult>;
|
|
1395
|
-
type UseSupplySwapQuoteArgs = Prettify<
|
|
1381
|
+
type UseSupplySwapQuoteArgs = Prettify<SupplySwapQuoteRequest & CurrencyQueryOptions>;
|
|
1396
1382
|
/**
|
|
1397
|
-
* @experimental
|
|
1398
1383
|
* Fetch a quote for a supply swap operation with the specified parameters.
|
|
1399
1384
|
*
|
|
1400
1385
|
* This signature supports React Suspense:
|
|
@@ -1413,7 +1398,6 @@ type UseSupplySwapQuoteArgs = Prettify<PrepareSupplySwapRequest & CurrencyQueryO
|
|
|
1413
1398
|
*/
|
|
1414
1399
|
declare function useSupplySwapQuote(args: UseSupplySwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
|
|
1415
1400
|
/**
|
|
1416
|
-
* @experimental
|
|
1417
1401
|
* Fetch a quote for a supply swap operation with the specified parameters.
|
|
1418
1402
|
*
|
|
1419
1403
|
* Pausable suspense mode.
|
|
@@ -1433,7 +1417,6 @@ declare function useSupplySwapQuote(args: UseSupplySwapQuoteArgs & Suspendable):
|
|
|
1433
1417
|
*/
|
|
1434
1418
|
declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
|
|
1435
1419
|
/**
|
|
1436
|
-
* @experimental
|
|
1437
1420
|
* Fetch a quote for a supply swap operation with the specified parameters.
|
|
1438
1421
|
*
|
|
1439
1422
|
* ```tsx
|
|
@@ -1449,7 +1432,6 @@ declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs> & Sus
|
|
|
1449
1432
|
*/
|
|
1450
1433
|
declare function useSupplySwapQuote(args: UseSupplySwapQuoteArgs): ReadResult<SwapQuote>;
|
|
1451
1434
|
/**
|
|
1452
|
-
* @experimental
|
|
1453
1435
|
* Fetch a quote for a supply swap operation with the specified parameters.
|
|
1454
1436
|
*
|
|
1455
1437
|
* Pausable loading state mode.
|
|
@@ -1467,9 +1449,8 @@ declare function useSupplySwapQuote(args: UseSupplySwapQuoteArgs): ReadResult<Sw
|
|
|
1467
1449
|
* ```
|
|
1468
1450
|
*/
|
|
1469
1451
|
declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs>): PausableReadResult<SwapQuote>;
|
|
1470
|
-
type UseBorrowSwapQuoteArgs = Prettify<
|
|
1452
|
+
type UseBorrowSwapQuoteArgs = Prettify<BorrowSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1471
1453
|
/**
|
|
1472
|
-
* @experimental
|
|
1473
1454
|
* Fetch a quote for a borrow swap operation with the specified parameters.
|
|
1474
1455
|
*
|
|
1475
1456
|
* This signature supports React Suspense:
|
|
@@ -1488,7 +1469,6 @@ type UseBorrowSwapQuoteArgs = Prettify<PrepareBorrowSwapRequest & CurrencyQueryO
|
|
|
1488
1469
|
*/
|
|
1489
1470
|
declare function useBorrowSwapQuote(args: UseBorrowSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
|
|
1490
1471
|
/**
|
|
1491
|
-
* @experimental
|
|
1492
1472
|
* Fetch a quote for a borrow swap operation with the specified parameters.
|
|
1493
1473
|
*
|
|
1494
1474
|
* Pausable suspense mode.
|
|
@@ -1508,7 +1488,6 @@ declare function useBorrowSwapQuote(args: UseBorrowSwapQuoteArgs & Suspendable):
|
|
|
1508
1488
|
*/
|
|
1509
1489
|
declare function useBorrowSwapQuote(args: Pausable<UseBorrowSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
|
|
1510
1490
|
/**
|
|
1511
|
-
* @experimental
|
|
1512
1491
|
* Fetch a quote for a borrow swap operation with the specified parameters.
|
|
1513
1492
|
*
|
|
1514
1493
|
* ```tsx
|
|
@@ -1524,7 +1503,6 @@ declare function useBorrowSwapQuote(args: Pausable<UseBorrowSwapQuoteArgs> & Sus
|
|
|
1524
1503
|
*/
|
|
1525
1504
|
declare function useBorrowSwapQuote(args: UseBorrowSwapQuoteArgs): ReadResult<SwapQuote>;
|
|
1526
1505
|
/**
|
|
1527
|
-
* @experimental
|
|
1528
1506
|
* Fetch a quote for a borrow swap operation with the specified parameters.
|
|
1529
1507
|
*
|
|
1530
1508
|
* Pausable loading state mode.
|
|
@@ -1546,15 +1524,12 @@ type SwapHandlerOptions = {
|
|
|
1546
1524
|
cancel: CancelOperation;
|
|
1547
1525
|
};
|
|
1548
1526
|
/**
|
|
1549
|
-
* @experimental
|
|
1550
1527
|
*/
|
|
1551
1528
|
type UseSwapSignerRequest = TransactionRequest;
|
|
1552
1529
|
/**
|
|
1553
|
-
* @experimental
|
|
1554
1530
|
*/
|
|
1555
1531
|
type SwapSignerError = CancelError | SigningError | UnexpectedError$1;
|
|
1556
1532
|
/**
|
|
1557
|
-
* @experimental
|
|
1558
1533
|
*/
|
|
1559
1534
|
type UseSwapSignerResult = UseAsyncTask<UseSwapSignerRequest, PendingTransaction | Signature, SwapSignerError>;
|
|
1560
1535
|
type PositionSwapPlan = PositionSwapApproval | SwapByIntent;
|
|
@@ -1563,24 +1538,19 @@ type PositionSwapValue = {
|
|
|
1563
1538
|
quote?: SwapQuote;
|
|
1564
1539
|
};
|
|
1565
1540
|
/**
|
|
1566
|
-
* @experimental
|
|
1567
1541
|
*/
|
|
1568
|
-
type UseSupplySwapRequest = Prettify<
|
|
1542
|
+
type UseSupplySwapRequest = Prettify<SupplySwapQuoteRequest & CurrencyQueryOptions>;
|
|
1569
1543
|
/**
|
|
1570
|
-
* @experimental
|
|
1571
1544
|
*/
|
|
1572
|
-
declare function useSupplySwap(handler: PositionSwapHandler): UseAsyncTask<
|
|
1545
|
+
declare function useSupplySwap(handler: PositionSwapHandler): UseAsyncTask<SupplySwapQuoteRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
|
|
1573
1546
|
/**
|
|
1574
|
-
* @experimental
|
|
1575
1547
|
*/
|
|
1576
|
-
type UseBorrowSwapRequest = Prettify<
|
|
1548
|
+
type UseBorrowSwapRequest = Prettify<BorrowSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1577
1549
|
/**
|
|
1578
|
-
* @experimental
|
|
1579
1550
|
*/
|
|
1580
|
-
declare function useBorrowSwap(handler: PositionSwapHandler): UseAsyncTask<
|
|
1581
|
-
type UseRepayWithSupplyQuoteArgs = Prettify<
|
|
1551
|
+
declare function useBorrowSwap(handler: PositionSwapHandler): UseAsyncTask<BorrowSwapQuoteRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
|
|
1552
|
+
type UseRepayWithSupplyQuoteArgs = Prettify<RepayWithSupplyQuoteRequest & CurrencyQueryOptions>;
|
|
1582
1553
|
/**
|
|
1583
|
-
* @experimental
|
|
1584
1554
|
* Fetch a quote for a repay with supply operation with the specified parameters.
|
|
1585
1555
|
*
|
|
1586
1556
|
* This signature supports React Suspense:
|
|
@@ -1599,7 +1569,6 @@ type UseRepayWithSupplyQuoteArgs = Prettify<PrepareRepayWithSupplyRequest & Curr
|
|
|
1599
1569
|
*/
|
|
1600
1570
|
declare function useRepayWithSupplyQuote(args: UseRepayWithSupplyQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
|
|
1601
1571
|
/**
|
|
1602
|
-
* @experimental
|
|
1603
1572
|
* Fetch a quote for a repay with supply operation with the specified parameters.
|
|
1604
1573
|
*
|
|
1605
1574
|
* Pausable suspense mode.
|
|
@@ -1619,7 +1588,6 @@ declare function useRepayWithSupplyQuote(args: UseRepayWithSupplyQuoteArgs & Sus
|
|
|
1619
1588
|
*/
|
|
1620
1589
|
declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
|
|
1621
1590
|
/**
|
|
1622
|
-
* @experimental
|
|
1623
1591
|
* Fetch a quote for a repay with supply operation with the specified parameters.
|
|
1624
1592
|
*
|
|
1625
1593
|
* ```tsx
|
|
@@ -1635,7 +1603,6 @@ declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteA
|
|
|
1635
1603
|
*/
|
|
1636
1604
|
declare function useRepayWithSupplyQuote(args: UseRepayWithSupplyQuoteArgs): ReadResult<SwapQuote>;
|
|
1637
1605
|
/**
|
|
1638
|
-
* @experimental
|
|
1639
1606
|
* Fetch a quote for a repay with supply operation with the specified parameters.
|
|
1640
1607
|
*
|
|
1641
1608
|
* Pausable loading state mode.
|
|
@@ -1654,16 +1621,13 @@ declare function useRepayWithSupplyQuote(args: UseRepayWithSupplyQuoteArgs): Rea
|
|
|
1654
1621
|
*/
|
|
1655
1622
|
declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteArgs>): PausableReadResult<SwapQuote>;
|
|
1656
1623
|
/**
|
|
1657
|
-
* @experimental
|
|
1658
1624
|
*/
|
|
1659
|
-
type UseRepayWithSupplyRequest = Prettify<
|
|
1625
|
+
type UseRepayWithSupplyRequest = Prettify<RepayWithSupplyQuoteRequest & CurrencyQueryOptions>;
|
|
1660
1626
|
/**
|
|
1661
|
-
* @experimental
|
|
1662
1627
|
*/
|
|
1663
|
-
declare function useRepayWithSupply(handler: PositionSwapHandler): UseAsyncTask<
|
|
1664
|
-
type UseWithdrawSwapQuoteArgs = Prettify<
|
|
1628
|
+
declare function useRepayWithSupply(handler: PositionSwapHandler): UseAsyncTask<RepayWithSupplyQuoteRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
|
|
1629
|
+
type UseWithdrawSwapQuoteArgs = Prettify<WithdrawSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1665
1630
|
/**
|
|
1666
|
-
* @experimental
|
|
1667
1631
|
* Fetch a quote for a withdraw swap operation with the specified parameters.
|
|
1668
1632
|
*
|
|
1669
1633
|
* This signature supports React Suspense:
|
|
@@ -1682,7 +1646,6 @@ type UseWithdrawSwapQuoteArgs = Prettify<PrepareWithdrawSwapRequest & CurrencyQu
|
|
|
1682
1646
|
*/
|
|
1683
1647
|
declare function useWithdrawSwapQuote(args: UseWithdrawSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
|
|
1684
1648
|
/**
|
|
1685
|
-
* @experimental
|
|
1686
1649
|
* Fetch a quote for a withdraw swap operation with the specified parameters.
|
|
1687
1650
|
*
|
|
1688
1651
|
* Pausable suspense mode.
|
|
@@ -1702,7 +1665,6 @@ declare function useWithdrawSwapQuote(args: UseWithdrawSwapQuoteArgs & Suspendab
|
|
|
1702
1665
|
*/
|
|
1703
1666
|
declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
|
|
1704
1667
|
/**
|
|
1705
|
-
* @experimental
|
|
1706
1668
|
* Fetch a quote for a withdraw swap operation with the specified parameters.
|
|
1707
1669
|
*
|
|
1708
1670
|
* ```tsx
|
|
@@ -1718,7 +1680,6 @@ declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs> &
|
|
|
1718
1680
|
*/
|
|
1719
1681
|
declare function useWithdrawSwapQuote(args: UseWithdrawSwapQuoteArgs): ReadResult<SwapQuote>;
|
|
1720
1682
|
/**
|
|
1721
|
-
* @experimental
|
|
1722
1683
|
* Fetch a quote for a withdraw swap operation with the specified parameters.
|
|
1723
1684
|
*
|
|
1724
1685
|
* Pausable loading state mode.
|
|
@@ -1737,23 +1698,20 @@ declare function useWithdrawSwapQuote(args: UseWithdrawSwapQuoteArgs): ReadResul
|
|
|
1737
1698
|
*/
|
|
1738
1699
|
declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs>): PausableReadResult<SwapQuote>;
|
|
1739
1700
|
/**
|
|
1740
|
-
* @experimental
|
|
1741
1701
|
*/
|
|
1742
|
-
type UseWithdrawSwapRequest = Prettify<
|
|
1702
|
+
type UseWithdrawSwapRequest = Prettify<WithdrawSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1743
1703
|
/**
|
|
1744
|
-
* @experimental
|
|
1745
1704
|
*/
|
|
1746
|
-
declare function useWithdrawSwap(handler: PositionSwapHandler): UseAsyncTask<
|
|
1747
|
-
type UseTokenSwapRequest = Prettify<
|
|
1748
|
-
type TokenSwapPlan = SwapTypedData |
|
|
1749
|
-
type TokenSwapHandler = (plan: TokenSwapPlan, options: SwapHandlerOptions) => ResultAsync<PendingTransaction | Signature, SwapSignerError>;
|
|
1705
|
+
declare function useWithdrawSwap(handler: PositionSwapHandler): UseAsyncTask<WithdrawSwapQuoteRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
|
|
1706
|
+
type UseTokenSwapRequest = Prettify<TokenSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1707
|
+
type TokenSwapPlan = SwapTypedData | Erc20Approval | SwapTransactionRequest;
|
|
1708
|
+
type TokenSwapHandler = (plan: TokenSwapPlan, options: SwapHandlerOptions) => ResultAsync<ERC20PermitSignature | PendingTransaction | Signature, SwapSignerError>;
|
|
1750
1709
|
/**
|
|
1751
|
-
* @experimental
|
|
1752
1710
|
* Orchestrate the swap execution plan.
|
|
1753
1711
|
*
|
|
1754
1712
|
* ```tsx
|
|
1755
1713
|
* const [sendTransaction] = useSendTransaction(wallet);
|
|
1756
|
-
* const [signSwapTypedData] =
|
|
1714
|
+
* const [signSwapTypedData] = useSignSwapTypedData(wallet);
|
|
1757
1715
|
*
|
|
1758
1716
|
* const [swap, { loading, error }] = useTokenSwap((plan) => {
|
|
1759
1717
|
* switch (plan.__typename) {
|
|
@@ -1797,12 +1755,11 @@ declare class CannotCancelSwapError extends ResultAwareError {
|
|
|
1797
1755
|
}
|
|
1798
1756
|
type CancelSwapError = CancelError | CannotCancelSwapError | SigningError | TimeoutError | TransactionError | UnexpectedError$1;
|
|
1799
1757
|
/**
|
|
1800
|
-
* @experimental
|
|
1801
1758
|
* Executes the complete swap cancellation workflow combining preparation and execution.
|
|
1802
1759
|
*
|
|
1803
1760
|
* ```tsx
|
|
1804
1761
|
* const [sendTransaction] = useSendTransaction(wallet);
|
|
1805
|
-
* const [signSwapTypedData] =
|
|
1762
|
+
* const [signSwapTypedData] = useSignSwapTypedData(wallet);
|
|
1806
1763
|
*
|
|
1807
1764
|
* const [cancelSwap, { loading, error }] = useCancelSwap((plan) => {
|
|
1808
1765
|
* switch (plan.__typename) {
|
|
@@ -2517,7 +2474,7 @@ declare function useActivities(args: Pausable<UseActivitiesArgs>): PausableReadR
|
|
|
2517
2474
|
* @param options - The query options.
|
|
2518
2475
|
* @returns The user history.
|
|
2519
2476
|
*/
|
|
2520
|
-
declare function useActivitiesAction(options?:
|
|
2477
|
+
declare function useActivitiesAction(options?: CurrencyQueryOptions & TimeWindowQueryOptions): UseAsyncTask<ActivitiesRequest, PaginatedActivitiesResult, UnexpectedError>;
|
|
2521
2478
|
|
|
2522
2479
|
type UseUserSuppliesArgs = Prettify<UserSuppliesRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
|
|
2523
2480
|
/**
|
|
@@ -2632,7 +2589,7 @@ declare function useUserSupplies(args: Pausable<UseUserSuppliesArgs>): PausableR
|
|
|
2632
2589
|
* }
|
|
2633
2590
|
* ```
|
|
2634
2591
|
*/
|
|
2635
|
-
declare function useUserSuppliesAction(options?:
|
|
2592
|
+
declare function useUserSuppliesAction(options?: CurrencyQueryOptions & TimeWindowQueryOptions): UseAsyncTask<UserSuppliesRequest, UserSupplyItem[], UnexpectedError>;
|
|
2636
2593
|
type UseUserBorrowsArgs = Prettify<UserBorrowsRequest & CurrencyQueryOptions & TimeWindowQueryOptions>;
|
|
2637
2594
|
/**
|
|
2638
2595
|
* Fetch all user borrow positions.
|
|
@@ -2739,7 +2696,7 @@ declare function useUserBorrows(args: Pausable<UseUserBorrowsArgs>): PausableRea
|
|
|
2739
2696
|
* }
|
|
2740
2697
|
* ```
|
|
2741
2698
|
*/
|
|
2742
|
-
declare function useUserBorrowsAction(options?:
|
|
2699
|
+
declare function useUserBorrowsAction(options?: CurrencyQueryOptions & TimeWindowQueryOptions): UseAsyncTask<UserBorrowsRequest, UserBorrowItem[], UnexpectedError>;
|
|
2743
2700
|
type UseUserSummaryArgs = Prettify<UserSummaryRequest & TimeWindowQueryOptions & CurrencyQueryOptions>;
|
|
2744
2701
|
/**
|
|
2745
2702
|
* Fetch a user's financial summary.
|
|
@@ -3154,4 +3111,4 @@ declare function useUserSummaryHistory(args: UseUserSummaryHistoryArgs): ReadRes
|
|
|
3154
3111
|
*/
|
|
3155
3112
|
declare function useUserSummaryHistory(args: Pausable<UseUserSummaryHistoryArgs>): PausableReadResult<UserSummaryHistoryItem[]>;
|
|
3156
3113
|
|
|
3157
|
-
export { AaveProvider, type AaveProviderProps, type CancelSwapError, type CancelSwapHandler, CannotCancelSwapError, type PositionSwapHandler, type PositionSwapPlan, type PositionSwapValue, SendTransactionError, type SwapHandlerOptions, type SwapSignerError, type TokenSwapHandler, type TokenSwapPlan, type UseActivitiesArgs, type UseAssetArgs, type UseAssetBorrowHistoryArgs, type UseAssetPriceHistoryArgs, type UseAssetSupplyHistoryArgs, UseAsyncTask, type UseBorrowApyHistoryArgs, type UseBorrowSwapQuoteArgs, type UseBorrowSwapRequest, type UseHubArgs, type UseHubAssetsArgs, type UseHubSummaryHistoryArgs, type UseHubsArgs, type UsePreviewArgs, type UseProtocolHistoryArgs, type UseRepayWithSupplyQuoteArgs, type UseRepayWithSupplyRequest, type UseReserveArgs, type UseReservesArgs, type UseSpokeArgs, type UseSpokePositionManagersArgs, type UseSpokeUserPositionManagersArgs, type UseSpokesArgs, type UseSupplyApyHistoryArgs, type UseSupplySwapQuoteArgs, type UseSupplySwapRequest, type
|
|
3114
|
+
export { AaveProvider, type AaveProviderProps, type CancelSwapError, type CancelSwapHandler, CannotCancelSwapError, PendingTransactionError, type PositionSwapHandler, type PositionSwapPlan, type PositionSwapValue, SendTransactionError, type SwapHandlerOptions, type SwapSignerError, type TokenSwapHandler, type TokenSwapPlan, type UseActivitiesArgs, type UseAssetArgs, type UseAssetBorrowHistoryArgs, type UseAssetPriceHistoryArgs, type UseAssetSupplyHistoryArgs, UseAsyncTask, type UseBorrowApyHistoryArgs, type UseBorrowSwapQuoteArgs, type UseBorrowSwapRequest, type UseHubArgs, type UseHubAssetsArgs, type UseHubSummaryHistoryArgs, type UseHubsArgs, type UsePreviewArgs, type UseProtocolHistoryArgs, type UseRepayWithSupplyQuoteArgs, type UseRepayWithSupplyRequest, type UseReserveArgs, type UseReservesArgs, type UseSpokeArgs, type UseSpokePositionManagersArgs, type UseSpokeUserPositionManagersArgs, type UseSpokesArgs, type UseSupplyApyHistoryArgs, type UseSupplySwapQuoteArgs, type UseSupplySwapRequest, type UseSwapSignerRequest, type UseSwapSignerResult, type UseSwappableTokensArgs, type UseTokenSwapQuoteArgs, type UseTokenSwapRequest, type UseUserBalancesArgs, type UseUserBorrowsArgs, type UseUserPositionArgs, type UseUserPositionsArgs, type UseUserRiskPremiumBreakdownArgs, type UseUserSummaryArgs, type UseUserSummaryHistoryArgs, type UseUserSuppliesArgs, type UseUserSwapsArgs, type UseWithdrawSwapQuoteArgs, type UseWithdrawSwapRequest, useAaveClient, useActivities, useActivitiesAction, useAsset, useAssetBorrowHistory, useAssetPriceHistory, useAssetSupplyHistory, useBorrow, useBorrowApyHistory, useBorrowSwap, useBorrowSwapQuote, useCancelSwap, useHub, useHubAssets, useHubSummaryHistory, useHubs, useHubsAction, useLiquidatePosition, usePermitTypedDataAction, usePreview, usePreviewAction, useProtocolHistory, useRenounceSpokeUserPositionManager, useRepay, useRepayWithSupply, useRepayWithSupplyQuote, useReserve, useReserveAction, useReserves, useReservesAction, useSetSpokeUserPositionManager, useSetUserSuppliesAsCollateral, useSpoke, useSpokePositionManagers, useSpokeUserPositionManagers, useSpokes, useSupply, useSupplyApyHistory, useSupplySwap, useSupplySwapQuote, useSwappableTokens, useTokenSwap, useTokenSwapQuote, useTokenSwapQuoteAction, useUpdateUserPositionConditions, useUserBalances, useUserBalancesAction, useUserBorrows, useUserBorrowsAction, useUserPosition, useUserPositions, useUserPositionsAction, useUserRiskPremiumBreakdown, useUserSummary, useUserSummaryHistory, useUserSupplies, useUserSuppliesAction, useUserSwaps, useWithdraw, useWithdrawSwap, useWithdrawSwapQuote };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'./chunk-7FNJZJRF.js';export{c as useChain,d as useChains,f as useExchangeRate,e as useExchangeRateAction}from'./chunk-7FNJZJRF.js';import {d,e,a,b as b$1,c}from'./chunk-IESN2WLA.js';export{e as useAaveClient,f as usePermitTypedDataAction}from'./chunk-IESN2WLA.js';import {DEFAULT_QUERY_OPTIONS,ValidationError}from'@aave/client';export*from'@aave/client';import G,{useCallback}from'react';import {hubs,reserve,reserves,swapQuote,supplySwapQuote,preparePositionSwap,borrowSwapQuote,repayWithSupplyQuote,withdrawSwapQuote,prepareTokenSwap,swap,swapStatus,prepareSwapCancel,cancelSwap,supply,borrow,repay,withdraw,renounceSpokeUserPositionManager,updateUserPositionConditions,setUserSuppliesAsCollateral,liquidatePosition,setSpokeUserPositionManager,preview,activities,userSupplies,userBorrows,userPositions,userBalances}from'@aave/client/actions';import {HubQuery,HubsQuery,HubAssetsQuery,HubSummaryHistoryQuery,AssetQuery,AssetPriceHistoryQuery,AssetSupplyHistoryQuery,AssetBorrowHistoryQuery,ProtocolHistoryQuery,ReserveQuery,ReservesQuery,BorrowApyHistoryQuery,SupplyApyHistoryQuery,SpokeQuery,SpokesQuery,SpokePositionManagersQuery,SpokeUserPositionManagersQuery,SwapQuoteQuery,SwappableTokensQuery,UserSwapsQuery,SupplySwapQuoteQuery,BorrowSwapQuoteQuery,RepayWithSupplyQuoteQuery,WithdrawSwapQuoteQuery,UserPositionsQuery,UserPositionQuery,decodeReserveId,UserSummaryQuery,isSpokeInputVariant,isChainIdsVariant,isHubInputVariant,decodeHubId,PreviewQuery,ActivitiesQuery,UserSuppliesQuery,UserBorrowsQuery,UserBalancesQuery,UserRiskPremiumBreakdownQuery,UserSummaryHistoryQuery}from'@aave/graphql';import {UnexpectedError,ValidationError as ValidationError$1}from'@aave/core';import {invariant,isSignature,okAsync,ResultAwareError,errAsync}from'@aave/types';function ys({children:s,client:e}){return G.createElement(d,{client:e},s)}function ms({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Ps({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function As({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubAssetsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function bs({suspense:s=false,pause:e=false,...r}){return b({document:HubSummaryHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function fs(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>hubs(e$1,r,{currency:s.currency}),[e$1,s.currency])}function qs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:AssetQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function ks({suspense:s=false,pause:e=false,...r}){return b({document:AssetPriceHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Qs({suspense:s=false,pause:e=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function vs({suspense:s=false,pause:e=false,...r}){return b({document:AssetBorrowHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Es({suspense:s=false,pause:e=false,...r}){return b({document:ProtocolHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Ns({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:ReserveQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Ms(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>reserve(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Ds({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,selector:t,...n}){return b({document:ReservesQuery,variables:{request:n,currency:r,timeWindow:a},suspense:s,pause:e,selector:t||void 0})}function Fs(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>reserves(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Vs({suspense:s=false,pause:e=false,...r}){return b({document:BorrowApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function $s({suspense:s=false,pause:e=false,...r}){return b({document:SupplyApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function js({suspense:s=false,pause:e=false,...r}){return b({document:SpokeQuery,variables:{request:r},suspense:s,pause:e})}function zs({suspense:s=false,pause:e=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:s,pause:e})}function Js({suspense:s=false,pause:e=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function Ks({suspense:s=false,pause:e=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function pr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:SwapQuoteQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function ir(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>swapQuote(e$1,r,{currency:s.currency}),[e$1,s.currency])}function lr({suspense:s=false,pause:e=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:s,pause:e})}function cr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:UserSwapsQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function yr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:SupplySwapQuoteQuery,variables:{request:a,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function Sr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:BorrowSwapQuoteQuery,variables:{request:a,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function k(s){return {with:e=>s.approvals.reduce((r,a)=>r.andThen(t=>e(a,{cancel:b$1}).map(n=>{switch(a.__typename){case "PositionSwapAdapterContractApproval":t.adapterContractSignature=isSignature(n)?n:null;break;case "PositionSwapPositionManagerApproval":t.positionManagerSignature=isSignature(n)?n:null;break}return t})),okAsync({quoteId:s.quote.quoteId,adapterContractSignature:null,positionManagerSignature:null}))}}function Q(s,e){return swap(s,{intent:e}).andThen(r=>{switch(r.__typename){case "SwapReceipt":return okAsync(r);case "InsufficientBalanceError":return ValidationError.fromGqlNode(r).asResultAsync();default:return UnexpectedError.from(r).asResultAsync()}})}function dr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>supplySwapQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Rr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>borrowSwapQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Ur({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:RepayWithSupplyQuoteQuery,variables:{request:a,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function wr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>repayWithSupplyQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function gr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:WithdrawSwapQuoteQuery,variables:{request:a,currency:r},selector:t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),t.quote),suspense:s,pause:e})}function mr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>withdrawSwapQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Pr(s){let e$1=e(),r=useCallback(a=>{switch(a.__typename){case "SwapTransactionRequest":return s(a,{cancel:b$1}).map(c.ensure).andThen(t=>t.wait()).andThen(()=>okAsync(a.orderReceipt));case "SwapApprovalRequired":return s(a,{cancel:b$1}).map(c.ensure).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).map(c.ensure).andThen(t=>t.wait()).andThen(()=>okAsync(a.originalTransaction.orderReceipt));case "InsufficientBalanceError":return ValidationError.fromGqlNode(a).asResultAsync();case "SwapReceipt":return okAsync(a);default:return new UnexpectedError(`Unsupported swap plan: ${a.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}},[s]);return a(({currency:a=DEFAULT_QUERY_OPTIONS.currency,...t})=>prepareTokenSwap(e$1,t,{currency:a}).andThen(n=>{switch(n.__typename){case "SwapByTransaction":return swap(e$1,{transaction:{quoteId:n.quote.quoteId}}).andThen(r);case "SwapByIntent":return s(n.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Invalid signature"),o)).andThen(o=>swap(e$1,{intent:{quoteId:n.quote.quoteId,signature:o}})).andThen(r);case "SwapByIntentWithApprovalRequired":return s(n,{cancel:b$1}).map(c.ensure).andThen(o=>o.wait()).andThen(()=>s(n.data,{cancel:b$1})).map(o=>(invariant(isSignature(o),"Invalid signature"),o)).andThen(o=>swap(e$1,{intent:{quoteId:n.quote.quoteId,signature:o}})).andThen(r);case "InsufficientBalanceError":return ValidationError.fromGqlNode(n).asResultAsync();default:return new UnexpectedError(`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}),[e$1,s,r])}var H=class extends ResultAwareError{name="CannotCancelSwapError"};function Ar(s){let e$1=e();return a(r=>swapStatus(e$1,{id:r.id}).andThen(a=>{switch(a.__typename){case "SwapOpen":case "SwapPendingSignature":return prepareSwapCancel(e$1,r).andThen(t=>s(t.data,{cancel:b$1})).map(t=>(invariant(isSignature(t),"Invalid signature"),t)).andThen(t=>cancelSwap(e$1,{intent:{id:r.id,signature:t}})).andThen(t=>t.__typename==="SwapCancelled"?okAsync(t):s(t,{cancel:b$1}).map(c.ensure).andThen(n=>n.wait()).andThen(()=>swapStatus(e$1,{id:r.id})).andThen(n=>n.__typename==="SwapCancelled"?okAsync(n):new H("Failed to cancel swap").asResultAsync()));case "SwapCancelled":return okAsync(a);case "SwapExpired":return new H("Swap cannot longer be cancelled").asResultAsync();default:return new UnexpectedError(`Unsupported swap status: ${a.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}),[e$1,s])}function E(s,e){let{chainId:r,spoke:a}=decodeReserveId(e.reserve);return async()=>Promise.all([await s.refreshQueryWhere(UserPositionsQuery,(t,n)=>t.request.user===e.sender&&n.some(o=>o.spoke.chain.chainId===r&&o.spoke.address===a)),await s.refreshQueryWhere(UserPositionQuery,(t,n)=>n?.spoke.chain.chainId===r&&n?.spoke.address===a&&n.user===e.sender),await s.refreshQueryWhere(UserSummaryQuery,t=>t.request.user===e.sender&&isSpokeInputVariant(t.request.filter)?t.request.filter.spoke.chainId===r&&t.request.filter.spoke.address===a:isChainIdsVariant(t.request.filter)?t.request.filter.chainIds.some(n=>n===r):false),await s.refreshQueryWhere(ReservesQuery,(t,n)=>n.some(o=>o.id===e.reserve)),await s.refreshQueryWhere(SpokesQuery,(t,n)=>n.some(o=>o.chain.chainId===r&&o.address===a)),await s.refreshQueryWhere(UserBalancesQuery,t=>t.request.user===e.sender),await s.refreshQueryWhere(HubsQuery,t=>isChainIdsVariant(t.request)&&t.request.chainIds.some(n=>n===r))])}function Qr(s){let e$1=e();return a(r=>supply(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function vr(s){let e$1=e();return a(r=>borrow(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function Er(s){let e$1=e();return a(r=>repay(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function Br(s){let e$1=e();return a(r=>withdraw(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function Wr(s){let e$1=e();return a(r=>renounceSpokeUserPositionManager(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,a=>a.request.spoke===r.spoke)),[e$1,s])}function Ir(s){let e$1=e();return a(r=>updateUserPositionConditions(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(async()=>{let{userPositionId:a}=r;return Promise.all([e$1.refreshQueryWhere(UserPositionsQuery,(t,n)=>n.some(o=>o.id===a)),e$1.refreshQueryWhere(UserPositionQuery,(t,n)=>n?.id===a)])}),[e$1,s])}function Cr(s){let e$1=e();return a(r=>{let a=r.changes.map(n=>n.reserve),t=a.map(n=>decodeReserveId(n));return setUserSuppliesAsCollateral(e$1,r).andThen(n=>s(n,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction).andTee(()=>Promise.all([...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(UserPositionsQuery,(y,R)=>y.request.user===r.sender&&R.some(b=>b.spoke.chain.chainId===n&&b.spoke.address===o))),...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(UserPositionQuery,(y,R)=>R?.spoke.chain.chainId===n&&R?.spoke.address===o&&R.user===r.sender)),...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(UserSummaryQuery,y=>y.request.user===r.sender&&isSpokeInputVariant(y.request.filter)?y.request.filter.spoke.chainId===n&&y.request.filter.spoke.address===o:isChainIdsVariant(y.request.filter)?y.request.filter.chainIds.some(R=>R===n):false)),e$1.refreshQueryWhere(ReservesQuery,(n,o)=>o.some(y=>a.includes(y.id))),...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(SpokesQuery,(y,R)=>R.some(b=>b.chain.chainId===n&&b.address===o))),...t.map(({chainId:n})=>e$1.refreshQueryWhere(HubsQuery,o=>isChainIdsVariant(o.request.query)?o.request.query.chainIds.some(y=>y===n):o.request.query.tokens.some(y=>y.chainId===n))),...t.map(({chainId:n})=>e$1.refreshQueryWhere(HubQuery,o=>isHubInputVariant(o.request.query)?o.request.query.hubInput.chainId===n:decodeHubId(o.request.query.hubId).chainId===n))]))},[e$1,s])}function _r(s){let e$1=e();return a(r=>liquidatePosition(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}),[e$1,s])}function Or(s){let e$1=e();return a(r=>setSpokeUserPositionManager(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,a=>a.request.spoke===r.spoke)),[e$1,s])}function Nr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>preview(e$1,r,{currency:s.currency}),[e$1,s.currency])}function Mr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:PreviewQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function Dr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:ActivitiesQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Fr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>activities(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function zr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSuppliesQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Jr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userSupplies(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Kr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserBorrowsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Xr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBorrows(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Zr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSummaryQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function et({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserPositionsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function st(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userPositions(e$1,r,{currency:s.currency,timeWindow:s.timeWindow}),[e$1,s.currency,s.timeWindow])}function rt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserPositionQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function tt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:UserBalancesQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function at({suspense:s=false,pause:e=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function nt(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBalances(e$1,r,{currency:s.currency}),[e$1,s.currency])}function ot({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:UserSummaryHistoryQuery,variables:{request:a,currency:r},suspense:s,pause:e,batch:false})}export{ys as AaveProvider,H as CannotCancelSwapError,Dr as useActivities,Fr as useActivitiesAction,qs as useAsset,vs as useAssetBorrowHistory,ks as useAssetPriceHistory,Qs as useAssetSupplyHistory,vr as useBorrow,Vs as useBorrowApyHistory,Rr as useBorrowSwap,Sr as useBorrowSwapQuote,Ar as useCancelSwap,ms as useHub,As as useHubAssets,bs as useHubSummaryHistory,Ps as useHubs,fs as useHubsAction,_r as useLiquidatePosition,Mr as usePreview,Nr as usePreviewAction,Es as useProtocolHistory,Wr as useRenounceSpokeUserPositionManager,Er as useRepay,wr as useRepayWithSupply,Ur as useRepayWithSupplyQuote,Ns as useReserve,Ms as useReserveAction,Ds as useReserves,Fs as useReservesAction,Or as useSetSpokeUserPositionManager,Cr as useSetUserSuppliesAsCollateral,js as useSpoke,Js as useSpokePositionManagers,Ks as useSpokeUserPositionManagers,zs as useSpokes,Qr as useSupply,$s as useSupplyApyHistory,dr as useSupplySwap,yr as useSupplySwapQuote,pr as useSwapQuote,ir as useSwapQuoteAction,lr as useSwappableTokens,Pr as useTokenSwap,Ir as useUpdateUserPositionConditions,tt as useUserBalances,nt as useUserBalancesAction,Kr as useUserBorrows,Xr as useUserBorrowsAction,rt as useUserPosition,et as useUserPositions,st as useUserPositionsAction,at as useUserRiskPremiumBreakdown,Zr as useUserSummary,ot as useUserSummaryHistory,zr as useUserSupplies,Jr as useUserSuppliesAction,cr as useUserSwaps,Br as useWithdraw,mr as useWithdrawSwap,gr as useWithdrawSwapQuote};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {b}from'./chunk-YGW2LSLM.js';export{c as useChain,d as useChains,f as useExchangeRate,e as useExchangeRateAction}from'./chunk-YGW2LSLM.js';import {d,e,a,b as b$1,c}from'./chunk-YPQBKWEA.js';export{e as useAaveClient,f as usePermitTypedDataAction}from'./chunk-YPQBKWEA.js';import {DEFAULT_QUERY_OPTIONS,ValidationError}from'@aave/client';export*from'@aave/client';import J,{useCallback}from'react';import {hubs,reserve,reserves,tokenSwapQuote,supplySwapQuote,preparePositionSwap,borrowSwapQuote,repayWithSupplyQuote,withdrawSwapQuote,prepareTokenSwap,swap,swapStatus,prepareSwapCancel,cancelSwap,supply,borrow,repay,withdraw,renounceSpokeUserPositionManager,updateUserPositionConditions,setUserSuppliesAsCollateral,liquidatePosition,setSpokeUserPositionManager,preview,activities,userSupplies,userBorrows,userPositions,userBalances}from'@aave/client/actions';import {HubQuery,HubsQuery,HubAssetsQuery,HubSummaryHistoryQuery,AssetQuery,AssetPriceHistoryQuery,AssetSupplyHistoryQuery,AssetBorrowHistoryQuery,ProtocolHistoryQuery,ReserveQuery,ReservesQuery,BorrowApyHistoryQuery,SupplyApyHistoryQuery,SpokeQuery,SpokesQuery,SpokePositionManagersQuery,SpokeUserPositionManagersQuery,TokenSwapQuoteQuery,SwappableTokensQuery,UserSwapsQuery,SupplySwapQuoteQuery,BorrowSwapQuoteQuery,RepayWithSupplyQuoteQuery,WithdrawSwapQuoteQuery,isERC20PermitSignature,UserPositionsQuery,UserPositionQuery,decodeReserveId,UserSummaryQuery,isSpokeInputVariant,isChainIdsVariant,isHubInputVariant,decodeHubId,PreviewQuery,ActivitiesQuery,UserSuppliesQuery,UserBorrowsQuery,UserBalancesQuery,UserRiskPremiumBreakdownQuery,UserSummaryHistoryQuery}from'@aave/graphql';import {UnexpectedError,ValidationError as ValidationError$1}from'@aave/core';import {invariant,isSignature,okAsync,never,ResultAwareError,errAsync}from'@aave/types';function Rs({children:s,client:e}){return J.createElement(d,{client:e},s)}function bs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function fs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubsQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function Ts({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubAssetsQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function xs({suspense:s=false,pause:e=false,...r}){return b({document:HubSummaryHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function ks(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>hubs(e$1,r,{currency:s.currency}),[e$1,s.currency])}function vs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:AssetQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function Es({suspense:s=false,pause:e=false,...r}){return b({document:AssetPriceHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Bs({suspense:s=false,pause:e=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Is({suspense:s=false,pause:e=false,...r}){return b({document:AssetBorrowHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Ws({suspense:s=false,pause:e=false,...r}){return b({document:ProtocolHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Fs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:ReserveQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function Vs(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>reserve(e$1,r,{currency:s.currency??DEFAULT_QUERY_OPTIONS.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function $s({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,selector:t,...a}){return b({document:ReservesQuery,variables:{request:a,currency:r,timeWindow:n},suspense:s,pause:e,selector:t||void 0})}function Ls(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>reserves(e$1,r,{currency:s.currency??DEFAULT_QUERY_OPTIONS.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Gs({suspense:s=false,pause:e=false,...r}){return b({document:BorrowApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Ys({suspense:s=false,pause:e=false,...r}){return b({document:SupplyApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Ks({suspense:s=false,pause:e=false,...r}){return b({document:SpokeQuery,variables:{request:r},suspense:s,pause:e})}function Xs({suspense:s=false,pause:e=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:s,pause:e})}function Zs({suspense:s=false,pause:e=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function er({suspense:s=false,pause:e=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function F(s){switch(s.__typename){case "SwapByIntent":return s.quote;case "SwapByIntentWithApprovalRequired":return s.quote;case "SwapByTransaction":return s.quote;default:never(`Unsupported swap quote result: ${s.__typename}. Upgrade to a newer version of the @aave/react package.`);}}function cr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:TokenSwapQuoteQuery,variables:{request:{market:n},currency:r},selector:F,suspense:s,pause:e})}function yr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>tokenSwapQuote(e$1,{market:r},{currency:s.currency}).map(F),[e$1,s.currency])}function Sr({suspense:s=false,pause:e=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:s,pause:e})}function dr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSwapsQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function Rr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:SupplySwapQuoteQuery,variables:{request:n,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function Ur({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:BorrowSwapQuoteQuery,variables:{request:n,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function H(s){return {with:e=>s.approvals.reduce((r,n)=>r.andThen(t=>e(n,{cancel:b$1}).map(a=>{switch(n.__typename){case "PositionSwapAdapterContractApproval":t.adapterContractSignature=isSignature(a)?a:null;break;case "PositionSwapPositionManagerApproval":t.positionManagerSignature=isSignature(a)?a:null;break}return t})),okAsync({quoteId:s.quote.quoteId,adapterContractSignature:null,positionManagerSignature:null}))}}function q(s,e){return swap(s,{intent:e}).andThen(r=>{switch(r.__typename){case "SwapReceipt":return okAsync(r);default:return UnexpectedError.from(r).asResultAsync()}})}function wr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...n})=>supplySwapQuote(e$1,n,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),H(t).with(s).andThen(a=>preparePositionSwap(e$1,a,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(a=>s(a,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(a=>q(e$1,{quoteId:t.quote.quoteId,signature:a})))),[e$1,s])}function gr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...n})=>borrowSwapQuote(e$1,n,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),H(t).with(s).andThen(a=>preparePositionSwap(e$1,a,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(a=>s(a,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(a=>q(e$1,{quoteId:t.quote.quoteId,signature:a})))),[e$1,s])}function mr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:RepayWithSupplyQuoteQuery,variables:{request:n,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function Pr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...n})=>repayWithSupplyQuote(e$1,n,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),H(t).with(s).andThen(a=>preparePositionSwap(e$1,a,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(a=>s(a,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(a=>q(e$1,{quoteId:t.quote.quoteId,signature:a})))),[e$1,s])}function Ar({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:WithdrawSwapQuoteQuery,variables:{request:n,currency:r},selector:t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),t.quote),suspense:s,pause:e})}function br(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...n})=>withdrawSwapQuote(e$1,n,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),H(t).with(s).andThen(a=>preparePositionSwap(e$1,a,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(a=>s(a,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(a=>q(e$1,{quoteId:t.quote.quoteId,signature:a})))),[e$1,s])}function fr(s){let e$1=e(),r=useCallback(n=>{switch(n.__typename){case "SwapTransactionRequest":return s(n,{cancel:b$1}).map(c.ensure).andThen(t=>t.wait()).andThen(()=>okAsync(n.orderReceipt));case "InsufficientBalanceError":return ValidationError.fromGqlNode(n).asResultAsync();case "SwapReceipt":return okAsync(n);default:return new UnexpectedError(`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}},[s]);return a(({currency:n=DEFAULT_QUERY_OPTIONS.currency,...t})=>tokenSwapQuote(e$1,t,{currency:n}).andThen(a=>{switch(a.__typename){case "SwapByTransaction":return swap(e$1,{transaction:{quoteId:a.quote.quoteId}}).andThen(r);case "SwapByIntent":return s(a.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Invalid signature"),o)).andThen(o=>swap(e$1,{intent:{quoteId:a.quote.quoteId,signature:o}})).andThen(r);case "SwapByIntentWithApprovalRequired":return s(a.approval,{cancel:b$1}).andThen(o=>isERC20PermitSignature(o)?prepareTokenSwap(e$1,{quoteId:a.quote.quoteId,permitSig:o.value}):c.isInstanceOf(o)?o.wait().andThen(()=>prepareTokenSwap(e$1,{quoteId:a.quote.quoteId})):UnexpectedError.from(o).asResultAsync()).andThen(o=>{switch(o.__typename){case "SwapByIntent":return s(o.data,{cancel:b$1});case "InsufficientBalanceError":return ValidationError.fromGqlNode(o).asResultAsync();default:return new UnexpectedError(`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}).map(o=>(invariant(isSignature(o),"Invalid signature"),o)).andThen(o=>swap(e$1,{intent:{quoteId:a.quote.quoteId,signature:o}})).andThen(r);default:never(`Unsupported swap quote result: ${a.__typename}. To be removed from API soon.`);}}),[e$1,s,r])}var Q=class extends ResultAwareError{name="CannotCancelSwapError"};function Tr(s){let e$1=e();return a(r=>swapStatus(e$1,{id:r.id}).andThen(n=>{switch(n.__typename){case "SwapOpen":case "SwapPendingSignature":return prepareSwapCancel(e$1,r).andThen(t=>s(t.data,{cancel:b$1})).map(t=>(invariant(isSignature(t),"Invalid signature"),t)).andThen(t=>cancelSwap(e$1,{intent:{id:r.id,signature:t}})).andThen(t=>t.__typename==="SwapCancelled"?okAsync(t):s(t,{cancel:b$1}).map(c.ensure).andThen(a=>a.wait()).andThen(()=>swapStatus(e$1,{id:r.id})).andThen(a=>a.__typename==="SwapCancelled"?okAsync(a):new Q("Failed to cancel swap").asResultAsync()));case "SwapCancelled":return okAsync(n);case "SwapExpired":return new Q("Swap cannot longer be cancelled").asResultAsync();default:return new UnexpectedError(`Unsupported swap status: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}),[e$1,s])}function E(s,e){let{chainId:r,spoke:n}=decodeReserveId(e.reserve);return async()=>Promise.all([await s.refreshQueryWhere(UserPositionsQuery,(t,a)=>t.request.user===e.sender&&a.some(o=>o.spoke.chain.chainId===r&&o.spoke.address===n)),await s.refreshQueryWhere(UserPositionQuery,(t,a)=>a?.spoke.chain.chainId===r&&a?.spoke.address===n&&a.user===e.sender),await s.refreshQueryWhere(UserSummaryQuery,t=>t.request.user===e.sender&&isSpokeInputVariant(t.request.filter)?t.request.filter.spoke.chainId===r&&t.request.filter.spoke.address===n:isChainIdsVariant(t.request.filter)?t.request.filter.chainIds.some(a=>a===r):false),await s.refreshQueryWhere(ReservesQuery,(t,a)=>a.some(o=>o.id===e.reserve)),await s.refreshQueryWhere(SpokesQuery,(t,a)=>a.some(o=>o.chain.chainId===r&&o.address===n)),await s.refreshQueryWhere(UserBalancesQuery,t=>t.request.user===e.sender),await s.refreshQueryWhere(HubsQuery,t=>isChainIdsVariant(t.request)&&t.request.chainIds.some(a=>a===r))])}function Br(s){let e$1=e();return a(r=>supply(e$1,r).andThen(n=>{switch(n.__typename){case "TransactionRequest":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(n.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(n))}}).andTee(E(e$1,r)),[e$1,s])}function Ir(s){let e$1=e();return a(r=>borrow(e$1,r).andThen(n=>{switch(n.__typename){case "TransactionRequest":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(n.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(n))}}).andTee(E(e$1,r)),[e$1,s])}function Wr(s){let e$1=e();return a(r=>repay(e$1,r).andThen(n=>{switch(n.__typename){case "TransactionRequest":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(n.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(n))}}).andTee(E(e$1,r)),[e$1,s])}function Cr(s){let e$1=e();return a(r=>withdraw(e$1,r).andThen(n=>{switch(n.__typename){case "TransactionRequest":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(n.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(n))}}).andTee(E(e$1,r)),[e$1,s])}function _r(s){let e$1=e();return a(r=>renounceSpokeUserPositionManager(e$1,r).andThen(n=>s(n,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,n=>n.request.spoke===r.spoke)),[e$1,s])}function Or(s){let e$1=e();return a(r=>updateUserPositionConditions(e$1,r).andThen(n=>s(n,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction).andTee(async()=>{let{userPositionId:n}=r;return Promise.all([e$1.refreshQueryWhere(UserPositionsQuery,(t,a)=>a.some(o=>o.id===n)),e$1.refreshQueryWhere(UserPositionQuery,(t,a)=>a?.id===n)])}),[e$1,s])}function Mr(s){let e$1=e();return a(r=>{let n=r.changes.map(a=>a.reserve),t=n.map(a=>decodeReserveId(a));return setUserSuppliesAsCollateral(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(()=>Promise.all([...t.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(UserPositionsQuery,(y,U)=>y.request.user===r.sender&&U.some(A=>A.spoke.chain.chainId===a&&A.spoke.address===o))),...t.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(UserPositionQuery,(y,U)=>U?.spoke.chain.chainId===a&&U?.spoke.address===o&&U.user===r.sender)),...t.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(UserSummaryQuery,y=>y.request.user===r.sender&&isSpokeInputVariant(y.request.filter)?y.request.filter.spoke.chainId===a&&y.request.filter.spoke.address===o:isChainIdsVariant(y.request.filter)?y.request.filter.chainIds.some(U=>U===a):false)),e$1.refreshQueryWhere(ReservesQuery,(a,o)=>o.some(y=>n.includes(y.id))),...t.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(SpokesQuery,(y,U)=>U.some(A=>A.chain.chainId===a&&A.address===o))),...t.map(({chainId:a})=>e$1.refreshQueryWhere(HubsQuery,o=>isChainIdsVariant(o.request.query)?o.request.query.chainIds.some(y=>y===a):o.request.query.tokens.some(y=>y.chainId===a))),...t.map(({chainId:a})=>e$1.refreshQueryWhere(HubQuery,o=>isHubInputVariant(o.request.query)?o.request.query.hubInput.chainId===a:decodeHubId(o.request.query.hubId).chainId===a))]))},[e$1,s])}function Nr(s){let e$1=e();return a(r=>liquidatePosition(e$1,r).andThen(n=>{switch(n.__typename){case "TransactionRequest":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(n,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(n.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(n))}}),[e$1,s])}function Dr(s){let e$1=e();return a(r=>setSpokeUserPositionManager(e$1,r).andThen(n=>s(n,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,n=>n.request.spoke===r.spoke)),[e$1,s])}function Fr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>preview(e$1,r,{currency:s.currency}),[e$1,s.currency])}function Vr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:PreviewQuery,variables:{request:n,currency:r},suspense:s,pause:e})}function $r({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:ActivitiesQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function Lr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>activities(e$1,r,{currency:s.currency??DEFAULT_QUERY_OPTIONS.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Xr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSuppliesQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function Zr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userSupplies(e$1,r,{currency:s.currency??DEFAULT_QUERY_OPTIONS.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function et({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserBorrowsQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function st(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBorrows(e$1,r,{currency:s.currency??DEFAULT_QUERY_OPTIONS.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function rt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSummaryQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function tt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserPositionsQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function nt(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userPositions(e$1,r,{currency:s.currency,timeWindow:s.timeWindow}),[e$1,s.currency,s.timeWindow])}function at({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:n=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserPositionQuery,variables:{request:t,currency:r,timeWindow:n},suspense:s,pause:e})}function ot({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:UserBalancesQuery,variables:{request:n,currency:r},suspense:s,pause:e})}function ut({suspense:s=false,pause:e=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function pt(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBalances(e$1,r,{currency:s.currency}),[e$1,s.currency])}function it({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...n}){return b({document:UserSummaryHistoryQuery,variables:{request:n,currency:r},suspense:s,pause:e,batch:false})}export{Rs as AaveProvider,Q as CannotCancelSwapError,$r as useActivities,Lr as useActivitiesAction,vs as useAsset,Is as useAssetBorrowHistory,Es as useAssetPriceHistory,Bs as useAssetSupplyHistory,Ir as useBorrow,Gs as useBorrowApyHistory,gr as useBorrowSwap,Ur as useBorrowSwapQuote,Tr as useCancelSwap,bs as useHub,Ts as useHubAssets,xs as useHubSummaryHistory,fs as useHubs,ks as useHubsAction,Nr as useLiquidatePosition,Vr as usePreview,Fr as usePreviewAction,Ws as useProtocolHistory,_r as useRenounceSpokeUserPositionManager,Wr as useRepay,Pr as useRepayWithSupply,mr as useRepayWithSupplyQuote,Fs as useReserve,Vs as useReserveAction,$s as useReserves,Ls as useReservesAction,Dr as useSetSpokeUserPositionManager,Mr as useSetUserSuppliesAsCollateral,Ks as useSpoke,Zs as useSpokePositionManagers,er as useSpokeUserPositionManagers,Xs as useSpokes,Br as useSupply,Ys as useSupplyApyHistory,wr as useSupplySwap,Rr as useSupplySwapQuote,Sr as useSwappableTokens,fr as useTokenSwap,cr as useTokenSwapQuote,yr as useTokenSwapQuoteAction,Or as useUpdateUserPositionConditions,ot as useUserBalances,pt as useUserBalancesAction,et as useUserBorrows,st as useUserBorrowsAction,at as useUserPosition,tt as useUserPositions,nt as useUserPositionsAction,ut as useUserRiskPremiumBreakdown,rt as useUserSummary,it as useUserSummaryHistory,Xr as useUserSupplies,Zr as useUserSuppliesAction,dr as useUserSwaps,Cr as useWithdraw,br as useWithdrawSwap,Ar as useWithdrawSwapQuote};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|