def phone_withdrawal(self, amount=None, first_names=None, last_names=None, phone_number=None, bank_code=None): """Triggers a withdrawal from your account to a phone number. (Phone number must be registered for SPEI Transfers with their corresponding bank) These withdrawals are immediate during banking hours for some banks (M-F 9:00AM - 5:00PM Mexico City Time), 24 hours for others. Args: amount (str): The amount of MXN to withdraw from your account recipient_given_names (str): The recipient's first and middle name(s) recipient_family_names (str): The recipient's last names clabe (str): The CLABE number where the funds will be sent to https://en.wikipedia.org/wiki/CLABE notes_ref (str): The alpha-numeric reference number for this SPEI numeric_ref (str): The numeric reference for this SPEI Returns: ok """ url = '%s/phone_withdrawal/' % self.base_url parameters = {} parameters['amount'] = str(amount).encode('utf-8') parameters['recipient_given_names'] = first_names parameters['recipient_family_names'] = last_names parameters['phone_number'] = phone_number parameters['bank_code'] = bank_code resp = self._request_url(url, 'POST', params=parameters, private=True) return Withdrawal._NewFromJsonDict(resp['payload'])
def withdrawals(self, wids=[], marker=None, limit=25, sort='desc'): """Get the ledger of user operations Args: wids (list, optional): Specifies which withdrawal objects to return marker (str, optional): Returns objects that are older or newer (depending on 'sort') than the object which has the marker value as ID limit (int, optional): Limit the number of results to parameter value, max=100, default=25 sort (str, optional): Sorting by datetime: 'asc', 'desc' Defuault is 'desc' Returns: A list bitso.Withdrawal instances. """ if isinstance(wids, basestring): wids = [wids] url = '%s/withdrawals/' % (self.base_url) if wids: url+='%s/' % ('-'.join(wids)) parameters = {} if marker: parameters['marker'] = marker if limit: parameters['limit'] = limit if sort: parameters['sort'] = sort resp = self._request_url(url, 'GET', params=parameters, private=True) return [Withdrawal._NewFromJsonDict(entry) for entry in resp['payload']]
def eth_withdrawal(self, amount, address): """Triggers an ether withdrawal from your account Args: amount (str): The amount of BTC to withdraw from your account address (str): The Bitcoin address to send the amount to Returns: ok """ url = '%s/ether_withdrawal/' % self.base_url parameters = {} parameters['amount'] = str(amount).encode('utf-8') parameters['address'] = address resp = self._request_url(url, 'POST', params=parameters, private=True) return Withdrawal._NewFromJsonDict(resp['payload'])
def ripple_withdrawal(self, currency, amount, address): """Triggers a ripple withdrawal from your account Args: currency (str): The currency to withdraw amount (str): The amount of BTC to withdraw from your account address (str): The ripple address to send the amount to Returns: ok """ url = '%s/ripple_withdrawal/' % self.base_url parameters = {} parameters['currency'] = str(currency).encode('utf-8') parameters['amount'] = str(amount).encode('utf-8') parameters['address'] = address resp = self._request_url(url, 'POST', params=parameters, private=True) return Withdrawal._NewFromJsonDict(resp['payload'])