neo3

Crates.ioneo3
lib.rsneo3
version0.5.0
created_at2025-02-28 20:49:56.371597+00
updated_at2025-08-20 04:36:08.503256+00
descriptionProduction-ready Rust SDK for Neo N3 blockchain with high-level API, unified error handling, and enterprise features
homepagehttps://github.com/R3E-Network/NeoRust
repositoryhttps://github.com/R3E-Network/NeoRust
max_upload_size
id1573166
size2,371,359
Jimmy (Jim8y)

documentation

https://docs.rs/neo3

README

NeoRust

Rust CI Build & Test Neo GUI Security License: MIT Crates.io Documentation MSRV

A comprehensive Rust SDK for the Neo N3 blockchain platform, providing a complete toolkit for interacting with Neo N3 networks.

๐Ÿ“Š Project Status

  • Version: 0.5.0 (Production Ready - Enhanced Developer Experience)
  • Rust Version: 1.70.0+
  • Platform Support: Windows, macOS, Linux
  • Security: All dependencies audited, 0 known vulnerabilities
  • Coverage: Comprehensive testing with property-based tests
  • Production Readiness: Enterprise-grade with rate limiting and gas estimation

Features

Core Features

  • ๐Ÿ” Cryptography - Complete cryptographic functions including key generation, signing, and verification
  • ๐Ÿ’ผ Wallet Management - Create, import, and manage Neo wallets with hardware wallet support
  • ๐Ÿ”— RPC Client - Full-featured RPC client for Neo N3 node interaction
  • ๐Ÿ“ฆ Smart Contracts - Deploy, invoke, and interact with Neo N3 smart contracts
  • ๐Ÿช™ Token Support - Native NEP-17 token operations and custom token support
  • ๐ŸŒ Network Support - Mainnet, Testnet, and custom network configurations

New in v0.5.0

  • ๐ŸŽฏ High-Level SDK API - Simplified interface for common blockchain operations
  • ๐Ÿ”ง Unified Error Handling - Consistent errors with recovery suggestions
  • ๐Ÿš€ Improved Developer Experience - 50% less code for common operations
  • โšก Real-time Gas Estimation - Accurate gas calculation via blockchain RPC
  • ๐Ÿšฆ Rate Limiting - Token bucket algorithm with configurable presets
  • ๐Ÿญ Production Client - Enterprise features with connection pooling and circuit breakers
  • ๐Ÿงช Property-Based Testing - Comprehensive testing with proptest framework
  • ๐Ÿ“Š Enhanced Monitoring - Metrics collection and health check support

Applications

  • ๐Ÿ–ฅ๏ธ CLI Tools - Command-line interface for common blockchain operations
  • ๐Ÿ–ผ๏ธ GUI Application - Desktop GUI application built with Tauri and React

Quick Start

Add NeoRust to your Cargo.toml:

[dependencies]
neo3 = "0.4.4"

Basic Usage

New Simplified API (v0.5.0+)

use neo3::sdk::Neo;

// Quick connection to TestNet
let neo = Neo::testnet().await?;

// Get balance with automatic error handling
let balance = neo.get_balance("NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc").await?;
println!("Balance: {} NEO, {} GAS", balance.neo, balance.gas);

// Custom configuration
let neo = Neo::builder()
    .network(Network::MainNet)
    .timeout(Duration::from_secs(30))
    .build()
    .await?;

Traditional API (still supported)

use neo3::prelude::*;

// Create a new wallet
let wallet = Wallet::new().unwrap();

// Connect to Neo testnet
let client = RpcClient::new("https://testnet1.neo.coz.io:443").unwrap();

// Get account balance
let balance = client.get_balance(&wallet.address()).await?;
println!("Balance: {} NEO", balance.neo);

Components

Core SDK (neo3)

The main Rust SDK providing all blockchain functionality.

CLI Tool (neo-cli)

Command-line interface for blockchain operations:

cargo run --bin neo-cli -- wallet create

GUI Application (neo-gui)

Desktop application with modern React UI. Note: Requires GTK libraries on Linux.

Building

Core SDK and CLI

cargo build --workspace --exclude neo-gui

GUI Application (requires additional dependencies)

Linux (Ubuntu/Debian):

sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
cd neo-gui && npm install && cargo build

macOS and Windows:

cd neo-gui && npm install && cargo build

Documentation

Examples

Explore our comprehensive examples:

  • Basic Operations: Wallet creation, token transfers, balance queries
  • Smart Contracts: Deploy and interact with Neo N3 contracts
  • Advanced Features: Multi-sig wallets, hardware wallet integration
  • DeFi Integration: Interact with popular Neo DeFi protocols
  • Neo X: Cross-chain bridge operations

See the examples directory for full code samples.

License

Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)

Testing

# Run all tests
cargo test --workspace

# Run specific component tests
cargo test -p neo3
cargo test -p neo-cli

# Run integration tests
cargo test --test integration_tests

CI/CD

The project uses GitHub Actions for continuous integration:

Running CI Locally

Before pushing changes, run the local CI scripts:

# Run all CI checks
./check-ci.sh

# Or run individual checks
./scripts/ci/01-format-check.sh
./scripts/ci/02-clippy-check.sh
./scripts/ci/03-rust-tests.sh
./scripts/ci/04-benchmarks.sh
./scripts/ci/05-documentation.sh
./scripts/ci/06-security-audit.sh
./scripts/ci/07-release-check.sh
./scripts/ci/08-neo-gui-tests.sh

GitHub Workflows

  • neorust-build-test.yml - Main Rust build and test workflow
  • neo-gui.yml - Separate workflow for GUI (Tauri) builds
  • docs.yml - Documentation generation and deployment
  • security.yml - Security audits and vulnerability scanning
  • ci.yml - Comprehensive CI checks
  • rust.yml - Rust-specific checks

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure:

  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt)
  • No clippy warnings (cargo clippy -- -D warnings)
  • Documentation is updated
  • CI checks pass locally before pushing

Security

For security issues, please email security@r3e.network instead of using the issue tracker.

Acknowledgments

  • Neo Foundation for the Neo N3 blockchain
  • Rust community for excellent tooling
  • All contributors who have helped shape this project
Commit count: 565

cargo fmt