import{useState as r,useEffect as e}from"react";import{u as o}from"./internal-context-dfitw7Ot.mjs";const t=({enabled:t=!0}={})=>{let{showFiatPrices:i,getUsdPriceForSol:a}=o(),[c,l]=r(!0),[s,n]=r(void 0),[d,f]=r(void 0);return e((()=>{(async()=>{if(i&&t)try{l(!0);let r=await a();r?f(r):n(Error("Unable to fetch SOL price"))}catch(r){n(r)}finally{l(!1)}else l(!1)})()}),[]),{solPrice:d,isSolPriceLoading:c,solPriceError:s}};export{t as u};
//# sourceMappingURL=useGetSolPrice-x7gfUIHJ.mjs.map
