rustywallet_import/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum ImportError {
8 #[error("Invalid format: {0}")]
10 InvalidFormat(String),
11
12 #[error("Invalid checksum")]
14 InvalidChecksum,
15
16 #[error("Invalid WIF: {0}")]
18 InvalidWif(String),
19
20 #[error("Invalid hex: {0}")]
22 InvalidHex(String),
23
24 #[error("Invalid mnemonic: {0}")]
26 InvalidMnemonic(String),
27
28 #[error("Invalid mini key: {0}")]
30 InvalidMiniKey(String),
31
32 #[error("Invalid BIP38: {0}")]
34 InvalidBip38(String),
35
36 #[error("Wrong password")]
38 WrongPassword,
39
40 #[error("Decryption failed: {0}")]
42 DecryptionFailed(String),
43
44 #[error("Key derivation failed: {0}")]
46 KeyDerivationFailed(String),
47
48 #[error("Unsupported format: {0}")]
50 UnsupportedFormat(String),
51
52 #[error("Private key out of range")]
54 KeyOutOfRange,
55}
56
57pub type Result<T> = std::result::Result<T, ImportError>;