pub struct Okx { /* private fields */ }Implementations§
Source§impl Okx
impl Okx
Sourcepub async fn subscribe_ticker(
&self,
inst_id: &CryptoSymbol,
) -> Result<Receiver<Result<Vec<OkxTicker>, SharedWsError>>, SharedWsError>
pub async fn subscribe_ticker( &self, inst_id: &CryptoSymbol, ) -> Result<Receiver<Result<Vec<OkxTicker>, SharedWsError>>, SharedWsError>
Retrieve the last traded price, bid price, ask price and 24-hour trading volume of instruments. Best ask price may be lower than the best bid price during the pre-open period. The fastest rate is 1 update/100ms. There will be no update if the event is not triggered. The events which can trigger update: trade, the change on best ask/bid.
https://www.okx.com/docs-v5/en/#order-book-trading-market-data-ws-tickers-channel
Source§impl Okx
impl Okx
Sourcepub async fn get_instruments(
&self,
params: &OkxInstrumentParams,
) -> OkxRestRespType<OkxInstrument>
pub async fn get_instruments( &self, params: &OkxInstrumentParams, ) -> OkxRestRespType<OkxInstrument>
Retrieve a list of instruments with open contracts for OKX. Retrieve available instruments info of current account, please refer to Get instruments.
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-instruments
Sourcepub async fn get_system_time(&self) -> OkxRestRespType<OkxSystemTime>
pub async fn get_system_time(&self) -> OkxRestRespType<OkxSystemTime>
Retrieve API server time.
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-system-time
Source§impl Okx
impl Okx
Sourcepub async fn get_balances(&self) -> OkxRestRespType<OkxBalance>
pub async fn get_balances(&self) -> OkxRestRespType<OkxBalance>
Retrieve a list of assets (with non-zero balance), remaining balance, and available amount in the trading account.
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance