@aave/react 4.0.0-next.11 → 4.0.0-next.13

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/index.d.cts CHANGED
@@ -1,13 +1,13 @@
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, S as SendTransactionError, P as PendingTransactionError, b as PendingTransaction, T as TransactionHandler } from './writes-BXnwYgAQ.cjs';
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-BXnwYgAQ.cjs';
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, SwapQuoteRequest, SwapQuote, SwappableTokensRequest, Token, UserSwapsRequest, PaginatedUserSwapsResult, PrepareSwapRequest, SwapByIntentTypedData, SwapByIntentWithApprovalRequired, SwapTransactionRequest, SwapApprovalRequired, ERC20PermitSignature, SwapReceipt, InsufficientBalanceError, CancelSwapTypedData, TransactionRequest, 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
- import { Prettify, 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-CB94S1RB.cjs';
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-CB94S1RB.cjs';
10
- import { UnexpectedError as UnexpectedError$1, SigningError, CancelError, TimeoutError, TransactionError, ValidationError as ValidationError$1 } from '@aave/core';
4
+ import { a as UseAsyncTask, C as CancelOperation, P as PendingTransaction, S as SendTransactionError, b as PendingTransactionError, T as TransactionHandler } from './writes-K_-o9pPN.cjs';
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-K_-o9pPN.cjs';
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, SwapQuoteRequest, SwapQuote, SwappableTokensRequest, Token, UserSwapsRequest, PaginatedUserSwapsResult, PrepareSupplySwapRequest, PrepareBorrowSwapRequest, TransactionRequest, PositionSwapApproval, SwapByIntent, SwapReceipt, InsufficientBalanceError, PrepareRepayWithSupplyRequest, PrepareWithdrawSwapRequest, PrepareTokenSwapRequest, SwapTypedData, SwapByIntentWithApprovalRequired, SwapTransactionRequest, SwapApprovalRequired, 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
+ 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-BbkH5nn7.cjs';
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-BbkH5nn7.cjs';
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
 
13
13
  /**
@@ -1172,7 +1172,7 @@ declare function useSpokeUserPositionManagers(args: Pausable<UseSpokeUserPositio
1172
1172
 
1173
1173
  type UseSwapQuoteArgs = Prettify<SwapQuoteRequest & CurrencyQueryOptions>;
1174
1174
  /**
1175
- * @internal
1175
+ * @experimental
1176
1176
  * Fetch a swap quote for the specified trade parameters.
1177
1177
  *
1178
1178
  * This signature supports React Suspense:
@@ -1180,17 +1180,17 @@ type UseSwapQuoteArgs = Prettify<SwapQuoteRequest & CurrencyQueryOptions>;
1180
1180
  * ```tsx
1181
1181
  * const { data } = useSwapQuote({
1182
1182
  * chainId: chainId(1),
1183
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1184
- * sell: { erc20: evmAddress('0x6B175474E...') },
1183
+ * buy: { erc20: evmAddress('0xA0b86a33E6') },
1184
+ * sell: { erc20: evmAddress('0x6B175474E') },
1185
1185
  * amount: bigDecimal('1000'),
1186
- * kind: SwapKind.SELL,
1186
+ * kind: SwapKind.Sell,
1187
1187
  * suspense: true,
1188
1188
  * });
1189
1189
  * ```
1190
1190
  */
1191
1191
  declare function useSwapQuote(args: UseSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
1192
1192
  /**
1193
- * @internal
1193
+ * @experimental
1194
1194
  * Fetch a swap quote for the specified trade parameters.
1195
1195
  *
1196
1196
  * Pausable suspense mode.
@@ -1198,11 +1198,11 @@ declare function useSwapQuote(args: UseSwapQuoteArgs & Suspendable): SuspenseRes
1198
1198
  * ```tsx
1199
1199
  * const { data } = useSwapQuote({
1200
1200
  * chainId: chainId(1),
1201
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1202
- * sell: { erc20: evmAddress('0x6B175474E...') },
1201
+ * buy: { erc20: evmAddress('0xA0b86a33E6') },
1202
+ * sell: { erc20: evmAddress('0x6B175474E') },
1203
1203
  * amount: bigDecimal('1000'),
1204
- * kind: SwapKind.SELL,
1205
- * from: evmAddress('0x742d35cc...'),
1204
+ * kind: SwapKind.Sell,
1205
+ * from: evmAddress('0x742d35cc'),
1206
1206
  * suspense: true,
1207
1207
  * pause: true,
1208
1208
  * });
@@ -1210,22 +1210,22 @@ declare function useSwapQuote(args: UseSwapQuoteArgs & Suspendable): SuspenseRes
1210
1210
  */
1211
1211
  declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
1212
1212
  /**
1213
- * @internal
1213
+ * @experimental
1214
1214
  * Fetch a swap quote for the specified trade parameters.
1215
1215
  *
1216
1216
  * ```tsx
1217
1217
  * const { data, error, loading } = useSwapQuote({
1218
1218
  * chainId: chainId(1),
1219
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1220
- * sell: { erc20: evmAddress('0x6B175474E...') },
1219
+ * buy: { erc20: evmAddress('0xA0b86a33E6') },
1220
+ * sell: { erc20: evmAddress('0x6B175474E') },
1221
1221
  * amount: bigDecimal('1000'),
1222
- * kind: SwapKind.SELL,
1222
+ * kind: SwapKind.Sell,
1223
1223
  * });
1224
1224
  * ```
1225
1225
  */
1226
1226
  declare function useSwapQuote(args: UseSwapQuoteArgs): ReadResult<SwapQuote>;
1227
1227
  /**
1228
- * @internal
1228
+ * @experimental
1229
1229
  * Fetch a swap quote for the specified trade parameters.
1230
1230
  *
1231
1231
  * Pausable loading state mode.
@@ -1233,18 +1233,18 @@ declare function useSwapQuote(args: UseSwapQuoteArgs): ReadResult<SwapQuote>;
1233
1233
  * ```tsx
1234
1234
  * const { data, error, loading, paused } = useSwapQuote({
1235
1235
  * chainId: chainId(1),
1236
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1237
- * sell: { erc20: evmAddress('0x6B175474E...') },
1236
+ * buy: { erc20: evmAddress('0xA0b86a33E6') },
1237
+ * sell: { erc20: evmAddress('0x6B175474E') },
1238
1238
  * amount: bigDecimal('1000'),
1239
- * kind: SwapKind.SELL,
1240
- * from: evmAddress('0x742d35cc...'),
1239
+ * kind: SwapKind.Sell,
1240
+ * from: evmAddress('0x742d35cc'),
1241
1241
  * pause: true,
1242
1242
  * });
1243
1243
  * ```
1244
1244
  */
1245
1245
  declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs>): PausableReadResult<SwapQuote>;
1246
1246
  /**
1247
- * @internal
1247
+ * @experimental
1248
1248
  * Low-level hook to execute a swap quote action directly.
1249
1249
  *
1250
1250
  * @experimental This hook is experimental and may be subject to breaking changes.
@@ -1260,10 +1260,10 @@ declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs>): PausableReadRes
1260
1260
  *
1261
1261
  * const result = await getQuote({
1262
1262
  * chainId: chainId(1),
1263
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1264
- * sell: { erc20: evmAddress('0x6B175474E...') },
1263
+ * buy: { erc20: evmAddress('0xA0b86a33E6') },
1264
+ * sell: { erc20: evmAddress('0x6B175474E') },
1265
1265
  * amount: bigDecimal('1000'),
1266
- * kind: SwapKind.SELL,
1266
+ * kind: SwapKind.Sell,
1267
1267
  * });
1268
1268
  *
1269
1269
  * if (result.isOk()) {
@@ -1276,7 +1276,7 @@ declare function useSwapQuote(args: Pausable<UseSwapQuoteArgs>): PausableReadRes
1276
1276
  declare function useSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<SwapQuoteRequest, SwapQuote, UnexpectedError$1>;
1277
1277
  type UseSwappableTokensArgs = SwappableTokensRequest;
1278
1278
  /**
1279
- * @internal
1279
+ * @experimental
1280
1280
  * Fetch the list of tokens available for swapping on a specific chain.
1281
1281
  *
1282
1282
  * This signature supports React Suspense:
@@ -1290,7 +1290,7 @@ type UseSwappableTokensArgs = SwappableTokensRequest;
1290
1290
  */
1291
1291
  declare function useSwappableTokens(args: UseSwappableTokensArgs & Suspendable): SuspenseResult<Token[]>;
1292
1292
  /**
1293
- * @internal
1293
+ * @experimental
1294
1294
  * Fetch the list of tokens available for swapping on a specific chain.
1295
1295
  *
1296
1296
  * Pausable suspense mode.
@@ -1305,7 +1305,7 @@ declare function useSwappableTokens(args: UseSwappableTokensArgs & Suspendable):
1305
1305
  */
1306
1306
  declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs> & Suspendable): PausableSuspenseResult<Token[]>;
