require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/protocol.constants.cjs`);let t=require(`ethers`),n=require(`@coral-xyz/anchor`);var r=(r,i,a,o,s,c,l,u)=>{let d=new n.BN(s.toString()),f=new n.BN(c.toString()),p=o.reduce((e,t)=>[...e,...new n.BN(t.length).toArray(`be`,8),...t],[]),m=l.reduce((e,t)=>{let r=[...new n.BN(t.programIndex).toArray(`be`,1),...new n.BN(t.accountIndexes.length).toArray(`be`,8),...t.accountIndexes,...new n.BN(t.data.length).toArray(`be`,8),...t.data];return[...e,...r]},[]),h=u.reduce((e,t)=>[...e,+!!t.isWritable,...t.pubkey.toBytes()],[]),g=[r.tokenNumber,r.nullifierAmount,r.outputAmount,...i.toBytes(),...a.toBytes(),...p,...d.toArray(`be`,8),...f.toArray(`be`,8),...m,...h];return BigInt(t.ethers.sha256(new Uint8Array(g)))%e.CIRCOM_P};exports.getSolanaCalldataHash=r;