module Binance::Spot::Market
def agg_trades(symbol:, **kwargs)
- See: https://binance-docs.github.io/apidocs/spot/en/#compressed-aggregate-trades-list -
Options Hash:
(**kwargs)-
:limit(Integer) -- Default 500; max 1000. -
:fromId(Integer) -- Trade id to fetch from. Default gets most recent trades. -
:endTime(Integer) -- Timestamp in ms to get aggregate trades until INCLUSIVE. -
:startTime(Integer) -- Timestamp in ms to get aggregate trades from INCLUSIVE.
Parameters:
-
kwargs(Hash) -- -
symbol(String) -- the symbol
def agg_trades(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.public_request( path: '/api/v3/aggTrades', params: kwargs.merge(symbol: symbol) ) end
def avg_price(symbol:)
- See: https://binance-docs.github.io/apidocs/spot/en/#current-average-price -
Parameters:
-
symbol(String) -- the symbol
def avg_price(symbol:) Binance::Utils::Validation.require_param('symbol', symbol) @session.public_request( path: '/api/v3/avgPrice', params: { symbol: symbol } ) end
def book_ticker(symbol: nil)
- See: https://binance-docs.github.io/apidocs/spot/en/#symbol-order-book-ticker -
Parameters:
-
symbol(String) -- the symbol
def book_ticker(symbol: nil) @session.public_request( path: '/api/v3/ticker/bookTicker', params: { symbol: symbol } ) end
def depth(symbol:, **kwargs)
- See: https://binance-docs.github.io/apidocs/spot/en/#order-book -
Options Hash:
(**kwargs)-
:limit(Integer) -- Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]
Parameters:
-
kwargs(Hash) -- -
symbol(String) -- the symbol
def depth(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.public_request( path: '/api/v3/depth', params: kwargs.merge(symbol: symbol) ) end
def exchange_info(symbol: nil, symbols: nil)
- See: https://binance-docs.github.io/apidocs/spot/en/#exchange-information -
Options Hash:
(**kwargs)-
:symbols(string) -- -
:symbol(string) --
def exchange_info(symbol: nil, symbols: nil) if symbols.is_a?(Array) symbols = symbols.map { |v| "%22#{v}%22" }.join(',') symbols = "%5B#{symbols}%5D" end @session.public_request( path: '/api/v3/exchangeInfo', params: { symbol: symbol, symbols: symbols } ) end
def historical_trades(symbol:, **kwargs)
- See: https://binance-docs.github.io/apidocs/spot/en/#old-trade-lookup-market_data -
Options Hash:
(**kwargs)-
:fromId(Integer) -- Trade id to fetch from. Default gets most recent trades. -
:limit(Integer) -- Default 500; max 1000.
Parameters:
-
kwargs(Hash) -- -
symbol(String) -- the symbol
def historical_trades(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.public_request( path: '/api/v3/historicalTrades', params: kwargs.merge(symbol: symbol) ) end
def klines(symbol:, interval:, **kwargs)
- See: https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data -
Options Hash:
(**kwargs)-
:limit(Integer) -- Default 500; max 1000. -
:endTime(Integer) -- Timestamp in ms to get aggregate trades until INCLUSIVE. -
:startTime(Integer) -- Timestamp in ms to get aggregate trades from INCLUSIVE.
Parameters:
-
kwargs(Hash) -- -
interval(String) -- interval -
symbol(String) -- the symbol
def klines(symbol:, interval:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('interval', interval) @session.public_request( path: '/api/v3/klines', params: kwargs.merge( symbol: symbol, interval: interval ) ) end
def ping
- See: https://binance-docs.github.io/apidocs/spot/en/#test-connectivity -
def ping @session.public_request(path: '/api/v3/ping') end
def ticker_24hr(symbol: nil)
- See: https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics -
Parameters:
-
symbol(String) -- the symbol
def ticker_24hr(symbol: nil) @session.public_request( path: '/api/v3/ticker/24hr', params: { symbol: symbol } ) end
def ticker_price(symbol: nil)
- See: https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker -
Parameters:
-
symbol(String) -- the symbol
def ticker_price(symbol: nil) @session.public_request( path: '/api/v3/ticker/price', params: { symbol: symbol } ) end
def time
- See: https://binance-docs.github.io/apidocs/spot/en/#check-server-time -
def time @session.public_request(path: '/api/v3/time') end
def trades(symbol:, **kwargs)
- See: https://binance-docs.github.io/apidocs/spot/en/#recent-trades-list -
Options Hash:
(**kwargs)-
:limit(Integer) -- Default 500; max 1000.
Parameters:
-
kwargs(Hash) -- -
symbol(String) -- the symbol
def trades(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.public_request( path: '/api/v3/trades', params: kwargs.merge(symbol: symbol) ) end