A comprehensive CLI tool for building, decoding, and analyzing Polkadot/Substrate extrinsics.
# Install dependencies
bun install
# Show available commands
bun cli.ts help
# Add a new chain
bunx papi add <chain> -n <name>- Build & decode extrinsics
- Compare two extrinsics side-by-side
- Query fees for calls and extrinsics
- Inspect blocks, storage, pallets, and types
- SCALE encoding utilities
# Decode an extrinsic
bun cli.ts decode <extrinsic-hex>
# Compare two extrinsics
bun cli.ts compare <hex1> <hex2>
# Query call fees
bun cli.ts query-fees --address <address> --call <call-hex>
# Get block info
bun cli.ts get-block --hash <block-hash>
# List available pallets
bun cli.ts list-palletsUse the add-chain command:
bun cli.ts add-chain \
--name polkadot \
--ws-url wss://rpc.polkadot.io \
--display-name "Polkadot Mainnet" \
--set-defaultThis automatically:
- Adds the chain to
.papi/polkadot-api.json - Updates
chains.jsonwith the chain configuration - Optionally sets it as the default chain
Options:
--name: Chain identifier used in commands (required)--ws-url: WebSocket RPC endpoint (required)--display-name: Human-readable name (optional, defaults to name)--papi-key: PAPI descriptor key (optional, defaults to name)--set-default: Make this the default chain (optional)
See AGENTS.md for complete CLI reference.