import{o as e}from"./rolldown-runtime.js";import{n as t}from"./jsx-runtime.js";import{Vt as n}from"./useActiveWallet-CEs8euQ3.js";var r=e(t(),1),i=({enabled:e=!0}={})=>{let{showFiatPrices:t,getUsdPriceForSol:i}=n(),[a,o]=(0,r.useState)(!0),[s,c]=(0,r.useState)(void 0),[l,u]=(0,r.useState)(void 0);return(0,r.useEffect)((()=>{(async()=>{if(t&&e)try{o(!0);let e=await i();e?u(e):c(Error(`Unable to fetch SOL price`))}catch(e){c(e)}finally{o(!1)}else o(!1)})()}),[]),{solPrice:l,isSolPriceLoading:a,solPriceError:s}};export{i as t};