1307
1307
  /**
1308
- * @internal
1308
+ * @experimental
1309
1309
  * Fetch the list of tokens available for swapping on a specific chain.
1310
1310
  *
1311
1311
  * ```tsx
@@ -1316,7 +1316,7 @@ declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs> & Sus
1316
1316
  */
1317
1317
  declare function useSwappableTokens(args: UseSwappableTokensArgs): ReadResult<Token[]>;
1318
1318
  /**
1319
- * @internal
1319
+ * @experimental
1320
1320
  * Fetch the list of tokens available for swapping on a specific chain.
1321
1321
  *
1322
1322
  * Pausable loading state mode.
@@ -1331,7 +1331,7 @@ declare function useSwappableTokens(args: UseSwappableTokensArgs): ReadResult<To
1331
1331
  declare function useSwappableTokens(args: Pausable<UseSwappableTokensArgs>): PausableReadResult<Token[]>;
1332
1332
  type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions>;
1333
1333
  /**
1334
- * @internal
1334
+ * @experimental
1335
1335
  * Fetch the user's swap history for a specific chain.
1336
1336
  *
1337
1337
  * This signature supports React Suspense:
@@ -1339,7 +1339,7 @@ type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions>;
1339
1339
  * ```tsx
1340
1340
  * const { data } = useUserSwaps({
1341
1341
  * chainId: chainId(1),
1342
- * user: evmAddress('0x742d35cc...'),
1342
+ * user: evmAddress('0x742d35cc'),
1343
1343
  * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1344
1344
  * suspense: true,
1345
1345
  * });
@@ -1347,7 +1347,7 @@ type UseUserSwapsArgs = Prettify<UserSwapsRequest & CurrencyQueryOptions>;
1347
1347
  */
