@openacid/acid
The four primitives — saga, invariant, idempotent, receipted — plus shared types, errors, conformance suite, EIP-712 receipt encoding, composition introspection, chain-aware broadcast helper.
npm i @openacid/acid@openacid/adapter-memory
StorageAdapter with atomic compare-and-swap; MemorySigner with real secp256k1 signing. For tests and the dry-run demo path. Not for production.
npm i @openacid/adapter-memory@openacid/adapter-viem
ChainAdapter wrapping a viem PublicClient (getTxByHash, getTxByNonce, waitForFinality). ViemSigner for production wallets.
npm i @openacid/adapter-viem@openacid/adapter-0g-storage
Write-through StorageAdapter on 0G blob storage. Receipts persist as content-addressed blobs; pointers live in-process for hot reads. Live conformance suite passes 10/10 against Galileo testnet.
npm i @openacid/adapter-0g-storage@openacid/adapter-ens
Mirrors receipt CIDs to ENS text records on every emitted receipt. Wires into receipted() via onReceipt. Any third party can resolve openacid.eth/receipt.latest with no library install.
npm i @openacid/adapter-ensOne command for the full kit.
Use this when you want the four primitives plus every adapter ready in one go. In production, prefer installing only the adapters you actually wire.
pnpm add @openacid/acid @openacid/adapter-memory @openacid/adapter-viem @openacid/adapter-0g-storage @openacid/adapter-ensNewest release.
- recipientWhitelist — built-in invariant that flags any tx whose recipient is not in your allowlist. Critical-severity rejection by default.
- withTimeout — top-level wrapper that races the wrapped fn against a hard deadline. Throws
TimeoutErrorwith the configured label. - See the recipes for both.
Earlier releases
- 0.1.2 —
getCompositionLabel(fn)renders a chain likereceipted→invariant→idempotent→saga. - 0.1.1 —
Error.causepropagation; saga errors carry{ sagaId, attempt }meta. - 0.1.0 — first publish across all five packages.