Skip to content

Commit d712ebf

Browse files
Add limit parameter to transactions endpoint (#75)
* transaction: add limit param for transactions endpoint * transaction: limit limit to 100 * transaction: min not max for limiting limit param --------- Co-authored-by: tommy bowles <tommy.bowles@disguise.one>
1 parent add556f commit d712ebf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

monzo/endpoints/transaction.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ def fetch(
517517
since: Optional[datetime] = None,
518518
before: Optional[datetime] = None,
519519
expand=None,
520+
limit=30
520521
) -> List[Transaction]:
521522
"""
522523
Fetch a list of transaction.
@@ -543,6 +544,8 @@ def fetch(
543544
data['since'] = format_date(since)
544545
if before:
545546
data['before'] = format_date(before)
547+
if limit:
548+
data['limit'] = min(limit, 100)
546549
path = '/transactions'
547550
res = auth.make_request(path=path, data=data)
548551
transactions = []

0 commit comments

Comments
 (0)