npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@valve-tech/trace-sdk

v0.4.0

Published

Standalone EVM trace loading, traversal, and rendering toolkit. No platform dependencies.

Readme

@valve-tech/trace-sdk

Standalone EVM trace loading, traversal, and rendering toolkit. No platform dependencies — works against any JSON-RPC node that supports debug_traceTransaction / debug_traceCall.

Originally extracted from the PulseChain Dev Platform debugger. Works for any EVM chain, not just PulseChain.

Install

npm install @valve-tech/trace-sdk viem
# React components are optional — only install if you'll render them
npm install react

Peer dependencies:

| Package | Required | Why | |---------|----------|-----| | viem | yes | RPC calls in loadTraceFromHash, address utilities | | react (>=18) | optional | Only for CallTree, GasFlamegraph, OpcodeViewer components |

Quickstart

// TODO: your quickstart snippet here

Subpath exports

Tree-shake friendly — import only what you need:

import { parseCallTrace } from "@valve-tech/trace-sdk/loaders";
import { walkCallTree, buildGasProfile } from "@valve-tech/trace-sdk/traversal";
import { parseTokenDeltas, parsePrestateDiff } from "@valve-tech/trace-sdk/parsers";
import { analyzeRisks } from "@valve-tech/trace-sdk/risks";
import { CallTree, GasFlamegraph, OpcodeViewer, FindingsPanel } from "@valve-tech/trace-sdk/components";
import { FullDebuggerLayout, RevertExplainer, CompactCallSummary } from "@valve-tech/trace-sdk/templates";
import type { CallNode, TraceFrame, GasProfile } from "@valve-tech/trace-sdk/types";

API

Loaders (/loaders)

  • loadTraceFromHash(rpcUrl, txHash, options?) — fetch + normalize a trace from a live node
  • loadTraceFromFile(path) — read a JSON trace dump
  • loadTraceFromObject(obj) — normalize an already-parsed trace
  • parseCallTrace / normalizeCallFrame — normalize a raw call frame
  • normalizeStructLogs — normalize step-level opcode logs

Traversal (/traversal)

  • walkCallTree(root, visitor) — depth-first traversal with enter/exit hooks
  • flattenCallTree(root) — array of FlatFrame with depth metadata
  • filterByAddress(root, addr) / filterBySelector(root, sel) — subtree filters
  • findRevertFrame(root) — first frame whose call reverted
  • buildGasProfile(root) — aggregated gas per contract / selector

Parsers (/parsers)

  • parseTokenDeltas(frame) — extract ERC-20 Transfer events as TokenDelta[]. Skips reverted call frames (and their subtrees) so output matches the on-chain receipt. Requires the trace to have been captured with the callTracer withLog: true option.
  • parsePrestateDiff(raw) — compute signed ETH balance changes per address from a prestateTracer diffMode: true payload, sorted by address.

Risks (/risks)

  • analyzeRisks(frame, options?) — walk the call tree and emit RiskFlag[] findings. Continues into reverted subtrees, tagging findings from there with reverted: true so consumers can filter or visually distinguish.
  • Built-in rule: DELEGATECALL_UNRECOGNIZED flags any DELEGATECALL whose target isn't in the optional whitelist set. Pass known-good implementation contracts in the whitelist to suppress noise.
  • BUILTIN_RULES / RiskRule are exported for composing custom analyses.

Components (/components, React peer dep)

  • <CallTree> — interactive call tree with expand/collapse
  • <GasFlamegraph> — proportional gas-cost flamegraph
  • <OpcodeViewer> — step-by-step opcode trace with category coloring
  • <FindingsPanel> — renders analyzeRisks output, grouped by severity
  • <StateDiffPanel> — renders StateDiff[] with balance/nonce/storage changes per address
  • <FrameDetailPanel> — renders metadata for a single TraceFrame (call type, gas, value, error, decoded I/O)

All components accept a classNames prop for full style override.

Templates (/templates, React peer dep)

Higher-order compositions of the components — drop-in views for common trace consumers:

  • <FullDebuggerLayout trace? opcodes? stateDiffs? risks? /> — tabbed view (Call Tree / Opcodes / State / Risks). Each tab independently renders its empty state when data is missing; the Call Tree tab shows a <FrameDetailPanel> underneath after a frame is selected.
  • <RevertExplainer frame /> — locates the innermost reverting frame, surfaces its revertReason prominently, and shows the breadcrumb chain from root to the reverter. Renders a success message when the transaction did not revert.
  • <CompactCallSummary frame maxDepth? /> — one-line-per-call terse summary with status badge + total-gas chip; suitable for embedding in logs, alerts, or chat messages.

License

MIT © Valve Tech