UNPKG

zkverifyjs

Version:

Submit proofs to zkVerify and query proof state with ease using our npm package.

21 lines 626 B
import { optimisticVerify } from "../optimisticVerify/index.js"; export const batchOptimisticVerify = async (connection, options, input) => { for (let i = 0; i < input.length; i++) { const res = await optimisticVerify(connection, options, input[i]); if (!res.success) { return { success: false, type: res.type, message: `Proof at index ${i} failed: ${res.message}`, code: res.code, verificationError: res.verificationError, failedIndex: i }; } } return { success: true, type: 'ok', message: 'Optimistic Verification Successful!' }; };