pub struct Signer { /* private fields */ }Expand description
Used for signing a transactions
Implementations§
Source§impl Signer
impl Signer
Sourcepub fn from_secret_str(
secret_key: &str,
account_id: AccountId,
nonce: Nonce,
) -> Result<Self, Error>
pub fn from_secret_str( secret_key: &str, account_id: AccountId, nonce: Nonce, ) -> Result<Self, Error>
Sourcepub fn from_secret(
secret_key: Ed25519SecretKey,
account_id: AccountId,
nonce: Nonce,
) -> Self
pub fn from_secret( secret_key: Ed25519SecretKey, account_id: AccountId, nonce: Nonce, ) -> Self
Creates a Signer from Ed25519SecretKey
Sourcepub fn sign(&self, data: &[u8]) -> Ed25519Signature
pub fn sign(&self, data: &[u8]) -> Ed25519Signature
Sourcepub fn public_key(&self) -> &Ed25519PublicKey
pub fn public_key(&self) -> &Ed25519PublicKey
Returns the public key of a Signer
Sourcepub fn secret_key(&self) -> &Ed25519SecretKey
pub fn secret_key(&self) -> &Ed25519SecretKey
Returns the secret key of a Signer
Sourcepub fn update_nonce(&self, nonce: Nonce)
pub fn update_nonce(&self, nonce: Nonce)
Update the key nonce
Sourcepub fn increment_nonce(&self, value: u64)
pub fn increment_nonce(&self, value: u64)
Increment the key nonce. Function is thread safe
Auto Trait Implementations§
impl !Freeze for Signer
impl RefUnwindSafe for Signer
impl Send for Signer
impl Sync for Signer
impl Unpin for Signer
impl UnwindSafe for Signer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more