1348
1348
  declare function useUserSwaps(args: UseUserSwapsArgs & Suspendable): SuspenseResult<PaginatedUserSwapsResult>;
1349
1349
  /**
1350
- * @internal
1350
+ * @experimental
1351
1351
  * Fetch the user's swap history for a specific chain.
1352
1352
  *
1353
1353
  * Pausable suspense mode.
@@ -1355,7 +1355,7 @@ declare function useUserSwaps(args: UseUserSwapsArgs & Suspendable): SuspenseRes
1355
1355
  * ```tsx
1356
1356
  * const { data } = useUserSwaps({
1357
1357
  * chainId: chainId(1),
1358
- * user: evmAddress('0x742d35cc...'),
1358
+ * user: evmAddress('0x742d35cc'),
1359
1359
  * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1360
1360
  * suspense: true,
1361
1361
  * pause: true,
@@ -1364,20 +1364,20 @@ declare function useUserSwaps(args: UseUserSwapsArgs & Suspendable): SuspenseRes
1364
1364
  */
1365
1365
  declare function useUserSwaps(args: Pausable<UseUserSwapsArgs> & Suspendable): PausableSuspenseResult<PaginatedUserSwapsResult>;
1366
1366
  /**
1367
- * @internal
1367
+ * @experimental
1368
1368
  * Fetch the user's swap history for a specific chain.
1369
1369
  *
1370
1370
  * ```tsx
1371
1371
  * const { data, error, loading } = useUserSwaps({
1372
1372
  * chainId: chainId(1),
1373
- * user: evmAddress('0x742d35cc...'),
1373
+ * user: evmAddress('0x742d35cc'),
1374
1374
  * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1375
1375
  * });
1376
1376
  * ```
1377
1377
  */
1378
1378
  declare function useUserSwaps(args: UseUserSwapsArgs): ReadResult<PaginatedUserSwapsResult>;
1379
1379
  /**
1380
- * @internal
1380
+ * @experimental
1381
1381
  * Fetch the user's swap history for a specific chain.
1382
1382
  *
1383
1383
  * Pausable loading state mode.
@@ -1385,36 +1385,387 @@ declare function useUserSwaps(args: UseUserSwapsArgs): ReadResult<PaginatedUserS
1385
1385
  * ```tsx
1386
1386
  * const { data, error, loading, paused } = useUserSwaps({
1387
1387
  * chainId: chainId(1),
1388
- * user: evmAddress('0x742d35cc...'),
1388
+ * user: evmAddress('0x742d35cc'),
1389
1389
  * filterBy: [SwapStatusFilter.FULFILLED, SwapStatusFilter.OPEN],
1390
1390
  * pause: true,
1391
1391
  * });
1392
1392
  * ```
1393
1393
  */
1394
1394
  declare function useUserSwaps(args: Pausable<UseUserSwapsArgs>): PausableReadResult<PaginatedUserSwapsResult>;
