DEFAULT_CONFIG
Midnight.js API Reference v3.1.0
Midnight.js API Reference / @midnight-ntwrk/midnight-js-http-client-proof-provider / DEFAULT_CONFIG
Variable: DEFAULT_CONFIG
constDEFAULT_CONFIG:object
HTTP Client Proof Provider
This package provides two levels of abstraction for interacting with a Midnight proof server:
High-Level: Transaction Proving (ProofProvider)
Use httpClientProofProvider for most use cases. It handles complete transactions
by using the low-level ProvingProvider internally.
import { httpClientProofProvider } from '@midnight-ntwrk/midnight-js-http-client-proof-provider';
const proofProvider = httpClientProofProvider(
'http://localhost:6300',
zkConfigProvider
);
const provenTx = await proofProvider.proveTx(unprovenTx, { zkConfig });
Low-Level: Circuit Proving (ProvingProvider)
Use httpClientProvingProvider for advanced scenarios where you need fine-grained
control over individual circuit proving operations.
import { httpClientProvingProvider } from '@midnight-ntwrk/midnight-js-http-client-proof-provider';
const provingProvider = httpClientProvingProvider(
'http://localhost:6300',
zkConfigProvider
);
const checkResult = await provingProvider.check(serializedPreimage, circuitId);
const proof = await provingProvider.prove(serializedPreimage, circuitId);
Architecture
ProofProvider (httpClientProofProvider)
↓ uses
ProvingProvider (httpClientProvingProvider)
↓ calls
Proof Server (/check, /prove)
Type Declaration
timeout
timeout:
number=300000
zkConfig
zkConfig:
undefined=undefined