MCPcopy Create free account
hub / github.com/ccxt/ccxt / withdraw

Method withdraw

python/ccxt/foxbit.py:1461–1496  ·  view source on GitHub ↗

Make a withdrawal. https://docs.foxbit.com.br/rest/v3/#tag/Withdrawal/operation/WithdrawalsController_createWithdrawal :param str code: unified currency code :param float amount: the amount to withdraw :param str address: the address to withdraw to

(self, code: str, amount: float, address: str, tag: Str = None, params={})

Source from the content-addressed store, hash-verified

1459 return self.parse_order(response['create'], market)
1460
1461 def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1462 """
1463 Make a withdrawal.
1464
1465 https://docs.foxbit.com.br/rest/v3/#tag/Withdrawal/operation/WithdrawalsController_createWithdrawal
1466
1467 :param str code: unified currency code
1468 :param float amount: the amount to withdraw
1469 :param str address: the address to withdraw to
1470 :param str tag:
1471 :param dict [params]: extra parameters specific to the exchange API endpoint
1472 :returns dict: a `transaction structure <https://docs.ccxt.com/?id=transaction-structure>`
1473 """
1474 tag, params = self.handle_withdraw_tag_and_params(tag, params)
1475 self.load_markets()
1476 currency = self.currency(code)
1477 request = {
1478 'currency_symbol': currency['id'],
1479 'amount': self.number_to_string(amount),
1480 'destination_address': address,
1481 }
1482 if tag is not None:
1483 request['destination_tag'] = tag
1484 networkCode = None
1485 networkCode, params = self.handle_network_code_and_params(params)
1486 if networkCode is not None:
1487 request['network_code'] = self.network_code_to_id(networkCode, code)
1488 response = self.v3PrivatePostWithdrawals(self.extend(request, params))
1489 # {
1490 # "amount": "2",
1491 # "currency_symbol": "xrp",
1492 # "network_code": "ripple",
1493 # "destination_address": "0x1234567890123456789012345678",
1494 # "destination_tag": "123456"
1495 # }
1496 return self.parse_transaction(response)
1497
1498 def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1499 """

Callers

nothing calls this directly

Calls 8

parse_transactionMethod · 0.95
load_marketsMethod · 0.45
currencyMethod · 0.45
network_code_to_idMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected