pub struct CasperAccount { /* private fields */ }Expand description
A Casper-specific derived account.
Wraps the unified DerivedAccount (address = account-hash-…) and
adds the signature algorithm plus the Casper tagged public-key hex
(01… / 02…) used in serialization contexts.
Implements Deref<Target = DerivedAccount> so shared accessors
(address(), public_key_bytes(), private_key_hex(), untagged
DerivedAccount::public_key_hex, …) work without name shadowing.
Implementations§
Source§impl CasperAccount
impl CasperAccount
Sourcepub fn tagged_public_key_hex(&self) -> &str
pub fn tagged_public_key_hex(&self) -> &str
Casper tagged public-key hex (01 ‖ ed25519 or 02 ‖ secp compressed).
No 0x prefix; lowercase. Distinct from untagged
DerivedAccount::public_key_hex (available via Deref).
Sourcepub fn account_hash(&self) -> &str
pub fn account_hash(&self) -> &str
Formatted AccountHash (account-hash- + 64 hex). Alias for
DerivedAccount::address.
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.
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 CasperAccount
impl AsRef<DerivedAccount> for CasperAccount
Source§fn as_ref(&self) -> &DerivedAccount
fn as_ref(&self) -> &DerivedAccount
Source§impl Clone for CasperAccount
impl Clone for CasperAccount
Source§fn clone(&self) -> CasperAccount
fn clone(&self) -> CasperAccount
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more