import { PreciseProofs } from 'ew-precise-proofs-js' ; export class PreciseProofUtils { static generateProofs ( commitment , salts ? ) { let leafs = salts ? PreciseProofs . createLeafs ( commitment , salts ) : PreciseProofs . createLeafs ( commitment ) ; leafs = PreciseProofs . sortLeafsByKey ( leafs ) ; const merkleTree = PreciseProofs . createMerkleTree ( leafs . map ( ( leaf ) => leaf . hash ) ) ; return { commitment , rootHash : PreciseProofs . getRootHash ( merkleTree ) , salts : leafs . map ( ( leaf ) => leaf . salt ) , leafs } ; } } export interface IOwnershipCommitment { [ address ] : string ; } export interface IOwnershipCommitmentProof { commitment : IOwnershipCommitment ; rootHash : string ; leafs : PreciseProofs . Leaf [ ] ; salts : string [ ] ; }