Skip to main content

@midnight-ntwrk/midnight-js-fetch-zk-config-provider v0.2.5 • API


Midnight.js API Reference v0.2.5 / @midnight-ntwrk/midnight-js-fetch-zk-config-provider / FetchZkConfigProvider

Class: FetchZkConfigProvider<K>

Retrieves ZK artifacts from a remote source.

Extends

Type parameters

K extends string

Constructors

new FetchZkConfigProvider(baseURL, fetchFunc)

new FetchZkConfigProvider<K>(baseURL, fetchFunc): FetchZkConfigProvider<K>

Parameters

baseURL: string

The endpoint to query for ZK artifacts.

fetchFunc= fetch

The function to use to execute queries.

Returns

FetchZkConfigProvider<K>

Overrides

ZKConfigProvider.constructor

Properties

baseURL

readonly baseURL: string

The endpoint to query for ZK artifacts.

Methods

get()

get(circuitId): Promise<ZKConfig<K>>

Retrieves all zero-knowledge artifacts produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the artifacts to retrieve.

Returns

Promise<ZKConfig<K>>

Inherited from

ZKConfigProvider.get


getProverKey()

getProverKey(circuitId): Promise<ProverKey>

Retrieves the prover key produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the prover key to retrieve.

Returns

Promise<ProverKey>

Overrides

ZKConfigProvider.getProverKey


getVerifierKey()

getVerifierKey(circuitId): Promise<VerifierKey>

Retrieves the verifier key produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the verifier key to retrieve.

Returns

Promise<VerifierKey>

Overrides

ZKConfigProvider.getVerifierKey


getVerifierKeys()

getVerifierKeys(circuitIds): Promise<[K, VerifierKey][]>

Retrieves the verifier keys produced by compactc for the given circuits.

Parameters

circuitIds: K[]

The circuit IDs of the verifier keys to retrieve.

Returns

Promise<[K, VerifierKey][]>

Inherited from

ZKConfigProvider.getVerifierKeys


getZKIR()

getZKIR(circuitId): Promise<ZKIR>

Retrieves the zero-knowledge intermediate representation produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the ZKIR to retrieve.

Returns

Promise<ZKIR>

Overrides

ZKConfigProvider.getZKIR