Skip to content

Commit ecf290f

Browse files
authored
Merge pull request #11 from Bubblyworld/master
Add sequence field to trades
2 parents 28183d0 + 0cf3029 commit ecf290f

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

luno_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.0.3'
1+
VERSION = '0.0.4'

luno_python/client.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,12 @@ def list_transactions(self, id, max_row, min_row):
429429
}
430430
return self.do('GET', '/api/1/accounts/{id}/transactions', req=req, auth=True)
431431

432-
def list_user_trades(self, pair, limit=None, since=None):
432+
def list_user_trades(self, pair, after_seq=None, before=None, before_seq=None, limit=None, since=None, sort_desc=None):
433433
"""Makes a call to GET /api/1/listtrades.
434434
435435
Returns a list of your recent trades for a given pair, sorted by oldest
436-
first.
436+
first. If <code>before</code> is specified, then the trades are returned
437+
sorted by most-recent first.
437438
438439
<code>type</code> in the response indicates the type of order that you placed
439440
in order to participate in the trade. Possible types: <code>BID</code>,
@@ -448,15 +449,30 @@ def list_user_trades(self, pair, limit=None, since=None):
448449
449450
:param pair: Filter to trades of this currency pair.
450451
:type pair: str
452+
:param after_seq: Filter to trades from (including) this sequence number.
453+
Default behaviour is not to include this filter.
454+
:type after_seq: int
455+
:param before: Filter to trades before this timestamp.
456+
:type before: int
457+
:param before_seq: Filter to trades before (excluding) this sequence number.
458+
Default behaviour is not to include this filter.
459+
:type before_seq: int
451460
:param limit: Limit to this number of trades (default 100).
452461
:type limit: int
453462
:param since: Filter to trades on or after this timestamp.
454463
:type since: int
464+
:param sort_desc: If set to true, sorts trades in descending order, otherwise ascending
465+
order will be assumed.
466+
:type sort_desc: bool
455467
"""
456468
req = {
457469
'pair': pair,
470+
'after_seq': after_seq,
471+
'before': before,
472+
'before_seq': before_seq,
458473
'limit': limit,
459474
'since': since,
475+
'sort_desc': sort_desc,
460476
}
461477
return self.do('GET', '/api/1/listtrades', req=req, auth=True)
462478

@@ -570,7 +586,7 @@ def send(self, address, amount, currency, description=None, message=None):
570586
If the email address is not associated with an existing Luno account, an
571587
invitation to create an account and claim the funds will be sent.
572588
573-
Warning! Digital currency transactions are irreversible. Please ensure your
589+
Warning! Cryptocurrency transactions are irreversible. Please ensure your
574590
program has been thoroughly tested before using this call.
575591
576592
Permissions required: <code>Perm_W_Send</code>

0 commit comments

Comments
 (0)