pub struct KrakenFuturesRawHttpClient { /* private fields */ }Expand description
Raw HTTP client for low-level Kraken Futures API operations.
This client handles request/response operations with the Kraken Futures API, returning venue-specific response types. It does not parse to Nautilus domain types.
Implementations§
Source§impl KrakenFuturesRawHttpClient
impl KrakenFuturesRawHttpClient
Sourcepub fn new(
environment: KrakenEnvironment,
base_url_override: Option<String>,
timeout_secs: Option<u64>,
max_retries: Option<u32>,
retry_delay_ms: Option<u64>,
retry_delay_max_ms: Option<u64>,
proxy_url: Option<String>,
max_requests_per_second: Option<u32>,
) -> Result<Self>
pub fn new( environment: KrakenEnvironment, base_url_override: Option<String>, timeout_secs: Option<u64>, max_retries: Option<u32>, retry_delay_ms: Option<u64>, retry_delay_max_ms: Option<u64>, proxy_url: Option<String>, max_requests_per_second: Option<u32>, ) -> Result<Self>
Creates a new KrakenFuturesRawHttpClient.
Sourcepub fn with_credentials(
api_key: String,
api_secret: String,
environment: KrakenEnvironment,
base_url_override: Option<String>,
timeout_secs: Option<u64>,
max_retries: Option<u32>,
retry_delay_ms: Option<u64>,
retry_delay_max_ms: Option<u64>,
proxy_url: Option<String>,
max_requests_per_second: Option<u32>,
) -> Result<Self>
pub fn with_credentials( api_key: String, api_secret: String, environment: KrakenEnvironment, base_url_override: Option<String>, timeout_secs: Option<u64>, max_retries: Option<u32>, retry_delay_ms: Option<u64>, retry_delay_max_ms: Option<u64>, proxy_url: Option<String>, max_requests_per_second: Option<u32>, ) -> Result<Self>
Creates a new KrakenFuturesRawHttpClient with credentials.
Sourcepub fn credential(&self) -> Option<&KrakenCredential>
pub fn credential(&self) -> Option<&KrakenCredential>
Returns the credential for this client, if set.
Sourcepub fn cancel_all_requests(&self)
pub fn cancel_all_requests(&self)
Cancels all pending HTTP requests.
Sourcepub fn cancellation_token(&self) -> &CancellationToken
pub fn cancellation_token(&self) -> &CancellationToken
Returns the cancellation token for this client.
Sourcepub async fn get_instruments(
&self,
) -> Result<FuturesInstrumentsResponse, KrakenHttpError>
pub async fn get_instruments( &self, ) -> Result<FuturesInstrumentsResponse, KrakenHttpError>
Requests tradable instruments from Kraken Futures.
Sourcepub async fn get_tickers(
&self,
) -> Result<FuturesTickersResponse, KrakenHttpError>
pub async fn get_tickers( &self, ) -> Result<FuturesTickersResponse, KrakenHttpError>
Requests ticker information for all futures instruments.
Sourcepub async fn get_ohlc(
&self,
tick_type: &str,
symbol: &str,
resolution: &str,
from: Option<i64>,
to: Option<i64>,
) -> Result<FuturesCandlesResponse, KrakenHttpError>
pub async fn get_ohlc( &self, tick_type: &str, symbol: &str, resolution: &str, from: Option<i64>, to: Option<i64>, ) -> Result<FuturesCandlesResponse, KrakenHttpError>
Requests OHLC candlestick data for a futures symbol.
Sourcepub async fn get_public_executions(
&self,
symbol: &str,
since: Option<i64>,
before: Option<i64>,
sort: Option<&str>,
continuation_token: Option<&str>,
) -> Result<FuturesPublicExecutionsResponse, KrakenHttpError>
pub async fn get_public_executions( &self, symbol: &str, since: Option<i64>, before: Option<i64>, sort: Option<&str>, continuation_token: Option<&str>, ) -> Result<FuturesPublicExecutionsResponse, KrakenHttpError>
Gets public execution events (trades) for a futures symbol.
Sourcepub async fn get_open_orders(
&self,
) -> Result<FuturesOpenOrdersResponse, KrakenHttpError>
pub async fn get_open_orders( &self, ) -> Result<FuturesOpenOrdersResponse, KrakenHttpError>
Requests all open orders (requires authentication).
Sourcepub async fn get_order_events(
&self,
before: Option<i64>,
since: Option<i64>,
continuation_token: Option<&str>,
) -> Result<FuturesOrderEventsResponse, KrakenHttpError>
pub async fn get_order_events( &self, before: Option<i64>, since: Option<i64>, continuation_token: Option<&str>, ) -> Result<FuturesOrderEventsResponse, KrakenHttpError>
Requests historical order events (requires authentication).
Sourcepub async fn get_fills(
&self,
last_fill_time: Option<&str>,
) -> Result<FuturesFillsResponse, KrakenHttpError>
pub async fn get_fills( &self, last_fill_time: Option<&str>, ) -> Result<FuturesFillsResponse, KrakenHttpError>
Requests fill/trade history (requires authentication).
Sourcepub async fn get_open_positions(
&self,
) -> Result<FuturesOpenPositionsResponse, KrakenHttpError>
pub async fn get_open_positions( &self, ) -> Result<FuturesOpenPositionsResponse, KrakenHttpError>
Requests open positions (requires authentication).
Sourcepub async fn get_accounts(
&self,
) -> Result<FuturesAccountsResponse, KrakenHttpError>
pub async fn get_accounts( &self, ) -> Result<FuturesAccountsResponse, KrakenHttpError>
Requests all accounts (cash and margin) with balances and margin info.
Sourcepub async fn send_order(
&self,
params: HashMap<String, String>,
) -> Result<FuturesSendOrderResponse, KrakenHttpError>
pub async fn send_order( &self, params: HashMap<String, String>, ) -> Result<FuturesSendOrderResponse, KrakenHttpError>
Submits a new order (requires authentication).
Sourcepub async fn send_order_params(
&self,
params: &KrakenFuturesSendOrderParams,
) -> Result<FuturesSendOrderResponse, KrakenHttpError>
pub async fn send_order_params( &self, params: &KrakenFuturesSendOrderParams, ) -> Result<FuturesSendOrderResponse, KrakenHttpError>
Submits a new order using typed parameters (requires authentication).
Sourcepub async fn cancel_order(
&self,
order_id: Option<String>,
cli_ord_id: Option<String>,
) -> Result<FuturesCancelOrderResponse, KrakenHttpError>
pub async fn cancel_order( &self, order_id: Option<String>, cli_ord_id: Option<String>, ) -> Result<FuturesCancelOrderResponse, KrakenHttpError>
Cancels an open order (requires authentication).
Sourcepub async fn edit_order(
&self,
params: &KrakenFuturesEditOrderParams,
) -> Result<FuturesEditOrderResponse, KrakenHttpError>
pub async fn edit_order( &self, params: &KrakenFuturesEditOrderParams, ) -> Result<FuturesEditOrderResponse, KrakenHttpError>
Edits an existing order (requires authentication).
Sourcepub async fn batch_order(
&self,
params: HashMap<String, String>,
) -> Result<FuturesBatchOrderResponse, KrakenHttpError>
pub async fn batch_order( &self, params: HashMap<String, String>, ) -> Result<FuturesBatchOrderResponse, KrakenHttpError>
Submits multiple orders in a single batch request (requires authentication).
Sourcepub async fn cancel_orders_batch(
&self,
order_ids: Vec<String>,
) -> Result<FuturesBatchCancelResponse, KrakenHttpError>
pub async fn cancel_orders_batch( &self, order_ids: Vec<String>, ) -> Result<FuturesBatchCancelResponse, KrakenHttpError>
Cancels multiple orders in a single batch request (requires authentication).
Sourcepub async fn cancel_all_orders(
&self,
symbol: Option<String>,
) -> Result<FuturesCancelAllOrdersResponse, KrakenHttpError>
pub async fn cancel_all_orders( &self, symbol: Option<String>, ) -> Result<FuturesCancelAllOrdersResponse, KrakenHttpError>
Cancels all open orders, optionally filtered by symbol (requires authentication).
Trait Implementations§
Source§impl Debug for KrakenFuturesRawHttpClient
impl Debug for KrakenFuturesRawHttpClient
Auto Trait Implementations§
impl !Freeze for KrakenFuturesRawHttpClient
impl !RefUnwindSafe for KrakenFuturesRawHttpClient
impl Send for KrakenFuturesRawHttpClient
impl Sync for KrakenFuturesRawHttpClient
impl Unpin for KrakenFuturesRawHttpClient
impl !UnwindSafe for KrakenFuturesRawHttpClient
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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