Introduction
hashspan is an open-source TypeScript library that turns each transaction an AI agent sends into OpenTelemetry spans, keyed by the transaction hash, inside the agent’s own trace.

What you get
Section titled “What you get”- A
send {chainId}span when the hash comes back, and a linkedconfirm {chainId}span when the receipt arrives. - Status (
success,reverted,replaced; a wait that gives up ends witherror.typetimeout), block, gas used and the fee, including the L1 data fee on OP-stack chains. - The decoded revert reason for mined reverts.
- For x402, a
payment {chainId}span per paid request: what was paid, to whom and whether it settled. With a reader, a linkedconfirmspan adds block, gas and fees of the settling transaction. - The agent’s identity (
gen_ai.agent.id,gen_ai.agent.name) on every transaction span.
The spans nest under whatever span is active when the transaction is sent, usually your agent framework’s execute_tool span. They go to the tracing backend you already use: Jaeger, Grafana Tempo, Langfuse, Honeycomb or any OTLP endpoint.
Packages
Section titled “Packages”| Package | Use it for |
|---|---|
@hashspan/viem |
Agents that send with viem wallet clients |
@hashspan/cdp |
Agents that send with Coinbase CDP server accounts |
@hashspan/x402 |
Agents that pay for API calls with x402 |
@hashspan/core |
Any other send path; the tracker every adapter uses |
What it doesn’t do
Section titled “What it doesn’t do”hashspan never signs or broadcasts transactions, and it doesn’t alert. It records what happened so you can read it next to the agent’s decisions.