orderBook method
Will get a specific symbol's order book using /depth
endpoint.
If limit
is provided, will modify the max number of bids/asks returned and the query weight. (defaults to 100)
API Key required : no
Valid limit values and associated query weight :
Limit | Weight |
---|---|
5, 10, 20, 50, 100 | 1 |
500 | 5 |
1000 | 10 |
5000 | 50 |
Returns a BinanceOrderBook
containing all returned data when request is a success.
Throws a BinanceApiError if an error occurs.
Implementation
Future<BinanceOrderBook> orderBook({
String baseUri = defaultUri,
required String symbol,
int limit = 100,
}) async =>
BinanceOrderBook.fromJson(await sendRequest(
baseUri,
orderBookPath,
queryParameters: {'symbol': symbol, 'limit': '$limit'},
));