pub struct KrakenCredential { /* private fields */ }Implementations§
Source§impl KrakenCredential
impl KrakenCredential
pub fn new(api_key: impl Into<String>, api_secret: impl Into<String>) -> Self
pub fn api_key(&self) -> &str
Sourcepub fn sign_request(
&self,
path: &str,
nonce: u64,
params: &HashMap<String, String>,
) -> Result<(String, String)>
pub fn sign_request( &self, path: &str, nonce: u64, params: &HashMap<String, String>, ) -> Result<(String, String)>
Sign a request for Kraken REST API.
Kraken uses HMAC-SHA512 with the following message:
- path + SHA256(nonce + POST data)
- The secret is base64 decoded before signing
Sourcepub fn api_key_masked(&self) -> String
pub fn api_key_masked(&self) -> String
Returns a masked version of the API key for logging purposes.
Shows first 4 and last 4 characters with ellipsis in between. For keys shorter than 8 characters, shows asterisks only.
Trait Implementations§
Source§impl Clone for KrakenCredential
impl Clone for KrakenCredential
Source§fn clone(&self) -> KrakenCredential
fn clone(&self) -> KrakenCredential
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KrakenCredential
impl Debug for KrakenCredential
Source§impl Drop for KrakenCredential
impl Drop for KrakenCredential
Auto Trait Implementations§
impl Freeze for KrakenCredential
impl RefUnwindSafe for KrakenCredential
impl Send for KrakenCredential
impl Sync for KrakenCredential
impl Unpin for KrakenCredential
impl UnwindSafe for KrakenCredential
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
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>
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