Skip to main content

Prep clients

Use the JavaScript client for typed queries and cursor handling, or call Prep's HTTP JSON API from your language of choice.

ClientResources
Node.js / TypeScriptAPI reference · npm · GitHub · Quickstart
HTTP JSONQuery reference · cURL examples · Playground

Node.js / TypeScript​

Requires Node.js 22.18+ and pnpm, or npm using the alternative below. The ESM package uses native fetch and includes TypeScript declarations.

pnpm add @zeer-dev/prep-client@0.1.0

With npm, use npm install @zeer-dev/prep-client@0.1.0 instead.

import { PrepClient } from "@zeer-dev/prep-client";

const client = new PrepClient({ url: "https://zeer.endpx.cloud/api/prep" });
for await (const page of client.stream({
from_block: 0,
to_block: 2,
field_selection: { block: ["height", "hash"], transaction: [] },
})) {
console.log(page.data.blocks);
}

Methods​

MethodPurpose
getHeight() / getCapabilities()Coverage, readiness and protocol features
get(query)One query page
stream(query, options)Cursor pages through a finite captured range
getTransactions(query)Bounded transaction-ID lookup
getMempool() / getTransaction(txid)Optional live node observations

The client validates responses and exposes typed errors. Streams advance through empty filtered pages and stop on snapshot changes instead of silently restarting. Defaults are 30 seconds per request and 120 seconds per stream; options let you set timeouts and cancellation.

API access​

The public Zcash Testnet preview requires no personal token. For a private Prep deployment, pass its bearer token as the client's token option. Keep private credentials out of frontend bundles. See API access & tokens.