@openpit/engine - embeddable pre-trade risk SDK as a WebAssembly engine for Node, browsers, Deno, Bun, and edge runtimes.

The root entry mirrors the SDK facade: the engine, its staged builder, the wasm initialization hooks, and the typed OpenpitError hierarchy. Everything else lives under a subpath that mirrors the SDK module tree:

  • @openpit/engine/param - value types, identifiers, and enums.
  • @openpit/engine/core - global instrument reference data.
  • @openpit/engine/model - order, execution-report, and adjustment models.
  • @openpit/engine/pretrade - pipeline handles, results, contexts, and the custom-policy contract.
  • @openpit/engine/pretrade/policies - built-in policy builders.
  • @openpit/engine/marketdata - the live market-data service.
  • @openpit/engine/reject - rejects, reject codes, and account-block types.
  • @openpit/engine/accountadjustment - adjustment outcome types.
  • @openpit/engine/accounts - the account registry handle.
  • @openpit/engine/tx - the commit/rollback mutation pair.

The published package ships two platform builds that share this surface:

  • Node (node/): reads the sibling .wasm from disk and instantiates synchronously at import.
  • Browser / edge (browser/): instantiates from base64-inlined wasm synchronously at import (no fetch, no fs).

Both default to zero-await usage:

import { Engine } from "@openpit/engine";
import { buildOrderValidation } from "@openpit/engine/pretrade/policies";

const engine = Engine.builder()
.builtin(buildOrderValidation())
.build();

For environments that forbid synchronous wasm compilation, await ready (or await ensureInit()) before touching any class.

Index

Classes

Interfaces

Type Aliases

Variables

Functions