API reference · Browser and Node
@toip-tools/trust-core
63 public exports.
import { type BodyCodec, type BodyContext, BodyError } from "@toip-tools/trust-core";
Functions
-
canonicalJsonJSON Canonicalization Scheme (RFC 8785) — the byte form eddsa-jcs-2022 and
-
checkStatus -
decodeBodyReads a body of any known format, choosing by its first byte.
-
encodeBodyThe body for `doc`: `codec`'s form when it has one that carries `doc` exactly, otherwise JSON.
-
fromB64u -
fromUtf8 -
identityFromSeedBuilds an Ed25519 did:key identity and derives its X25519 encryption keys.
-
isRevokedIn -
issueCredentialCreates and signs a VC-shaped credential with a fresh UUID and the issuer's DID.
-
memoryReplayStoreA store in memory: survives a new guard, not a new process.
-
openItemOpens the item as `me`.
-
ourSpecA spec in our own namespace.
-
resealTextNew text under the item's existing key, for the same readers.
-
resolveDidKeyResolves an Ed25519 did:key locally and derives its X25519 public key without network access.
-
sealItem -
seedFromDerives a reproducible seed by hashing a label with SHA-256.
-
signDocumentSigns a JSON object with an eddsa-jcs-2022 Data Integrity proof.
-
toB64ubase64url without padding, using only APIs present in browsers and Node.
-
utf8 -
verifyCredentialChecks a credential's proof and validity window.
-
verifyDocumentVerifies a document's Data Integrity proof, allowing five minutes of clock skew.
Classes
-
BodyErrorWhy a body could not be read, in the TSP binding's failure terms.
-
BusAn in-memory network that delivers bytes by receiver VID, and lets the UI tap every message.
-
CoarseClockA clock that rounds every reading down to `granularityMs` (default one hour), so documents and
-
DemoClockA manually advanced clock, so tests are deterministic.
-
EndpointSends and receives Trust Task documents as real TSP Direct messages.
-
KnowledgeLog -
PersistentReplayGuard -
PoliciesRego policies compiled to one WebAssembly bundle with `opa build -t wasm`, evaluated locally.
-
RefusalA handler returns this to refuse a request.
-
RelayTransport -
StatusList -
SystemClock -
TaskError
Interfaces
-
BodyCodec -
BodyContext -
ClockWhere every component gets the time.
-
Credential -
CredentialBody -
FactWhat one agent has learned about another, and how.
-
IdentityOne agent's keys.
-
OutboxItem -
OutboxStoreWhere the outbox survives a restart.
-
ReplayRecord -
ReplayStoreWhere the record lives.
-
SealedText -
StatusListDocA signed revocation list: one bit per credential index.
-
TrafficOne message this endpoint sent or received, for an inspector.
-
Transport -
WireRecordOne message on the simulated network, as an observer sees it, plus what its recipient opened.
Types
-
CredentialCheck -
DeliveryDelivery of sealed TSP bytes between VIDs.
-
Handler -
RelayStatus
Constants
-
ctt1CTT1, format 0x01 (mesh design §8.1).
-
CTT1_FORMAT -
CTT1_KEYSObject keys written as their index.
-
CTT1_PREFIXESString prefixes written as `[index, rest]`.
-
CTT1_STRINGSWhole strings written as their index.
-
JSON_FORMAT -
jsonBodyThe binding's standard JSON body, byte for byte what `packTrustTask` seals.
-
MAX_WIRE_BYTESThe relay's per-message limit.
-
OUR_SPEC_BASE
Signatures and source documentation are generated from packages/trust-core/src/index.ts.