pub struct Account {
pub index: u32,
pub address: String,
pub account_id: AccountId,
pub account_number: u64,
pub sequence_number: u64,
/* private fields */
}Expand description
Represents a derived dYdX account.
An account contains the signing key and metadata needed to sign and broadcast transactions.
The account_number and sequence_number must be set from on-chain data before signing.
See also Wallet.
Fields§
§index: u32Derivation index of the account.
address: StringdYdX address (bech32 encoded).
account_id: AccountIdCosmos SDK account ID.
account_number: u64On-chain account number (must be fetched before signing).
sequence_number: u64Transaction sequence number (must be fetched before signing).
Implementations§
Source§impl Account
impl Account
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Get the public key associated with this account.
Sourcepub fn set_account_info(&mut self, account_number: u64, sequence_number: u64)
pub fn set_account_info(&mut self, account_number: u64, sequence_number: u64)
Update account and sequence numbers from on-chain data.
Sourcepub fn increment_sequence(&mut self)
pub fn increment_sequence(&mut self)
Increment the sequence number (used after successful transaction broadcast).
Sourcepub fn subaccount(&self, number: u32) -> Result<Subaccount, Error>
pub fn subaccount(&self, number: u32) -> Result<Subaccount, Error>
Trait Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].