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

Method fetch_withdrawals

python/ccxt/bybit.py:5704–5780  ·  view source on GitHub ↗

fetch all withdrawals made from an account https://bybit-exchange.github.io/docs/v5/asset/withdraw-record :param str code: unified currency code :param int [since]: the earliest time in ms to fetch withdrawals for :param int [limit]: the maximum number of w

(self, code: Str = None, since: Int = None, limit: Int = None, params={})

Source from the content-addressed store, hash-verified

5702 return self.parse_transactions(data, currency, since, limit)
5703
5704 def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5705 """
5706 fetch all withdrawals made from an account
5707
5708 https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
5709
5710 :param str code: unified currency code
5711 :param int [since]: the earliest time in ms to fetch withdrawals for
5712 :param int [limit]: the maximum number of withdrawals structures to retrieve
5713 :param dict [params]: extra parameters specific to the exchange API endpoint
5714 :param int [params.until]: the latest time in ms to fetch entries for
5715 :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5716 :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/?id=transaction-structure>`
5717 """
5718 self.load_markets()
5719 paginate = False
5720 paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
5721 if paginate:
5722 return self.fetch_paginated_call_cursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
5723 request = {
5724 # 'coin': currency['id'],
5725 # 'limit': 20, # max 50
5726 # 'cusor': '',
5727 }
5728 currency = None
5729 if code is not None:
5730 currency = self.currency(code)
5731 request['coin'] = currency['id']
5732 if since is not None:
5733 request['startTime'] = since
5734 if limit is not None:
5735 request['limit'] = limit
5736 request, params = self.handle_until_option('endTime', request, params)
5737 response = self.privateGetV5AssetWithdrawQueryRecord(self.extend(request, params))
5738 #
5739 # {
5740 # "retCode": 0,
5741 # "retMsg": "success",
5742 # "result": {
5743 # "rows": [
5744 # {
5745 # "coin": "USDT",
5746 # "chain": "ETH",
5747 # "amount": "77",
5748 # "txID": "",
5749 # "status": "SecurityCheck",
5750 # "toAddress": "0x99ced129603abc771c0dabe935c326ff6c86645d",
5751 # "tag": "",
5752 # "withdrawFee": "10",
5753 # "createTime": "1670922217000",
5754 # "updateTime": "1670922217000",
5755 # "withdrawId": "9976",
5756 # "withdrawType": 0
5757 # },
5758 # {
5759 # "coin": "USDT",
5760 # "chain": "ETH",
5761 # "amount": "26",

Callers

nothing calls this directly

Calls 9

handle_until_optionMethod · 0.80
parse_transactionsMethod · 0.80
load_marketsMethod · 0.45
currencyMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected