Skip to content

OpenSource CLI version of starknet wallet that is compatible with v10 RPC 1. The Degen's Swiss Knife 2. Automation Native 3. Privacy & Security Hardened

Notifications You must be signed in to change notification settings

0xcrypto2024/stark-ark

Repository files navigation

StarkArk v0.2.0

A secure, Rust-based CLI wallet and library for Starknet with a modular architecture and AI-first design.

🚀 What's New in v0.2.0

  • 🏗️ Modular Architecture: Complete codebase refactoring for high maintainability, testability, and performance.
  • 💰 Multi-Token Portfolio: Automatically scans and displays balances for all AVNU-supported tokens, not just STRK.
  • 📱 QR Code Integration: Instant QR code generation for account addresses in balance views.
  • 🔄 Full Interactive Parity: The guided TUI now supports every single command available in the CLI, including staking, swaps, and backups.

Features

  • 🤖 AI-First Design: Native JSON output (--json), secure non-interactive mode, and MCP Server support for autonomous agents.
  • 💱 DEX Integration: Built-in AVNU swap aggregator support for best-price execution and token discovery.
  • 🦁 Degen UX: High-speed TUI with arrow-key menus, ASCII banners, and live spinners for humans.
  • 🛡️ Secure Keystore: Encrypted local storage for private keys using AES-256-GCM and Argon2.
  • Starknet Integration: Native support for Starknet accounts (OpenZeppelin), transfers, and deployments.
  • 📦 Library Support: Optimized as a modular Rust crate.

Installation

From Source

Ensure you have Rust installed.

git clone https://github.com/0xcrypto2024/stark-ark.git
cd stark-ark
cargo install --path .

Configuration

Before using StarkArk, you need to configure the RPC endpoint and other settings.

  1. Initialize Configuration: Run the following command to generate a default configuration file in your system's config directory:

    stark-ark config init
  2. Edit Configuration: The command above will tell you where the file was created. Open it and set your STARKNET_RPC_URL and optionally STARK_ARK_PASSWORD for autonomous mode.

    STARKNET_RPC_URL=https://starknet-sepolia.public.blastapi.io
    
    # Optional: For autonomous AI Agent / MCP usage without prompts
    STARK_ARK_PASSWORD=my_secure_wallet_password
  3. Check Configuration: Verify your settings:

    stark-ark config show

🤖 AI & Automation Guide

StarkArk is built to be the best Starknet wallet for AI Agents.

1. Model Context Protocol (MCP) Server

StarkArk transforms into an MCP server, allowing AI agents (like Claude Desktop) to directly "see" and "use" your wallet safely.

Prerequisites:

  • Set STARK_ARK_PASSWORD in your environment or .env file.

Run Server:

stark-ark mcp

Exposed Tools:

  • list_accounts(): View all available wallet accounts.
  • get_balance(token_symbol, account_address?): Check holdings. Scans for ETH, STRK, and all supported tokens.
  • stake(amount, validator_address, account_address?): Delegate STRK to a validator.
  • unstake(amount, pool_address, account_address?): Signal intent to unstake.
  • withdraw_unstaked(pool_address, account_address?): Withdraw unbonded funds.
  • swap(sell, buy, amount, account_address?): Execute swaps via AVNU.
  • transfer(to, amount, account_address?): Send funds.

Example Prompts for Claude

Once connected, you can simply ask Claude in natural language:

  • Check Balance: "What are my balances?" (Scans for all supported tokens) or "Check USDC on my main account."
  • Manage Accounts: "List all my wallet accounts."
  • Staking:
    • "Stake 100 STRK to 0x123..."
    • "Unstake 50 STRK from 0x123..."
    • "Withdraw my unstaked funds."
  • Swap: "Swap 10 STRK for ETH using my second account."
  • Transfer: "Send 5 STRK to 0x123..."

Claude will verify the tool call with you before executing any transaction.

Configuration for Claude Desktop

To use StarkArk with Claude Desktop, edit your claude_desktop_config.json file:

Add the following entry:

{
  "mcpServers": {
    "stark-ark": {
      "command": "/absolute/path/to/stark-ark",
      "args": ["mcp"],
      "env": {
        "STARKNET_RPC_URL": "https://starknet-sepolia.public.blastapi.io",
        "STARK_ARK_PASSWORD": "your_wallet_password",
        "KEYSTORE_FILE": "/absolute/path/to/keystore.json",
        "STRK_CONTRACT_ADDRESS": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
        "OZ_CLASS_HASH": "0x061dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",
        "STAKING_CONTRACT_ADDRESS": "0x03745ab04a431fc02871a139be6b93d9260b0ff3e779ad9c8b377183b23109f1"
      }
    }
  }
}

2. Enable Machine Output (CLI Mode)

Use the --json flag to get strict, structured JSON output for parsing.

stark-ark --json balance --index 0
# Output: {"index":0,"address":"0x...","balance":100.0,"unit":"STRK"}

Usage

StarkArk can be used in Interactive Mode (by running without arguments) or CLI Mode.

Interactive Mode (Degen UX)

Run stark-ark without arguments to enter the TUI mode.

  • Full Command Parity: Access transfers, staking, and backups via intuitive menus.
  • Account Selection: Manage multiple accounts with arrow keys.
  • Real-time Portfolio: Scans balances for all supported tokens during balance checks.
  • QR Codes: View and share addresses instantly.
stark-ark

CLI Commands

1. Account Management

  • stark-ark new: Generate a new account.
  • stark-ark list: View all accounts.
  • stark-ark import: Import a private key or config.
  • stark-ark export --index 0: Export account data.

2. Network Operations

  • stark-ark balance --index 0: Comprehensive balance check.
  • stark-ark deploy --index 0: Activate account on-chain.
  • stark-ark transfer --from-index 0 --to 0x... --amount 1.5: Send STRK.

3. DEX & Staking (v0.2.0 Enhanced)

  • stark-ark swap --sell STRK --buy ETH --amount 10: AVNU swap.
  • stark-ark tokens: List supported tokens.
  • stark-ark stake --amount 10 --validator 0x...: Stake STRK.
  • stark-ark overview: Detailed table of all accounts, balances, and staking status.

4. Cloud Backup

  • stark-ark backup: Securely upload to Google Drive.
  • stark-ark restore: Download and sync keystore.

Architecture

StarkArk v0.2.0 introduced a modular architecture to scale with Starknet:

  • /src/commands/: Individual command implementations (logic separation).
  • /src/domain/: Core business logic and validation rules.
  • /src/ui/: CLI parsing and TUI (Terminal UI) components.
  • /src/error.rs: Centralized, type-safe error handling.

License

MIT

About

OpenSource CLI version of starknet wallet that is compatible with v10 RPC 1. The Degen's Swiss Knife 2. Automation Native 3. Privacy & Security Hardened

Resources

Stars

Watchers

Forks

Packages

No packages published