From e5d0abb07ce2c513a341f208d025c6ef488f0d38 Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Thu, 14 Nov 2024 05:51:56 +0100 Subject: [PATCH 1/4] Add extras_require setting to setup.py. --- README.md | 5 +++++ setup.py | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0edadc3..9a0604a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,11 @@ Official implementation of the [Bitfinex APIs (V2)](https://docs.bitfinex.com/do python3 -m pip install bitfinex-api-py ``` +If you intend to use mypy type hints in your project, use: +```console +python3 -m pip install bitfinex-api-py[typing] +``` + --- # Quickstart diff --git a/setup.py b/setup.py index 3862d96..0d82da9 100644 --- a/setup.py +++ b/setup.py @@ -45,9 +45,12 @@ setup( "pyee~=11.1.0", "websockets~=12.0", "requests~=2.32.3", - "types-requests~=2.31.0.10", - "types-urllib3~=1.26.25.14", ], + extras_require={ + "typing": [ + "types-requests~=2.32.0.20241016", + ] + }, python_requires=">=3.8", package_data={"bfxapi": ["py.typed"]}, ) From a57c0d81e0b4c7ac11d3e1b3f3c18522af9d8480 Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Thu, 14 Nov 2024 05:55:06 +0100 Subject: [PATCH 2/4] Add support for endpoint: GET /auth/r/ledgets/hist. --- bfxapi/rest/_interfaces/rest_auth_endpoints.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bfxapi/rest/_interfaces/rest_auth_endpoints.py b/bfxapi/rest/_interfaces/rest_auth_endpoints.py index 8b01f45..ad3b806 100644 --- a/bfxapi/rest/_interfaces/rest_auth_endpoints.py +++ b/bfxapi/rest/_interfaces/rest_auth_endpoints.py @@ -232,18 +232,23 @@ class RestAuthEndpoints(Interface): def get_ledgers( self, - currency: str, + currency: Optional[str] = None, *, category: Optional[int] = None, start: Optional[str] = None, end: Optional[str] = None, limit: Optional[int] = None, ) -> List[Ledger]: + if currency is None: + endpoint = "auth/r/ledgers/hist" + else: + endpoint = f"auth/r/ledgers/{currency}/hist" + body = {"category": category, "start": start, "end": end, "limit": limit} return [ serializers.Ledger.parse(*sub_data) - for sub_data in self._m.post(f"auth/r/ledgers/{currency}/hist", body=body) + for sub_data in self._m.post(endpoint, body=body) ] def get_base_margin_info(self) -> BaseMarginInfo: From 9bc89249c2a38d3d9572a00ea501d6f5852eeaa2 Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Thu, 14 Nov 2024 06:03:00 +0100 Subject: [PATCH 3/4] Add support to python 3.13. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 0d82da9..eb92415 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ setup( "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], keywords="bitfinex,api,trading", project_urls={ From 07c1d632411915146eb9bb03d9e36757399f3d4b Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Thu, 14 Nov 2024 06:03:29 +0100 Subject: [PATCH 4/4] Bump __version__ in file bfxapi/_version.py to v3.0.5. --- bfxapi/_version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bfxapi/_version.py b/bfxapi/_version.py index 8e10cb4..e94f36f 100644 --- a/bfxapi/_version.py +++ b/bfxapi/_version.py @@ -1 +1 @@ -__version__ = "3.0.4" +__version__ = "3.0.5" diff --git a/setup.py b/setup.py index eb92415..cc928e0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name="bitfinex-api-py", - version="3.0.4", + version="3.0.5", description="Official Bitfinex Python API", long_description=( "A Python reference implementation of the Bitfinex API "