@aave/react 4.0.0-next.10 → 4.0.0-next.12
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/ethers.cjs +1 -1
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +4 -4
- package/dist/ethers.d.ts +4 -4
- package/dist/ethers.js +1 -1
- package/dist/ethers.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +407 -164
- package/dist/index.d.ts +407 -164
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{misc-CB94S1RB.d.cts → misc-BbkH5nn7.d.cts} +1 -1
- package/dist/{misc-BUJSXsyz.d.ts → misc-Cza-qIHo.d.ts} +1 -1
- package/dist/privy.cjs +1 -1
- package/dist/privy.cjs.map +1 -1
- package/dist/privy.d.cts +4 -4
- package/dist/privy.d.ts +4 -4
- package/dist/privy.js +1 -1
- package/dist/privy.js.map +1 -1
- package/dist/thirdweb.cjs +1 -1
- package/dist/thirdweb.cjs.map +1 -1
- package/dist/thirdweb.d.cts +4 -4
- package/dist/thirdweb.d.ts +4 -4
- package/dist/thirdweb.js +1 -1
- package/dist/thirdweb.js.map +1 -1
- package/dist/viem/index.cjs +1 -1
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +5 -5
- package/dist/viem/index.d.ts +5 -5
- package/dist/viem/index.js +1 -1
- package/dist/viem/index.js.map +1 -1
- package/dist/{writes-BXnwYgAQ.d.cts → writes-K_-o9pPN.d.cts} +1 -1
- package/dist/{writes-BXnwYgAQ.d.ts → writes-K_-o9pPN.d.ts} +1 -1
- package/package.json +5 -5
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,AssetCategoryBorrowHistoryQuery,AssetCategorySupplyHistoryQuery,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 ts({children:e,client:s}){return V.createElement(d,{client:s},e)}function ls({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:HubQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function ys({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:HubsQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function cs({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:HubAssetsQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Ss({suspense:e=false,pause:s=false,...r}){return b({document:HubSummaryHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function ds(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>hubs(s,r,{currency:e$1.currency}),[s,e$1.currency])}function gs({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:AssetQuery,variables:{request:o,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 Ps({suspense:e=false,pause:s=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function fs({suspense:e=false,pause:s=false,...r}){return b({document:AssetBorrowHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function ws({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:AssetCategoryBorrowHistoryQuery,variables:{request:t,currency:r},suspense:e,pause:s,batch:false})}function xs({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,...t}){return b({document:AssetCategorySupplyHistoryQuery,variables:{request:t,currency:r},suspense:e,pause:s,batch:false})}function Ts({suspense:e=false,pause:s=false,...r}){return b({document:ProtocolHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Bs({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:ReserveQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Es(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 Cs({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,selector:o,...n}){return b({document:ReservesQuery,variables:{request:n,currency:r,timeWindow:t},suspense:e,pause:s,selector:o||void 0})}function Is(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 Ws({suspense:e=false,pause:s=false,...r}){return b({document:BorrowApyHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Os({suspense:e=false,pause:s=false,...r}){return b({document:SupplyApyHistoryQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function _s({suspense:e=false,pause:s=false,...r}){return b({document:SpokeQuery,variables:{request:r},suspense:e,pause:s})}function Fs({suspense:e=false,pause:s=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:e,pause:s})}function Vs({suspense:e=false,pause:s=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:e,pause:s})}function Ls({suspense:e=false,pause:s=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:e,pause:s})}function er({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 sr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>swapQuote(s,r,{currency:e$1.currency}),[s,e$1.currency])}function rr({suspense:e=false,pause:s=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:e,pause:s})}function tr({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 v(e){return typeof e=="object"&&e!==null&&"deadline"in e&&"value"in e}function or(e$1){let s=e(),r=useCallback(t=>{switch(t.__typename){case "SwapTransactionRequest":return e$1(t,{cancel:b$1}).map(c.ensure).andThen(o=>o.wait()).andThen(()=>okAsync(t.orderReceipt));case "SwapApprovalRequired":return e$1(t,{cancel:b$1}).map(c.ensure).andThen(o=>o.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).map(c.ensure).andThen(o=>o.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,...o})=>prepareSwap(s,o,{currency:t}).andThen(n=>{switch(n.__typename){case "SwapByTransaction":return swap(s,{transaction:{quoteId:n.quote.quoteId}}).andThen(r);case "SwapByIntent":return e$1(n.data,{cancel:b$1}).andThen(a=>(invariant(v(a),"Invalid signature"),swap(s,{intent:{quoteId:n.quote.quoteId,signature:a.value}}).andThen(r)));case "SwapByIntentWithApprovalRequired":return e$1(n,{cancel:b$1}).map(c.ensure).andThen(a=>a.wait()).andThen(()=>e$1(n.data,{cancel:b$1})).map(c.ensure).andThen(a=>a.wait()).andThen(a=>(invariant(v(a),"Invalid signature"),swap(s,{intent:{quoteId:n.quote.quoteId,signature:a.value}}).andThen(r)));case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(n))}}),[s,e$1,r])}var x=class extends ResultAwareError{name="CannotCancelSwapError"};function nr(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(o=>e$1(o.data)).andThen(o=>(invariant(v(o),"Invalid signature"),cancelSwap(s,{intent:{id:r.id,signature:o.value}}))).andThen(o=>o.__typename==="SwapCancelled"?okAsync(o):e$1(o).map(c.ensure).andThen(n=>n.wait()).andThen(()=>swapStatus(s,{id:r.id})).andThen(n=>n.__typename==="SwapCancelled"?okAsync(n):errAsync(new x("Failed to cancel swap"))));case "SwapCancelled":return okAsync(t);default:return errAsync(new x("Swap cannot longer be cancelled"))}}),[s,e$1])}function k(e,s){let{chainId:r,spoke:t}=decodeReserveId(s.reserve);return async()=>Promise.all([await e.refreshQueryWhere(UserPositionsQuery,(o,n)=>o.request.user===s.sender&&n.some(a=>a.spoke.chain.chainId===r&&a.spoke.address===t)),await e.refreshQueryWhere(UserPositionQuery,(o,n)=>n?.spoke.chain.chainId===r&&n?.spoke.address===t&&n.user===s.sender),await e.refreshQueryWhere(UserSummaryQuery,o=>o.request.user===s.sender&&isSpokeInputVariant(o.request.filter)?o.request.filter.spoke.chainId===r&&o.request.filter.spoke.address===t:isChainIdsVariant(o.request.filter)?o.request.filter.chainIds.some(n=>n===r):false),await e.refreshQueryWhere(ReservesQuery,(o,n)=>n.some(a=>a.id===s.reserve)),await e.refreshQueryWhere(SpokesQuery,(o,n)=>n.some(a=>a.chain.chainId===r&&a.address===t)),await e.refreshQueryWhere(UserBalancesQuery,o=>o.request.user===s.sender),await e.refreshQueryWhere(HubsQuery,o=>isChainIdsVariant(o.request)&&o.request.chainIds.some(n=>n===r))])}function dr(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(o=>o.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(o=>o.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(o=>o.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(k(s,r)),[s,e$1])}function Rr(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(o=>o.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(o=>o.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(o=>o.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(k(s,r)),[s,e$1])}function Ur(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(o=>o.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(o=>o.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(o=>o.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(k(s,r)),[s,e$1])}function Ar(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(o=>o.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(o=>o.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(o=>o.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}).andTee(k(s,r)),[s,e$1])}function mr(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 gr(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,(o,n)=>n.some(a=>a.id===t)),s.refreshQueryWhere(UserPositionQuery,(o,n)=>n?.id===t)])}),[s,e$1])}function br(e$1){let s=e();return a(r=>{let t=r.changes.map(n=>n.reserve),o=t.map(n=>decodeReserveId(n));return setUserSuppliesAsCollateral(s,r).andThen(n=>e$1(n,{cancel:b$1})).andThen(n=>n.wait()).andThen(s.waitForTransaction).andTee(()=>Promise.all([...o.map(({chainId:n,spoke:a})=>s.refreshQueryWhere(UserPositionsQuery,(c,S)=>c.request.user===r.sender&&S.some(g=>g.spoke.chain.chainId===n&&g.spoke.address===a))),...o.map(({chainId:n,spoke:a})=>s.refreshQueryWhere(UserPositionQuery,(c,S)=>S?.spoke.chain.chainId===n&&S?.spoke.address===a&&S.user===r.sender)),...o.map(({chainId:n,spoke:a})=>s.refreshQueryWhere(UserSummaryQuery,c=>c.request.user===r.sender&&isSpokeInputVariant(c.request.filter)?c.request.filter.spoke.chainId===n&&c.request.filter.spoke.address===a:isChainIdsVariant(c.request.filter)?c.request.filter.chainIds.some(S=>S===n):false)),s.refreshQueryWhere(ReservesQuery,(n,a)=>a.some(c=>t.includes(c.id))),...o.map(({chainId:n,spoke:a})=>s.refreshQueryWhere(SpokesQuery,(c,S)=>S.some(g=>g.chain.chainId===n&&g.address===a))),...o.map(({chainId:n})=>s.refreshQueryWhere(HubsQuery,a=>isChainIdsVariant(a.request.query)?a.request.query.chainIds.some(c=>c===n):a.request.query.tokens.some(c=>c.chainId===n))),...o.map(({chainId:n})=>s.refreshQueryWhere(HubQuery,a=>isHubInputVariant(a.request.query)?a.request.query.hubInput.chainId===n:decodeHubId(a.request.query.hubId).chainId===n))]))},[s,e$1])}function Pr(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(o=>o.wait()).andThen(s.waitForTransaction);case "Erc20ApprovalRequired":case "PreContractActionRequired":return e$1(t,{cancel:b$1}).andThen(o=>o.wait()).andThen(()=>e$1(t.originalTransaction,{cancel:b$1})).andThen(o=>o.wait()).andThen(s.waitForTransaction);case "InsufficientBalanceError":return errAsync$1(ValidationError$1.fromGqlNode(t))}}),[s,e$1])}function fr(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 wr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>preview(s,r,{currency:e$1.currency}),[s,e$1.currency])}function xr({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 Tr({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:ActivitiesQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Hr(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 Er({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:UserSuppliesQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Cr(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 Ir({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:UserBorrowsQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Wr(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 Or({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:UserSummaryQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Nr({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:UserPositionsQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function Mr(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 Dr({suspense:e=false,pause:s=false,currency:r=DEFAULT_QUERY_OPTIONS.currency,timeWindow:t=DEFAULT_QUERY_OPTIONS.timeWindow,...o}){return b({document:UserPositionQuery,variables:{request:o,currency:r,timeWindow:t},suspense:e,pause:s})}function _r({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 Fr({suspense:e=false,pause:s=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:e,pause:s,batch:false})}function Vr(e$1=DEFAULT_QUERY_OPTIONS){let s=e();return a(r=>userBalances(s,r,{currency:e$1.currency}),[s,e$1.currency])}function Lr({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{ts as AaveProvider,x as CannotCancelSwapError,Tr as useActivities,Hr as useActivitiesAction,gs as useAsset,fs as useAssetBorrowHistory,ws as useAssetCategoryBorrowHistory,xs as useAssetCategorySupplyHistory,bs as useAssetPriceHistory,Ps as useAssetSupplyHistory,Rr as useBorrow,Ws as useBorrowApyHistory,nr as useCancelSwap,ls as useHub,cs as useHubAssets,Ss as useHubSummaryHistory,ys as useHubs,ds as useHubsAction,Pr as useLiquidatePosition,xr as usePreview,wr as usePreviewAction,Ts as useProtocolHistory,mr as useRenounceSpokeUserPositionManager,Ur as useRepay,Bs as useReserve,Es as useReserveAction,Cs as useReserves,Is as useReservesAction,fr as useSetSpokeUserPositionManager,br as useSetUserSuppliesAsCollateral,_s as useSpoke,Vs as useSpokePositionManagers,Ls as useSpokeUserPositionManagers,Fs as useSpokes,dr as useSupply,Os as useSupplyApyHistory,er as useSwapQuote,sr as useSwapQuoteAction,or as useSwapTokens,rr as useSwappableTokens,gr as useUpdateUserPositionConditions,_r as useUserBalances,Vr as useUserBalancesAction,Ir as useUserBorrows,Wr as useUserBorrowsAction,Dr as useUserPosition,Nr as useUserPositions,Mr as useUserPositionsAction,Fr as useUserRiskPremiumBreakdown,Or as useUserSummary,Lr as useUserSummaryHistory,Er as useUserSupplies,Cr as useUserSuppliesAction,tr as useUserSwaps,Ar 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 Y,{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 Ss({children:s,client:e}){return Y.createElement(d,{client:e},s)}function Ps({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 As({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 bs({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 fs({suspense:s=false,pause:e=false,...r}){return b({document:HubSummaryHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function xs(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>hubs(e$1,r,{currency:s.currency}),[e$1,s.currency])}function ks({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 Qs({suspense:s=false,pause:e=false,...r}){return b({document:AssetPriceHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function vs({suspense:s=false,pause:e=false,...r}){return b({document:AssetSupplyHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Es({suspense:s=false,pause:e=false,...r}){return b({document:AssetBorrowHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Bs({suspense:s=false,pause:e=false,...r}){return b({document:ProtocolHistoryQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function Ms({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 Ds(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 Fs({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 Vs(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 Ls({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 zs({suspense:s=false,pause:e=false,...r}){return b({document:SpokeQuery,variables:{request:r},suspense:s,pause:e})}function Js({suspense:s=false,pause:e=false,...r}){return b({document:SpokesQuery,variables:{request:r},suspense:s,pause:e})}function Ks({suspense:s=false,pause:e=false,...r}){return b({document:SpokePositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function Xs({suspense:s=false,pause:e=false,...r}){return b({document:SpokeUserPositionManagersQuery,variables:{request:r},suspense:s,pause:e})}function ir({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 lr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>swapQuote(e$1,r,{currency:s.currency}),[e$1,s.currency])}function cr({suspense:s=false,pause:e=false,...r}){return b({document:SwappableTokensQuery,variables:{request:r},suspense:s,pause:e})}function yr({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 Sr({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 dr({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 q(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 k(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 Rr(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.`),q(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=>k(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function Ur(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.`),q(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=>k(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function wr({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 gr(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.`),q(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=>k(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function mr({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 Pr(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.`),q(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=>k(e$1,{quoteId:t.quote.quoteId,signature:n})))),[e$1,s])}function W(s){return typeof s=="object"&&s!==null&&"deadline"in s&&"value"in s}function Ar(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}).andThen(o=>(invariant(W(o),"Invalid signature"),swap(e$1,{intent:{quoteId:n.quote.quoteId,signature:o.value}}).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(c.ensure).andThen(o=>o.wait()).andThen(o=>(invariant(W(o),"Invalid signature"),swap(e$1,{intent:{quoteId:n.quote.quoteId,signature:o.value}}).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 br(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)).andThen(t=>(invariant(W(t),"Invalid signature"),cancelSwap(e$1,{intent:{id:r.id,signature:t.value}}))).andThen(t=>t.__typename==="SwapCancelled"?okAsync(t):s(t).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);default:return new h("Swap cannot longer be cancelled").asResultAsync()}}),[e$1,s])}function v(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 vr(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(v(e$1,r)),[e$1,s])}function Er(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(v(e$1,r)),[e$1,s])}function Br(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(v(e$1,r)),[e$1,s])}function Wr(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(v(e$1,r)),[e$1,s])}function Ir(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 Cr(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 _r(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 Or(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 Nr(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 Mr(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>preview(e$1,r,{currency:s.currency}),[e$1,s.currency])}function Dr({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 Fr({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 Vr(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 Jr({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 Kr(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 Xr({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 Zr(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 et({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 st({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 rt(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 tt({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 at({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 nt({suspense:s=false,pause:e=false,...r}){return b({document:UserRiskPremiumBreakdownQuery,variables:{request:r},suspense:s,pause:e,batch:false})}function ot(s=DEFAULT_QUERY_OPTIONS){let e$1=e();return a(r=>userBalances(e$1,r,{currency:s.currency}),[e$1,s.currency])}function ut({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{Ss as AaveProvider,h as CannotCancelSwapError,Fr as useActivities,Vr as useActivitiesAction,ks as useAsset,Es as useAssetBorrowHistory,Qs as useAssetPriceHistory,vs as useAssetSupplyHistory,Er as useBorrow,Ls as useBorrowApyHistory,Ur as useBorrowSwap,dr as useBorrowSwapQuote,br as useCancelSwap,Ps as useHub,bs as useHubAssets,fs as useHubSummaryHistory,As as useHubs,xs as useHubsAction,Or as useLiquidatePosition,Dr as usePreview,Mr as usePreviewAction,Bs as useProtocolHistory,Ir as useRenounceSpokeUserPositionManager,Br as useRepay,gr as useRepayWithSupply,wr as useRepayWithSupplyQuote,Ms as useReserve,Ds as useReserveAction,Fs as useReserves,Vs as useReservesAction,Nr as useSetSpokeUserPositionManager,_r as useSetUserSuppliesAsCollateral,zs as useSpoke,Ks as useSpokePositionManagers,Xs as useSpokeUserPositionManagers,Js as useSpokes,vr as useSupply,$s as useSupplyApyHistory,Rr as useSupplySwap,Sr as useSupplySwapQuote,ir as useSwapQuote,lr as useSwapQuoteAction,cr as useSwappableTokens,Ar as useTokenSwap,Cr as useUpdateUserPositionConditions,at as useUserBalances,ot as useUserBalancesAction,Xr as useUserBorrows,Zr as useUserBorrowsAction,tt as useUserPosition,st as useUserPositions,rt as useUserPositionsAction,nt as useUserRiskPremiumBreakdown,et as useUserSummary,ut as useUserSummaryHistory,Jr as useUserSupplies,Kr as useUserSuppliesAction,yr as useUserSwaps,Wr as useWithdraw,Pr as useWithdrawSwap,mr as useWithdrawSwapQuote};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|