import{createPublicClient as r,http as t}from"viem";import{tempo as e,tempoModerato as i}from"viem/chains";import{e as p}from"./errors-Dd6zfYtp.mjs";const l=(l,s,c,o)=>{let a=Number(l),d=s.find((r=>r.id===a));if(!d)throw new p(`Unsupported chainId ${l}`,4901);let u=n(d,c,o.appId);if(a===e.id||a===i.id){let p=a===e.id?e:i;return r({transport:t(u),chain:p})}return r({transport:t(u),chain:d})};function s(r){if(void 0===r)return!1;let t=Number(r);return Number.isFinite(t)&&(t===e.id||t===i.id)}const n=(r,t,e)=>{let i,l=r.id,s=Number(r.id);if(r.rpcUrls.privyWalletOverride&&r.rpcUrls.privyWalletOverride.http[0])i=r.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[s])i=t.rpcUrls[s];else if(r.rpcUrls.privy?.http[0]){let t=new URL(r.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",e),i=t.toString()}else i=r.rpcUrls.public?.http[0]?r.rpcUrls.public.http[0]:r.rpcUrls.default?.http[0];if(!i)throw new p(`No RPC url found for ${l}`);return i};export{n as a,l as g,s as i};
//# sourceMappingURL=getPublicClient-D4yNgeGy.mjs.map
