Skip to content

Commit 7f157ee

Browse files
committed
Support fetching all currencies ledgers
1 parent d536297 commit 7f157ee

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ This repository includes a pre-commit configuration file that defines the follow
342342

343343
To set up pre-commit use:
344344
```console
345-
python3 -m pre-commit install
345+
python3 -m pre_commit install
346346
```
347347

348348
These will ensure that isort, black and flake8 are run on each git commit.
@@ -353,7 +353,7 @@ These will ensure that isort, black and flake8 are run on each git commit.
353353

354354
You can also manually trigger the execution of all hooks with:
355355
```console
356-
python3 -m pre-commit run --all-files
356+
python3 -m pre_commit run --all-files
357357
```
358358

359359
## Before opening a PR

bfxapi/rest/_interfaces/rest_auth_endpoints.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,14 @@ def get_ledgers(
240240
limit: Optional[int] = None,
241241
) -> List[Ledger]:
242242
body = {"category": category, "start": start, "end": end, "limit": limit}
243+
if currency:
244+
endpoint = "auth/r/ledgers/{currency}/hist"
245+
else:
246+
endpoint = "auth/r/ledgers/hist"
243247

244248
return [
245249
serializers.Ledger.parse(*sub_data)
246-
for sub_data in self._m.post(f"auth/r/ledgers/{currency}/hist", body=body)
250+
for sub_data in self._m.post(endpoint, body=body)
247251
]
248252

249253
def get_base_margin_info(self) -> BaseMarginInfo:

0 commit comments

Comments
 (0)