pub struct Account {
pub secret: SecretKey,
pub public: PublicKey,
pub address: ElrondAddress,
}
Expand description
An account is derived from a ed25519 keypair. New transactions are signed with the secret key and signatures can be verified with the public key. An address derived from the public key (in Bech32
Fields§
§secret: SecretKey
§public: PublicKey
§address: ElrondAddress
Implementations§
Source§impl Account
impl Account
Sourcepub fn from_secret(secret: SecretKey) -> Result<Self>
pub fn from_secret(secret: SecretKey) -> Result<Self>
Import an Elrond account from an existing secret (private key)
Sourcepub fn sign(&self, data: &str) -> Result<String>
pub fn sign(&self, data: &str) -> Result<String>
Sign data with account and return signature as a hex string
Sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Returns a hex string representation of the secret/private key associated with an account.
You can restore an account from this data using Account::from_string
.
Sourcepub fn from_string(hex_str: &str) -> Result<Self>
pub fn from_string(hex_str: &str) -> Result<Self>
Load an account from a hex string representation of a secret/private key
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
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