pub struct InfoClient {
pub base_url: &'static str,
pub market_cache: HashMap<String, MarketModel>,
pub tick_lot_utils: TickLot,
pub web_socket_client: Option<WebSocketClient>,
/* private fields */
}Fields§
§base_url: &'static str§market_cache: HashMap<String, MarketModel>§tick_lot_utils: TickLot§web_socket_client: Option<WebSocketClient>Implementations§
Source§impl InfoClient
impl InfoClient
pub async fn new( is_mainnet: bool, enable_ws: bool, api_key: Option<String>, ) -> Result<Self, ExchangeError>
pub async fn set_default_api_key( &mut self, api_key: String, ) -> Result<(), ExchangeError>
pub async fn get_markets_info( &self, ) -> Result<DefaultResponse<MarketsInfoResponse>, ExchangeError>
pub async fn prices( &self, ) -> Result<DefaultResponse<PricesResponse>, ExchangeError>
pub async fn kline( &self, symbol: String, interval: Interval, start_time: u64, end_time: Option<u64>, ) -> Result<DefaultResponse<KlineResponse>, ExchangeError>
pub async fn recent_trades( &self, symbol: String, ) -> Result<DefaultResponse<RecentTradesResponse>, ExchangeError>
pub async fn order_book( &self, symbol: String, agg_level: Option<AggLevel>, ) -> Result<DefaultResponse<OrderBookResponse>, ExchangeError>
pub async fn funding_rate_history( &self, symbol: String, ) -> Result<DefaultResponse<FundingRateHistoryResponse>, ExchangeError>
pub async fn account( &self, account: Pubkey, ) -> Result<DefaultResponse<AccountResponse>, ExchangeError>
pub async fn account_funding_history( &self, account: Pubkey, limit: Option<u32>, offset: Option<u32>, ) -> Result<DefaultResponse<AccountFundingHistoryResponse>, ExchangeError>
pub async fn account_settings( &self, account: Pubkey, ) -> Result<DefaultResponse<AccountSettingsResponse>, ExchangeError>
pub async fn positions( &self, account: Pubkey, ) -> Result<DefaultResponse<PositionsResponse>, ExchangeError>
pub async fn trade_history( &self, account: Pubkey, symbol: Option<String>, start_time: Option<u64>, end_time: Option<u64>, limit: Option<u32>, offset: Option<u32>, ) -> Result<DefaultResponse<TradesHistoryResponse>, ExchangeError>
pub async fn balance_history( &self, account: Pubkey, limit: Option<u32>, offset: Option<u32>, ) -> Result<DefaultResponse<BalanceHistoryResponse>, ExchangeError>
pub async fn equity_history( &self, equity_history_params: EquityHistoryParams, ) -> Result<DefaultResponse<EquityHistoryResponse>, ExchangeError>
pub async fn opened_orders( &self, account: Pubkey, ) -> Result<DefaultResponse<OpenedOrdersResponse>, ExchangeError>
pub async fn order_history( &self, account: Pubkey, limit: Option<u32>, offset: Option<u32>, ) -> Result<DefaultResponse<OrderHistoryResponse>, ExchangeError>
pub async fn order_history_by_id( &self, order_id: u64, ) -> Result<DefaultResponse<OrderHistoryByIdResponse>, ExchangeError>
Auto Trait Implementations§
impl !RefUnwindSafe for InfoClient
impl !UnwindSafe for InfoClient
impl Freeze for InfoClient
impl Send for InfoClient
impl Sync for InfoClient
impl Unpin for InfoClient
impl UnsafeUnpin for InfoClient
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