solana-client crate provides a high-level Rust client for interacting with Harmonic Salsa validators via RPC.
Installation
Add to yourCargo.toml:
Core Client Types
RpcClient
The main client for JSON-RPC requests.get_account(&self, pubkey: &Pubkey)- Fetch account dataget_balance(&self, pubkey: &Pubkey)- Get account balancesend_and_confirm_transaction(&self, transaction: &Transaction)- Send transactionget_latest_blockhash(&self)- Get recent blockhashget_slot(&self)- Get current slot
NonblockingRpcClient
Async version of RpcClient for use withtokio.
TpuClient
Direct TPU (Transaction Processing Unit) client for low-latency transaction submission.Configuration
RpcClientConfig
Configure RPC client behavior:Example Usage
Fetching Account Balance
Sending a Transaction
Querying Program Accounts
Error Handling
The client usesClientError for error handling:
See Also
- RPC API Reference - JSON-RPC methods
- CLI Tools - Command-line client
- Rust Documentation - Full API reference