Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions luno_python/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def create_account(self, currency, name):

Users must be verified to trade currency in order to be able to create an Account. For more information on the verification process, please see <a href="/help/en/articles/1000168396">How do I verify my identity?</a>.

Users have a limit of 4 accounts per currency.
Users have a limit of 10 accounts per currency.
:type currency: str
:param name: The label to use for this account
:type name: str
Expand Down Expand Up @@ -202,9 +202,6 @@ def get_move(self, client_move_id=None, id=None):
<code>client_move_id</code>. If both are provided an API error will be
returned.

This endpoint is in BETA, behaviour and specification may change without
any previous notice.

Permissions required: <code>MP_None</code>

:param client_move_id: Get by the user defined ID. This is mutually exclusive with <code>id</code> and is required if <code>id</code> is
Expand Down Expand Up @@ -369,9 +366,6 @@ def list_moves(self, before=None, limit=None):
Returns a list of the most recent moves ordered from newest to oldest.
This endpoint will list up to 100 most recent moves by default.

This endpoint is in BETA, behaviour and specification may change without
any previous notice.

Permissions required: <code>MP_None</code>

:param before: Filter to moves requested before this timestamp (Unix milliseconds)
Expand Down Expand Up @@ -523,9 +517,6 @@ def list_transfers(self, account_id, before=None, limit=None):
until you have all the transfers you need.
This endpoint will list up to 100 transfers at a time by default.

This endpoint is in BETA, behaviour and specification may change without
any previous notice.

Permissions required: <Code>Perm_R_Transfers</Code>

:param account_id: Unique identifier of the account to list the transfers from.
Expand Down Expand Up @@ -629,9 +620,6 @@ def move(self, amount, credit_account_id, debit_account_id, client_move_id=None)

Note: moves will show as transactions, but not as transfers.

This endpoint is in BETA, behaviour and specification may change without
any previous notice.

Permissions required: <code>MP_None_Write</code>

:param amount: Amount to transfer. Must be positive.
Expand Down Expand Up @@ -782,7 +770,7 @@ def post_market_order(self, pair, type, base_account_id=None, base_volume=None,
}
return self.do('POST', '/api/1/marketorder', req=req, auth=True)

def send(self, address, amount, currency, description=None, destination_tag=None, external_id=None, forex_notice_self_declaration=None, has_destination_tag=None, is_drb=None, is_forex_send=None, message=None):
def send(self, address, amount, currency, description=None, destination_tag=None, external_id=None, forex_notice_self_declaration=None, has_destination_tag=None, is_drb=None, is_forex_send=None, memo=None, message=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the order of arguments for these two functions within our control, or controlled by the generator?

My Python is a little rusty, (and assuming this is public) but if someone is calling this function already with send(x,y,z...,message), when they use this new version they'll be calling memo with the message arg, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the sdk generator - I hope nobody is using positional arguments with python for optional params and instead should be using named ones but I take your point. However outside of changing the sdkgen (and it appears like use of this client) I'm not sure exactly what I can do as it appears to be ordering parameters alphabetically

"""Makes a call to POST /api/1/send.

Send assets from an Account. Please note that the asset type sent must match the receive address of the same cryptocurrency of the same type - Bitcoin to Bitcoin, Ethereum to Ethereum, etc.
Expand Down Expand Up @@ -822,6 +810,9 @@ def send(self, address, amount, currency, description=None, destination_tag=None
:type is_drb: bool
:param is_forex_send: Only required for Foreign Exchange Notification under the Malaysia FEN rules. IsForexSend must be true if sending to an address hosted outside of Malaysia.
:type is_forex_send: bool
:param memo: Optional memo string used to provide account information for ATOM, etc. where it holds "account" information
for a generic address.
:type memo: str
:param message: Message to send to the recipient.
This is only relevant when sending to an email address.
:type message: str
Expand All @@ -837,6 +828,7 @@ def send(self, address, amount, currency, description=None, destination_tag=None
'has_destination_tag': has_destination_tag,
'is_drb': is_drb,
'is_forex_send': is_forex_send,
'memo': memo,
'message': message,
}
return self.do('POST', '/api/1/send', req=req, auth=True)
Expand Down Expand Up @@ -907,7 +899,7 @@ def update_account_name(self, id, name):
}
return self.do('PUT', '/api/1/accounts/{id}/name', req=req, auth=True)

def validate(self, address, currency, address_name=None, beneficiary_name=None, country=None, date_of_birth=None, destination_tag=None, has_destination_tag=None, institution_name=None, is_legal_entity=None, is_private_wallet=None, is_self_send=None, nationality=None, physical_address=None, wallet_name=None):
def validate(self, address, currency, address_name=None, beneficiary_name=None, country=None, date_of_birth=None, destination_tag=None, has_destination_tag=None, institution_name=None, is_legal_entity=None, is_private_wallet=None, is_self_send=None, memo=None, nationality=None, physical_address=None, wallet_name=None):
"""Makes a call to POST /api/1/address/validate.

Validate receive addresses, to which a customer wishes to make cryptocurrency sends, are verified under covering
Expand Down Expand Up @@ -952,6 +944,9 @@ def validate(self, address, currency, address_name=None, beneficiary_name=None,
If this field is true then the remaining omitempty fields should not
be populated.
:type is_self_send: bool
:param memo: Optional memo string used to provide account information for ATOM, etc. where it holds "account" information
for a generic address.
:type memo: str
:param nationality: Nationality ISO 3166-1 country code of the nationality of the (non-institutional) beneficial owner of the address
:type nationality: str
:param physical_address: PhysicalAddress is the legal physical address of the beneficial owner of the crypto address
Expand All @@ -972,6 +967,7 @@ def validate(self, address, currency, address_name=None, beneficiary_name=None,
'is_legal_entity': is_legal_entity,
'is_private_wallet': is_private_wallet,
'is_self_send': is_self_send,
'memo': memo,
'nationality': nationality,
'physical_address': physical_address,
'wallet_name': wallet_name,
Expand Down