corridor-in-a-box

Architecture

packages/
  types/         Outcome<T> result type + decimal-safe Money
  manifest/      Zod schema for a corridor + loader
  adapter-kit/   AnchorAdapter port + conformance probes + mock adapter
  sep31/         ONE generic adapter (SEP-10 auth + SEP-12 KYC)
  stellar/       the ONLY chain-touching package: settlement submitter + SEP-10 signer
  router/        RouteResolver seam — open interface + static default
  engine/        orchestration: state machine, crash-resume, recovery, audit, metrics
  service/       thin HTTP API over the engine (auth + rate limiting)
  cli/           validate a manifest; print an offline runnability plan

The five verbs

StepVerbStandard
1quoteSEP-38 POST /quote
2complySEP-10 auth + SEP-12 KYC handoff
3openSEP-31 POST /transactions
4settlenative Stellar payment of the bridge asset
5reconcileSEP-31 GET /transactions/:id

A persisted state machine drives created → quoted → compliant → opened → settling → settled → reconciled → completed, with recovering → refunded / held for failures. Every transition is logged, audited, and counted.