Skip to content

Commit 2679822

Browse files
authored
Merge pull request #12 from ShiraazMoollatjie/luno-external-id
Add external_id
2 parents ecf290f + 88081c0 commit 2679822

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

luno_python/client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def create_quote(self, base_amount, pair, type, base_account_id=None, counter_ac
116116
}
117117
return self.do('POST', '/api/1/quotes', req=req, auth=True)
118118

119-
def create_withdrawal(self, amount, type, beneficiary_id=None, reference=None):
119+
def create_withdrawal(self, amount, type, beneficiary_id=None, external_id=None, reference=None):
120120
"""Makes a call to POST /api/1/withdrawals.
121121
122122
Creates a new withdrawal request.
@@ -132,13 +132,18 @@ def create_withdrawal(self, amount, type, beneficiary_id=None, reference=None):
132132
bank account beneficiary ID can be found by clicking on the beneficiary
133133
name on the <a href="/wallet/beneficiaries">Beneficiaries</a> page.
134134
:type beneficiary_id: str
135+
:param external_id: Optional unique ID to associate with this withdrawal. Useful to prevent
136+
duplicate sends in case of failure. It supports all alphanumeric
137+
characters, as well as "-" and "_".
138+
:type external_id: str
135139
:param reference: For internal use.
136140
:type reference: str
137141
"""
138142
req = {
139143
'amount': amount,
140144
'type': type,
141145
'beneficiary_id': beneficiary_id,
146+
'external_id': external_id,
142147
'reference': reference,
143148
}
144149
return self.do('POST', '/api/1/withdrawals', req=req, auth=True)
@@ -577,7 +582,7 @@ def post_market_order(self, pair, type, base_account_id=None, base_volume=None,
577582
}
578583
return self.do('POST', '/api/1/marketorder', req=req, auth=True)
579584

580-
def send(self, address, amount, currency, description=None, message=None):
585+
def send(self, address, amount, currency, description=None, external_id=None, message=None):
581586
"""Makes a call to POST /api/1/send.
582587
583588
Send Bitcoin from your account to a Bitcoin address or email address. Send
@@ -607,6 +612,10 @@ def send(self, address, amount, currency, description=None, message=None):
607612
:type currency: str
608613
:param description: Description for the transaction to record on the account statement.
609614
:type description: str
615+
:param external_id: Optional unique ID to associate with this withdrawal. Useful to prevent
616+
duplicate sends in case of failure. It supports all alphanumeric
617+
characters, as well as "-" and "_".
618+
:type external_id: str
610619
:param message: Message to send to the recipient. This is only relevant when sending to
611620
an email address.
612621
:type message: str
@@ -616,6 +625,7 @@ def send(self, address, amount, currency, description=None, message=None):
616625
'amount': amount,
617626
'currency': currency,
618627
'description': description,
628+
'external_id': external_id,
619629
'message': message,
620630
}
621631
return self.do('POST', '/api/1/send', req=req, auth=True)

0 commit comments

Comments
 (0)