use thiserror::Error;
#[derive(Error, Debug)]
pub enum CryptoError {
#[error("Invalid key length")]
InvalidKeyLength,
#[error("Encryption failed: {0}")]
EncryptionFailed(String),
#[error("Decryption failed: {0}")]
DecryptionFailed(String),
#[error("Signature format error: {0}")]
SignatureFormatError(String),
#[error("Keypair already exists: {0}")]
KeypairAlreadyExists(String),
#[error("Keypair not found: {0}")]
KeypairNotFound(String),
#[error("No active key space")]
NoActiveSpace,
#[error("No keypair selected")]
NoKeypairSelected,
#[error("Serialization error: {0}")]
SerializationError(String),
#[error("Invalid address format: {0}")]
InvalidAddress(String),
#[error("Smart contract error: {0}")]
ContractError(String),
}