use thiserror::Error;
#[derive(Debug, Error)]
pub enum WalletError {
#[error("Wallet not found: {0}")]
WalletNotFound(String),
#[error("Invalid wallet ID: {0}")]
InvalidWalletId(String),
#[error("Wallet already exists: {0}")]
WalletAlreadyExists(String),
#[error("Insufficient balance: have {have}, need {need}")]
InsufficientBalance { have: u128, need: u128 },
#[error("Asset not supported: {0}")]
AssetNotSupported(String),
#[error("Invalid key share: {0}")]
InvalidKeyShare(String),
#[error("Threshold not met: got {got}, need {need}")]
ThresholdNotMet { got: usize, need: usize },
#[error("Signature generation failed: {0}")]
SignatureFailed(String),
#[error("Keystore error: {0}")]
KeystoreError(String),
#[error("Encryption error: {0}")]
EncryptionError(String),
#[error("Decryption error: {0}")]
DecryptionError(String),
#[error("Invalid password")]
InvalidPassword,
#[error("Provisioning failed: {0}")]
ProvisioningFailed(String),
#[error("Transaction validation failed: {0}")]
TransactionValidationFailed(String),
#[error("Signature verification failed: {0}")]
SignatureVerificationFailed(String),
#[error("Contact not found: {0}")]
ContactNotFound(String),
#[error("State sync error: {0}")]
StateSyncError(String),
#[error("Serialization error: {0}")]
SerializationError(String),
#[error("Crypto error: {0}")]
CryptoError(#[from] tenzro_crypto::CryptoError),
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("{0}")]
Other(String),
}
pub type Result<T> = std::result::Result<T, WalletError>;