UNPKG

zkverifyjs

Version:

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

32 lines (31 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchVerificationBuilder = void 0; class BatchVerificationBuilder { constructor(batchExecuteVerify, proofOptions, accountAddress) { this.batchExecuteVerify = batchExecuteVerify; this.nonceSet = false; this.registeredVkSet = false; this.options = { proofOptions, accountAddress }; } nonce(nonce) { if (this.nonceSet) { throw new Error('Nonce can only be set once.'); } this.nonceSet = true; this.options.nonce = nonce; return this; } withRegisteredVk() { if (this.registeredVkSet) { throw new Error('withRegisteredVk can only be set once.'); } this.registeredVkSet = true; this.options.registeredVk = true; return this; } async execute(input) { return this.batchExecuteVerify(this.options, input); } } exports.BatchVerificationBuilder = BatchVerificationBuilder;