pub struct CoinbaseAuth { /* private fields */ }Expand description
Coinbase authentication implementation for Advanced Trade API
Implementations§
Source§impl CoinbaseAuth
impl CoinbaseAuth
Sourcepub const fn new_hmac(api_key: SmartString, secret_key: SmartString) -> Self
pub const fn new_hmac(api_key: SmartString, secret_key: SmartString) -> Self
Create new Coinbase auth with HMAC key (legacy)
Sourcepub fn new_ecdsa(api_key: SmartString, private_key: SmartString) -> Result<Self>
pub fn new_ecdsa(api_key: SmartString, private_key: SmartString) -> Result<Self>
Create new Coinbase auth with ECDSA key (Advanced Trade) private_key should be a PEM-encoded ECDSA P-256 private key
Sourcepub fn generate_timestamp_nanos() -> u128
pub fn generate_timestamp_nanos() -> u128
Generate timestamp in nanoseconds for high-precision timing
Sourcepub fn generate_headers(
&self,
method: &str,
path: &str,
body: Option<&str>,
) -> Result<FxHashMap<SmartString, SmartString>>
pub fn generate_headers( &self, method: &str, path: &str, body: Option<&str>, ) -> Result<FxHashMap<SmartString, SmartString>>
Generate REST API authentication headers (optimized for performance) Returns headers directly as HashMap to avoid conversion overhead in hot paths
Sourcepub fn generate_ws_subscription(
&self,
channels: &[&str],
) -> Result<CoinbaseWsSubscription>
pub fn generate_ws_subscription( &self, channels: &[&str], ) -> Result<CoinbaseWsSubscription>
Generate WebSocket subscription message
Sourcepub fn generate_jwt(&self) -> Result<SmartString>
pub fn generate_jwt(&self) -> Result<SmartString>
Get JWT token for ECDSA authentication (Advanced Trade)
Sourcepub fn generate_signature_for_request(
&self,
method: &str,
path: &str,
body: &str,
) -> Result<SmartString>
pub fn generate_signature_for_request( &self, method: &str, path: &str, body: &str, ) -> Result<SmartString>
Generate HMAC signature for legacy authentication
Sourcepub fn build_param_string_optimized(
params: &[(&str, &str)],
) -> Result<SmartString>
pub fn build_param_string_optimized( params: &[(&str, &str)], ) -> Result<SmartString>
Optimized parameter string building using the pure URL encoding function Uses the auth module’s URL encoding for consistency and performance
Sourcepub fn param_count(params: Option<&[(&str, &str)]>) -> usize
pub fn param_count(params: Option<&[(&str, &str)]>) -> usize
Fast parameter count for pre-allocation decisions
Sourcepub fn generate_fix_auth(&self) -> Result<(SmartString, SmartString)>
pub fn generate_fix_auth(&self) -> Result<(SmartString, SmartString)>
Generate FIX protocol authentication (username and password) For Coinbase FIX, username is the API key and password is a signed message
Sourcepub fn sign_hmac(&self, data: &[u8]) -> Result<SmartString>
pub fn sign_hmac(&self, data: &[u8]) -> Result<SmartString>
Generate HMAC signature for FIX logon message Used by FIX client for creating signed authentication messages
Sourcepub fn passphrase(&self) -> SmartString
pub fn passphrase(&self) -> SmartString
Get passphrase for authentication (used by FIX protocol) Returns the passphrase field needed for Coinbase FIX authentication
Trait Implementations§
Source§impl Clone for CoinbaseAuth
impl Clone for CoinbaseAuth
Source§fn clone(&self) -> CoinbaseAuth
fn clone(&self) -> CoinbaseAuth
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more