require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../crypto/poseidon.cjs`);let t=require(`@solana/web3.js`),n=require(`@coral-xyz/anchor`);var r=e=>new TextEncoder().encode(e),i=e=>{let t=[],n=e;for(;n>0n;)t.unshift(Number(n%256n)),n/=256n;for(;t.length<32;)t.unshift(0);return t},a=e=>({extraRandomization:i(e.extraRandomization),stealthAddress:i(e.stealthAddress),h0:i(e.H0),h1:i(e.H1)}),o=(e,n,a)=>{let o=i(e),s=[r(`hinkal_nullifier`),n.toBytes(),new Uint8Array(o)],[c]=t.PublicKey.findProgramAddressSync(s,a);return c},s=(e,n)=>{let i=[r(`hinkal`),n.toBytes()],[a]=t.PublicKey.findProgramAddressSync(i,e);return a},c=(e,n)=>{let i=[r(`hinkal_merkle`),n.toBytes()],[a]=t.PublicKey.findProgramAddressSync(i,e);return a},l=(e,i,a)=>{let o=[r(`hinkal_swapper`),i.toBytes(),new Uint8Array(new n.BN(a.toString()).toArray(`be`,32))],[s]=t.PublicKey.findProgramAddressSync(o,e);return s},u=(t,n,r)=>l(t,n,e.poseidonFunction(r)),d=(e,n)=>{let i=[r(`hinkal_vault`),n.toBytes()],[a]=t.PublicKey.findProgramAddressSync(i,e);return a},f=(e,i,a,o)=>{let s=[r(`hinkal_proof_part1`),i.toBytes(),a.toBytes(),new Uint8Array(new n.BN(o.toString()).toArray(`be`,4))],[c]=t.PublicKey.findProgramAddressSync(s,e);return c},p=(e,i,a,o)=>{let s=[r(`hinkal_proof_part2`),i.toBytes(),a.toBytes(),new Uint8Array(new n.BN(o.toString()).toArray(`be`,4))],[c]=t.PublicKey.findProgramAddressSync(s,e);return c},m=(e,i,a,o)=>{let s=[r(`hinkal_encrypted_outputs`),i.toBytes(),a.toBytes(),new Uint8Array(new n.BN(o.toString()).toArray(`be`,4))],[c]=t.PublicKey.findProgramAddressSync(s,e);return c},h=(e,i,a,o)=>{let s=[r(`hinkal_instructions`),i.toBytes(),a.toBytes(),new Uint8Array(new n.BN(o.toString()).toArray(`be`,4))],[c]=t.PublicKey.findProgramAddressSync(s,e);return c};exports.buildAnchorStealthAddressStructure=a,exports.encodeToByte32Array=i,exports.getEncryptedOutputsAccountPublicKey=m,exports.getInstructionsAccountPublicKey=h,exports.getMerkleAccountPublicKey=c,exports.getNullifierAccount=o,exports.getProofAccountPart1PublicKey=f,exports.getProofAccountPart2PublicKey=p,exports.getStorageAccountPublicKey=s,exports.getStorageVaultPublicKey=d,exports.getSwapperAccountPublicKey=l,exports.getSwapperAccountPublicKeyFromSalt=u;