@aave/react 4.0.0-next.17 → 4.0.0-next.19
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export * from '@aave/client';
|
|
|
3
3
|
import React, { ReactNode } from 'react';
|
|
4
4
|
import { a as UseAsyncTask, C as CancelOperation, P as PendingTransaction, S as SendTransactionError, b as PendingTransactionError, T as TransactionHandler } from './writes-YQQTp7E5.cjs';
|
|
5
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.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, MarketOrderTokenSwapQuoteInput, SwapQuote, SwappableTokensRequest, Token, UserSwapsRequest, PaginatedUserSwapsResult, SupplySwapQuoteRequest,
|
|
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, SwapTypedData, SwapReceipt, InsufficientBalanceError, RepayWithSupplyQuoteRequest, WithdrawSwapQuoteRequest, TokenSwapQuoteRequest, 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
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-Bqd-LTM7.cjs';
|
|
9
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-Bqd-LTM7.cjs';
|
|
@@ -1475,7 +1475,7 @@ declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs>): Pau
|
|
|
1475
1475
|
* }
|
|
1476
1476
|
* ```
|
|
1477
1477
|
*/
|
|
1478
|
-
declare function useSupplySwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1478
|
+
declare function useSupplySwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<SupplySwapQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1479
1479
|
type UseBorrowSwapQuoteArgs = Prettify<BorrowSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1480
1480
|
/**
|
|
1481
1481
|
* Fetch a quote for a borrow swap operation with the specified parameters.
|
|
@@ -1573,7 +1573,7 @@ declare function useBorrowSwapQuote(args: Pausable<UseBorrowSwapQuoteArgs>): Pau
|
|
|
1573
1573
|
* }
|
|
1574
1574
|
* ```
|
|
1575
1575
|
*/
|
|
1576
|
-
declare function useBorrowSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1576
|
+
declare function useBorrowSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<BorrowSwapQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1577
1577
|
type SwapHandlerOptions = {
|
|
1578
1578
|
cancel: CancelOperation;
|
|
1579
1579
|
};
|
|
@@ -1586,7 +1586,7 @@ type SwapSignerError = CancelError | SigningError | UnexpectedError$1;
|
|
|
1586
1586
|
/**
|
|
1587
1587
|
*/
|
|
1588
1588
|
type UseSwapSignerResult = UseAsyncTask<UseSwapSignerRequest, PendingTransaction | Signature, SwapSignerError>;
|
|
1589
|
-
type PositionSwapPlan = PositionSwapApproval |
|
|
1589
|
+
type PositionSwapPlan = PositionSwapApproval | SwapTypedData;
|
|
1590
1590
|
type PositionSwapHandler = (plan: PositionSwapPlan, options: SwapHandlerOptions) => ResultAsync<PendingTransaction | Signature, SwapSignerError>;
|
|
1591
1591
|
type PositionSwapValue = {
|
|
1592
1592
|
quote?: SwapQuote;
|
|
@@ -1700,7 +1700,7 @@ declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteA
|
|
|
1700
1700
|
* }
|
|
1701
1701
|
* ```
|
|
1702
1702
|
*/
|
|
1703
|
-
declare function useRepayWithSupplyQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1703
|
+
declare function useRepayWithSupplyQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<RepayWithSupplyQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1704
1704
|
/**
|
|
1705
1705
|
*/
|
|
1706
1706
|
type UseRepayWithSupplyRequest = Prettify<RepayWithSupplyQuoteRequest & CurrencyQueryOptions>;
|
|
@@ -1804,7 +1804,7 @@ declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs>):
|
|
|
1804
1804
|
* }
|
|
1805
1805
|
* ```
|
|
1806
1806
|
*/
|
|
1807
|
-
declare function useWithdrawSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1807
|
+
declare function useWithdrawSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<WithdrawSwapQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1808
1808
|
/**
|
|
1809
1809
|
*/
|
|
1810
1810
|
type UseWithdrawSwapRequest = Prettify<WithdrawSwapQuoteRequest & CurrencyQueryOptions>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from '@aave/client';
|
|
|
3
3
|
import React, { ReactNode } from 'react';
|
|
4
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
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,
|
|
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, SwapTypedData, SwapReceipt, InsufficientBalanceError, RepayWithSupplyQuoteRequest, WithdrawSwapQuoteRequest, TokenSwapQuoteRequest, 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
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
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';
|
|
@@ -1475,7 +1475,7 @@ declare function useSupplySwapQuote(args: Pausable<UseSupplySwapQuoteArgs>): Pau
|
|
|
1475
1475
|
* }
|
|
1476
1476
|
* ```
|
|
1477
1477
|
*/
|
|
1478
|
-
declare function useSupplySwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1478
|
+
declare function useSupplySwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<SupplySwapQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1479
1479
|
type UseBorrowSwapQuoteArgs = Prettify<BorrowSwapQuoteRequest & CurrencyQueryOptions>;
|
|
1480
1480
|
/**
|
|
1481
1481
|
* Fetch a quote for a borrow swap operation with the specified parameters.
|
|
@@ -1573,7 +1573,7 @@ declare function useBorrowSwapQuote(args: Pausable<UseBorrowSwapQuoteArgs>): Pau
|
|
|
1573
1573
|
* }
|
|
1574
1574
|
* ```
|
|
1575
1575
|
*/
|
|
1576
|
-
declare function useBorrowSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1576
|
+
declare function useBorrowSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<BorrowSwapQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1577
1577
|
type SwapHandlerOptions = {
|
|
1578
1578
|
cancel: CancelOperation;
|
|
1579
1579
|
};
|
|
@@ -1586,7 +1586,7 @@ type SwapSignerError = CancelError | SigningError | UnexpectedError$1;
|
|
|
1586
1586
|
/**
|
|
1587
1587
|
*/
|
|
1588
1588
|
type UseSwapSignerResult = UseAsyncTask<UseSwapSignerRequest, PendingTransaction | Signature, SwapSignerError>;
|
|
1589
|
-
type PositionSwapPlan = PositionSwapApproval |
|
|
1589
|
+
type PositionSwapPlan = PositionSwapApproval | SwapTypedData;
|
|
1590
1590
|
type PositionSwapHandler = (plan: PositionSwapPlan, options: SwapHandlerOptions) => ResultAsync<PendingTransaction | Signature, SwapSignerError>;
|
|
1591
1591
|
type PositionSwapValue = {
|
|
1592
1592
|
quote?: SwapQuote;
|
|
@@ -1700,7 +1700,7 @@ declare function useRepayWithSupplyQuote(args: Pausable<UseRepayWithSupplyQuoteA
|
|
|
1700
1700
|
* }
|
|
1701
1701
|
* ```
|
|
1702
1702
|
*/
|
|
1703
|
-
declare function useRepayWithSupplyQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1703
|
+
declare function useRepayWithSupplyQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<RepayWithSupplyQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1704
1704
|
/**
|
|
1705
1705
|
*/
|
|
1706
1706
|
type UseRepayWithSupplyRequest = Prettify<RepayWithSupplyQuoteRequest & CurrencyQueryOptions>;
|
|
@@ -1804,7 +1804,7 @@ declare function useWithdrawSwapQuote(args: Pausable<UseWithdrawSwapQuoteArgs>):
|
|
|
1804
1804
|
* }
|
|
1805
1805
|
* ```
|
|
1806
1806
|
*/
|
|
1807
|
-
declare function useWithdrawSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<
|
|
1807
|
+
declare function useWithdrawSwapQuoteAction(options?: Required<CurrencyQueryOptions>): UseAsyncTask<WithdrawSwapQuoteRequest, SwapQuote, UnexpectedError$1>;
|
|
1808
1808
|
/**
|
|
1809
1809
|
*/
|
|
1810
1810
|
type UseWithdrawSwapRequest = Prettify<WithdrawSwapQuoteRequest & CurrencyQueryOptions>;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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 ee,{useCallback}from'react';import {hubs,reserve,reserves,tokenSwapQuote,supplySwapQuote,borrowSwapQuote,preparePositionSwap,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 ee.createElement(d,{client:e},s)}function bs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:HubQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function fs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:HubsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function xs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:HubAssetsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function Ts({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:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:AssetQuery,variables:{request:n,currency:r,timeWindow:t},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:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:ReserveQuery,variables:{request:n,currency:r,timeWindow:t},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:t=DEFAULT_QUERY_OPTIONS.timeWindow,selector:n,...a}){return b({document:ReservesQuery,variables:{request:a,currency:r,timeWindow:t},suspense:s,pause:e,selector:n||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 G(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,...t}){return b({document:TokenSwapQuoteQuery,variables:{request:{market:t},currency:r},selector:G,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(G),[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:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserSwapsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function Rr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:SupplySwapQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function Ur(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>supplySwapQuote(e$1,{market:r},{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function wr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:BorrowSwapQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function mr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>borrowSwapQuote(e$1,{market:r},{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function H(s){return {with:e=>s.approvals.reduce((r,t)=>r.andThen(n=>e(t,{cancel:b$1}).map(a=>{switch(t.__typename){case "PositionSwapAdapterContractApproval":n.adapterContractSignature=isSignature(a)?a:null;break;case "PositionSwapPositionManagerApproval":n.positionManagerSignature=isSignature(a)?a:null;break}return n})),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 gr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>supplySwapQuote(e$1,t,{currency:r}).andThen(n=>(invariant(n.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`),H(n).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:n.quote.quoteId,signature:a})))),[e$1,s])}function Ar(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>borrowSwapQuote(e$1,t,{currency:r}).andThen(n=>(invariant(n.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`),H(n).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:n.quote.quoteId,signature:a})))),[e$1,s])}function Pr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:RepayWithSupplyQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function br(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>repayWithSupplyQuote(e$1,{market:r},{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function fr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>repayWithSupplyQuote(e$1,t,{currency:r}).andThen(n=>(invariant(n.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`),H(n).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:n.quote.quoteId,signature:a})))),[e$1,s])}function xr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:WithdrawSwapQuoteQuery,variables:{request:t,currency:r},selector:n=>(invariant(n.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`),n.quote),suspense:s,pause:e})}function Tr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>withdrawSwapQuote(e$1,{market:r},{currency:s.currency}).map(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),t.quote)),[e$1,s.currency])}function kr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>withdrawSwapQuote(e$1,t,{currency:r}).andThen(n=>(invariant(n.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`),H(n).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:n.quote.quoteId,signature:a})))),[e$1,s])}function Qr(s){let e$1=e(),r=useCallback(t=>{switch(t.__typename){case "SwapTransactionRequest":return s(t,{cancel:b$1}).map(c.ensure).andThen(n=>n.wait()).andThen(()=>okAsync(t.orderReceipt));case "InsufficientBalanceError":return ValidationError.fromGqlNode(t).asResultAsync();case "SwapReceipt":return okAsync(t);default:return new UnexpectedError(`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}},[s]);return a(({currency:t=DEFAULT_QUERY_OPTIONS.currency,...n})=>tokenSwapQuote(e$1,n,{currency:t}).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}):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 hr(s){let e$1=e();return a(r=>swapStatus(e$1,{id:r.id}).andThen(t=>{switch(t.__typename){case "SwapOpen":case "SwapPendingSignature":return prepareSwapCancel(e$1,r).andThen(n=>s(n.data,{cancel:b$1})).map(n=>(invariant(isSignature(n),"Invalid signature"),n)).andThen(n=>cancelSwap(e$1,{intent:{id:r.id,signature:n}})).andThen(n=>n.__typename==="SwapCancelled"?okAsync(n):s(n,{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(t);case "SwapExpired":return new Q("Swap cannot longer be cancelled").asResultAsync();default:return new UnexpectedError(`Unsupported swap status: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}),[e$1,s])}function E(s,e){let{chainId:r,spoke:t}=decodeReserveId(e.reserve);return async()=>Promise.all([await s.refreshQueryWhere(UserPositionsQuery,(n,a)=>n.request.user===e.sender&&a.some(o=>o.spoke.chain.chainId===r&&o.spoke.address===t)),await s.refreshQueryWhere(UserPositionQuery,(n,a)=>a?.spoke.chain.chainId===r&&a?.spoke.address===t&&a.user===e.sender),await s.refreshQueryWhere(UserSummaryQuery,n=>n.request.user===e.sender&&isSpokeInputVariant(n.request.filter)?n.request.filter.spoke.chainId===r&&n.request.filter.spoke.address===t:isChainIdsVariant(n.request.filter)?n.request.filter.chainIds.some(a=>a===r):false),await s.refreshQueryWhere(ReservesQuery,(n,a)=>a.some(o=>o.id===e.reserve)),await s.refreshQueryWhere(SpokesQuery,(n,a)=>a.some(o=>o.chain.chainId===r&&o.address===t)),await s.refreshQueryWhere(UserBalancesQuery,n=>n.request.user===e.sender),await s.refreshQueryWhere(HubsQuery,n=>isChainIdsVariant(n.request)&&n.request.chainIds.some(a=>a===r))])}function _r(s){let e$1=e();return a(r=>supply(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(t))}}).andTee(E(e$1,r)),[e$1,s])}function Or(s){let e$1=e();return a(r=>borrow(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(t))}}).andTee(E(e$1,r)),[e$1,s])}function Mr(s){let e$1=e();return a(r=>repay(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(t))}}).andTee(E(e$1,r)),[e$1,s])}function Nr(s){let e$1=e();return a(r=>withdraw(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(t))}}).andTee(E(e$1,r)),[e$1,s])}function Dr(s){let e$1=e();return a(r=>renounceSpokeUserPositionManager(e$1,r).andThen(t=>s(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,t=>t.request.spoke===r.spoke)),[e$1,s])}function Fr(s){let e$1=e();return a(r=>updateUserPositionConditions(e$1,r).andThen(t=>s(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction).andTee(async()=>{let{userPositionId:t}=r;return Promise.all([e$1.refreshQueryWhere(UserPositionsQuery,(n,a)=>a.some(o=>o.id===t)),e$1.refreshQueryWhere(UserPositionQuery,(n,a)=>a?.id===t)])}),[e$1,s])}function Vr(s){let e$1=e();return a(r=>{let t=r.changes.map(a=>a.reserve),n=t.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([...n.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(UserPositionsQuery,(d,U)=>d.request.user===r.sender&&U.some(P=>P.spoke.chain.chainId===a&&P.spoke.address===o))),...n.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(UserPositionQuery,(d,U)=>U?.spoke.chain.chainId===a&&U?.spoke.address===o&&U.user===r.sender)),...n.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(UserSummaryQuery,d=>d.request.user===r.sender&&isSpokeInputVariant(d.request.filter)?d.request.filter.spoke.chainId===a&&d.request.filter.spoke.address===o:isChainIdsVariant(d.request.filter)?d.request.filter.chainIds.some(U=>U===a):false)),e$1.refreshQueryWhere(ReservesQuery,(a,o)=>o.some(d=>t.includes(d.id))),...n.map(({chainId:a,spoke:o})=>e$1.refreshQueryWhere(SpokesQuery,(d,U)=>U.some(P=>P.chain.chainId===a&&P.address===o))),...n.map(({chainId:a})=>e$1.refreshQueryWhere(HubsQuery,o=>isChainIdsVariant(o.request.query)?o.request.query.chainIds.some(d=>d===a):o.request.query.tokens.some(d=>d.chainId===a))),...n.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 $r(s){let e$1=e();return a(r=>liquidatePosition(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(t))}}),[e$1,s])}function Lr(s){let e$1=e();return a(r=>setSpokeUserPositionManager(e$1,r).andThen(t=>s(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,t=>t.request.spoke===r.spoke)),[e$1,s])}function Gr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>preview(e$1,r,{currency:s.currency}),[e$1,s.currency])}function Yr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:PreviewQuery,variables:{request:t,currency:r},suspense:s,pause:e})}function jr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:ActivitiesQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function zr(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 rt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserSuppliesQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function tt(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 nt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserBorrowsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function at(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 ot({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserSummaryQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function ut({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserPositionsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function pt(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 it({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserPositionQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function lt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserBalancesQuery,variables:{request:t,currency:r},suspense:s,pause:e})}function ct({suspense:s=false,pause:e=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function yt(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBalances(e$1,r,{currency:s.currency}),[e$1,s.currency])}function St({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserSummaryHistoryQuery,variables:{request:t,currency:r},suspense:s,pause:e,batch:false})}export{Rs as AaveProvider,Q as CannotCancelSwapError,jr as useActivities,zr as useActivitiesAction,vs as useAsset,Is as useAssetBorrowHistory,Es as useAssetPriceHistory,Bs as useAssetSupplyHistory,Or as useBorrow,Gs as useBorrowApyHistory,Ar as useBorrowSwap,wr as useBorrowSwapQuote,mr as useBorrowSwapQuoteAction,hr as useCancelSwap,bs as useHub,xs as useHubAssets,Ts as useHubSummaryHistory,fs as useHubs,ks as useHubsAction,$r as useLiquidatePosition,Yr as usePreview,Gr as usePreviewAction,Ws as useProtocolHistory,Dr as useRenounceSpokeUserPositionManager,Mr as useRepay,fr as useRepayWithSupply,Pr as useRepayWithSupplyQuote,br as useRepayWithSupplyQuoteAction,Fs as useReserve,Vs as useReserveAction,$s as useReserves,Ls as useReservesAction,Lr as useSetSpokeUserPositionManager,Vr as useSetUserSuppliesAsCollateral,Ks as useSpoke,Zs as useSpokePositionManagers,er as useSpokeUserPositionManagers,Xs as useSpokes,_r as useSupply,Ys as useSupplyApyHistory,gr as useSupplySwap,Rr as useSupplySwapQuote,Ur as useSupplySwapQuoteAction,Sr as useSwappableTokens,Qr as useTokenSwap,cr as useTokenSwapQuote,yr as useTokenSwapQuoteAction,Fr as useUpdateUserPositionConditions,lt as useUserBalances,yt as useUserBalancesAction,nt as useUserBorrows,at as useUserBorrowsAction,it as useUserPosition,ut as useUserPositions,pt as useUserPositionsAction,ct as useUserRiskPremiumBreakdown,ot as useUserSummary,St as useUserSummaryHistory,rt as useUserSupplies,tt as useUserSuppliesAction,dr as useUserSwaps,Nr as useWithdraw,kr as useWithdrawSwap,xr as useWithdrawSwapQuote,Tr as useWithdrawSwapQuoteAction};//# 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}from'@aave/client';export*from'@aave/client';import X,{useCallback}from'react';import {hubs,reserve,reserves,tokenSwapQuote,supplySwapQuote,borrowSwapQuote,preparePositionSwap,repayWithSupplyQuote,withdrawSwapQuote,swap,prepareTokenSwap,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}from'@aave/core';import {invariant,isSignature,okAsync,never,ResultAwareError,errAsync}from'@aave/types';function ds({children:s,client:e}){return X.createElement(d,{client:e},s)}function As({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:HubQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function bs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:HubsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function fs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:HubAssetsQuery,variables:{request:n,currency:r,timeWindow:t},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 Ts(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>hubs(e$1,r,{currency:s.currency}),[e$1,s.currency])}function hs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:AssetQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function vs({suspense:s=false,pause:e=false,...r}){return b({document:AssetPriceHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Es({suspense:s=false,pause:e=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Bs({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 _s({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:ReserveQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function Fs(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 Vs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,selector:n,...u}){return b({document:ReservesQuery,variables:{request:u,currency:r,timeWindow:t},suspense:s,pause:e,selector:n||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 Ys({suspense:s=false,pause:e=false,...r}){return b({document:BorrowApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Gs({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 Ks({suspense:s=false,pause:e=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:s,pause:e})}function Xs({suspense:s=false,pause:e=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function Zs({suspense:s=false,pause:e=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function L(s){switch(s.__typename){case "SwapByIntent":case "SwapByIntentWithApprovalRequired":case "SwapByTransaction":return s.quote;default:throw UnexpectedError.upgradeRequired(`Unsupported swap quote result: ${s.__typename}`)}}function lr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:TokenSwapQuoteQuery,variables:{request:{market:t},currency:r},selector:L,suspense:s,pause:e})}function cr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>tokenSwapQuote(e$1,{market:r},{currency:s.currency}).map(L),[e$1,s.currency])}function yr({suspense:s=false,pause:e=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:s,pause:e})}function Sr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserSwapsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function dr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:SupplySwapQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function Rr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>supplySwapQuote(e$1,r,{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function Ur({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:BorrowSwapQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function wr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>borrowSwapQuote(e$1,r,{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function q(s){return {with:e=>s.approvals.reduce((r,t)=>r.andThen(n=>e(t,{cancel:b$1}).map(u=>{switch(t.__typename){case "PositionSwapAdapterContractApproval":n.adapterContractSignature=isSignature(u)?u:null;break;case "PositionSwapPositionManagerApproval":n.positionManagerSignature=isSignature(u)?u:null;break}return n})),okAsync({quoteId:s.quote.quoteId,adapterContractSignature:null,positionManagerSignature:null}))}}function H(s,e){return swap(s,{intent:e}).andThen(r=>{switch(r.__typename){case "SwapReceipt":return okAsync(r);default:return UnexpectedError.from(r).asResultAsync()}})}function mr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>supplySwapQuote(e$1,t,{currency:r}).andThen(n=>q(n).with(s).andThen(u=>preparePositionSwap(e$1,u)).andThen(u=>s(u.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(u=>H(e$1,{quoteId:n.quote.quoteId,signature:u}))),[e$1,s])}function gr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>borrowSwapQuote(e$1,t,{currency:r}).andThen(n=>q(n).with(s).andThen(u=>preparePositionSwap(e$1,u)).andThen(u=>s(u.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(u=>H(e$1,{quoteId:n.quote.quoteId,signature:u}))),[e$1,s])}function Pr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:RepayWithSupplyQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function Ar(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>repayWithSupplyQuote(e$1,r,{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function br(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>repayWithSupplyQuote(e$1,t,{currency:r}).andThen(n=>q(n).with(s).andThen(u=>preparePositionSwap(e$1,u)).andThen(u=>s(u.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(u=>H(e$1,{quoteId:n.quote.quoteId,signature:u}))),[e$1,s])}function fr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:WithdrawSwapQuoteQuery,variables:{request:t,currency:r},selector:n=>n.quote,suspense:s,pause:e})}function xr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>withdrawSwapQuote(e$1,r,{currency:s.currency}).map(t=>t.quote),[e$1,s.currency])}function Tr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...t})=>withdrawSwapQuote(e$1,t,{currency:r}).andThen(n=>q(n).with(s).andThen(u=>preparePositionSwap(e$1,u)).andThen(u=>s(u.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(u=>H(e$1,{quoteId:n.quote.quoteId,signature:u}))),[e$1,s])}function Qr(s){let e$1=e(),r=useCallback(t=>swap(e$1,t).andThen(n=>{switch(n.__typename){case "SwapTransactionRequest":return s(n,{cancel:b$1}).map(c.ensure).andThen(u=>u.wait()).andThen(()=>okAsync(n.orderReceipt));case "SwapReceipt":return okAsync(n)}}),[e$1,s]);return a(({currency:t=DEFAULT_QUERY_OPTIONS.currency,...n})=>tokenSwapQuote(e$1,n,{currency:t}).andThen(u=>{switch(u.__typename){case "SwapByTransaction":return r({transaction:{quoteId:u.quote.quoteId}});case "SwapByIntent":return prepareTokenSwap(e$1,{quoteId:u.quote.quoteId}).andThen(o=>s(o.data,{cancel:b$1}).map(c=>(invariant(isSignature(c),"Invalid signature"),c)).andThen(c=>r({intent:{quoteId:o.newQuoteId,signature:c}})));case "SwapByIntentWithApprovalRequired":return s(u.approval,{cancel:b$1}).andThen(o=>isERC20PermitSignature(o)?prepareTokenSwap(e$1,{quoteId:u.quote.quoteId,permitSig:o}):c.isInstanceOf(o)?o.wait().andThen(()=>prepareTokenSwap(e$1,{quoteId:u.quote.quoteId})):UnexpectedError.from(o).asResultAsync()).andThen(o=>s(o.data,{cancel:b$1}).map(c=>(invariant(isSignature(c),"Invalid signature"),c)).andThen(c=>r({intent:{quoteId:u.quote.quoteId,signature:c}})));default:never(`Unsupported swap quote result: ${u.__typename}. To be removed from API soon.`);}}),[e$1,s,r])}var T=class extends ResultAwareError{name="CannotCancelSwapError"};function kr(s){let e$1=e();return a(r=>swapStatus(e$1,{id:r.id}).andThen(t=>{switch(t.__typename){case "SwapOpen":case "SwapPendingSignature":return prepareSwapCancel(e$1,r).andThen(n=>s(n.data,{cancel:b$1})).map(n=>(invariant(isSignature(n),"Invalid signature"),n)).andThen(n=>cancelSwap(e$1,{intent:{id:r.id,signature:n}})).andThen(n=>n.__typename==="SwapCancelled"?okAsync(n):s(n,{cancel:b$1}).map(c.ensure).andThen(u=>u.wait()).andThen(()=>swapStatus(e$1,{id:r.id})).andThen(u=>u.__typename==="SwapCancelled"?okAsync(u):new T("Failed to cancel swap").asResultAsync()));case "SwapCancelled":return okAsync(t);case "SwapExpired":return new T("Swap cannot longer be cancelled").asResultAsync();default:return UnexpectedError.upgradeRequired(`Unsupported swap status: ${t.__typename}`).asResultAsync()}}),[e$1,s])}function v(s,e){let{chainId:r,spoke:t}=decodeReserveId(e.reserve);return async()=>Promise.all([await s.refreshQueryWhere(UserPositionsQuery,(n,u)=>n.request.user===e.sender&&u.some(o=>o.spoke.chain.chainId===r&&o.spoke.address===t)),await s.refreshQueryWhere(UserPositionQuery,(n,u)=>u?.spoke.chain.chainId===r&&u?.spoke.address===t&&u.user===e.sender),await s.refreshQueryWhere(UserSummaryQuery,n=>n.request.user===e.sender&&isSpokeInputVariant(n.request.filter)?n.request.filter.spoke.chainId===r&&n.request.filter.spoke.address===t:isChainIdsVariant(n.request.filter)?n.request.filter.chainIds.some(u=>u===r):false),await s.refreshQueryWhere(ReservesQuery,(n,u)=>u.some(o=>o.id===e.reserve)),await s.refreshQueryWhere(SpokesQuery,(n,u)=>u.some(o=>o.chain.chainId===r&&o.address===t)),await s.refreshQueryWhere(UserBalancesQuery,n=>n.request.user===e.sender),await s.refreshQueryWhere(HubsQuery,n=>isChainIdsVariant(n.request)&&n.request.chainIds.some(u=>u===r))])}function Cr(s){let e$1=e();return a(r=>supply(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}).andTee(v(e$1,r)),[e$1,s])}function Or(s){let e$1=e();return a(r=>borrow(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}).andTee(v(e$1,r)),[e$1,s])}function Mr(s){let e$1=e();return a(r=>repay(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}).andTee(v(e$1,r)),[e$1,s])}function Nr(s){let e$1=e();return a(r=>withdraw(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}).andTee(v(e$1,r)),[e$1,s])}function Dr(s){let e$1=e();return a(r=>renounceSpokeUserPositionManager(e$1,r).andThen(t=>s(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,t=>t.request.spoke===r.spoke)),[e$1,s])}function _r(s){let e$1=e();return a(r=>updateUserPositionConditions(e$1,r).andThen(t=>s(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction).andTee(async()=>{let{userPositionId:t}=r;return Promise.all([e$1.refreshQueryWhere(UserPositionsQuery,(n,u)=>u.some(o=>o.id===t)),e$1.refreshQueryWhere(UserPositionQuery,(n,u)=>u?.id===t)])}),[e$1,s])}function Fr(s){let e$1=e();return a(r=>{let t=r.changes.map(u=>u.reserve),n=t.map(u=>decodeReserveId(u));return setUserSuppliesAsCollateral(e$1,r).andThen(u=>s(u,{cancel:b$1})).andThen(u=>u.wait()).andThen(e$1.waitForTransaction).andTee(()=>Promise.all([...n.map(({chainId:u,spoke:o})=>e$1.refreshQueryWhere(UserPositionsQuery,(c,R)=>c.request.user===r.sender&&R.some(A=>A.spoke.chain.chainId===u&&A.spoke.address===o))),...n.map(({chainId:u,spoke:o})=>e$1.refreshQueryWhere(UserPositionQuery,(c,R)=>R?.spoke.chain.chainId===u&&R?.spoke.address===o&&R.user===r.sender)),...n.map(({chainId:u,spoke:o})=>e$1.refreshQueryWhere(UserSummaryQuery,c=>c.request.user===r.sender&&isSpokeInputVariant(c.request.filter)?c.request.filter.spoke.chainId===u&&c.request.filter.spoke.address===o:isChainIdsVariant(c.request.filter)?c.request.filter.chainIds.some(R=>R===u):false)),e$1.refreshQueryWhere(ReservesQuery,(u,o)=>o.some(c=>t.includes(c.id))),...n.map(({chainId:u,spoke:o})=>e$1.refreshQueryWhere(SpokesQuery,(c,R)=>R.some(A=>A.chain.chainId===u&&A.address===o))),...n.map(({chainId:u})=>e$1.refreshQueryWhere(HubsQuery,o=>isChainIdsVariant(o.request.query)?o.request.query.chainIds.some(c=>c===u):o.request.query.tokens.some(c=>c.chainId===u))),...n.map(({chainId:u})=>e$1.refreshQueryWhere(HubQuery,o=>isHubInputVariant(o.request.query)?o.request.query.hubInput.chainId===u:decodeHubId(o.request.query.hubId).chainId===u))]))},[e$1,s])}function Vr(s){let e$1=e();return a(r=>liquidatePosition(e$1,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>s(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}),[e$1,s])}function Lr(s){let e$1=e();return a(r=>setSpokeUserPositionManager(e$1,r).andThen(t=>s(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,t=>t.request.spoke===r.spoke)),[e$1,s])}function Yr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>preview(e$1,r,{currency:s.currency}),[e$1,s.currency])}function Gr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:PreviewQuery,variables:{request:t,currency:r},suspense:s,pause:e})}function jr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:ActivitiesQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function $r(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 st({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserSuppliesQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function rt(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 tt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserBorrowsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function nt(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 ut({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserSummaryQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function ot({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserPositionsQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function at(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 pt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...n}){return b({document:UserPositionQuery,variables:{request:n,currency:r,timeWindow:t},suspense:s,pause:e})}function it({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserBalancesQuery,variables:{request:t,currency:r},suspense:s,pause:e})}function lt({suspense:s=false,pause:e=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function ct(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBalances(e$1,r,{currency:s.currency}),[e$1,s.currency])}function yt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserSummaryHistoryQuery,variables:{request:t,currency:r},suspense:s,pause:e,batch:false})}export{ds as AaveProvider,T as CannotCancelSwapError,jr as useActivities,$r as useActivitiesAction,hs as useAsset,Bs as useAssetBorrowHistory,vs as useAssetPriceHistory,Es as useAssetSupplyHistory,Or as useBorrow,Ys as useBorrowApyHistory,gr as useBorrowSwap,Ur as useBorrowSwapQuote,wr as useBorrowSwapQuoteAction,kr as useCancelSwap,As as useHub,fs as useHubAssets,xs as useHubSummaryHistory,bs as useHubs,Ts as useHubsAction,Vr as useLiquidatePosition,Gr as usePreview,Yr as usePreviewAction,Ws as useProtocolHistory,Dr as useRenounceSpokeUserPositionManager,Mr as useRepay,br as useRepayWithSupply,Pr as useRepayWithSupplyQuote,Ar as useRepayWithSupplyQuoteAction,_s as useReserve,Fs as useReserveAction,Vs as useReserves,Ls as useReservesAction,Lr as useSetSpokeUserPositionManager,Fr as useSetUserSuppliesAsCollateral,Js as useSpoke,Xs as useSpokePositionManagers,Zs as useSpokeUserPositionManagers,Ks as useSpokes,Cr as useSupply,Gs as useSupplyApyHistory,mr as useSupplySwap,dr as useSupplySwapQuote,Rr as useSupplySwapQuoteAction,yr as useSwappableTokens,Qr as useTokenSwap,lr as useTokenSwapQuote,cr as useTokenSwapQuoteAction,_r as useUpdateUserPositionConditions,it as useUserBalances,ct as useUserBalancesAction,tt as useUserBorrows,nt as useUserBorrowsAction,pt as useUserPosition,ot as useUserPositions,at as useUserPositionsAction,lt as useUserRiskPremiumBreakdown,ut as useUserSummary,yt as useUserSummaryHistory,st as useUserSupplies,rt as useUserSuppliesAction,Sr as useUserSwaps,Nr as useWithdraw,Tr as useWithdrawSwap,fr as useWithdrawSwapQuote,xr as useWithdrawSwapQuoteAction};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|