import { useState } from 'react'; import React from 'react'; import { useOnChainVerification } from '../hooks/useOnChainVerification.jsx'; import { useProofGeneration } from '../hooks/useProofGeneration.jsx'; import { useOffChainVerification } from '../hooks/useOffChainVerification.jsx'; function Component() { const [input, setInput] = useState<{ x: string; y: string } | undefined>(); const { noir, proofData, backend } = useProofGeneration(input); useOffChainVerification(backend!, noir, proofData); const verifyButton = useOnChainVerification(proofData); const submit = (e: React.FormEvent) => { e.preventDefault(); const elements = e.currentTarget.elements; if (!elements) return; const x = elements.namedItem('x') as HTMLInputElement; const y = elements.namedItem('y') as HTMLInputElement; setInput({ x: x.value, y: y.value }); }; return ( <>

Example starter

This circuit checks that x and y are different (yey!)

Try it!

{verifyButton} ); } export default Component;