npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@secentra/escrow-sdk

v0.1.0

Published

Deterministic, failure-honest SDK for the Secentra Escrow domain

Readme

Secentra Escrow SDK

A deterministic, failure-honest SDK for building escrow workflows on top of the Secentra Escrow Engine.

This SDK is intentionally minimal. It exposes a small, explicit public API and enforces correctness over convenience.

What this SDK IS

Deterministic execution model

Explicit, synchronous dispatch

Strict and explicit domain contracts

Production-grade error taxonomy

Type-safe by default (no implicit payload assumptions)

What this SDK is NOT

Not an ORM

Not async or retry-based

Not persistence-aware

Not event sourcing infrastructure

Not forgiving of incorrect usage

Principle: correctness over convenience.

Installation npm install @secentra/escrow-sdk

Quick Example (Happy Path) import { EscrowSDK } from "@secentra/escrow-sdk" import type { Projection } from "@secentra/escrow-sdk"

const sdk = new EscrowSDK({ projections: [ ((ctx) => { if (ctx.event.type !== "payment.received") return console.log("Event received:", ctx.event.type) }) satisfies Projection, ], })

sdk.dispatch({ type: "payment.received", payload: { amount: 1000 }, })

Execution Model (High Level)

dispatch() is synchronous

Projections execute in registration order

Execution stops on the first failure

Re-entrant dispatch is not allowed

Errors are never swallowed

If a projection throws, dispatch fails immediately.

Error Model

All runtime failures surface as explicit domain errors.

Error Types

ProjectionError — a projection failed during execution

ConfigurationError — invalid SDK configuration

DispatchError — invalid dispatch usage

InvariantViolationError — violated core guarantees

Example import { ProjectionError } from "@secentra/escrow-sdk"

try { sdk.dispatch(event) } catch (e) { if (e instanceof ProjectionError) { console.error(e.event.type) console.error(e.cause) } }

Errors always preserve their original cause.

Consumers should treat errors as expected control flow, not exceptional accidents.

Payload Safety

Event payloads are typed as unknown by design.

This forces consumers to:

Validate payloads explicitly

Avoid unsafe assumptions

Fail fast and clearly

function isPaymentPayload(p: unknown): p is { amount: number } { return typeof p === "object" && p !== null && "amount" in p }

Warnings (DX Only)

The SDK may emit non-fatal warnings in development mode (e.g. missing projections).

Warnings:

Never affect execution

Are never thrown

Exist only to surface potential misuse

Versioning Policy

This SDK follows Semantic Versioning.

PATCH — documentation, comments, examples

MINOR — additive, backward-compatible API changes

MAJOR — breaking contracts or semantics

If an existing test breaks, it is a MAJOR change.

Supported Environments

Node.js 18+

TypeScript 5+

Documentation

Extended documentation is available in /docs:

docs/getting-started.md

docs/execution-model.md

docs/error-model.md

docs/faq.md

Stability Promise

Public API is defined only via package exports

No deep imports are supported

Internal structure may change without notice

Exported contracts are stable within a major version

Phase 3 — SDK Hardening & Build Output

This phase focuses on locking contracts and preparing the SDK for safe distribution.

Phase 3.3 — Public API Hardening

This phase formalizes and freezes the public contracts of the SDK. No new features are introduced in this phase.

Public API Freeze

The following exports are considered stable and frozen:

EscrowSDK

Projection

ProjectionError

ConfigurationError

DispatchError

InvariantViolationError

Any change to their signatures, semantics, or throwing behavior constitutes a breaking change and requires a MAJOR version bump.

Error Semantics (Locked)

The SDK throws only the following domain-specific errors:

| Error Type | When It Is Thrown | |----------------------------|---------------------------------------------------------| | ConfigurationError | Invalid SDK construction or configuration | | DispatchError | Invalid dispatch usage or malformedevent | | InvariantViolationError | Violation of core guarantees (e.g. re-entrant dispatch) | | ProjectionError | A projection throws during execution |

No other errors are permitted to escape the SDK.

Invariants (Guaranteed)

The following guarantees are enforced by the SDK:

Dispatch is synchronous

Projections execute in registration order

Re-entrant dispatch is forbidden

Errors are never swallowed

Event payloads are typed as unknown and must be validated by consumers

These guarantees are part of the public contract, not implementation detail.

Misuse Behavior

The SDK distinguishes between hard failures and non-fatal misuse:

Missing or non-matching projections → ignored (may emit warnings in development)

Invalid event object → hard failure (DispatchError)

Projection throws → hard failure (ProjectionError)

There is no silent recovery from invalid execution.

Rules (Enforced Across Phase 3)

SDK is a standalone, consumer-facing library

No assumptions about runtime, storage, or network

No breaking changes without explicit version increment