pub trait Derive {
type Error: Debug + Display + From<Error>;
// Required methods
fn derive(&self, index: u32) -> Result<DerivedAccount, Self::Error>;
fn derive_path(&self, path: &str) -> Result<DerivedAccount, Self::Error>;
}Expand description
Unified derivation trait implemented by all chain derivers.
Provides a consistent API for deriving accounts regardless of the
underlying chain. Each chain crate (kobe-evm, kobe-btc, etc.)
implements this trait on its Deriver type.
Batch derivation is provided by the blanket DeriveExt trait.
§Example
ⓘ
use kobe::{Derive, DeriveExt};
fn derive_first_account(d: &impl Derive) -> kobe::DerivedAccount {
d.derive(0).unwrap()
}Required Associated Types§
Required Methods§
Sourcefn derive(&self, index: u32) -> Result<DerivedAccount, Self::Error>
fn derive(&self, index: u32) -> Result<DerivedAccount, Self::Error>
Derive an account at the given index using the chain’s default path.
Sourcefn derive_path(&self, path: &str) -> Result<DerivedAccount, Self::Error>
fn derive_path(&self, path: &str) -> Result<DerivedAccount, Self::Error>
Derive an account at a custom path string.