pub struct ChainAccount {
pub address: String,
pub account_id: [u8; 32],
/* private fields */
}Expand description
A chain account (public id + expanded secret), ready to sign & submit.
Fields§
§address: StringSS58 address.
account_id: [u8; 32]Raw 32-byte account id.
Implementations§
Source§impl ChainAccount
impl ChainAccount
Sourcepub fn from_parts(account_id: [u8; 32], secret: Vec<u8>) -> Self
pub fn from_parts(account_id: [u8; 32], secret: Vec<u8>) -> Self
Build a chain account from a 32-byte account id + 64-byte expanded secret.
Sourcepub fn from_address(
address: &str,
secret: Vec<u8>,
) -> Result<Self, ContentError>
pub fn from_address( address: &str, secret: Vec<u8>, ) -> Result<Self, ContentError>
Build a chain account from an SS58 address + 64-byte expanded secret (validates that the address matches the secret’s public key).
§Errors
Fails with ContentError::Account when secret is not a valid
64-byte expanded ed25519 secret, or when the address does not match
the secret’s derived public key; with
ContentError::InvalidArgument when address is not valid SS58
(see account_id_from_address).
Auto Trait Implementations§
impl Freeze for ChainAccount
impl RefUnwindSafe for ChainAccount
impl Send for ChainAccount
impl Sync for ChainAccount
impl Unpin for ChainAccount
impl UnsafeUnpin for ChainAccount
impl UnwindSafe for ChainAccount
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreimpl<T> JsonSchemaMaybe for T
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.