| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7c6b7a5 commit 78825bb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -264,6 +264,55 @@ def get_exchange_info(self): | |||
| 264 | 264 | ||
| 265 | 265 | return self._get('exchangeInfo') | |
| 266 | 266 | ||
| 267 | + def get_symbol_info(self, symbol): | ||
| 268 | + """Return information about a symbol | ||
| 269 | + | ||
| 270 | + :param symbol: required e.g BNBBTC | ||
| 271 | + :type symbol: str | ||
| 272 | + | ||
| 273 | + :returns: Dict if found, None if not | ||
| 274 | + | ||
| 275 | + .. code-block:: python | ||
| 276 | + | ||
| 277 | + { | ||
| 278 | + "symbol": "ETHBTC", | ||
| 279 | + "status": "TRADING", | ||
| 280 | + "baseAsset": "ETH", | ||
| 281 | + "baseAssetPrecision": 8, | ||
| 282 | + "quoteAsset": "BTC", | ||
| 283 | + "quotePrecision": 8, | ||
| 284 | + "orderTypes": ["LIMIT", "MARKET"], | ||
| 285 | + "icebergAllowed": false, | ||
| 286 | + "filters": [ | ||
| 287 | + { | ||
| 288 | + "filterType": "PRICE_FILTER", | ||
| 289 | + "minPrice": "0.00000100", | ||
| 290 | + "maxPrice": "100000.00000000", | ||
| 291 | + "tickSize": "0.00000100" | ||
| 292 | + }, { | ||
| 293 | + "filterType": "LOT_SIZE", | ||
| 294 | + "minQty": "0.00100000", | ||
| 295 | + "maxQty": "100000.00000000", | ||
| 296 | + "stepSize": "0.00100000" | ||
| 297 | + }, { | ||
| 298 | + "filterType": "MIN_NOTIONAL", | ||
| 299 | + "minNotional": "0.00100000" | ||
| 300 | + } | ||
| 301 | + ] | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + :raises: BinanceResponseException, BinanceAPIException | ||
| 305 | + | ||
| 306 | + """ | ||
| 307 | + | ||
| 308 | + res = self._get('exchangeInfo') | ||
| 309 | + | ||
| 310 | + for item in res['symbols']: | ||
| 311 | + if item['symbol'] == symbol.upper(): | ||
| 312 | + return item | ||
| 313 | + | ||
| 314 | + return None | ||
| 315 | + | ||
| 267 | 316 | # General Endpoints | |
| 268 | 317 | ||
| 269 | 318 | def ping(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,15 @@ General Endpoints | |||
| 22 | 22 | ||
| 23 | 23 | info = client.get_exchange_info() | |
| 24 | 24 | ||
| 25 | + `Get Symbol Info <binance.html#binance.client.Client.get_symbol_info>`_ | ||
| 26 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 27 | + | ||
| 28 | + Get the exchange info for a particular symbol | ||
| 29 | + | ||
| 30 | + .. code:: python | ||
| 31 | + | ||
| 32 | + info = client.get_symbol_info('BNBBTC') | ||
| 33 | + | ||
| 25 | 34 | `Get Current Products <binance.html#binance.client.Client.get_products>`_ | |
| 26 | 35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 27 | 36 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments