SDKs
Official SDKs for integrating NeoEngine into your applications. All SDKs provide type-safe interfaces for job submission, provider management, and wallet operations.
All SDKs are open source and available on GitHub .
Installation
Rust
cargo add neoengine-sdkQuick Start
Rust
use neoengine_sdk::{Client, JobConfig, Resources};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize client with API key
let client = Client::new("your-api-key")?;
// Submit a job
let job = client
.jobs()
.create(JobConfig {
image: "python:3.11-slim".into(),
command: vec!["python", "-c", "print('Hello from NeoEngine!')"],
resources: Resources {
cpu: 2,
memory: "4Gi".into(),
gpu: None,
},
max_price: "1.0".into(),
timeout: "1h".into(),
})
.await?;
println!("Job submitted: {}", job.id);
// Wait for completion
let result = client.jobs().wait(&job.id).await?;
println!("Output: {}", result.output);
Ok(())
}Features
All SDKs provide consistent access to:
Job Management
- Submit compute jobs with custom Docker images
- Stream logs in real-time
- Cancel running jobs
- Query job status and results
Provider Discovery
- List available providers with filters
- Query provider capabilities and pricing
- Check provider reputation scores
Wallet Operations
- Check NGNX token balance
- View earnings history
- Initiate withdrawals
Market Data
- Real-time pricing information
- Network statistics
- Resource availability
Authentication
All SDKs support multiple authentication methods:
// API Key (recommended for server-side)
const neo = new NeoEngine({ apiKey: 'your-api-key' });
// Wallet signature (for client-side)
const neo = new NeoEngine({
wallet: yourWalletAdapter
});Get your API key from the dashboard .
Error Handling
Rust
use neoengine_sdk::{Client, Error};
match client.jobs().create(config).await {
Ok(job) => println!("Success: {}", job.id),
Err(Error::RateLimit { retry_after }) => {
println!("Rate limited, retry after {}s", retry_after);
}
Err(Error::InsufficientFunds) => {
println!("Not enough NGNX balance");
}
Err(e) => eprintln!("Error: {}", e),
}WebSocket Streaming
For real-time updates, all SDKs support WebSocket connections:
// Stream job logs
const stream = neo.jobs.streamLogs(job.id);
stream.on('log', (line) => {
console.log(line);
});
stream.on('status', (status) => {
console.log('Status changed:', status);
});
stream.on('complete', (result) => {
console.log('Job complete:', result);
});Resources
- API Reference — Full REST API documentation
- GitHub — Source code and issues
- Discord — Community support
- Examples — Sample projects
Version Compatibility
| SDK | NeoEngine API | Status |
|---|---|---|
| Rust 0.1.x | v1 | Stable |
| TypeScript 0.1.x | v1 | Stable |
| Python 0.1.x | v1 | Stable |
| Go 0.1.x | v1 | Stable |