pub struct DydxCredential {
pub address: String,
pub authenticator_ids: Vec<u64>,
/* private fields */
}Expand description
dYdX wallet credentials for signing blockchain transactions.
Uses secp256k1 for signing as per Cosmos SDK specifications.
Fields§
§address: StringBech32-encoded account address (e.g., dydx1…).
authenticator_ids: Vec<u64>Optional authenticator IDs for permissioned key trading.
Implementations§
Source§impl DydxCredential
impl DydxCredential
Sourcepub fn from_mnemonic(
mnemonic_phrase: &str,
account_index: u32,
authenticator_ids: Vec<u64>,
) -> Result<Self>
pub fn from_mnemonic( mnemonic_phrase: &str, account_index: u32, authenticator_ids: Vec<u64>, ) -> Result<Self>
Creates a new DydxCredential from a mnemonic phrase.
§Errors
Returns an error if the mnemonic is invalid or key derivation fails.
Sourcepub fn from_private_key(
private_key_hex: &str,
authenticator_ids: Vec<u64>,
) -> Result<Self>
pub fn from_private_key( private_key_hex: &str, authenticator_ids: Vec<u64>, ) -> Result<Self>
Creates a new DydxCredential from a raw private key.
§Errors
Returns an error if private key is invalid.
Sourcepub fn account_id(&self) -> Result<AccountId>
pub fn account_id(&self) -> Result<AccountId>
Returns the account ID for this credential.
§Errors
Returns an error if the address cannot be parsed as a valid account ID.
Sourcepub fn sign(&self, sign_doc: &SignDoc) -> Result<Vec<u8>>
pub fn sign(&self, sign_doc: &SignDoc) -> Result<Vec<u8>>
Signs a transaction SignDoc.
This produces the signature bytes that will be included in the transaction.
§Errors
Returns an error if SignDoc serialization or signing fails.
Sourcepub fn sign_bytes(&self, message: &[u8]) -> Result<Vec<u8>>
pub fn sign_bytes(&self, message: &[u8]) -> Result<Vec<u8>>
Signs raw message bytes.
Used for custom signing operations outside of standard transaction flow.
§Errors
Returns an error if signing fails.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the public key for this credential.
Trait Implementations§
Source§impl Debug for DydxCredential
impl Debug for DydxCredential
Auto Trait Implementations§
impl Freeze for DydxCredential
impl !RefUnwindSafe for DydxCredential
impl Send for DydxCredential
impl Sync for DydxCredential
impl Unpin for DydxCredential
impl !UnwindSafe for DydxCredential
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
§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<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].§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].