@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.js CHANGED
@@ -1,2 +1,2 @@
1
- import {b}from'./chunk-7FNJZJRF.js';export{c as useChain,d as useChains,f as useExchangeRate,e as useExchangeRateAction}from'./chunk-7FNJZJRF.js';import {d,e,a,b as b$1,c}from'./chunk-IESN2WLA.js';export{e as useAaveClient,f as usePermitTypedDataAction}from'./chunk-IESN2WLA.js';import {DEFAULT_QUERY_OPTIONS,errAsync,ValidationError}from'@aave/client';export*from'@aave/client';import V,{useCallback}from'react';import {hubs,reserve,reserves,swapQuote,prepareSwap,swap,swapStatus,prepareSwapCancel,cancelSwap,supply,borrow,repay,withdraw,renounceSpokeUserPositionManager,updateUserPositionConditions,setUserSuppliesAsCollateral,liquidatePosition,setSpokeUserPositionManager,preview,activities,userSupplies,userBorrows,userPositions,userBalances}from'@aave/client/actions';import {HubQuery,HubsQuery,HubAssetsQuery,HubSummaryHistoryQuery,AssetQuery,AssetPriceHistoryQuery,AssetSupplyHistoryQuery,AssetBorrowHistoryQuery,ProtocolHistoryQuery,ReserveQuery,ReservesQuery,BorrowApyHistoryQuery,SupplyApyHistoryQuery,SpokeQuery,SpokesQuery,SpokePositionManagersQuery,SpokeUserPositionManagersQuery,SwapQuoteQuery,SwappableTokensQuery,UserSwapsQuery,UserPositionsQuery,UserPositionQuery,decodeReserveId,UserSummaryQuery,isSpokeInputVariant,isChainIdsVariant,isHubInputVariant,decodeHubId,PreviewQuery,ActivitiesQuery,UserSuppliesQuery,UserBorrowsQuery,UserBalancesQuery,UserRiskPremiumBreakdownQuery,UserSummaryHistoryQuery}from'@aave/graphql';import {okAsync,invariant,ResultAwareError,errAsync as errAsync$1}from'@aave/types';import {ValidationError as ValidationError$1}from'@aave/core';function ss({children:e,client:s}){return V.createElement(d,{client:s},e)}function is({suspense:e=false,pause:s=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:e,pause:s})}function ps({suspense:e=false,pause:s=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:e,pause:s})}function ls({suspense:e=false,pause:s=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:e,pause:s})}function cs({suspense:e=false,pause:s=false,...r}){return b({document:HubSummaryHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function ys(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>hubs(s,r,{currency:e$1.currency}),[s,e$1.currency])}function ms({suspense:e=false,pause:s=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:e,pause:s})}function bs({suspense:e=false,pause:s=false,...r}){return b({document:AssetPriceHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function As({suspense:e=false,pause:s=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Ps({suspense:e=false,pause:s=false,...r}){return b({document:AssetBorrowHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function gs({suspense:e=false,pause:s=false,...r}){return b({document:ProtocolHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function qs({suspense:e=false,pause:s=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:e,pause:s})}function hs(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>reserve(s,r,{currency:e$1.currency,timeWindow:e$1.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[s,e$1.currency,e$1.timeWindow])}function vs({suspense:e=false,pause:s=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:e,pause:s,selector:n||void 0})}function Qs(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>reserves(s,r,{currency:e$1.currency,timeWindow:e$1.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[s,e$1.currency,e$1.timeWindow])}function Es({suspense:e=false,pause:s=false,...r}){return b({document:BorrowApyHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Bs({suspense:e=false,pause:s=false,...r}){return b({document:SupplyApyHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Os({suspense:e=false,pause:s=false,...r}){return b({document:SpokeQuery,variables:{request:r},suspense:e,pause:s})}function Ns({suspense:e=false,pause:s=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:e,pause:s})}function Ms({suspense:e=false,pause:s=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:e,pause:s})}function Ds({suspense:e=false,pause:s=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:e,pause:s})}function Ks({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:SwapQuoteQuery,variables:{request:t,currency:r},suspense:e,pause:s})}function Xs(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>swapQuote(s,r,{currency:e$1.currency}),[s,e$1.currency])}function Zs({suspense:e=false,pause:s=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:e,pause:s})}function $s({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserSwapsQuery,variables:{request:t,currency:r},suspense:e,pause:s})}function h(e){return typeof e=="object"&&e!==null&&"deadline"in e&&"value"in e}function er(e$1){let s=e(),r=useCallback(t=>{switch(t.__typename){case "SwapTransactionRequest":return e$1(t,{cancel:b$1}).map(c.ensure).andThen(n=>n.wait()).andThen(()=>okAsync(t.orderReceipt));case "SwapApprovalRequired":return e$1(t,{cancel:b$1}).map(c.ensure).andThen(n=>n.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).map(c.ensure).andThen(n=>n.wait()).andThen(()=>okAsync(t.originalTransaction.orderReceipt));case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t));case "SwapReceipt":return okAsync(t)}},[e$1]);return a(({currency:t=DEFAULT_QUERY_OPTIONS.currency,...n})=>prepareSwap(s,n,{currency:t}).andThen(u=>{switch(u.__typename){case "SwapByTransaction":return swap(s,{transaction:{quoteId:u.quote.quoteId}}).andThen(r);case "SwapByIntent":return e$1(u.data,{cancel:b$1}).andThen(a=>(invariant(h(a),"Invalid signature"),swap(s,{intent:{quoteId:u.quote.quoteId,signature:a.value}}).andThen(r)));case "SwapByIntentWithApprovalRequired":return e$1(u,{cancel:b$1}).map(c.ensure).andThen(a=>a.wait()).andThen(()=>e$1(u.data,{cancel:b$1})).map(c.ensure).andThen(a=>a.wait()).andThen(a=>(invariant(h(a),"Invalid signature"),swap(s,{intent:{quoteId:u.quote.quoteId,signature:a.value}}).andThen(r)));case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(u))}}),[s,e$1,r])}var w=class extends ResultAwareError{name="CannotCancelSwapError"};function sr(e$1){let s=e();return a(r=>swapStatus(s,{id:r.id}).andThen(t=>{switch(t.__typename){case "SwapOpen":case "SwapPendingSignature":return prepareSwapCancel(s,r).andThen(n=>e$1(n.data)).andThen(n=>(invariant(h(n),"Invalid signature"),cancelSwap(s,{intent:{id:r.id,signature:n.value}}))).andThen(n=>n.__typename==="SwapCancelled"?okAsync(n):e$1(n).map(c.ensure).andThen(u=>u.wait()).andThen(()=>swapStatus(s,{id:r.id})).andThen(u=>u.__typename==="SwapCancelled"?okAsync(u):errAsync(new w("Failed to cancel swap"))));case "SwapCancelled":return okAsync(t);default:return errAsync(new w("Swap cannot longer be cancelled"))}}),[s,e$1])}function H(e,s){let{chainId:r,spoke:t}=decodeReserveId(s.reserve);return async()=>Promise.all([await e.refreshQueryWhere(UserPositionsQuery,(n,u)=>n.request.user===s.sender&&u.some(a=>a.spoke.chain.chainId===r&&a.spoke.address===t)),await e.refreshQueryWhere(UserPositionQuery,(n,u)=>u?.spoke.chain.chainId===r&&u?.spoke.address===t&&u.user===s.sender),await e.refreshQueryWhere(UserSummaryQuery,n=>n.request.user===s.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 e.refreshQueryWhere(ReservesQuery,(n,u)=>u.some(a=>a.id===s.reserve)),await e.refreshQueryWhere(SpokesQuery,(n,u)=>u.some(a=>a.chain.chainId===r&&a.address===t)),await e.refreshQueryWhere(UserBalancesQuery,n=>n.request.user===s.sender),await e.refreshQueryWhere(HubsQuery,n=>isChainIdsVariant(n.request)&&n.request.chainIds.some(u=>u===r))])}function lr(e$1){let s=e();return a(r=>supply(s,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(H(s,r)),[s,e$1])}function cr(e$1){let s=e();return a(r=>borrow(s,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(H(s,r)),[s,e$1])}function yr(e$1){let s=e();return a(r=>repay(s,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(H(s,r)),[s,e$1])}function dr(e$1){let s=e();return a(r=>withdraw(s,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(H(s,r)),[s,e$1])}function Sr(e$1){let s=e();return a(r=>renounceSpokeUserPositionManager(s,r).andThen(t=>e$1(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(s.waitForTransaction).andTee(()=>s.refreshQueryWhere(SpokePositionManagersQuery,t=>t.request.spoke===r.spoke)),[s,e$1])}function Rr(e$1){let s=e();return a(r=>updateUserPositionConditions(s,r).andThen(t=>e$1(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(s.waitForTransaction).andTee(async()=>{let{userPositionId:t}=r;return Promise.all([s.refreshQueryWhere(UserPositionsQuery,(n,u)=>u.some(a=>a.id===t)),s.refreshQueryWhere(UserPositionQuery,(n,u)=>u?.id===t)])}),[s,e$1])}function Ur(e$1){let s=e();return a(r=>{let t=r.changes.map(u=>u.reserve),n=t.map(u=>decodeReserveId(u));return setUserSuppliesAsCollateral(s,r).andThen(u=>e$1(u,{cancel:b$1})).andThen(u=>u.wait()).andThen(s.waitForTransaction).andTee(()=>Promise.all([...n.map(({chainId:u,spoke:a})=>s.refreshQueryWhere(UserPositionsQuery,(y,d)=>y.request.user===r.sender&&d.some(A=>A.spoke.chain.chainId===u&&A.spoke.address===a))),...n.map(({chainId:u,spoke:a})=>s.refreshQueryWhere(UserPositionQuery,(y,d)=>d?.spoke.chain.chainId===u&&d?.spoke.address===a&&d.user===r.sender)),...n.map(({chainId:u,spoke:a})=>s.refreshQueryWhere(UserSummaryQuery,y=>y.request.user===r.sender&&isSpokeInputVariant(y.request.filter)?y.request.filter.spoke.chainId===u&&y.request.filter.spoke.address===a:isChainIdsVariant(y.request.filter)?y.request.filter.chainIds.some(d=>d===u):false)),s.refreshQueryWhere(ReservesQuery,(u,a)=>a.some(y=>t.includes(y.id))),...n.map(({chainId:u,spoke:a})=>s.refreshQueryWhere(SpokesQuery,(y,d)=>d.some(A=>A.chain.chainId===u&&A.address===a))),...n.map(({chainId:u})=>s.refreshQueryWhere(HubsQuery,a=>isChainIdsVariant(a.request.query)?a.request.query.chainIds.some(y=>y===u):a.request.query.tokens.some(y=>y.chainId===u))),...n.map(({chainId:u})=>s.refreshQueryWhere(HubQuery,a=>isHubInputVariant(a.request.query)?a.request.query.hubInput.chainId===u:decodeHubId(a.request.query.hubId).chainId===u))]))},[s,e$1])}function mr(e$1){let s=e();return a(r=>liquidatePosition(s,r).andThen(t=>{switch(t.__typename){case "TransactionRequest":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(n=>n.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(n=>n.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}),[s,e$1])}function br(e$1){let s=e();return a(r=>setSpokeUserPositionManager(s,r).andThen(t=>e$1(t,{cancel:b$1})).andThen(t=>t.wait()).andThen(s.waitForTransaction).andTee(()=>s.refreshQueryWhere(SpokePositionManagersQuery,t=>t.request.spoke===r.spoke)),[s,e$1])}function Ar(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>preview(s,r,{currency:e$1.currency}),[s,e$1.currency])}function Pr({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:PreviewQuery,variables:{request:t,currency:r},suspense:e,pause:s})}function gr({suspense:e=false,pause:s=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:e,pause:s})}function fr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>activities(s,r,{currency:e$1.currency,timeWindow:e$1.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[s,e$1.currency,e$1.timeWindow])}function hr({suspense:e=false,pause:s=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:e,pause:s})}function vr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>userSupplies(s,r,{currency:e$1.currency,timeWindow:e$1.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[s,e$1.currency,e$1.timeWindow])}function Qr({suspense:e=false,pause:s=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:e,pause:s})}function Er(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>userBorrows(s,r,{currency:e$1.currency,timeWindow:e$1.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[s,e$1.currency,e$1.timeWindow])}function Br({suspense:e=false,pause:s=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:e,pause:s})}function Ir({suspense:e=false,pause:s=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:e,pause:s})}function Cr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>userPositions(s,r,{currency:e$1.currency,timeWindow:e$1.timeWindow}),[s,e$1.currency,e$1.timeWindow])}function Wr({suspense:e=false,pause:s=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:e,pause:s})}function Or({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserBalancesQuery,variables:{request:t,currency:r},suspense:e,pause:s})}function Nr({suspense:e=false,pause:s=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Mr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>userBalances(s,r,{currency:e$1.currency}),[s,e$1.currency])}function Dr({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:UserSummaryHistoryQuery,variables:{request:t,currency:r},suspense:e,pause:s,batch:false})}export{ss as AaveProvider,w as CannotCancelSwapError,gr as useActivities,fr as useActivitiesAction,ms as useAsset,Ps as useAssetBorrowHistory,bs as useAssetPriceHistory,As as useAssetSupplyHistory,cr as useBorrow,Es as useBorrowApyHistory,sr as useCancelSwap,is as useHub,ls as useHubAssets,cs as useHubSummaryHistory,ps as useHubs,ys as useHubsAction,mr as useLiquidatePosition,Pr as usePreview,Ar as usePreviewAction,gs as useProtocolHistory,Sr as useRenounceSpokeUserPositionManager,yr as useRepay,qs as useReserve,hs as useReserveAction,vs as useReserves,Qs as useReservesAction,br as useSetSpokeUserPositionManager,Ur as useSetUserSuppliesAsCollateral,Os as useSpoke,Ms as useSpokePositionManagers,Ds as useSpokeUserPositionManagers,Ns as useSpokes,lr as useSupply,Bs as useSupplyApyHistory,Ks as useSwapQuote,Xs as useSwapQuoteAction,er as useSwapTokens,Zs as useSwappableTokens,Rr as useUpdateUserPositionConditions,Or as useUserBalances,Mr as useUserBalancesAction,Qr as useUserBorrows,Er as useUserBorrowsAction,Wr as useUserPosition,Ir as useUserPositions,Cr as useUserPositionsAction,Nr as useUserRiskPremiumBreakdown,Br as useUserSummary,Dr as useUserSummaryHistory,hr as useUserSupplies,vr as useUserSuppliesAction,$s as useUserSwaps,dr as useWithdraw};//# sourceMappingURL=index.js.map
1
+ import {b}from'./chunk-7FNJZJRF.js';export{c as useChain,d as useChains,f as useExchangeRate,e as useExchangeRateAction}from'./chunk-7FNJZJRF.js';import {d,e,a,b as b$1,c}from'./chunk-IESN2WLA.js';export{e as useAaveClient,f as usePermitTypedDataAction}from'./chunk-IESN2WLA.js';import {DEFAULT_QUERY_OPTIONS,ValidationError}from'@aave/client';export*from'@aave/client';import G,{useCallback}from'react';import {hubs,reserve,reserves,swapQuote,supplySwapQuote,preparePositionSwap,borrowSwapQuote,repayWithSupplyQuote,withdrawSwapQuote,prepareTokenSwap,swap,swapStatus,prepareSwapCancel,cancelSwap,supply,borrow,repay,withdraw,renounceSpokeUserPositionManager,updateUserPositionConditions,setUserSuppliesAsCollateral,liquidatePosition,setSpokeUserPositionManager,preview,activities,userSupplies,userBorrows,userPositions,userBalances}from'@aave/client/actions';import {HubQuery,HubsQuery,HubAssetsQuery,HubSummaryHistoryQuery,AssetQuery,AssetPriceHistoryQuery,AssetSupplyHistoryQuery,AssetBorrowHistoryQuery,ProtocolHistoryQuery,ReserveQuery,ReservesQuery,BorrowApyHistoryQuery,SupplyApyHistoryQuery,SpokeQuery,SpokesQuery,SpokePositionManagersQuery,SpokeUserPositionManagersQuery,SwapQuoteQuery,SwappableTokensQuery,UserSwapsQuery,SupplySwapQuoteQuery,BorrowSwapQuoteQuery,RepayWithSupplyQuoteQuery,WithdrawSwapQuoteQuery,UserPositionsQuery,UserPositionQuery,decodeReserveId,UserSummaryQuery,isSpokeInputVariant,isChainIdsVariant,isHubInputVariant,decodeHubId,PreviewQuery,ActivitiesQuery,UserSuppliesQuery,UserBorrowsQuery,UserBalancesQuery,UserRiskPremiumBreakdownQuery,UserSummaryHistoryQuery}from'@aave/graphql';import {UnexpectedError,ValidationError as ValidationError$1}from'@aave/core';import {invariant,isSignature,okAsync,ResultAwareError,errAsync}from'@aave/types';function ys({children:s,client:e}){return G.createElement(d,{client:e},s)}function ms({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Ps({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function As({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:HubAssetsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function bs({suspense:s=false,pause:e=false,...r}){return b({document:HubSummaryHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function fs(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>hubs(e$1,r,{currency:s.currency}),[e$1,s.currency])}function qs({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:AssetQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function ks({suspense:s=false,pause:e=false,...r}){return b({document:AssetPriceHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Qs({suspense:s=false,pause:e=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function vs({suspense:s=false,pause:e=false,...r}){return b({document:AssetBorrowHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Es({suspense:s=false,pause:e=false,...r}){return b({document:ProtocolHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Ns({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:ReserveQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Ms(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>reserve(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Ds({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,selector:t,...n}){return b({document:ReservesQuery,variables:{request:n,currency:r,timeWindow:a},suspense:s,pause:e,selector:t||void 0})}function Fs(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>reserves(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Vs({suspense:s=false,pause:e=false,...r}){return b({document:BorrowApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function $s({suspense:s=false,pause:e=false,...r}){return b({document:SupplyApyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function js({suspense:s=false,pause:e=false,...r}){return b({document:SpokeQuery,variables:{request:r},suspense:s,pause:e})}function zs({suspense:s=false,pause:e=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:s,pause:e})}function Js({suspense:s=false,pause:e=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function Ks({suspense:s=false,pause:e=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function pr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:SwapQuoteQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function ir(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>swapQuote(e$1,r,{currency:s.currency}),[e$1,s.currency])}function lr({suspense:s=false,pause:e=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:s,pause:e})}function cr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:UserSwapsQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function yr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:SupplySwapQuoteQuery,variables:{request:a,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function Sr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:BorrowSwapQuoteQuery,variables:{request:a,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function k(s){return {with:e=>s.approvals.reduce((r,a)=>r.andThen(t=>e(a,{cancel:b$1}).map(n=>{switch(a.__typename){case "PositionSwapAdapterContractApproval":t.adapterContractSignature=isSignature(n)?n:null;break;case "PositionSwapPositionManagerApproval":t.positionManagerSignature=isSignature(n)?n:null;break}return t})),okAsync({quoteId:s.quote.quoteId,adapterContractSignature:null,positionManagerSignature:null}))}}function Q(s,e){return swap(s,{intent:e}).andThen(r=>{switch(r.__typename){case "SwapReceipt":return okAsync(r);case "InsufficientBalanceError":return ValidationError.fromGqlNode(r).asResultAsync();default:return UnexpectedError.from(r).asResultAsync()}})}function dr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>supplySwapQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Rr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>borrowSwapQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Ur({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:RepayWithSupplyQuoteQuery,variables:{request:a,currency:r},selector:t=>t.quote,suspense:s,pause:e})}function wr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>repayWithSupplyQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function gr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:WithdrawSwapQuoteQuery,variables:{request:a,currency:r},selector:t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),t.quote),suspense:s,pause:e})}function mr(s){let e$1=e();return a(({currency:r=DEFAULT_QUERY_OPTIONS.currency,...a})=>withdrawSwapQuote(e$1,a,{currency:r}).andThen(t=>(invariant(t.__typename==="PositionSwapByIntentApprovalsRequired",`Unsupported swap plan: ${t.__typename}. Upgrade to a newer version of the @aave/react package.`),k(t).with(s).andThen(n=>preparePositionSwap(e$1,n,{currency:r}).map(o=>(invariant(o.__typename==="SwapByIntent",`Unsupported swap plan: ${o.__typename}. Upgrade to a newer version of the @aave/react package.`),o))).andThen(n=>s(n,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Expected signature, got an object instead."),o))).andThen(n=>Q(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Pr(s){let e$1=e(),r=useCallback(a=>{switch(a.__typename){case "SwapTransactionRequest":return s(a,{cancel:b$1}).map(c.ensure).andThen(t=>t.wait()).andThen(()=>okAsync(a.orderReceipt));case "SwapApprovalRequired":return s(a,{cancel:b$1}).map(c.ensure).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).map(c.ensure).andThen(t=>t.wait()).andThen(()=>okAsync(a.originalTransaction.orderReceipt));case "InsufficientBalanceError":return ValidationError.fromGqlNode(a).asResultAsync();case "SwapReceipt":return okAsync(a);default:return new UnexpectedError(`Unsupported swap plan: ${a.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}},[s]);return a(({currency:a=DEFAULT_QUERY_OPTIONS.currency,...t})=>prepareTokenSwap(e$1,t,{currency:a}).andThen(n=>{switch(n.__typename){case "SwapByTransaction":return swap(e$1,{transaction:{quoteId:n.quote.quoteId}}).andThen(r);case "SwapByIntent":return s(n.data,{cancel:b$1}).map(o=>(invariant(isSignature(o),"Invalid signature"),o)).andThen(o=>swap(e$1,{intent:{quoteId:n.quote.quoteId,signature:o}})).andThen(r);case "SwapByIntentWithApprovalRequired":return s(n,{cancel:b$1}).map(c.ensure).andThen(o=>o.wait()).andThen(()=>s(n.data,{cancel:b$1})).map(o=>(invariant(isSignature(o),"Invalid signature"),o)).andThen(o=>swap(e$1,{intent:{quoteId:n.quote.quoteId,signature:o}})).andThen(r);case "InsufficientBalanceError":return ValidationError.fromGqlNode(n).asResultAsync();default:return new UnexpectedError(`Unsupported swap plan: ${n.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}),[e$1,s,r])}var H=class extends ResultAwareError{name="CannotCancelSwapError"};function Ar(s){let e$1=e();return a(r=>swapStatus(e$1,{id:r.id}).andThen(a=>{switch(a.__typename){case "SwapOpen":case "SwapPendingSignature":return prepareSwapCancel(e$1,r).andThen(t=>s(t.data,{cancel:b$1})).map(t=>(invariant(isSignature(t),"Invalid signature"),t)).andThen(t=>cancelSwap(e$1,{intent:{id:r.id,signature:t}})).andThen(t=>t.__typename==="SwapCancelled"?okAsync(t):s(t,{cancel:b$1}).map(c.ensure).andThen(n=>n.wait()).andThen(()=>swapStatus(e$1,{id:r.id})).andThen(n=>n.__typename==="SwapCancelled"?okAsync(n):new H("Failed to cancel swap").asResultAsync()));case "SwapCancelled":return okAsync(a);case "SwapExpired":return new H("Swap cannot longer be cancelled").asResultAsync();default:return new UnexpectedError(`Unsupported swap status: ${a.__typename}. Upgrade to a newer version of the @aave/react package.`).asResultAsync()}}),[e$1,s])}function E(s,e){let{chainId:r,spoke:a}=decodeReserveId(e.reserve);return async()=>Promise.all([await s.refreshQueryWhere(UserPositionsQuery,(t,n)=>t.request.user===e.sender&&n.some(o=>o.spoke.chain.chainId===r&&o.spoke.address===a)),await s.refreshQueryWhere(UserPositionQuery,(t,n)=>n?.spoke.chain.chainId===r&&n?.spoke.address===a&&n.user===e.sender),await s.refreshQueryWhere(UserSummaryQuery,t=>t.request.user===e.sender&&isSpokeInputVariant(t.request.filter)?t.request.filter.spoke.chainId===r&&t.request.filter.spoke.address===a:isChainIdsVariant(t.request.filter)?t.request.filter.chainIds.some(n=>n===r):false),await s.refreshQueryWhere(ReservesQuery,(t,n)=>n.some(o=>o.id===e.reserve)),await s.refreshQueryWhere(SpokesQuery,(t,n)=>n.some(o=>o.chain.chainId===r&&o.address===a)),await s.refreshQueryWhere(UserBalancesQuery,t=>t.request.user===e.sender),await s.refreshQueryWhere(HubsQuery,t=>isChainIdsVariant(t.request)&&t.request.chainIds.some(n=>n===r))])}function Qr(s){let e$1=e();return a(r=>supply(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function vr(s){let e$1=e();return a(r=>borrow(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function Er(s){let e$1=e();return a(r=>repay(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function Br(s){let e$1=e();return a(r=>withdraw(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}).andTee(E(e$1,r)),[e$1,s])}function Wr(s){let e$1=e();return a(r=>renounceSpokeUserPositionManager(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,a=>a.request.spoke===r.spoke)),[e$1,s])}function Ir(s){let e$1=e();return a(r=>updateUserPositionConditions(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(async()=>{let{userPositionId:a}=r;return Promise.all([e$1.refreshQueryWhere(UserPositionsQuery,(t,n)=>n.some(o=>o.id===a)),e$1.refreshQueryWhere(UserPositionQuery,(t,n)=>n?.id===a)])}),[e$1,s])}function Cr(s){let e$1=e();return a(r=>{let a=r.changes.map(n=>n.reserve),t=a.map(n=>decodeReserveId(n));return setUserSuppliesAsCollateral(e$1,r).andThen(n=>s(n,{cancel:b$1})).andThen(n=>n.wait()).andThen(e$1.waitForTransaction).andTee(()=>Promise.all([...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(UserPositionsQuery,(y,R)=>y.request.user===r.sender&&R.some(b=>b.spoke.chain.chainId===n&&b.spoke.address===o))),...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(UserPositionQuery,(y,R)=>R?.spoke.chain.chainId===n&&R?.spoke.address===o&&R.user===r.sender)),...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(UserSummaryQuery,y=>y.request.user===r.sender&&isSpokeInputVariant(y.request.filter)?y.request.filter.spoke.chainId===n&&y.request.filter.spoke.address===o:isChainIdsVariant(y.request.filter)?y.request.filter.chainIds.some(R=>R===n):false)),e$1.refreshQueryWhere(ReservesQuery,(n,o)=>o.some(y=>a.includes(y.id))),...t.map(({chainId:n,spoke:o})=>e$1.refreshQueryWhere(SpokesQuery,(y,R)=>R.some(b=>b.chain.chainId===n&&b.address===o))),...t.map(({chainId:n})=>e$1.refreshQueryWhere(HubsQuery,o=>isChainIdsVariant(o.request.query)?o.request.query.chainIds.some(y=>y===n):o.request.query.tokens.some(y=>y.chainId===n))),...t.map(({chainId:n})=>e$1.refreshQueryWhere(HubQuery,o=>isHubInputVariant(o.request.query)?o.request.query.hubInput.chainId===n:decodeHubId(o.request.query.hubId).chainId===n))]))},[e$1,s])}function _r(s){let e$1=e();return a(r=>liquidatePosition(e$1,r).andThen(a=>{switch(a.__typename){case "TransactionRequest":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return s(a,{cancel:b$1}).andThen(t=>t.wait()).andThen(()=>s(a.originalTransaction,{cancel:b$1})).andThen(t=>t.wait()).andThen(e$1.waitForTransaction);case "InsufficientBalanceError":return errAsync(ValidationError$1.fromGqlNode(a))}}),[e$1,s])}function Or(s){let e$1=e();return a(r=>setSpokeUserPositionManager(e$1,r).andThen(a=>s(a,{cancel:b$1})).andThen(a=>a.wait()).andThen(e$1.waitForTransaction).andTee(()=>e$1.refreshQueryWhere(SpokePositionManagersQuery,a=>a.request.spoke===r.spoke)),[e$1,s])}function Nr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>preview(e$1,r,{currency:s.currency}),[e$1,s.currency])}function Mr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:PreviewQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function Dr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:ActivitiesQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Fr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>activities(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function zr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSuppliesQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Jr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userSupplies(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Kr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserBorrowsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function Xr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBorrows(e$1,r,{currency:s.currency,timeWindow:s.timeWindow??DEFAULT_QUERY_OPTIONS.timeWindow}),[e$1,s.currency,s.timeWindow])}function Zr({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserSummaryQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function et({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserPositionsQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function st(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userPositions(e$1,r,{currency:s.currency,timeWindow:s.timeWindow}),[e$1,s.currency,s.timeWindow])}function rt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:a=DEFAULT_QUERY_OPTIONS.timeWindow,...t}){return b({document:UserPositionQuery,variables:{request:t,currency:r,timeWindow:a},suspense:s,pause:e})}function tt({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:UserBalancesQuery,variables:{request:a,currency:r},suspense:s,pause:e})}function at({suspense:s=false,pause:e=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function nt(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBalances(e$1,r,{currency:s.currency}),[e$1,s.currency])}function ot({suspense:s=false,pause:e=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...a}){return b({document:UserSummaryHistoryQuery,variables:{request:a,currency:r},suspense:s,pause:e,batch:false})}export{ys as AaveProvider,H as CannotCancelSwapError,Dr as useActivities,Fr as useActivitiesAction,qs as useAsset,vs as useAssetBorrowHistory,ks as useAssetPriceHistory,Qs as useAssetSupplyHistory,vr as useBorrow,Vs as useBorrowApyHistory,Rr as useBorrowSwap,Sr as useBorrowSwapQuote,Ar as useCancelSwap,ms as useHub,As as useHubAssets,bs as useHubSummaryHistory,Ps as useHubs,fs as useHubsAction,_r as useLiquidatePosition,Mr as usePreview,Nr as usePreviewAction,Es as useProtocolHistory,Wr as useRenounceSpokeUserPositionManager,Er as useRepay,wr as useRepayWithSupply,Ur as useRepayWithSupplyQuote,Ns as useReserve,Ms as useReserveAction,Ds as useReserves,Fs as useReservesAction,Or as useSetSpokeUserPositionManager,Cr as useSetUserSuppliesAsCollateral,js as useSpoke,Js as useSpokePositionManagers,Ks as useSpokeUserPositionManagers,zs as useSpokes,Qr as useSupply,$s as useSupplyApyHistory,dr as useSupplySwap,yr as useSupplySwapQuote,pr as useSwapQuote,ir as useSwapQuoteAction,lr as useSwappableTokens,Pr as useTokenSwap,Ir as useUpdateUserPositionConditions,tt as useUserBalances,nt as useUserBalancesAction,Kr as useUserBorrows,Xr as useUserBorrowsAction,rt as useUserPosition,et as useUserPositions,st as useUserPositionsAction,at as useUserRiskPremiumBreakdown,Zr as useUserSummary,ot as useUserSummaryHistory,zr as useUserSupplies,Jr as useUserSuppliesAction,cr as useUserSwaps,Br as useWithdraw,mr as useWithdrawSwap,gr as useWithdrawSwapQuote};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map