TypeScript SDK — @zeq/sdk
Local physics computation, HulyaPulse timing, the operator catalogue, and a typed platform client — in one package. Compute locally with no key, or call the platform and get an Ed25519-signed result anyone can verify offline.
Package @zeq/sdk (v1.0.0) Runtime Node 18+, modern browsers Registry https://zeqsdk.com (not npmjs) Source app/packages/sdk/ License MIT Precision ≤0.1%
Install
The SDK is published to Zeq's own registry. Point the @zeq scope at it
once, then install normally:
npm config set @zeq:registry https://zeqsdk.com
npm install @zeq/sdk
Or pin it in a project-local .npmrc:
@zeq:registry=https://zeqsdk.com
The scope registry is served by every framework node — swap the host
(zeqond.com, zeqstate.com, zeqapi.com, zeq.dev) and the tarball
is byte-identical. Prefer a one-liner that also wires the zeq CLI?
curl -fsSL https://zeqsdk.com/install.sh | sh
The public surface
| Import | Purpose |
|---|---|
ZeqClient | compute (local or platform), solve, solveStrict, multibody, pulse, modulate |
pulse() | current HulyaPulse snapshot — { zeqond, phase, R_t, pulseHz, zeqondSec, … } |
modulate(s, t) | proper-time modulation R(t) = S(t)·[1 + α·sin(2πft + φ₀)] |
verify(envelope, { origin }) | independent recompute + Ed25519 signature check on any node |
ZeqWalletClient | public economy reads — transparency, prices, balances |
ZeqProofClient | fault-tolerant prove/verify client — multi-endpoint failover |
ZeqMailClient / ZeqMeshClient / ZeqDaemonClient | mail, mesh status, the audit daemon |
unixToZeqond / zeqondToUnix | timebase bridge |
Subpath exports, tree-shakable:
import { computeByDomain } from "@zeq/sdk/solvers";
import { getOperators, DOMAINS } from "@zeq/sdk/operators";
import { NIST, PULSE_HZ, ZEQOND_SEC, ALPHA_K } from "@zeq/sdk/constants";
PULSE_HZ = 1.287, ZEQOND_SEC = 0.777, ALPHA_K = 10⁻³ exactly.
Quickstart
import { ZeqClient, pulse } from "@zeq/sdk";
// HulyaPulse snapshot — local, no key.
const p = pulse();
console.log(`Zeqond ${p.zeqond} · phase ${p.phase.toFixed(3)} · R(t) ${p.R_t}`);
// Local compute — bundled solvers + NIST constants, in-process, no key.
// Partial coverage: the local solver knows a subset of the catalogue and
// returns no signature. For full physics + a verifiable result, use a key.
const zeq = new ZeqClient();
const local = await zeq.compute({ domain: "newtonian_mechanics", operators: ["KO42"] });
console.log(`${local.value} ${local.unit}`); // local pulse carrier
// Platform compute — pass a key + origin, get a signed envelope back.
const prod = new ZeqClient({ apiKey: process.env.ZEQ_API_KEY, origin: "https://zeqsdk.com" });
const horizon = await prod.compute({
domain: "general_relativity",
operators: ["KO42", "GR37"],
inputs: { mass: 1.98892e30 },
});
console.log(`${horizon.value} ${horizon.unit}`); // → 2954.0077 m
console.log(horizon.signed?.claim.registry_version); // the physics fingerprint
console.log(horizon.signed?.public_key); // the computing node's Ed25519 key
console.log(horizon.explorer_url); // this exact tick, on the Explorer
new ZeqClient() with no options computes locally — fast, no
network, no signature, and partial domain coverage (the bundled
solvers cover a subset of the catalogue). Add { apiKey, origin } and
the same call routes to the platform, which solves the full
catalogue and returns an Ed25519-signed claim, the compliance envelope,
and a tally_charge receipt metered against your ZEQ balance. Because
the signature is platform-only, guard horizon.signed with ?. in code
that may run in either mode.
Verify any result — offline, no secrets
Every platform result carries a signed claim. verify POSTs it to a
node's /api/attest, which independently re-derives the physics
bit-for-bit and checks the Ed25519 signature. Point it at a different
node than the one that computed the result for true independence:
import { verify } from "@zeq/sdk";
const v = await verify(horizon, { origin: "https://zeqond.com" });
console.log(v.verdict, v.valid); // "agree" true
verify returns { verdict, valid, zeqond?, verifier? } — valid is
true only when the verdict is "agree" (signature valid and
recompute matches). The same check is a one-liner from the terminal
(zeq verify) and from the public scripts every node serves
(/verify-zeq-result.mjs). No account, no key needed to verify.
Master-equation solve — solve(), solveStrict(), multibody()
compute() runs the operator-dispatch path. To run the master equation
itself — full trajectory, register dump, functional energy
E = P_φ · Z(M, R, δ, C, X) — use the dedicated methods. They're typed
end-to-end and require an API key (the master equation runs
server-side only).
import {
ZeqClient,
type SolveRequest, type SolveResponse,
type MultibodyRequest, type MultibodyResponse,
type RegisterDump,
} from "@zeq/sdk";
const zeq = new ZeqClient({ apiKey: process.env.ZEQ_API_KEY, origin: "https://zeqsdk.com" });
// Single-body — feather drop on Earth.
const r = await zeq.solve({
prompt: "feather drop",
mass: 1e-4,
location: "earth",
medium: "air",
koSettings: { KO42: 1.0 },
});
console.log("errorPct: ", r.errorPct, "%");
console.log("functionalEnergy:", r.functionalEnergy);
console.log("φ_final: ", r.registerDump.phi_final);
console.log("frequency_Hz: ", r.registerDump.frequency_Hz);
console.log("freq / 1.287 Hz: ", r.registerDump.freq_ratio_fH);
// Strict autotune to ≤ 0.1 % error.
const tuned = await zeq.solveStrict({
prompt: "free-fall calibration",
mass: 1.0,
koSettings: { NM19: 1.0, NM24: 0.3 },
tMax: 0.4, dt: 0.001,
maxIterations: 40,
referenceMode: "free-fall",
});
console.log(tuned.tuneStatus, tuned.tuneIterations, tuned.betaFinal);
// Multi-body — Sun-Earth-Moon (set pairwiseCoupling: 6.674e-11 for Newton's G).
const mb = await zeq.multibody({
prompt: "sun-earth-moon",
bodies: [
{ mass: 1.989e30, location: "sun", object: "sun" },
{ mass: 5.972e24, location: "earth", object: "earth" },
{ mass: 7.342e22, location: "moon", object: "moon" },
],
koSettings: { KO42: 1.0, NM21: 0.5, GR35: 0.3 },
});
for (const body of mb.bodies) console.log(body.object, body.registerDump);
for (const ix of mb.interactions) console.log(`pair (${ix.bodyA},${ix.bodyB}): F_avg=${ix.F_avg}`);
Optional request fields (every one numerical / categorical — no string parsing):
| Field | Type | Use |
|---|---|---|
mass, location, medium, object | number / categorical | Explicit physics inputs. |
useOperatorModules | boolean | Use operator-specific physics values instead of the legacy Σ w·φ. |
normalizeOperators | boolean | Default true; commensurate-scale operator values. |
coreOnly | boolean | Restrict to the Core Operator Families. |
referenceMode | "free-fall" | "shm" | "model" | Analytic comparison target for errorPct. |
pairwiseCoupling, pairwiseSoftening | number | (multibody only) γ and ε² in the pairwise interaction. |
See /api/framework/ for the full reference.
ZeqWalletClient — the economy read surface
Public, no-auth reads against the framework's ZEQ economy:
import {
ZeqWalletClient,
OPERATION_COSTS, TIER_BURN_RATES, TIER_DAILY_LIMITS, TIER_PRICES, PRICE_PER_TOKEN_USD,
} from "@zeq/sdk";
const w = new ZeqWalletClient({ origin: "https://zeqsdk.com" });
const status = await w.walletStatus("ZEQ07090490306"); // balance, tier, daily limit, burn rate
const now = await w.transparencyNow(); // network supply snapshot
const recent = await w.transparencyHistory(60);
const revenue = await w.revenue(); // two-channel revenue ledger
const quote = await w.swapQuote({ chain: "btc", usd: 50 });
const pot = await w.foundationPot();
tally_charge on platform compute
Platform compute() responses include the per-call wallet receipt:
const r = await prod.compute({ operators: ["KO42", "NM19"], inputs: { mass: 2, acceleration: 3 } });
console.log("Charged:", r.tally_charge.charged, "ZEQ");
console.log("Burned:", r.tally_charge.burned);
console.log("To foundation:", r.tally_charge.toFoundation);
console.log("Wallet now:", r.tally_charge.remainingAfter);
When the wallet is short, compute() throws a ZeqApiError with
code: "INSUFFICIENT_BALANCE" — catch it and route the user to
/tally/ for a top-up.
See also
- API reference — every endpoint
ZeqClientandZeqWalletClientwrap - Verify anything — the offline-verification story end to end
- ZEQ economy · BYOK
- Python —
zeq.py· MCP · Terminal CLI - Operators · Protocols
- Papers: Zeq Paper · Zeq Framework
Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.