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/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/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 @@ def get_trades_history( 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: diff --git a/setup.py b/setup.py index 3862d96..cc928e0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ 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 " @@ -23,6 +23,7 @@ "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={ @@ -45,9 +46,12 @@ "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"]}, )