pub struct AxRawHttpClient { /* private fields */ }Expand description
Raw HTTP client for low-level AX Exchange API operations.
This client handles request/response operations with the AX Exchange API, returning venue-specific response types. It does not parse to Nautilus domain types.
Implementations§
Source§impl AxRawHttpClient
impl AxRawHttpClient
Sourcepub fn cancel_all_requests(&self)
pub fn cancel_all_requests(&self)
Cancel all pending HTTP requests.
Sourcepub fn cancellation_token(&self) -> &CancellationToken
pub fn cancellation_token(&self) -> &CancellationToken
Get the cancellation token for this client.
Sourcepub fn new(
base_url: Option<String>,
orders_base_url: 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>,
) -> Result<Self, AxHttpError>
pub fn new( base_url: Option<String>, orders_base_url: 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>, ) -> Result<Self, AxHttpError>
Creates a new AxRawHttpClient using the default Ax HTTP URL.
§Errors
Returns an error if the retry manager cannot be created.
Sourcepub fn with_credentials(
api_key: String,
api_secret: String,
base_url: Option<String>,
orders_base_url: 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>,
) -> Result<Self, AxHttpError>
pub fn with_credentials( api_key: String, api_secret: String, base_url: Option<String>, orders_base_url: 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>, ) -> Result<Self, AxHttpError>
Creates a new AxRawHttpClient configured with credentials.
§Errors
Returns an error if the HTTP client cannot be created.
Sourcepub fn set_session_token(&self, token: String)
pub fn set_session_token(&self, token: String)
Sets the session token for authenticated requests.
The session token is obtained through the login flow and used for bearer token authentication.
§Panics
Panics if the internal lock is poisoned (indicates a panic in another thread).
Sourcepub async fn get_whoami(&self) -> Result<AxWhoAmI, AxHttpError>
pub async fn get_whoami(&self) -> Result<AxWhoAmI, AxHttpError>
Sourcepub async fn get_instruments(
&self,
) -> Result<AxInstrumentsResponse, AxHttpError>
pub async fn get_instruments( &self, ) -> Result<AxInstrumentsResponse, AxHttpError>
Sourcepub async fn get_balances(&self) -> Result<AxBalancesResponse, AxHttpError>
pub async fn get_balances(&self) -> Result<AxBalancesResponse, AxHttpError>
Sourcepub async fn get_positions(&self) -> Result<AxPositionsResponse, AxHttpError>
pub async fn get_positions(&self) -> Result<AxPositionsResponse, AxHttpError>
Sourcepub async fn get_tickers(&self) -> Result<AxTickersResponse, AxHttpError>
pub async fn get_tickers(&self) -> Result<AxTickersResponse, AxHttpError>
Sourcepub async fn get_ticker(&self, symbol: &str) -> Result<AxTicker, AxHttpError>
pub async fn get_ticker(&self, symbol: &str) -> Result<AxTicker, AxHttpError>
Sourcepub async fn get_instrument(
&self,
symbol: &str,
) -> Result<AxInstrument, AxHttpError>
pub async fn get_instrument( &self, symbol: &str, ) -> Result<AxInstrument, AxHttpError>
Sourcepub async fn authenticate(
&self,
api_key: &str,
api_secret: &str,
expiration_seconds: i32,
) -> Result<AxAuthenticateResponse, AxHttpError>
pub async fn authenticate( &self, api_key: &str, api_secret: &str, expiration_seconds: i32, ) -> Result<AxAuthenticateResponse, AxHttpError>
Sourcepub async fn authenticate_with_totp(
&self,
api_key: &str,
api_secret: &str,
expiration_seconds: i32,
totp: Option<&str>,
) -> Result<AxAuthenticateResponse, AxHttpError>
pub async fn authenticate_with_totp( &self, api_key: &str, api_secret: &str, expiration_seconds: i32, totp: Option<&str>, ) -> Result<AxAuthenticateResponse, AxHttpError>
Sourcepub async fn place_order(
&self,
request: &PlaceOrderRequest,
) -> Result<AxPlaceOrderResponse, AxHttpError>
pub async fn place_order( &self, request: &PlaceOrderRequest, ) -> Result<AxPlaceOrderResponse, AxHttpError>
Sourcepub async fn cancel_order(
&self,
order_id: &str,
) -> Result<AxCancelOrderResponse, AxHttpError>
pub async fn cancel_order( &self, order_id: &str, ) -> Result<AxCancelOrderResponse, AxHttpError>
Sourcepub async fn get_open_orders(&self) -> Result<AxOpenOrdersResponse, AxHttpError>
pub async fn get_open_orders(&self) -> Result<AxOpenOrdersResponse, AxHttpError>
Sourcepub async fn get_fills(&self) -> Result<AxFillsResponse, AxHttpError>
pub async fn get_fills(&self) -> Result<AxFillsResponse, AxHttpError>
Sourcepub async fn get_candles(
&self,
symbol: &str,
start_timestamp_ns: i64,
end_timestamp_ns: i64,
candle_width: AxCandleWidth,
) -> Result<AxCandlesResponse, AxHttpError>
pub async fn get_candles( &self, symbol: &str, start_timestamp_ns: i64, end_timestamp_ns: i64, candle_width: AxCandleWidth, ) -> Result<AxCandlesResponse, AxHttpError>
Sourcepub async fn get_current_candle(
&self,
symbol: &str,
candle_width: AxCandleWidth,
) -> Result<AxCandle, AxHttpError>
pub async fn get_current_candle( &self, symbol: &str, candle_width: AxCandleWidth, ) -> Result<AxCandle, AxHttpError>
Sourcepub async fn get_last_candle(
&self,
symbol: &str,
candle_width: AxCandleWidth,
) -> Result<AxCandle, AxHttpError>
pub async fn get_last_candle( &self, symbol: &str, candle_width: AxCandleWidth, ) -> Result<AxCandle, AxHttpError>
Sourcepub async fn get_funding_rates(
&self,
symbol: &str,
start_timestamp_ns: i64,
end_timestamp_ns: i64,
) -> Result<AxFundingRatesResponse, AxHttpError>
pub async fn get_funding_rates( &self, symbol: &str, start_timestamp_ns: i64, end_timestamp_ns: i64, ) -> Result<AxFundingRatesResponse, AxHttpError>
Sourcepub async fn get_risk_snapshot(
&self,
) -> Result<AxRiskSnapshotResponse, AxHttpError>
pub async fn get_risk_snapshot( &self, ) -> Result<AxRiskSnapshotResponse, AxHttpError>
Sourcepub async fn get_transactions(
&self,
transaction_types: Vec<String>,
) -> Result<AxTransactionsResponse, AxHttpError>
pub async fn get_transactions( &self, transaction_types: Vec<String>, ) -> Result<AxTransactionsResponse, AxHttpError>
Trait Implementations§
Source§impl Debug for AxRawHttpClient
impl Debug for AxRawHttpClient
Auto Trait Implementations§
impl !Freeze for AxRawHttpClient
impl !RefUnwindSafe for AxRawHttpClient
impl Send for AxRawHttpClient
impl Sync for AxRawHttpClient
impl Unpin for AxRawHttpClient
impl !UnwindSafe for AxRawHttpClient
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
§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