lightspeed_sdk/
error.rs

1// src/error.rs
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum LightspeedError {
6    #[error("Invalid API key format")]
7    InvalidApiKey,
8    
9    #[error("Invalid tip address: {0}")]
10    InvalidTipAddress(String),
11    
12    #[error("Tip amount {0} is below minimum {1}")]
13    TipBelowMinimum(u64, u64),
14    
15    #[error("Keep-alive is already running")]
16    KeepAliveAlreadyRunning,
17    
18    #[error("Network error: {0}")]
19    NetworkError(#[from] reqwest::Error),
20    
21    #[error("Transaction failed: {0}")]
22    TransactionFailed(String),
23    
24    #[error("Solana client error: {0}")]
25    SolanaError(#[from] solana_client::client_error::ClientError),
26    
27    #[error("Invalid URL: {0}")]
28    InvalidUrl(String),
29    
30    #[error("Serialization error: {0}")]
31    SerializationError(#[from] serde_json::Error),
32    
33    #[error("Bincode error: {0}")]
34    BincodeError(#[from] bincode::Error),
35}