Solana Kite 🪁
[!NOTE] This is a new Rust port of Solana Kite! It works well but it may have some bugs - please report them!
A Rust library that works great with LiteSVM for testing your Solana programs. Solana Kite offers high-level abstractions for common Solana operations like program deployment, transaction sending, token operations, and account management.
Features
- 🚀 Program Deployment: Deploy programs to test environments
- 💸 Transaction Utilities: Send transactions from instructions with proper signing
- 🪙 Token Operations: Create mints, associated token accounts, and mint tokens
- 👛 Account Management: Create wallets, check balances, and manage account state
- 🔑 PDA Utilities: Generate Program Derived Addresses with type-safe seed handling
- 🛡️ Error Handling: Comprehensive error types for robust error handling
- 📚 Well Documented: Extensive documentation and examples
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Quick Start
use ;
use LiteSVM;
API Overview
Wallet Operations
use ;
// Create a single wallet with 1 SOL
let wallet = create_wallet?;
// Create multiple wallets
let wallets = create_wallets?; // 5 wallets, 1 SOL each
Token Operations
use ;
// Create token mint with 9 decimals
let mint = create_token_mint?;
// Create associated token account
let token_account = create_associated_token_account?;
// Mint tokens
mint_tokens_to_account?;
// Check balance
let balance = get_token_account_balance?;
// Assert balance (useful for testing)
assert_token_balance;
Program Derived Addresses (PDAs)
use ;
use Pubkey;
let program_id = new_unique;
let user_address = new_unique;
// Using the convenient seeds! macro
let seed_vec = seeds!;
let = get_pda_and_bump;
// Or create seeds manually
let manual_seeds = vec!;
let = get_pda_and_bump;
Transaction Sending
use send_transaction_from_instructions;
let instructions = vec!;
send_transaction_from_instructions?;
Program Deployment
use deploy_program;
deploy_program?;
Error Handling
Solana Kite provides comprehensive error handling through the SolanaKiteError enum:
use SolanaKiteError;
match some_operation
Examples
The repository includes comprehensive examples:
- Basic Usage:
cargo run --example basic_usage - Token Operations:
cargo run --example token_operations
Testing
Run the test suite:
# Run all tests
# Run with output
# Run integration tests specifically
Features
The crate supports the following Cargo features:
default: Standard functionalitytesting: Additional testing utilities (currently empty, reserved for future use)
Documentation
Full API documentation is available on docs.rs.
Generate local documentation:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
- Clone the repository
- Install Rust (if not already installed)
- Run tests:
cargo test - Run examples:
cargo run --example basic_usage
License
This project is licensed under the MIT License. See LICENSE.md for details.
Changelog
See CHANGELOG.md for details about changes in each version.
Made with ❤️ for the Solana ecosystem