1395
- type UseSwapTokensRequest = Prettify<PrepareSwapRequest & CurrencyQueryOptions>;
1396
- type SwapIntent = SwapByIntentTypedData | SwapByIntentWithApprovalRequired | SwapTransactionRequest | SwapApprovalRequired;
1395
+ type UseSupplySwapQuoteArgs = Prettify<PrepareSupplySwapRequest & CurrencyQueryOptions>;
1396
+ /**
1397
+ * @experimental
1398
+ * Fetch a quote for a supply swap operation with the specified parameters.
1399
+ *
1400
+ * This signature supports React Suspense:
1401
+ *
1402
+ * ```tsx
1403
+ * const { data } = useSupplySwapQuote({
1404
+ * market: {
1405
+ * sellPosition: userSupplyItem.id,
1406
+ * buyReserve: reserve.id,
1407
+ * amount: bigDecimal('1000'),
1408
+ * user: evmAddress('0x742d35cc…'),
1409
+ * },
1410
+ * suspense: true,
1411
+ * });
1412
+ * ```
1413
+ */
1414
+ declare function useSupplySwapQuote(args: UseSupplySwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
1415
+ /**
1416
+ * @experimental
1417
+ * Fetch a quote for a supply swap operation with the specified parameters.
1418
+ *
1419
+ * Pausable suspense mode.
1420
+ *
1421
+ * ```tsx
1422
+ * const { data } = useSupplySwapQuote({
1423
+ * market: {
1424
+ * sellPosition: userSupplyItem.id,
1425
+ * buyReserve: reserve.id,
1426
+ * amount: bigDecimal('1000'),
1427
+ * user: evmAddress('0x742d35cc…'),
1428
+ * },
1429
+ * suspense: true,
1430
+ * pause: true,
1431
+ * });
1432
+ * ```
1433
+ */
1434
+ declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
1435
+ /**
1436
+ * @experimental
1437
+ * Fetch a quote for a supply swap operation with the specified parameters.
1438
+ *
1439
+ * ```tsx
1440
+ * const { data, error, loading } = useSupplySwapQuote({
1441
+ * market: {
1442
+ * sellPosition: userSupplyItem.id,
1443
+ * buyReserve: reserve.id,
1444
+ * amount: bigDecimal('1000'),
1445
+ * user: evmAddress('0x742d35cc…'),
1446
+ * },
1447
+ * });
1448
+ * ```
1449
+ */
1450
+ declare function useSupplySwapQuote(args: UseSupplySwapQuoteArgs): ReadResult<SwapQuote>;
1451
+ /**
1452
+ * @experimental
1453
+ * Fetch a quote for a supply swap operation with the specified parameters.
1454
+ *
1455
+ * Pausable loading state mode.
1456
+ *
1457
+ * ```tsx
1458
+ * const { data, error, loading, paused } = useSupplySwapQuote({
1459
+ * market: {
1460
+ * sellPosition: userSupplyItem.id,
1461
+ * buyReserve: reserve.id,
1462
+ * amount: bigDecimal('1000'),
1463
+ * user: evmAddress('0x742d35cc…'),
1464
+ * },
1465
+ * pause: true,
1466
+ * });
1467
+ * ```
1468
+ */
1469
+ declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs>): PausableReadResult<SwapQuote>;
1470
+ type UseBorrowSwapQuoteArgs = Prettify<PrepareBorrowSwapRequest & CurrencyQueryOptions>;
1471
+ /**
1472
+ * @experimental
1473
+ * Fetch a quote for a borrow swap operation with the specified parameters.
1474
+ *
1475
+ * This signature supports React Suspense:
1476
+ *
1477
+ * ```tsx
1478
+ * const { data } = useBorrowSwapQuote({
1479
+ * market: {
1480
+ * sellPosition: userBorrowItem.id,
1481
+ * buyReserve: reserve.id,
1482
+ * amount: bigDecimal('1000'),
1483
+ * user: evmAddress('0x742d35cc…'),
1484
+ * },
1485
+ * suspense: true,
1486
+ * });
1487
+ * ```
1488
+ */
1489
+ declare function useBorrowSwapQuote(args: UseBorrowSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
1490
+ /**
1491
+ * @experimental
1492
+ * Fetch a quote for a borrow swap operation with the specified parameters.
1493
+ *
1494
+ * Pausable suspense mode.
1495
+ *
1496
+ * ```tsx
1497
+ * const { data } = useBorrowSwapQuote({
1498
+ * market: {
1499
+ * sellPosition: userBorrowItem.id,
1500
+ * buyReserve: reserve.id,
1501
+ * amount: bigDecimal('1000'),
1502
+ * user: evmAddress('0x742d35cc…'),
1503
+ * },
1504
+ * suspense: true,
1505
+ * pause: true,
1506
+ * });
1507
+ * ```
1508
+ */
1509
+ declare function useBorrowSwapQuote(args: Pausable<UseBorrowSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
1510
+ /**
1511
+ * @experimental
1512
+ * Fetch a quote for a borrow swap operation with the specified parameters.
1513
+ *
1514
+ * ```tsx
1515
+ * const { data, error, loading } = useBorrowSwapQuote({
1516
+ * market: {
1517
+ * sellPosition: userBorrowItem.id,
1518
+ * buyReserve: reserve.id,
1519
+ * amount: bigDecimal('1000'),
1520
+ * user: evmAddress('0x742d35cc…'),
1521
+ * },
1522
+ * });
1523
+ * ```
1524
+ */
1525
+ declare function useBorrowSwapQuote(args: UseBorrowSwapQuoteArgs): ReadResult<SwapQuote>;
1526
+ /**
1527
+ * @experimental
1528
+ * Fetch a quote for a borrow swap operation with the specified parameters.
1529
+ *
1530
+ * Pausable loading state mode.
1531
+ *
1532
+ * ```tsx
1533
+ * const { data, error, loading, paused } = useBorrowSwapQuote({
1534
+ * market: {
1535
+ * sellPosition: userBorrowItem.id,
1536
+ * buyReserve: reserve.id,
1537
+ * amount: bigDecimal('1000'),
1538
+ * user: evmAddress('0x742d35cc…'),
1539
+ * },
1540
+ * pause: true,
1541
+ * });
1542
+ * ```
1543
+ */
1544
+ declare function useBorrowSwapQuote(args: Pausable<UseBorrowSwapQuoteArgs>): PausableReadResult<SwapQuote>;
1397
1545
  type SwapHandlerOptions = {
1398
1546
  cancel: CancelOperation;
1399
1547
  };
1400
- type SwapHandler = (intent: SwapIntent, options: SwapHandlerOptions) => ResultAsync<ERC20PermitSignature | SwapReceipt, SendTransactionError | PendingTransactionError>;
1401
1548
  /**
1402
- * @internal
1549
+ * @experimental
1550
+ */
1551
+ type UseSwapSignerRequest = TransactionRequest;
1552
+ /**
1553
+ * @experimental
1554
+ */
1555
+ type SwapSignerError = CancelError | SigningError | UnexpectedError$1;
1556
+ /**
1557
+ * @experimental
1558
+ */
1559
+ type UseSwapSignerResult = UseAsyncTask<UseSwapSignerRequest, PendingTransaction | Signature, SwapSignerError>;
1560
+ type PositionSwapPlan = PositionSwapApproval | SwapByIntent;
1561
+ type PositionSwapHandler = (plan: PositionSwapPlan, options: SwapHandlerOptions) => ResultAsync<PendingTransaction | Signature, SwapSignerError>;
1562
+ type PositionSwapValue = {
1563
+ quote?: SwapQuote;
1564
+ };
1565
+ /**
1566
+ * @experimental
1567
+ */
1568
+ type UseSupplySwapRequest = Prettify<PrepareSupplySwapRequest & CurrencyQueryOptions>;
1569
+ /**
1570
+ * @experimental
1571
+ */
1572
+ declare function useSupplySwap(handler: PositionSwapHandler): UseAsyncTask<PrepareSupplySwapRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1573
+ /**
1574
+ * @experimental
1575
+ */
1576
+ type UseBorrowSwapRequest = Prettify<PrepareBorrowSwapRequest & CurrencyQueryOptions>;
1577
+ /**
1578
+ * @experimental
1579
+ */
1580
+ declare function useBorrowSwap(handler: PositionSwapHandler): UseAsyncTask<PrepareBorrowSwapRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1581
+ type UseRepayWithSupplyQuoteArgs = Prettify<PrepareRepayWithSupplyRequest & CurrencyQueryOptions>;
1582
+ /**
1583
+ * @experimental
1584
+ * Fetch a quote for a repay with supply operation with the specified parameters.
1585
+ *
1586
+ * This signature supports React Suspense:
1587
+ *
1588
+ * ```tsx
1589
+ * const { data } = useRepayWithSupplyQuote({
1590
+ * market: {
1591
+ * sellPosition: userSupplyItem.id,
1592
+ * buyPosition: userBorrowItem.id,
1593
+ * amount: bigDecimal('1000'),
1594
+ * user: evmAddress('0x742d35cc…'),
1595
+ * },
1596
+ * suspense: true,
1597
+ * });
1598
+ * ```
1599
+ */
1600
+ declare function useRepayWithSupplyQuote(args: UseRepayWithSupplyQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
1601
+ /**
1602
+ * @experimental
1603
+ * Fetch a quote for a repay with supply operation with the specified parameters.
1604
+ *
1605
+ * Pausable suspense mode.
1606
+ *
1607
+ * ```tsx
1608
+ * const { data } = useRepayWithSupplyQuote({
1609
+ * market: {
1610
+ * sellPosition: userSupplyItem.id,
1611
+ * buyPosition: userBorrowItem.id,
1612
+ * amount: bigDecimal('1000'),
1613
+ * user: evmAddress('0x742d35cc…'),
1614
+ * },
1615
+ * suspense: true,
1616
+ * pause: true,
1617
+ * });
1618
+ * ```
1619
+ */
1620
+ declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
1621
+ /**
1622
+ * @experimental
1623
+ * Fetch a quote for a repay with supply operation with the specified parameters.
1624
+ *
1625
+ * ```tsx
1626
+ * const { data, error, loading } = useRepayWithSupplyQuote({
1627
+ * market: {
1628
+ * sellPosition: userSupplyItem.id,
1629
+ * buyPosition: userBorrowItem.id,
1630
+ * amount: bigDecimal('1000'),
1631
+ * user: evmAddress('0x742d35cc…'),
1632
+ * },
1633
+ * });
1634
+ * ```
1635
+ */
1636
+ declare function useRepayWithSupplyQuote(args: UseRepayWithSupplyQuoteArgs): ReadResult<SwapQuote>;
1637
+ /**
1638
+ * @experimental
1639
+ * Fetch a quote for a repay with supply operation with the specified parameters.
1640
+ *
1641
+ * Pausable loading state mode.
1642
+ *
1643
+ * ```tsx
1644
+ * const { data, error, loading, paused } = useRepayWithSupplyQuote({
1645
+ * market: {
1646
+ * sellPosition: userSupplyItem.id,
1647
+ * buyPosition: userBorrowItem.id,
1648
+ * amount: bigDecimal('1000'),
1649
+ * user: evmAddress('0x742d35cc…'),
1650
+ * },
1651
+ * pause: true,
1652
+ * });
1653
+ * ```
1654
+ */
1655
+ declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteArgs>): PausableReadResult<SwapQuote>;
1656
+ /**
1657
+ * @experimental
1658
+ */
1659
+ type UseRepayWithSupplyRequest = Prettify<PrepareRepayWithSupplyRequest & CurrencyQueryOptions>;
1660
+ /**
1661
+ * @experimental
1662
+ */
1663
+ declare function useRepayWithSupply(handler: PositionSwapHandler): UseAsyncTask<PrepareRepayWithSupplyRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1664
+ type UseWithdrawSwapQuoteArgs = Prettify<PrepareWithdrawSwapRequest & CurrencyQueryOptions>;
1665
+ /**
1666
+ * @experimental
1667
+ * Fetch a quote for a withdraw swap operation with the specified parameters.
1668
+ *
1669
+ * This signature supports React Suspense:
1670
+ *
1671
+ * ```tsx
1672
+ * const { data } = useWithdrawSwapQuote({
1673
+ * market: {
1674
+ * position: userSupplyItem.id,
1675
+ * buyReserve: reserve.id,
1676
+ * amount: bigDecimal('1000'),
1677
+ * user: evmAddress('0x742d35cc…'),
1678
+ * },
1679
+ * suspense: true,
1680
+ * });
1681
+ * ```
1682
+ */
1683
+ declare function useWithdrawSwapQuote(args: UseWithdrawSwapQuoteArgs & Suspendable): SuspenseResult<SwapQuote>;
1684
+ /**
1685
+ * @experimental
1686
+ * Fetch a quote for a withdraw swap operation with the specified parameters.
1687
+ *
1688
+ * Pausable suspense mode.
1689
+ *
1690
+ * ```tsx
1691
+ * const { data } = useWithdrawSwapQuote({
1692
+ * market: {
1693
+ * position: userSupplyItem.id,
1694
+ * buyReserve: reserve.id,
1695
+ * amount: bigDecimal('1000'),
1696
+ * user: evmAddress('0x742d35cc…'),
1697
+ * },
1698
+ * suspense: true,
1699
+ * pause: true,
1700
+ * });
1701
+ * ```
1702
+ */
1703
+ declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs> & Suspendable): PausableSuspenseResult<SwapQuote>;
1704
+ /**
1705
+ * @experimental
1706
+ * Fetch a quote for a withdraw swap operation with the specified parameters.
1707
+ *
1708
+ * ```tsx
1709
+ * const { data, error, loading } = useWithdrawSwapQuote({
1710
+ * market: {
1711
+ * position: userSupplyItem.id,
1712
+ * buyReserve: reserve.id,
1713
+ * amount: bigDecimal('1000'),
1714
+ * user: evmAddress('0x742d35cc…'),
1715
+ * },
1716
+ * });
1717
+ * ```
1718
+ */
1719
+ declare function useWithdrawSwapQuote(args: UseWithdrawSwapQuoteArgs): ReadResult<SwapQuote>;
1720
+ /**
1721
+ * @experimental
1722
+ * Fetch a quote for a withdraw swap operation with the specified parameters.
1723
+ *
1724
+ * Pausable loading state mode.
1725
+ *
1726
+ * ```tsx
1727
+ * const { data, error, loading, paused } = useWithdrawSwapQuote({
1728
+ * market: {
1729
+ * position: userSupplyItem.id,
1730
+ * buyReserve: reserve.id,
1731
+ * amount: bigDecimal('1000'),
1732
+ * user: evmAddress('0x742d35cc…'),
1733
+ * },
1734
+ * pause: true,
1735
+ * });
1736
+ * ```
1737
+ */
1738
+ declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs>): PausableReadResult<SwapQuote>;
1739
+ /**
1740
+ * @experimental
1741
+ */
1742
+ type UseWithdrawSwapRequest = Prettify<PrepareWithdrawSwapRequest & CurrencyQueryOptions>;
1743
+ /**
1744
+ * @experimental
1745
+ */
1746
+ declare function useWithdrawSwap(handler: PositionSwapHandler): UseAsyncTask<PrepareWithdrawSwapRequest, SwapReceipt, SwapSignerError | SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1747
+ type UseTokenSwapRequest = Prettify<PrepareTokenSwapRequest & CurrencyQueryOptions>;
1748
+ type TokenSwapPlan = SwapTypedData | SwapByIntentWithApprovalRequired | SwapTransactionRequest | SwapApprovalRequired;
1749
+ type TokenSwapHandler = (plan: TokenSwapPlan, options: SwapHandlerOptions) => ResultAsync<PendingTransaction | Signature, SwapSignerError>;
1750
+ /**
1751
+ * @experimental
1403
1752
  * Orchestrate the swap execution plan.
1404
1753
  *
1405
1754
  * ```tsx
1406
- * const [sendTransaction, sending] = useSendTransaction(wallet);
1407
- * const [signSwapByIntentWith, signing] = useSignSwapByIntentWith(wallet);
1755
+ * const [sendTransaction] = useSendTransaction(wallet);
1756
+ * const [signSwapTypedData] = useSignSwapTypedDataWith(wallet);
1408
1757
  *
1409
- * const [swap, swapping] = useSwapTokens((plan) => {
1758
+ * const [swap, { loading, error }] = useTokenSwap((plan) => {
1410
1759
  * switch (plan.__typename) {
1411
- * case 'SwapByIntentTypedData':
1412
- * return signSwapByIntentWith(plan);
1760
+ * case 'SwapTypedData':
1761
+ * return signSwapTypedData(plan);
1413
1762
  *
1414
1763
  * case 'SwapApprovalRequired':
1415
- * case 'SwapByIntentWithApprovalRequired':
1416
1764
  * return sendTransaction(plan.transaction);
1417
1765
  *
1766
+ * case 'SwapByIntentWithApprovalRequired':
1767
+ * return sendTransaction(plan.approval);
1768
+ *
1418
1769
  * case 'SwapTransactionRequest':
1419
1770
  * return sendTransaction(plan.transaction);
1420
1771
  * }
@@ -1423,11 +1774,11 @@ type SwapHandler = (intent: SwapIntent, options: SwapHandlerOptions) => ResultAs
1423
1774
  * const result = await swap({
1424
1775
  * market: {
1425
1776
  * chainId: chainId(1),
1426
- * buy: { erc20: evmAddress('0xA0b86a33E6...') },
1427
- * sell: { erc20: evmAddress('0x6B175474E...') },
1777
+ * buy: { erc20: evmAddress('0xA0b86a33E6') },
1778
+ * sell: { erc20: evmAddress('0x6B175474E') },
1428
1779
  * amount: bigDecimal('1000'),
1429
- * kind: SwapKind.SELL,
1430
- * user: evmAddress('0x742d35cc...'),
1780
+ * kind: SwapKind.Sell,
1781
+ * user: evmAddress('0x742d35cc'),
1431
1782
  * },
1432
1783
  * });
1433
1784
  *
@@ -1439,32 +1790,32 @@ type SwapHandler = (intent: SwapIntent, options: SwapHandlerOptions) => ResultAs
1439
1790
  * // result.value: SwapReceipt
1440
1791
  * ```
1441
1792
  */
