pub struct Wallet { /* private fields */ }Expand description
Wallet for dYdX v4 transaction signing.
A wallet holds a secp256k1 private key used to sign Cosmos SDK transactions. The private key bytes are stored to allow recreating SigningKey (which doesn’t implement Clone). Address and account_id are pre-computed during construction to avoid repeated derivation.
§Security
Private key bytes should be treated as sensitive material.
Implementations§
Source§impl Wallet
impl Wallet
Sourcepub fn from_private_key(private_key_hex: &str) -> Result<Self>
pub fn from_private_key(private_key_hex: &str) -> Result<Self>
Create a wallet from a hex-encoded private key.
The private key should be a 32-byte secp256k1 key encoded as hex,
optionally with a 0x prefix. Address and account ID are derived
during construction.
§Errors
Returns an error if the private key is invalid hex or not a valid secp256k1 key.
Sourcepub fn account_offline(&self) -> Result<Account, Error>
pub fn account_offline(&self) -> Result<Account, Error>
Get a dYdX account with zero account and sequence numbers.
Creates an account using the pre-computed address/account_id. SigningKey is recreated from stored bytes (it doesn’t implement Clone). Account and sequence numbers must be set before signing.
§Errors
Returns an error if the signing key creation fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Wallet
impl RefUnwindSafe for Wallet
impl Send for Wallet
impl Sync for Wallet
impl Unpin for Wallet
impl UnsafeUnpin for Wallet
impl UnwindSafe for Wallet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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>
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>,
Layered].