Skip to main content
A tiny composite TS package every other workspace depends on. Three files.

Layout

index.ts

Browser-safe barrel. Re-exports bytes.js + constants.js + the Env type only. env.ts is not re-exported because it touches process.env/dotenv, which breaks browser bundles. Server-side code imports @darkpool/shared/env directly.

env.ts

zod schema for every .env var. Two entry points:
The result is cached, so subsequent calls don’t re-validate. Up-walks ancestors for .env, so it resolves correctly from any subdirectory. tsx watch from packages/server finds repo-root .env cleanly.

constants.ts

Mirrors Move-side enums:
Single source of truth that must stay in sync with Move constants. If Move’s Outcome::YES changes, this file changes too.

bytes.ts

Used by scripts (scripts/lib/cli.ts), server (indexer/ for ID parsing), and frontend (lib/ptb.ts for pure.vector('u8', …) args).