1use thiserror::Error;
2
3pub type AekoRustSdkResult<T> = Result<T, AekoRustSdkError>;
4
5#[derive(Debug, Error)]
6pub enum AekoRustSdkError {
7 #[error(transparent)]
8 Http(#[from] reqwest::Error),
9
10 #[error(transparent)]
11 Json(#[from] serde_json::Error),
12
13 #[error("{label} account owner mismatch: expected {expected}, found {found}")]
14 InvalidAccountOwner {
15 label: &'static str,
16 expected: String,
17 found: String,
18 },
19
20 #[error("failed to decode {label} account data")]
21 DecodeAccount { label: &'static str },
22
23 #[error("AEKO RPC request failed: {0}")]
24 Rpc(String),
25}