#[cfg(feature = "alloc")]
use alloc::string::String;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum DeriveError {
#[error("mnemonic: {0}")]
Mnemonic(#[cfg_attr(feature = "std", from)] bip39::Error),
#[cfg(feature = "alloc")]
#[error("derivation path: {0}")]
Path(String),
#[cfg(feature = "alloc")]
#[error("cryptographic operation failed: {0}")]
Crypto(String),
#[cfg(feature = "alloc")]
#[error("invalid input: {0}")]
Input(String),
#[cfg(feature = "alloc")]
#[error("address encoding: {0}")]
AddressEncoding(String),
}
#[cfg(not(feature = "std"))]
impl From<bip39::Error> for DeriveError {
fn from(e: bip39::Error) -> Self {
Self::Mnemonic(e)
}
}