require(`../../constants/chains.constants.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`./amounts.utils.cjs`);require(`../../types/index.cjs`);const n=require(`./caseInsensitive.utils.cjs`);require(`../../data-structures/crypto-keys/keys.cjs`);const r=require(`./getContractAddress.cjs`);require(`../../data-structures/crypto-keys/encryptDecryptUtxo.cjs`);const i=require(`../../data-structures/crypto-keys/decodeUTXO.cjs`);require(`ethers`);var a=(a,o,s,c)=>{let l=o.getContractWithFetcher(s,e.ContractType.HinkalContract),u=l.interface,d=o.userKeys.getShieldedPrivateKey(),f=r.getContractAddress(l);return a.logs.filter(e=>n.caseInsensitiveEqual(e.address,f)).map(e=>{try{let r=u.parseLog(e);if(r?.name===`NewCommitment`){let{encryptedOutput:e,index:a}=r.args;if(t.toBigInt(a)<0n){let t=i.decodeUtxo(e,d,s);if(n.caseInsensitiveEqual(t.erc20TokenAddress,c))return t}}}catch{return null}return null}).filter(e=>e!==null)};exports.getOnChainUtxosFromReceipt=a;