Modular, TypeScript-first system for on-chain blockchain analysis. Built on top of @openscan/network-connectors.
| Package | Description |
|---|---|
@openscan/utils |
Zero-dep utilities: hex, units, address validation, ABI, events, signatures, tx-analysis (call trees, prestate diffs, contract enrichment) |
@openscan/algorithms |
On-chain algorithms: tx history, token balance, gas price |
@openscan/cli |
CLI tool (openscan) wrapping algorithms and utils |
@openscan/skills |
Markdown-based procedural knowledge for AI agents (skills.sh format) |
@openscan/adapters-langchain |
LangChain tool wrappers |
@openscan/adapters-openclaw |
OpenClaw adapter |
pnpm install
pnpm buildAfter pnpm build, invoke the CLI via node packages/cli/dist/bin.js <command> (or link the openscan bin).
High-level transaction debugger. Wraps analyzeTx from @openscan/utils to fetch the call tree, prestate diff, raw structLogs trace, and contract metadata in one pass. Requires an RPC that supports debug_traceTransaction (e.g., Alchemy) — falls back per-section with { data: null, error: "not supported" } when a tracer isn't available.
# Defaults: call tree + contracts
openscan analyze-tx 0x<txHash> --chain 1 --alchemy-key "$ALCHEMY_API_KEY"
# Full: add prestate diff and raw trace, enrich contracts via Etherscan
openscan analyze-tx 0x<txHash> --chain 1 --alchemy-key "$ALCHEMY_API_KEY" \
--include-prestate --include-raw-trace --etherscan-key "$ETHERSCAN_API_KEY"Flags: --include-prestate, --include-raw-trace, --skip-call-tree, --skip-contracts, --etherscan-key (or ETHERSCAN_API_KEY env var).
Result includes verificationLinks pointing at https://openscan.eth.link/#/:chainId/tx/:txHash.
pnpm testpnpm --filter @openscan/utils test
pnpm --filter @openscan/algorithms test
pnpm --filter @openscan/cli test
pnpm --filter @openscan/adapters-langchain test
pnpm --filter @openscan/adapters-openclaw testpnpm --filter @openscan/utils exec tsx --test tests/hex.test.tspnpm typecheckpnpm lint
pnpm format:fix
pnpm lint:fixPackages use changesets for independent versioning.
pnpm changesetFollow the prompts to select which packages changed and the semver bump type (patch, minor, major). This creates a changeset file in .changeset/.
pnpm changeset versionThis consumes all pending changesets, bumps versions in each package's package.json, and updates changelogs.
pnpm buildpnpm changeset publishThis publishes all packages with new versions to npm. Each package has "publishConfig": { "access": "public" } configured.
pnpm --filter @openscan/utils exec npm publish --access publicpnpm --filter @openscan/utils exec npm publish --access public --dry-run