zkverifyjs
Version:
Submit proofs to zkVerify and query proof state with ease using our npm package.
36 lines (35 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatManager = void 0;
const format_1 = require("../../../api/format");
/**
* Manages proof formatting operations.
*/
class FormatManager {
/**
* Formats proof details for the specified proof type.
*
* @param proofOptions - The options for the proof, including type, library, and curve.
* @param proof - The proof data to format.
* @param publicSignals - The public signals associated with the proof.
* @param vk - The verification key to format.
* @param registeredVk - Optional flag indicating if the verification key is registered.
* @returns {Promise<FormattedProofData>} A promise resolving to the formatted proof data.
* @throws {Error} - Throws an error if formatting fails.
*/
async format(proofOptions, proof, publicSignals, vk, registeredVk) {
return (0, format_1.format)(proofOptions, proof, publicSignals, vk, registeredVk);
}
/**
* Formats a verification key using the configured proof processor.
*
* @param proofOptions - The options for the proof, including type, library, and curve.
* @param vk - The verification key to format.
* @returns The formatted verification key.
* @throws Throws an error if formatting fails.
*/
async formatVk(proofOptions, vk) {
return (0, format_1.formatVk)(proofOptions, vk);
}
}
exports.FormatManager = FormatManager;