pub struct BybitAuth { /* private fields */ }Expand description
Bybit authentication handler
Implementations§
Source§impl BybitAuth
impl BybitAuth
Sourcepub const fn new(config: BybitAuthConfig) -> Self
pub const fn new(config: BybitAuthConfig) -> Self
Create a new authentication handler
Sourcepub fn generate_timestamp() -> u64
pub fn generate_timestamp() -> u64
Generate timestamp in milliseconds
Sourcepub fn generate_signature(
&self,
timestamp: u64,
api_key: &str,
recv_window: u64,
query_params: Option<&str>,
body_json: Option<&str>,
) -> Result<String>
pub fn generate_signature( &self, timestamp: u64, api_key: &str, recv_window: u64, query_params: Option<&str>, body_json: Option<&str>, ) -> Result<String>
Sourcepub fn generate_auth_headers(
&self,
query_params: Option<&str>,
body_json: Option<&str>,
) -> Result<(String, u64, String, u64)>
pub fn generate_auth_headers( &self, query_params: Option<&str>, body_json: Option<&str>, ) -> Result<(String, u64, String, u64)>
Sourcepub fn generate_websocket_signature(&self, expires: u64) -> Result<String>
pub fn generate_websocket_signature(&self, expires: u64) -> Result<String>
Sourcepub fn generate_websocket_auth(&self) -> Result<(String, u64, String)>
pub fn generate_websocket_auth(&self) -> Result<(String, u64, String)>
Generate WebSocket authentication message
§Returns
WebSocket auth arguments [api_key, expires, signature]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BybitAuth
impl RefUnwindSafe for BybitAuth
impl Send for BybitAuth
impl Sync for BybitAuth
impl Unpin for BybitAuth
impl UnwindSafe for BybitAuth
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