require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../functions/utils/serialize.utils.cjs`),t=require(`../data-structures/http/HttpClient.cjs`),n=require(`../error-handling/logger.cjs`);let r=require(`@solana/web3.js`);var i=class extends r.Connection{constructor(r,i=`confirmed`){let a=async(r,i)=>{let a;a=typeof r==`string`?r:r instanceof URL?r.toString():r.url;let o=typeof i?.body==`string`?i.body:null,s=o?JSON.parse(o):{};try{let n=await t.httpClient.post(a,s);if(n.error)throw Error(n.error.message||`RPC Error`);return new Response(e.safeJsonStringify(n),{status:200,statusText:`OK`,headers:{"Content-Type":`application/json`}})}catch(e){throw n.Logger.error(`Solana RPC Error [${s.method}]:`,e),e}},o={...typeof i==`object`?i:{},fetch:a};super(r,o)}};exports.CustomSolanaConnection=i;