pub struct StandardWallet { /* private fields */ }Expand description
A standard Solana wallet with a single keypair (no HD derivation).
Implementations§
Source§impl StandardWallet
impl StandardWallet
Sourcepub fn from_private_key(private_key: &[u8; 32]) -> Self
pub fn from_private_key(private_key: &[u8; 32]) -> Self
Create a wallet from a raw 32-byte private key.
Sourcepub fn from_private_key_hex(hex_key: &str) -> Result<Self, Error>
pub fn from_private_key_hex(hex_key: &str) -> Result<Self, Error>
Create a wallet from a hex-encoded private key.
§Errors
Returns an error if the hex is invalid or key length is wrong.
Sourcepub fn address_string(&self) -> String
pub fn address_string(&self) -> String
Get the Solana address (Base58 encoded public key).
Sourcepub fn private_key_hex(&self) -> Zeroizing<String>
pub fn private_key_hex(&self) -> Zeroizing<String>
Get the private key as hex string.
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Get the public key as hex string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StandardWallet
impl RefUnwindSafe for StandardWallet
impl Send for StandardWallet
impl Sync for StandardWallet
impl Unpin for StandardWallet
impl UnwindSafe for StandardWallet
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