1442
- declare function useSwapTokens(handler: SwapHandler): UseAsyncTask<PrepareSwapRequest, SwapReceipt, SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1443
- type CancelSwapHandler = (data: CancelSwapTypedData | TransactionRequest) => ResultAsync<ERC20PermitSignature | PendingTransaction, SigningError | UnexpectedError$1>;
1793
+ declare function useTokenSwap(handler: TokenSwapHandler): UseAsyncTask<UseTokenSwapRequest, SwapReceipt, SendTransactionError | PendingTransactionError | ValidationError<InsufficientBalanceError>>;
1794
+ type CancelSwapHandler = (data: SwapTypedData | TransactionRequest, options: SwapHandlerOptions) => ResultAsync<PendingTransaction | Signature, SwapSignerError>;
1444
1795
  declare class CannotCancelSwapError extends ResultAwareError {
1445
1796
  name: "CannotCancelSwapError";
1446
1797
  }
1447
1798
  type CancelSwapError = CancelError | CannotCancelSwapError | SigningError | TimeoutError | TransactionError | UnexpectedError$1;
1448
1799
  /**
1449
- * @internal
1800
+ * @experimental
1450
1801
  * Executes the complete swap cancellation workflow combining preparation and execution.
1451
1802
  *
1452
1803
  * ```tsx
1453
1804
  * const [sendTransaction] = useSendTransaction(wallet);
1454
- * const [signSwapCancelWith] = useSignSwapCancelWith(wallet);
1805
+ * const [signSwapTypedData] = useSignSwapTypedDataWith(wallet);
1455
1806
  *
1456
- * const [cancelSwap, {loading, error}] = useCancelSwap((plan: CancelSwapTypedData | TransactionRequest) => {
1807
+ * const [cancelSwap, { loading, error }] = useCancelSwap((plan) => {
1457
1808
  * switch (plan.__typename) {
1458
1809
  * case 'TransactionRequest':
1459
1810
  * return sendTransaction(plan);
1460
1811
  *
1461
- * case 'CancelSwapTypedData':
1462
- * return signSwapCancelWith(plan);
1812
+ * case 'SwapTypedData':
1813
+ * return signSwapTypedData(plan);
1463
1814
  * }
1464
1815
  * });
1465
1816
  *
1466
1817
  * const result = await cancelSwap({
1467
- * id: swapId('123...'),
1818
+ * id: swapId('123'),
1468
1819
  * });
1469
1820
  *
1470
1821
  * if (result.isErr()) {
@@ -2803,4 +3154,4 @@ declare function useUserSummaryHistory(args: UseUserSummaryHistoryArgs): ReadRes
2803
3154
  */
