haasomeapi.apis.MarketDataApi module¶
Functions¶
-
class
haasomeapi.apis.MarketDataApi.MarketDataApi(connectionstring: str, privatekey: str)¶ Bases:
haasomeapi.apis.ApiBase.ApiBaseThe Market Data API Class. Gives access to the market data endpoints
Parameters: - connectionstring – str: Connection String Formatted Ex. http://127.0.0.1:9000
- privatekey – str: Private Key Set In The Haas Settings
-
get_all_price_markets()¶ Returns all markets
Returns: HaasomeClientResponseReturns: In .result List[ Market] of markets
-
get_all_price_sources()¶ Returns all avalible price sources
Returns: HaasomeClientResponseReturns: In .result List[str] of all the prices sources
-
get_enabled_price_sources()¶ Returns all enabled price sources
Returns: HaasomeClientResponseReturns: In .result List[str] of all the enabled sources
-
get_history(pricesource: haasomeapi.enums.EnumPriceSource.EnumPriceSource, primarycoin: str, secondarycoin: str, contractname: str, interval: int, depth: int)¶ Get price history from price servers
Parameters: - pricesource –
EnumPriceSource: Price Source (Exchange) to get ticker from - primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Contract Name (Optional)
- interval – int: The candle interval value Ex. 1,2,3,5,15,30,etc (In minutes)
- depth – int: The depth or how many candles to get
Returns: Returns: In .result List[
PriceTick]: List of Price Tick objects- pricesource –
-
get_history_from_market(market: haasomeapi.dataobjects.marketdata.Market.Market, interval: int, depth: int)¶ Get price history from price servers using market object
Parameters: - market –
Market: Market object to use - interval – int: The candle interval value Ex. 1,2,3,5,15,30,etc (In minutes)
- depth – int: The depth or how many candles to get
Returns: Returns: In .result List[
PriceTick]: List of Price Tick objects- market –
-
get_last_trades(pricesource: haasomeapi.enums.EnumPriceSource.EnumPriceSource, primarycoin: str, secondarycoin: str, contractname: str)¶ Returns trade history for the specified market
Parameters: - pricesource –
EnumPriceSource: Price Source (Exchange) to get ticker from - primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Contract Name (Optional)
Returns: Returns: In .result
TradeContainer: Trade Container object- pricesource –
-
get_last_trades_from_market(market: haasomeapi.dataobjects.marketdata.Market.Market)¶ Returns trade history for the specified market using a market object
Parameters: market – Market: Market object to useReturns: HaasomeClientResponseReturns: In .result TradeContainer: Trade Container object
-
get_minute_price_ticker(pricesource: haasomeapi.enums.EnumPriceSource.EnumPriceSource, primarycoin: str, secondarycoin: str, contractname: str)¶ Returns a minute price ticker
Parameters: - pricesource –
EnumPriceSource: Price Source (Exchange) to get ticker from - primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Contract Name (Optional)
Returns: Returns: In .result
PriceTick: Price Tick object- pricesource –
-
get_minute_price_ticker_from_market(market: haasomeapi.dataobjects.marketdata.Market.Market)¶ Returns a minute price ticker using a market object
Parameters: market – Market: Market object to useReturns: HaasomeClientResponseReturns: In .result PriceTick: Price Tick object
-
get_order_book(pricesource: haasomeapi.enums.EnumPriceSource.EnumPriceSource, primarycoin: str, secondarycoin: str, contractname: str)¶ Returns the current order book for specified market
Parameters: - pricesource –
EnumPriceSource: Price Source (Exchange) to get ticker from - primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Contract Name (Optional)
Returns: Returns: In .result
Orderbook: Orderbook object- pricesource –
-
get_order_book_from_market(market: haasomeapi.dataobjects.marketdata.Market.Market)¶ Returns the current order book for specified market using a market object
Parameters: market – Market: Market object to useReturns: HaasomeClientResponseReturns: In .result Orderbook: Orderbook object
-
get_price_markets(pricesource: haasomeapi.enums.EnumPriceSource.EnumPriceSource)¶ Returns markets for specified price source
Parameters: pricesource – EnumPriceSource: Price Source (Exchange)Returns: HaasomeClientResponseReturns: In .result List[ Market] of markets
-
get_price_ticker(pricesource: haasomeapi.enums.EnumPriceSource.EnumPriceSource, primarycoin: str, secondarycoin: str, contractname: str)¶ Returns the current price tick object
Parameters: - pricesource –
EnumPriceSource: Price Source (Exchange) to get ticker from - primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Contract Name (Optional)
Returns: Returns: In .result
PriceTick: Price Tick object- pricesource –
-
get_price_ticker_from_market(market: haasomeapi.dataobjects.marketdata.Market.Market)¶ Returns the current price tick object from a market object
Parameters: market – Market: Market object to useReturns: HaasomeClientResponseReturns: In .result PriceTick: Price Tick object