require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../web3/events/getShieldedBalance.cjs`),n=require(`./solana.cjs`),r=require(`../utils/create-provider.cjs`);let i=require(`@solana/web3.js`);var a=async(a,o,s,c)=>{if(!e.isSolanaLike(o)||s.length===0||c.length===0)return 0;try{let l=(await t.addPaddingToUtxos(a,o,s,c,6)).flat().filter(e=>e.amount!==0n);if(l.length===0)return 0;let{fetchRpcUrl:u,contractData:d}=e.networkRegistry[o],{originalDeployer:f,hinkalIdl:p}=d;if(!u)throw Error(`RPC URL not found for chain ID`);if(!f)throw Error(`Original deployer not found for chain ID`);if(!p)throw Error(`Hinkal IDL not found for chain ID`);let m=r.createCustomSolanaConnection(u),h=new i.PublicKey(f),g=new i.PublicKey(p.address),_=l.map(e=>n.getNullifierAccount(BigInt(e.getNullifier()),h,g));return(await m.getMultipleAccountsInfo(_)).filter(e=>e===null).length}catch(e){return(e instanceof Error?e.message:String(e)).toLowerCase().includes(`utxos limitations`)?6:0}};exports.calculateSolanaNullifierCount=a;