"use strict";var e=require("viem"),r=require("./internal-context-CdsQ3LEl.js"),t=require("./wallet-connect-BuohfvHK.js");let o=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),s=e=>o.format(e);const a=(r,t=6,o=!1)=>{let s=parseFloat(e.formatEther(r)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return o?s:`${"0"===s?"<0.001":s}`};exports.getBlockExplorerUrlForAddress=(e,o)=>{let{chains:s}=r.usePrivyInternal(),a=`https://etherscan.io/address/${o}`,n=`${t.getBlockExplorer(e,s)}/address/${o}`;if(!n)return a;try{new URL(n)}catch{return a}return n},exports.getDollarsFromStringFloat=(e,r)=>{let t=s(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},exports.getDollarsFromWei=(r,t)=>{let o=s(t*parseFloat(e.formatEther(r)));return"$0.00"===o?"<$0.01":o},exports.getNativeCurrencyFromWei=(e,r,t=6,o=!1)=>`${a(e,t,o)} ${r}`,exports.parseNativeCurrencyFromWei=a,exports.sumWeiQuantities=e=>e.reduce(((e,r)=>e+r),0n);
//# sourceMappingURL=ethers-DEImj_8B.js.map
