@ddsm/processor
v0.1.0
Published
DDSM processor — stateful token handling, signing, discovery
Readme
@ddsm/processor
Stateful DDSM processor: receive tokens, advance them through manifest-defined transitions, sign each step with Ed25519, and generate reconciliation batches for settlement.
Install
npm install @ddsm/processorUsage
import { DDSMProcessor, createSigner } from "@ddsm/processor";
const signer = createSigner(privateKeyHex);
const processor = new DDSMProcessor({
did: "did:web:acme.example.com",
signer,
ledger, // LedgerAdapter — see @ddsm/ledger-postgres
manifestUrl: "https://acme.example.com/.well-known/ddsm/",
});
// Advance a token through a transition
const result = await processor.advance(token, {
transition: "complete",
params: { grade: "pass" },
});Key exports
| Export | Description |
|---|---|
| DDSMProcessor | Main processor class |
| createSigner | Create an Ed25519 signer from a hex private key |
| LedgerAdapter | Interface for pluggable ledger backends |
| LocalInMemoryLedgerAdapter | In-memory ledger for testing |
| ReconciliationBatch, LocalTransition | Reconciliation types |
| loadManifest, discoverParticipant | Manifest resolution utilities |
| serializeToken, deserializeToken | Token transport helpers |
Packages
| Package | Description |
|---|---|
| @ddsm/core | Protocol types and pure functions |
| @ddsm/processor | This package |
| @ddsm/ledger-postgres | PostgreSQL LedgerAdapter |
| @ddsm/cli | CLI / REPL |