2804
3155
  declare function useUserSummaryHistory(args: Pausable<UseUserSummaryHistoryArgs>): PausableReadResult<UserSummaryHistoryItem[]>;
2805
3156
 
2806
- export { AaveProvider, type AaveProviderProps, type CancelSwapError, type CancelSwapHandler, CannotCancelSwapError, SendTransactionError, type SwapHandler, type SwapHandlerOptions, type SwapIntent, type UseActivitiesArgs, type UseAssetArgs, type UseAssetBorrowHistoryArgs, type UseAssetPriceHistoryArgs, type UseAssetSupplyHistoryArgs, UseAsyncTask, type UseBorrowApyHistoryArgs, type UseHubArgs, type UseHubAssetsArgs, type UseHubSummaryHistoryArgs, type UseHubsArgs, type UsePreviewArgs, type UseProtocolHistoryArgs, type UseReserveArgs, type UseReservesArgs, type UseSpokeArgs, type UseSpokePositionManagersArgs, type UseSpokeUserPositionManagersArgs, type UseSpokesArgs, type UseSupplyApyHistoryArgs, type UseSwapQuoteArgs, type UseSwapTokensRequest, type UseSwappableTokensArgs, type UseUserBalancesArgs, type UseUserBorrowsArgs, type UseUserPositionArgs, type UseUserPositionsArgs, type UseUserRiskPremiumBreakdownArgs, type UseUserSummaryArgs, type UseUserSummaryHistoryArgs, type UseUserSuppliesArgs, type UseUserSwapsArgs, useAaveClient, useActivities, useActivitiesAction, useAsset, useAssetBorrowHistory, useAssetPriceHistory, useAssetSupplyHistory, useBorrow, useBorrowApyHistory, useCancelSwap, useHub, useHubAssets, useHubSummaryHistory, useHubs, useHubsAction, useLiquidatePosition, usePermitTypedDataAction, usePreview, usePreviewAction, useProtocolHistory, useRenounceSpokeUserPositionManager, useRepay, useReserve, useReserveAction, useReserves, useReservesAction, useSetSpokeUserPositionManager, useSetUserSuppliesAsCollateral, useSpoke, useSpokePositionManagers, useSpokeUserPositionManagers, useSpokes, useSupply, useSupplyApyHistory, useSwapQuote, useSwapQuoteAction, useSwapTokens, useSwappableTokens, useUpdateUserPositionConditions, useUserBalances, useUserBalancesAction, useUserBorrows, useUserBorrowsAction, useUserPosition, useUserPositions, useUserPositionsAction, useUserRiskPremiumBreakdown, useUserSummary, useUserSummaryHistory, useUserSupplies, useUserSuppliesAction, useUserSwaps, useWithdraw };
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 UseSwapQuoteArgs, type UseSwapSignerRequest, type UseSwapSignerResult, type UseSwappableTokensArgs, 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, useSwapQuote, useSwapQuoteAction, useSwappableTokens, useTokenSwap, useUpdateUserPositionConditions, useUserBalances, useUserBalancesAction, useUserBorrows, useUserBorrowsAction, useUserPosition, useUserPositions, useUserPositionsAction, useUserRiskPremiumBreakdown, useUserSummary, useUserSummaryHistory, useUserSupplies, useUserSuppliesAction, useUserSwaps, useWithdraw, useWithdrawSwap, useWithdrawSwapQuote };