Skip to content

Commit 251a4c6

Browse files
committed
Support fetching all currencies ledgers
1 parent d536297 commit 251a4c6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,22 @@ def get_trades_history(
232232

233233
def get_ledgers(
234234
self,
235-
currency: str,
235+
currency: Optional[str] = None,
236236
*,
237237
category: Optional[int] = None,
238238
start: Optional[str] = None,
239239
end: Optional[str] = None,
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)