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

@0xsequence/sidekick-cli

v0.0.1

Published

Sidekick API CLI

Readme

Sidekick CLI

A powerful command-line tool for generating Fastify API endpoints from smart contract ABIs for Sequence Sidekick.

Features

  • 🚀 Automatic API Generation: Generate complete Fastify API endpoints from any smart contract ABI
  • 📝 Write Endpoints: Create transaction endpoints for state-changing functions
  • 📖 Read Endpoints: Create query endpoints for view/pure functions
  • 🔄 Function Overloading Support: Handle multiple functions with the same name
  • 🎯 TypeScript Support: Full TypeScript type definitions and schemas
  • 🔧 Customizable Output: Flexible output directory configuration
  • 🛡️ Error Handling: Comprehensive error handling and logging

Installation

Global Installation (Published Package)

npm install -g @0xsequence/sidekick-cli
# or
pnpm install -g @0xsequence/sidekick-cli
# or
yarn install -g @0xsequence/sidekick-cli

Usage Guide

sidekick-cli build-api \
  --abi ./abis/erc20.json \
  --output ./src/contract/extensions

The CLI will automatically import the generated API routes into src/routes/index.ts in order to expose the endpoints to your Fastify app.

If no output directory is provided, the CLI will default to ./src/routes/contract/autogenerated.

If no contract name is provided, the CLI will automatically use the ABI file name.

If provided, --contract-name must match the ABI file name. (ex: ERC20.json -> ERC20)

Command Options

| Option | Required | Description | Default | |--------|----------|-------------|---------| | --abi <path> | ✅ | Path to the ABI JSON file | - | | --contract-name <name> | ✅ | Name of the smart contract | - | | --output <path> | ❌ | Output directory for generated files | ./generated |

Examples

Generate API for ERC20 Tokens

sidekick-cli build-api \
  --abi ./abis/erc20.json \
  --contract-name ERC20 \
  --output ./api/contracts

Generate API for Custom Contracts

sidekick-cli build-api \
  --abi ./contracts/MyNFT.json \
  --contract-name MyNFT \
  --output ./generated-apis

Generated Output Structure

The CLI generates a well-organized directory structure:

{output-directory}/
└── {contract-name}/
    ├── index.ts              # Main registration file
    ├── read/                 # Read-only function endpoints
    │   ├── balanceOf.ts
    │   ├── name.ts
    │   └── symbol.ts
    └── write/                # State-changing function endpoints
        ├── transfer.ts
        ├── approve.ts
        └── mint.ts

Supported ABI Types

The CLI automatically maps Solidity types to TypeScript types:

| Solidity Type | TypeScript Type | Notes | |---------------|-----------------|-------| | uint* | string | Converted to string for JSON compatibility | | int* | string | Converted to string for JSON compatibility | | address | string | Ethereum address as string | | string | string | Direct mapping | | bytes* | string | Hex-encoded bytes | | bool | boolean | Boolean type | | *[] | string[] | Arrays of any supported type |

Unsupported Parameter Types (WIP)

  • Structs (tuple): A function like function setUser(User memory _user) where User is a struct will not work.
  • Arrays of Structs (tuple[]): A function like function addUsers(User[] memory _users) will not be supported.
  • Multi-dimensional Arrays: A function defined as function setMatrix(uint256[][] memory _matrix) would have its parameter type incorrectly handled.
  • Fixed-Size Arrays: A function signature like function setWhitelist(address[10] memory _addresses) will not be correctly processed.

Function Overloading

The CLI handles function overloading by appending numeric suffixes:

  • transfer(address,uint256)transfer.ts
  • transfer(address,uint256,bytes)transfer_2.ts

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Support

For issues and questions, please open an issue on the GitHub repository.