const e=require(`../utils/bytes32.utils.cjs`),t=require(`./solana.cjs`),n=require(`./sendV0Transaction.cjs`);var r=async(n,r,i,a,o)=>{if(o.every(e=>e===0))return{instruction:void 0,willCreate:!1};let s=t.getNullifierAccount(e.convertBytes32ToBigInt(o),i,r.programId);return await n.getAccountInfo(s)?{instruction:void 0,willCreate:!1}:{instruction:await r.methods.initNullifier(o).accounts({originalDeployer:i,signer:a}).instruction(),willCreate:!0,account:s,nullifier:o}},i=async(e,t,n,i,a)=>{let o=[],s=[];for(let c of a){let{instruction:a,willCreate:l,account:u,nullifier:d}=await r(e,t,n,i,c);a&&o.push(a),l&&u&&d&&s.push({account:u,nullifier:d})}return{instructions:o,createdAccounts:s}},a=async(e,t,r,a,o)=>{let{instructions:s,createdAccounts:c}=await i(e,t,r,a.publicKey,o);return{signature:await n.sendV0Transaction(e,s,a,[a]),createdAccounts:c}};exports.sendInitNullifiersTransaction=a;