npm i zkproofaggregator-sdk
create without deployed zkaFactory contract
import { ZkProofAggregator } from 'zkproofaggregator-sdk';
const zkpproofAggregator = new ZkProofAggregator(signer);
create with zkaFactory contract
import { ZkProofAggregator } from 'zkproofaggregator-sdk';
const zkpproofAggregator = new ZkProofAggregator(signer, zkaFactoryAddress);
reconnect signer
zkpproofAggregator.connect(newSigner);
spv.connect(newSigner);
create without deployed spv contract
import { SPV } from 'zkproofaggregator-sdk';
const spv = new SPV(signer);
create with spv contract
import { SPV } from 'zkproofaggregator-sdk';
const spv = new SPV(signer, spvAddress);
in development environment, you can deploy contracts by using the following methods.
const zkpproofAggregator = new ZkProofAggregator(signer);
await zkpproofAggregator.deploy();
const spv = new SPV(signer);
await spv.deploy();
you can check all detail in config
const zkaSatate = zkpproofAggregator.getConfig();
const spvState = spv.getConfig();
after call deploy methods, contracts address has been add to instance.config()
const zkpproofAggregator = new ZkProofAggregator(signer, zkaFactoryAddress);
const zkpVerifierName = "PLONK2";
const url = "http://localhost:3000";
const deployer = await zkpproofAggregator.getConfig().signer.getAddress();
const { tx, computeZKAVerifierAddress } =
await zkpproofAggregator.deployZKAVerifier(
zkpVerifierName,
url,
deployer,
await plonk2MockVerifier.getAddress()
);
await tx.wait();
const zkpVerifierAddress = await zkpproofAggregator.fetchVerifiersMeta();
const tx = await zkpproofAggregator.zkpVerify(currentVerifier, proof);
await tx.wait();
const proofStatus = await zkpproofAggregator.checkProofVerifyStatus(
currentVerifier,
proofMock
);
const spv = new SPV(signer, spvAddress);
const tx = await spv.verify(proofMock);
await tx.wait();