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

decode-anything-cli

v1.0.0

Published

CLI tool for decoding ABI-encoded data without knowing the ABI

Readme

decode-anything-cli

A CLI wrapper for @openchainxyz/abi-guesser to decode any ABI-encoded data without knowing the ABI.

Features

  • 🔍 Guess ABI types from encoded data automatically
  • 🎯 Decode function calldata including function selectors
  • 📊 Multiple output formats (human-readable or JSON)
  • 🚀 No ABI required - works with any properly encoded data

Installation

Global Installation

npm install -g decode-anything-cli
# or
yarn global add decode-anything-cli

Local Development

git clone <repository-url>
cd decode-anything-cli
yarn install
yarn build

Usage

Basic Usage

Decode ABI-encoded data:

decode-anything 0x0000000000000000000000000000000000000000000000000000000000000001

Decode Function Calldata

Include the 4-byte function selector (first 4 bytes of transaction calldata):

decode-anything --calldata 0xa9059cbb000000000000000000000000...

JSON Output

Get machine-readable JSON output:

decode-anything --json 0x0000000000000000000000000000000000000000000000000000000000000001

Command Line Options

USAGE:
  decode-anything <data> [options]

ARGUMENTS:
  <data>              Hex-encoded data (with or without 0x prefix)

OPTIONS:
  -j, --json          Output in JSON format
  -c, --calldata      Decode as function calldata (expects first 4 bytes to be function selector)
  -h, --help          Show this help message

Examples

Example 1: Simple uint256

$ decode-anything 0x0000000000000000000000000000000000000000000000000000000000000001

Guessed Parameter Types:
  [0] uint256

Decoded Values:
  [0] 1

Example 2: Address and Amount

$ decode-anything 0x000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000186a0

Guessed Parameter Types:
  [0] address
  [1] uint256

Decoded Values:
  [0] 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  [1] 100000

Example 3: Function Calldata

$ decode-anything --calldata 0xa9059cbb000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000186a0

Function Fragment:
  guessed_a9059cbb(address,uint256)

Selector: 0xa9059cbb

Parameter Types:
  [0] address
  [1] uint256

Decoded Values:
  [0] 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  [1] 100000

Example 4: JSON Output

$ decode-anything --json 0x0000000000000000000000000000000000000000000000000000000000000001

{
  "success": true,
  "types": [
    {
      "type": "uint256",
      "baseType": "uint256",
      "format": "uint256"
    }
  ]
}
{
  "decodedValues": [
    "1"
  ]
}

How It Works

This tool uses the abi-guesser library which:

  1. Analyzes the structure of ABI-encoded data
  2. Identifies parameter boundaries using 32-byte padding
  3. Detects dynamic types using offset pointers
  4. Infers specific types based on data patterns (addresses, uint sizes, etc.)

Note: This only works with abi.encode() formatted data. Data encoded with abi.encodePacked() cannot be reliably decoded without knowing the types beforehand.

Development

Build

yarn build

Run in Development

yarn dev <data> [options]

Type Checking

yarn check-types

Linting & Formatting

yarn lint
yarn format

Limitations

  • Only works with properly ABI-encoded data (using abi.encode())
  • Cannot decode abi.encodePacked() data (no type boundaries)
  • Type inference may not always be 100% accurate
  • Complex nested structures might have ambiguous types

Credits

Built on top of @openchainxyz/abi-guesser by the OpenChain team.

License

MIT