#[cfg(feature = "alloc")]
use alloc::string::String;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("invalid mnemonic: {0}")]
Mnemonic(#[from] bip39::Error),
#[error("BIP32 derivation error: {0}")]
Bip32(#[from] bitcoin::bip32::Error),
#[error("invalid word count {0}, must be 12, 15, 18, 21, or 24")]
InvalidWordCount(usize),
#[cfg(feature = "alloc")]
#[error("invalid derivation path: {0}")]
InvalidDerivationPath(String),
#[error("invalid WIF format")]
InvalidWif,
#[error("invalid hex string")]
InvalidHex,
#[error("invalid private key")]
InvalidPrivateKey,
#[error("secp256k1 error: {0}")]
Secp256k1(#[from] bitcoin::secp256k1::Error),
}