zkverifyjs
Version:
Submit proofs to zkVerify and query proof state with ease using our npm package.
31 lines • 1.27 kB
JavaScript
import { format, formatVk } from "../../../api/format/index.js";
/**
* Manages proof formatting operations.
*/
export 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 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 formatVk(proofOptions, vk);
}
}