pub struct SvmAccount { /* private fields */ }Expand description
A Solana-specific derived account — DerivedAccount plus Phantom-style keypair.
Wraps the unified DerivedAccount (path, 32-byte private key, 32-byte
public key, Base58 address) and adds the Solana-native 64-byte keypair
(secret || public) Base58-encoded for Phantom / Backpack / Solflare
import.
Implements Deref<Target = DerivedAccount>, so all shared accessors
(address(), public_key_bytes(), etc.) are available directly.
Implementations§
Source§impl SvmAccount
impl SvmAccount
Sourcepub const fn keypair_base58(&self) -> &Zeroizing<String>
pub const fn keypair_base58(&self) -> &Zeroizing<String>
Full keypair in Base58 format (64 bytes: secret 32 B + public 32 B), zeroized on drop.
Standard import format used by Phantom, Backpack, and Solflare.
Sourcepub const fn as_derived_account(&self) -> &DerivedAccount
pub const fn as_derived_account(&self) -> &DerivedAccount
The underlying unified DerivedAccount.
Sourcepub fn into_derived_account(self) -> DerivedAccount
pub fn into_derived_account(self) -> DerivedAccount
Consume and yield the underlying DerivedAccount, dropping the
Solana-specific keypair field.
Methods from Deref<Target = DerivedAccount>§
Sourcepub fn private_key_bytes(&self) -> &Zeroizing<[u8; 32]>
pub fn private_key_bytes(&self) -> &Zeroizing<[u8; 32]>
Raw 32-byte private key (zeroized on drop).
Sourcepub fn private_key_hex(&self) -> Zeroizing<String>
pub fn private_key_hex(&self) -> Zeroizing<String>
Lowercase hex-encoded private key (64 chars, zeroized on drop).
Sourcepub fn public_key(&self) -> &DerivedPublicKey
pub fn public_key(&self) -> &DerivedPublicKey
Typed public key, carrying algorithm + length information at the type level.
Sourcepub fn public_key_bytes(&self) -> &[u8] ⓘ
pub fn public_key_bytes(&self) -> &[u8] ⓘ
Public key bytes, chain-specific layout.
For pattern-matching on the algorithm, use
public_key instead.
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Lowercase hex-encoded public key.
Trait Implementations§
Source§impl AsRef<DerivedAccount> for SvmAccount
impl AsRef<DerivedAccount> for SvmAccount
Source§fn as_ref(&self) -> &DerivedAccount
fn as_ref(&self) -> &DerivedAccount
Source§impl Clone for SvmAccount
impl Clone for SvmAccount
Source§fn clone(&self) -> SvmAccount
fn clone(&self) -> SvmAccount
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more