koios-sdk
A comprehensive Rust SDK for interacting with the Koios Cardano API. This SDK provides a strongly-typed, async interface for accessing Cardano blockchain data through Koios endpoints.
Features
- 🔄 Full coverage of Koios API endpoints
- 🌐 Support for multiple networks (Mainnet, Preprod, Preview, Guild)
- 🔒 Authentication support (JWT Bearer tokens)
- ⚡ Built-in rate limiting
- 🔄 Async/await support
- 💪 Strong typing with comprehensive error handling
- 📦 Zero-copy deserialization
- 🛠️ Builder pattern for client configuration
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Quick Start
use Client;
async
Network Selection
use ;
async
Authentication
use ClientBuilder;
async
Advanced Configuration
use ClientBuilder;
use Quota;
use NonZeroU32;
use Duration;
async
Features
The SDK supports several optional features:
rustls-tls(default) - Uses rustls for TLSnative-tls- Uses native TLS implementationfull- Enables all optional features including base64 and hex encoding
Enable features in your Cargo.toml:
[]
= { = "0.1.0", = ["full"] }
Examples
Query Account Information
use Client;
async
Get Pool Information
use Client;
async
API Coverage
The SDK provides comprehensive coverage of all Koios API endpoints, including:
Error Handling
The SDK provides detailed error types for handling various failure cases:
use ;
async
Development
Building
To build the project:
# Debug build
# Release build
# Build with all features
Testing
Run the test suite:
# Run all tests
# Run tests with all features
# Run specific test
# Run tests with output
Documentation
Generate and view the documentation:
# Generate documentation
# Generate and open documentation in browser
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.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.