-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added method for /sapi/v1/asset/wallet/balance endpoint (#268) * fix: incorrect anchors (#265) * Add websocket timeout execption handler (#228) * Add websocket timeout execption handler * Remove redundant timeout field in BinanceSocketManager * Add a dedicated websocket error handler --------- Co-authored-by: Jeremy <[email protected]> * updates the timeout implementation --------- Co-authored-by: Akshat Gadhwal <[email protected]> Co-authored-by: Igor Shadurin <[email protected]> Co-authored-by: Riyum <[email protected]>
- Loading branch information
1 parent
3367d18
commit 75c5d53
Showing
16 changed files
with
117 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "3.4.0" | ||
__version__ = "3.5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
WEBSOCKET_TIMEOUT_IN_SECONDS = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python | ||
|
||
import logging | ||
from binance.spot import Spot as Client | ||
from binance.lib.utils import config_logging | ||
from examples.utils.prepare_env import get_api_key | ||
|
||
config_logging(logging, logging.DEBUG) | ||
|
||
api_key, api_secret = get_api_key() | ||
|
||
spot_client = Client(api_key, api_secret) | ||
logging.info(spot_client.balance()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import responses | ||
from binance.spot import Spot as Client | ||
from tests.util import mock_http_response | ||
from tests.util import random_str | ||
|
||
mock_item = [{"key_1": "value_1", "key_2": "value_2"}] | ||
key = random_str() | ||
secret = random_str() | ||
|
||
|
||
@mock_http_response(responses.GET, "/sapi/v1/asset/wallet/balance", mock_item, 200) | ||
def test_balance(): | ||
"""Tests the API endpoint to get balance""" | ||
|
||
client = Client(key, secret) | ||
response = client.balance() | ||
response.should.equal(mock_item) |