Skip to content

AmAzing129/sol-smart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SolSmart πŸ’‘

πŸ§ͺ Experimental Vibe Coding Project This is an experimental project, 100% vibe coding built with claude code. Expect the unexpected, embrace the chaos, and enjoy the ride! 🎒

SolSmart - The thinking parser for Solana transactions. An intelligent CLI tool that not only parses transactions but understands them. From basic decoding to AI-powered insights, SolSmart reveals what your transactions really mean.

Built with Bun for blazing fast performance! πŸš€

Features

  • πŸ” Parse any base64-encoded Solana transaction
  • πŸ”‘ Fetch and parse transactions by signature (with RPC)
  • πŸ“Š Support for both Legacy and Versioned (v0) transactions
  • 🎯 Automatic instruction parsing for common programs
  • πŸ–₯️ Beautiful interactive CLI interface built with Ink (React for CLIs)
  • πŸ“‹ Multi-line input support for long transactions
  • πŸ”§ Detailed instruction breakdown with account roles
  • 🌐 RPC endpoint management with saved history

Prerequisites

  • Bun >= 1.0.0 (Install with: curl -fsSL https://bun.sh/install | bash)
  • Or Node.js >= 18.0.0 (as fallback)

Installation

# Clone the repository
git clone https://github.com/yourusername/sol-smart.git
cd sol-smart

# Install dependencies with Bun (recommended)
bun install

# Or with npm/pnpm/yarn
npm install

# Build the project
bun run build

# Or build for production (minified)
bun run build:prod

Usage

Development Mode

# Run with hot reload
bun run dev

# Run simple CLI with hot reload
bun run dev:simple

# Run without hot reload
bun run dev:direct

Interactive Mode

# Start interactive mode
bun run start

# Start with RPC pre-configured
bun run start -- --rpc https://api.mainnet-beta.solana.com

Interactive flow:

  1. Choose input type: Base64 or Transaction Signature
  2. If signature selected, choose or enter RPC endpoint
  3. Paste your transaction/signature and press Enter
  4. Navigate the results:
    • Press o to view transaction overview
    • Press i to view instruction details
    • Use arrow keys to select different instructions
    • Press b to parse another transaction
    • Press Ctrl+C to exit

Non-Interactive Mode

# Run directly with Bun
bun run src/cli-simple.ts "AVagrLHsMsqnN3nMGnRyGJ9dJJR8Xh/..."

# Or after building and installing globally
sol-smart "AVagrLHsMsqnN3nMGnRyGJ9dJJR8Xh/..."

# Parse by transaction signature
sol-smart "5vH3r2eKpJZKp8kseHBBxZK7HTmZu7khcqVYwYwNjhJP..." --rpc https://api.mainnet-beta.solana.com

Example

# Parse a transaction by signature
sol-smart "4YS9iAqznn167KEFKqRHBSDgA3mEwAE7tfPCkBx9ZXX37MnXCtdUG7psDacvC4SyiT8CaZ8q8Y6pUokiPagvjPeH" --rpc https://api.mainnet-beta.solana.com

# Output:
# βœ… Transaction Overview
# ═══════════════════════
# Version: 0
# Fee Payer: 6wXkJRuNuKSoseyvb1nEF8QJr6AFewv5jeBp2A2XLT4a
# Signatures: 1
# Instructions: 4
# ...

Supported Programs

The parser includes built-in support for:

  • System Program: Transfer, CreateAccount, Allocate, Assign
  • Memo Program: Text memos
  • Compute Budget Program: SetComputeUnitLimit, SetComputeUnitPrice
  • Unknown Programs: Shows raw data with preview

More program parsers can be easily added in src/parser/instruction-parsers/.

Why Bun?

This project uses Bun for:

  • ⚑ Faster startup: ~3x faster CLI startup compared to Node.js
  • πŸ“¦ Better dependency management: Faster installs with built-in package manager
  • πŸ”₯ Native TypeScript: Run TypeScript directly without transpilation in development
  • πŸ› οΈ Built-in tooling: Bundler, test runner, and more included

Architecture

  • Parser Core: Uses @solana/kit for transaction decoding
  • UI Components: Built with Ink for interactive CLI
  • Instruction Parsers: Modular system for parsing program-specific data
  • Type Safety: Full TypeScript support throughout
  • Build System: Optimized Bun bundler for production builds

Scripts

# Development
bun run dev          # Interactive CLI with hot reload
bun run dev:simple   # Simple CLI with hot reload
bun run dev:direct   # Run without hot reload

# Building
bun run build        # Build for development
bun run build:prod   # Build for production (minified)
bun run clean        # Clean build directory

# Type checking
bun run typecheck    # Run TypeScript type checking

# Production
bun run start        # Run interactive CLI
bun run start:simple # Run simple CLI

Development

To add support for a new program:

  1. Create a new parser in src/parser/instruction-parsers/
  2. Implement the InstructionParser interface
  3. Add the parser to the parsers array in instruction-parsers/index.ts

πŸš€ Future Roadmap

1. Transaction Simulation πŸ”¬

  • Simulate transactions before execution to preview effects
  • Show expected balance changes and state modifications
  • Identify potential errors or failures before submission
  • Support for both historical and new transaction simulation

2. Enhanced Information Display πŸ“Š

  • Account Analysis: Show account ownership, token balances, and history
  • Program Details: Decode and explain program-specific data structures
  • Transaction Effects: Display all state changes, token transfers, and account modifications
  • Cost Analysis: Break down transaction fees, compute units, and priority fees
  • Cross-Program Invocation (CPI): Visualize the full call stack of nested program calls
  • Rich Formatting: Tables, charts, and tree views for complex data

3. LLM Integration πŸ€–

  • Natural Language Explanations: "What does this transaction do?" in plain English
  • Security Analysis: AI-powered detection of suspicious patterns or potential risks
  • Code Generation: Generate similar transactions based on examples
  • Interactive Q&A: Ask questions about transactions and get intelligent answers
  • Learning Mode: Educational explanations for Solana concepts and patterns

4. Model Context Protocol (MCP) πŸ”Œ

  • IDE Integration: Use as a tool within AI coding assistants
  • Standardized API: MCP server for transaction parsing capabilities
  • Context Sharing: Share parsed transaction data with other MCP tools
  • Workflow Automation: Integrate with development workflows and CI/CD pipelines

5. Plugin System for Custom Programs 🧩

  • Extensible Architecture: Plugin-based system for parsing any Solana program
  • Custom Decoders: Support for arbitrary program instruction and account decoding
  • IDL Integration: Automatic parsing using Anchor IDLs
  • Community Plugins: Marketplace for sharing program-specific parsers
  • Dynamic Loading: Load parsers on-demand for any program ID
  • Schema Detection: Automatic detection of program data structures

6. Additional Features ✨

  • Transaction Builder: Interactive UI for constructing transactions
  • Batch Processing: Parse multiple transactions from files or CSV
  • Export Options: JSON, CSV, or custom formats for parsed data
  • Historical Analysis: Track patterns and trends across transactions
  • Real-time Monitoring: Watch and parse transactions as they happen

Contributing

We welcome contributions to help implement these features! Here's how you can help:

  1. Pick a Feature: Choose from the roadmap or propose your own
  2. Discuss: Open an issue to discuss implementation approach
  3. Implement: Follow the contribution guidelines
  4. Submit PR: Create a pull request with your changes

Priority areas for contribution:

  • Additional program instruction parsers
  • Transaction simulation implementation
  • LLM integration proof of concepts
  • MCP server implementation

Please feel free to submit a Pull Request or open an issue to discuss ideas!

License

MIT License - see LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors