Commit Graph

89 Commits

Author SHA1 Message Date
Davide Casale
a7f5aa684a Apply pylint's linting rules to bfxapi/websocket/__init__.py, bfxapi/websocket/enums.py, bfxapi/websocket/exceptions.py, bfxapi/websocket/serializers.py and bfxapi/websocket/subscriptions.py. 2023-03-06 17:28:56 +01:00
Davide Casale
7288d05939 Apply pylint's linting rules to bfxapi/utils/*.py. 2023-03-06 17:22:00 +01:00
Davide Casale
a4c1418113 Install and configure pylint. Add pylint to dev-requirements.txt. Start rewriting code to follow pylint's linting rules. 2023-03-06 16:43:08 +01:00
Davide Casale
b3e1e27331 Add and implement FileLogger in bfxapi.utils.logger. 2023-03-03 21:12:34 +01:00
itsdeka
b06476e0d4 nonce must be str 2023-03-03 15:53:06 +01:00
Davide Casale
6f61b983a5 Rewrite, edit and organize examples/websocket demos. 2023-02-20 18:22:57 +01:00
Davide Casale
e3eb3d6a56 Merge pull request #1 from itsdeka/patch-1
Nonce generation must be the same of the previous version.
2023-02-20 15:23:05 +01:00
Davide Casale
ab66170cf3 Apply refactoring to root package bfxapi. 2023-02-17 18:38:07 +01:00
Davide Casale
d72fcf3981 Add better handling for info code 20051. 2023-02-17 17:21:57 +01:00
Davide Casale
fde27e933f Add handling for <20051 : Stop/Restart Websocket Server (please reconnect)>. 2023-02-17 04:15:38 +01:00
Davide Casale
9eb2c73407 Fix small bug in examples/websocket/ticker.py demo. 2023-02-17 04:07:44 +01:00
Davide Casale
4d0fa49e22 Rewrite bfxapi/utils/logger.py with new ColoredLogger. 2023-02-17 04:01:47 +01:00
Davide Casale
e536515bbd Fix bugs and rewrite code in bfxapi.websocket.client sub-package. 2023-02-17 02:58:53 +01:00
Davide Casale
b8a5bcb515 Fix bugs and rewrite regions of new reconnection system. 2023-02-16 20:12:02 +01:00
Davide Casale
fa9bdfc333 Rewrite reconnection system with numerous fixes. 2023-02-15 21:58:01 +01:00
Davide Casale
99f58ddb04 Add new packages to setup.py. Add new feature in .on and .once methods in bfxapi.websocket.client.bfx_websocket_client. Fix small typo in __init__.py. 2023-02-14 18:49:45 +01:00
Davide Casale
49517f9709 Small fix in package import statements. 2023-02-14 17:03:16 +01:00
Davide Casale
17c9502733 Apply fixes and refactoring to the bfxapi.handlers sub-package. 2023-02-14 16:29:50 +01:00
Davide Casale
f0f150cec2 Split websocket package in multiple sub-package. Split handlers.py in public_channels_handler.py and authenticated_channels_handler.py. Rename files attaining to new conventions. 2023-02-13 19:09:38 +01:00
Davide Casale
7dc043bbe5 Small fix in BfxWebsocketClient class. 2023-02-09 04:35:43 +01:00
Davide Casale
c588d9f20c Rewrite bfxapi/rest/_Requests.py with type hinting. Add None values erasement in bfxapi/utils/JSONEncoder.py. Update code with new improvements. 2023-02-06 19:15:58 +01:00
Davide Casale
929ae62d2f Fix bug in bfxapi.tests sub-package. 2023-02-06 16:16:11 +01:00
Davide Casale
06dc9e1c0a Remove cid.py and integers.py from bfxapi.utils subpackage. Rename encoder.py file to JSONEncoder.py. Remove IntegerUnderflowError and IntegerOverflowflowError exceptions from bfxapi/exceptions.py. 2023-02-01 17:18:05 +01:00
Davide Casale
05784cc8ec Add tests subpackage. Add TestRestSerializersAndTypes and TestWebsocketSerializersAndTypes unit tests. Fix consistency bugs between serializers and types. 2023-02-01 17:05:25 +01:00
Davide Casale
40a48184da Fix bugs and differences in namings/types/fields between bfxapi.rest.types, bfxapi.rest.serializers and bfxapi.websocket.types, bfxapi.websocket.serializers. 2023-01-31 18:54:15 +01:00
Davide Casale
7b313ddcab Merge TradeExecutionUpdate and TradeExecuted serializers and types in websocket subpackage. 2023-01-31 17:27:14 +01:00
Davide Casale
d767e5dcfe Replace every snake case (uppercase) to snake case (lowercase) in serializers, types and notification. 2023-01-26 19:00:13 +01:00
Davide Casale
ed12bf473f Rewrite and extend custom JSONEncoder in bfxapi/utils/encoder.py to automatically convert floats to strs. Change every Union[Decimal, str] type to Union[Decimal, float, str]. Fix type hinting bug in labeler.py. 2023-01-25 18:18:15 +01:00
Davide Casale
28c00d460b Exclude subId field from every subscription dictionary. 2023-01-24 19:02:44 +01:00
Davide Casale
36725a183e Move _BfxWebsocketBucket class in its own file bfxapi/websocket/_BfxWebsocketBucket.py. 2023-01-19 18:12:12 +01:00
Davide Casale
5fe4d83902 Move subscriptions type hinting from bfxapi/websocket/types.py to bfxapi/websocket/subscriptions.py. 2023-01-19 18:00:51 +01:00
Davide Casale
2afcc76647 Fix bug regarding new typing with dataclasses. 2023-01-16 18:18:12 +01:00
Davide Casale
e185da4cc9 Rename bfxapi/websocket/typings.py to types.py. Replace TypedDicts with dataclasses (with _Type as base class). Update demos in examples/websocket to use new implementation. 2023-01-16 17:07:16 +01:00
Davide Casale
e64c25bf19 Implement bfxapi/notifications.py in websocket subpackage. 2023-01-12 18:36:23 +01:00
Davide Casale
ff58f049a7 Separate _BfxWebsocketInputs from bfxapi/websocket/BfxWebsocketClient.py to _BfxWebsocketInputs.py. Rename websocket authenticated inputs methods. Refactoring to maintain consistency across the library. 2023-01-12 18:10:00 +01:00
Davide Casale
454a7542ed Add bfxapi/enums.py file. Split enumerations in bfxapi/rest/enums.py and bfxapi/websocket/enums.py. Rename enumeration classes to use singular name identifiers. 2022-12-22 18:42:55 +01:00
Davide Casale
6217f9040c Rename bfxapi/utils/decimal.py to encoder.py. Add support for datetime JSON serialization. Update class reference in BfxWebsocketClient.py. 2022-12-20 18:40:41 +01:00
Davide Casale
87bb6dc5c7 Add generic error handling (UnknownGenericError in bfxapi/rest/exceptions.py). Add support for new endpoints in _RestAuthenticatedEndpoints class. Extend serializers.py and typings.py. 2022-12-20 17:48:38 +01:00
Davide Casale
0a53ab7f7e Apply lots of refactoring to the websocket subpackage (fix every mypy error and warning). Add integers.py and decimal.py to bfxapi.utils package. Update requirements.txt and setup.py with new mypy dependencies. 2022-12-16 18:30:41 +01:00
Davide Casale
4cfeab8a79 Add barebone files for rest section. 2022-11-30 18:25:15 +01:00
Davide Casale
48f1745f10 Add MAXIMUM_BUCKETS_AMOUNT constant to BfxWebsocketClient class. 2022-11-30 17:55:10 +01:00
Davide Casale
509223ae9b Add order_multiple_operations input in _BfxWebsocketInputs. 2022-11-30 17:34:13 +01:00
Davide Casale
e71d4b6e26 Add new websocket authenticated inputs in _BfxWebsocketInputs class. Add new type hinting inside bfxapi/websocket/typings.py. 2022-11-30 17:24:51 +01:00
Davide Casale
d9ecbaa9f0 Change exception formatting inside error .add_listener in BfxWebsocketClient. 2022-11-29 18:05:20 +01:00
Davide Casale
bfd05cf7c7 Add traceback import and implementation. 2022-11-29 17:53:39 +01:00
Davide Casale
e262c81f97 Change default log_level value (from 'INFO' to 'ERROR'). Implement error event into AsyncIOEventEmitter. Add error logging. 2022-11-29 17:17:17 +01:00
Davide Casale
b308bbacbd Add Flags enumeration to enums.py. Rename new_order and new_position to order_new and position_new to mantain consistency. Add _BfxWebsocketInputs class with order_new, order_update and order_cancel inputs. 2022-11-29 15:26:02 +01:00
Davide Casale
fa073823ce Add .run method in BfxWebsocketClient class. 2022-11-28 17:08:27 +01:00
Davide Casale
4bb62a942f Allow users to use .on and .once as non-decorators methods. 2022-11-28 16:58:09 +01:00
Davide Casale
9e8bea905a Rename .chanIds field in _BfxWebsocketBucket to .subscriptions. 2022-11-28 16:50:07 +01:00