fetch a history of internal transfers made on an account https://www.bitrue.com/api-docs#get-future-account-transfer-history-list-user_data-hmac-sha256 https://www.bitrue.com/api_docs_includes_file/delivery.html#get-future-account-transfer-history-list-user_data-hmac-sha256
(self, code: Str = None, since: Int = None, limit: Int = None, params={})
| 2889 | } |
| 2890 | |
| 2891 | def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]: |
| 2892 | """ |
| 2893 | fetch a history of internal transfers made on an account |
| 2894 | |
| 2895 | https://www.bitrue.com/api-docs#get-future-account-transfer-history-list-user_data-hmac-sha256 |
| 2896 | https://www.bitrue.com/api_docs_includes_file/delivery.html#get-future-account-transfer-history-list-user_data-hmac-sha256 |
| 2897 | |
| 2898 | :param str code: unified currency code of the currency transferred |
| 2899 | :param int [since]: the earliest time in ms to fetch transfers for |
| 2900 | :param int [limit]: the maximum number of transfers structures to retrieve |
| 2901 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 2902 | :param int [params.until]: the latest time in ms to fetch transfers for |
| 2903 | :param str [params.type]: transfer type wallet_to_contract or contract_to_wallet |
| 2904 | :returns dict[]: a list of `transfer structures <https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure>` |
| 2905 | """ |
| 2906 | self.load_markets() |
| 2907 | type = self.safe_string_2(params, 'type', 'transferType') |
| 2908 | request = { |
| 2909 | 'transferType': type, |
| 2910 | } |
| 2911 | currency = None |
| 2912 | if code is not None: |
| 2913 | currency = self.currency(code) |
| 2914 | request['coinSymbol'] = currency['id'] |
| 2915 | if since is not None: |
| 2916 | request['beginTime'] = since |
| 2917 | if limit is not None: |
| 2918 | if limit > 200: |
| 2919 | limit = 200 |
| 2920 | request['limit'] = limit |
| 2921 | until = self.safe_integer(params, 'until') |
| 2922 | if until is not None: |
| 2923 | params = self.omit(params, 'until') |
| 2924 | request['endTime'] = until |
| 2925 | response = self.fapiV2PrivateGetFuturesTransferHistory(self.extend(request, params)) |
| 2926 | # |
| 2927 | # { |
| 2928 | # 'code': '0', |
| 2929 | # 'msg': 'Success', |
| 2930 | # 'data': [{ |
| 2931 | # 'transferType': 'wallet_to_contract', |
| 2932 | # 'symbol': 'USDT', |
| 2933 | # 'amount': 1.0, |
| 2934 | # 'status': 1, |
| 2935 | # 'ctime': 1685404575000 |
| 2936 | # }] |
| 2937 | # } |
| 2938 | # |
| 2939 | data = self.safe_list(response, 'data', []) |
| 2940 | return self.parse_transfers(data, currency, since, limit) |
| 2941 | |
| 2942 | def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry: |
| 2943 | """ |
nothing calls this directly
no test coverage detected