1

I see a function in client.py called futures_exchange_info(self). What is self here? The documentation is really slim but I'm assuming it refers to Exchange Information? How does this function work exactly? I've tried calling it as futures_exchange_info('VETUSDT') but I just get the error: "TypeError: futures_exchange_info() takes 1 positional argument but 2 were given".

Does anyone know how this function works?

enmasse
  • 143
  • 2
  • 13
  • Does this answer your question? [What is the purpose of the word 'self'?](https://stackoverflow.com/questions/2709821/what-is-the-purpose-of-the-word-self) – Reti43 Mar 07 '21 at 01:41

1 Answers1

1

You need to create a Client object and then call client.futures_exchange_info(). The method takes no parameters and according to the documentation returns "Current exchange trading rules and symbol information".

Something like this should work:

from binance.client import Client

client = Client(api_key, api_secret)
info = client.futures_exchange_info()

Documentation is here and take a look at the quick start.

mhawke
  • 84,695
  • 9
  • 117
  • 138
  • There we go! Thank you! Not quite as elegant of an output as `client.get_symbol_info` but you work with what's available I guess. – enmasse Mar 07 '21 at 03:33
  • 1
    For um_futures: [exchange_info()](https://github.com/binance/binance-futures-connector-python/blob/main/binance/um_futures/market.py#L35) – Kuznetsov-M Aug 14 '22 at 15:30