LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
692 stars 164 forks source link

get_exchange_info does not work in websocket API - easy fix included #346

Closed fpaincha closed 1 year ago

fpaincha commented 1 year ago

Version of this library.

1.46.1

Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.

Hardware?

Local server/workstation

Operating System?

Windows

Python version?

Python3.10

Installed packages

Not relevant here.

Logging output

Not relevant here.

Processing method?

stream_buffer

Used endpoint?

concerns all

Issue

Congrats - this library is just marvellous!

The source code for method get_exchange_info in the websocket API reads as:

[snip]

    if symbol is None:
        params = {"symbol": symbol}
    if symbols is None:
        symbols = [symbol.upper() for symbol in symbols]
        params = {"symbols": symbols}
    if permissions is None:
        params = {"permissions": permissions}

[snip]

All of those three method parameters are None by default. Of course, what was meant was this instead:

    params = {}
    if symbol is not None:
        params = {"symbol": symbol}
    elif symbols is not None:
        symbols = [symbol.upper() for symbol in symbols]
        params = {"symbols": symbols}
    elif permissions is not None:
        params = {"permissions": permissions}

This fixes method get_exchange_info...

Cheers.

oliver-zehentleitner commented 1 year ago

thank you! is fixed now!

oliver-zehentleitner commented 1 year ago

https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/releases/tag/1.46.2