pub struct Deriver<'a> { /* private fields */ }Expand description
Solana address deriver from a unified wallet seed.
This deriver takes a seed from kobe_primitives::Wallet and derives
Solana addresses following BIP44/SLIP-0010 standards.
Implementations§
Source§impl<'a> Deriver<'a>
impl<'a> Deriver<'a>
Sourcepub fn derive(&self, index: u32) -> Result<SvmAccount, DeriveError>
pub fn derive(&self, index: u32) -> Result<SvmAccount, DeriveError>
Derive a Solana account using the Standard derivation style.
Uses path m/44'/501'/{index}'/0' (Phantom, Backpack, Solflare).
§Errors
Returns an error if derivation fails.
Sourcepub fn derive_with(
&self,
style: DerivationStyle,
index: u32,
) -> Result<SvmAccount, DeriveError>
pub fn derive_with( &self, style: DerivationStyle, index: u32, ) -> Result<SvmAccount, DeriveError>
Derive a Solana account with a specific DerivationStyle.
Supported path layouts:
- Standard (Phantom/Backpack):
m/44'/501'/{index}'/0' - Trust:
m/44'/501'/{index}' - Ledger Live:
m/44'/501'/{index}'/0'/0' - Legacy:
m/501'/{index}'/0'/0'
§Errors
Returns an error if derivation fails.
Sourcepub fn derive_many_with(
&self,
style: DerivationStyle,
start: u32,
count: u32,
) -> Result<Vec<SvmAccount>, DeriveError>
pub fn derive_many_with( &self, style: DerivationStyle, start: u32, count: u32, ) -> Result<Vec<SvmAccount>, DeriveError>
Derive multiple accounts with a specific DerivationStyle.
§Errors
Returns an error if any derivation fails.
Sourcepub fn derive_at(&self, path: &str) -> Result<SvmAccount, DeriveError>
pub fn derive_at(&self, path: &str) -> Result<SvmAccount, DeriveError>
Derive an account at a custom SLIP-0010 path.
Note: Ed25519 (Solana) only supports hardened derivation; all path components are treated as hardened.
§Errors
Returns an error if derivation fails.
Trait Implementations§
Source§impl Derive for Deriver<'_>
impl Derive for Deriver<'_>
Source§type Account = SvmAccount
type Account = SvmAccount
The (possibly newtype) account returned by this deriver. Read more
Source§type Error = DeriveError
type Error = DeriveError
The error type returned by derivation operations.
Source§fn derive(&self, index: u32) -> Result<SvmAccount, DeriveError>
fn derive(&self, index: u32) -> Result<SvmAccount, DeriveError>
Derive an account at the given index using the chain’s default path. Read more
Source§fn derive_path(&self, path: &str) -> Result<SvmAccount, DeriveError>
fn derive_path(&self, path: &str) -> Result<SvmAccount, DeriveError>
Derive an account at a custom path string. Read more
Auto Trait Implementations§
impl<'a> Freeze for Deriver<'a>
impl<'a> RefUnwindSafe for Deriver<'a>
impl<'a> Send for Deriver<'a>
impl<'a> Sync for Deriver<'a>
impl<'a> Unpin for Deriver<'a>
impl<'a> UnsafeUnpin for Deriver<'a>
impl<'a> UnwindSafe for Deriver<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more