"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PreciseProofUtils = void 0;
const precise_proofs_js_1 = require("precise-proofs-js");
class PreciseProofUtils {
    static generateProofs(commitment, salts) {
        let leafs = salts
            ? precise_proofs_js_1.PreciseProofs.createLeafs(commitment, salts)
            : precise_proofs_js_1.PreciseProofs.createLeafs(commitment);
        leafs = precise_proofs_js_1.PreciseProofs.sortLeafsByKey(leafs);
        const merkleTree = precise_proofs_js_1.PreciseProofs.createMerkleTree(leafs.map((leaf) => leaf.hash));
        return {
            commitment,
            rootHash: precise_proofs_js_1.PreciseProofs.getRootHash(merkleTree),
            salts: leafs.map((leaf) => leaf.salt),
            leafs
        };
    }
}
exports.PreciseProofUtils = PreciseProofUtils;
//# sourceMappingURL=PreciseProofUtils.js.map