The ZK3 client is a wrapper around the ZK3 GraphQL API.
Setup
import { ZK3Client } from'zk3-sdk'constzk3=newZK3Client()// or if you plan on calling client methods from within useEffect in a component:constzk3=useMemo(() =>newZK3Client(), [])
Methods
Get Circle
// @param: id: string// @return: circle object or null if circle doesn't existawaitzk3.getCircle(id)
Get Circles
// @param: commitment: string (optional)// @return: array of circle objects that the commitment is a part of // or all circles if no commitment is providedawaitzk3.getCircles(commitment)
Get Stats
// @return: stats object containing number of circles, // identities and proofs generated so farawaitzk3.getStats()
All of the other methods of the client are used internally for the various hooks that enable seamless functionality in React. It is heavily recommended you use the hooks instead of the client methods.