@usehaia/trace-core.
Install
Connect it
Calltrace() once, passing your x402 instance — a client, resource server,
facilitator, or MCP client:
trace() inspects the instance’s method set to resolve its kind, attaches to
that kind’s lifecycle hooks, and logs the context each hook is handed, tagging
every line with the observing role (client / server / facilitator).
It works the same on either side of a payment:
@x402 value is imported at runtime — so
API-compatible forks are covered too.
Passivity — the load-bearing guarantee
SetHAIA_TRACE_DISABLE=1 in the environment to make trace() a no-op.
Options
{ hook, role, context }.
Attestation
trace() returns a TraceAttestation describing what it connected to — so a
caller can tell “no payment events happened” apart from “the recorder never wired
up”:
Recognized kinds
Status
This adapter currently records hook firings as raw context. Two pieces are
still on the roadmap, and until they land it’s meant for local development and
wiring, not a production or real-money flow:
- Normalized events + local sink — mapping firings to the Event Contract’s
event_types (x402.payment.required, …) and writing them to.trace/events/*.ndjson, sotrace(...)feedshaia-trace buildend-to-end. - Redaction — the raw context can contain signatures and credentials; an allowlist-based redaction pass is not in place yet.