fetch history of deposits, withdrawals, and transfers https://api.docs.extended.exchange/#get-deposits-withdrawals-transfers-history :param str [code]: unified currency code :param int [since]: the earliest time in ms to fetch transactions for :param int [l
(self, code: Str = None, since: Int = None, limit: Int = None, params={})
| 1622 | }, ledgerCurrency) |
| 1623 | |
| 1624 | def fetch_transactions(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]: |
| 1625 | """ |
| 1626 | fetch history of deposits, withdrawals, and transfers |
| 1627 | |
| 1628 | https://api.docs.extended.exchange/#get-deposits-withdrawals-transfers-history |
| 1629 | |
| 1630 | :param str [code]: unified currency code |
| 1631 | :param int [since]: the earliest time in ms to fetch transactions for |
| 1632 | :param int [limit]: the maximum number of transaction structures to retrieve |
| 1633 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1634 | :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| 1635 | :returns Transaction[]: a list of `transaction structures <https://docs.ccxt.com/?id=transaction-structure>` |
| 1636 | """ |
| 1637 | self.load_markets() |
| 1638 | paginate = False |
| 1639 | paginate, params = self.handle_option_and_params(params, 'fetchTransactions', 'paginate') |
| 1640 | if paginate: |
| 1641 | return self.fetch_paginated_call_cursor('fetchTransactions', code, since, limit, params, 'cursor', 'cursor', None, 50) |
| 1642 | currency = None |
| 1643 | if code is not None: |
| 1644 | currency = self.currency(code) |
| 1645 | request = {} |
| 1646 | if limit is not None: |
| 1647 | request['limit'] = limit |
| 1648 | response = self.v1PrivateGetUserAssetOperations(self.extend(request, params)) |
| 1649 | # |
| 1650 | # { |
| 1651 | # "status": "OK", |
| 1652 | # "data": [ |
| 1653 | # { |
| 1654 | # "id": "1951255127004282880", |
| 1655 | # "type": "TRANSFER", |
| 1656 | # "status": "COMPLETED", |
| 1657 | # "amount": "-3.0000000000000000", |
| 1658 | # "fee": "0", |
| 1659 | # "asset": 1, |
| 1660 | # "time": 1754050449502, |
| 1661 | # "accountId": 100009, |
| 1662 | # "counterpartyAccountId": 100023 |
| 1663 | # } |
| 1664 | # ], |
| 1665 | # "pagination": { |
| 1666 | # "cursor": 1951255127004282880, |
| 1667 | # "count": 1 |
| 1668 | # } |
| 1669 | # } |
| 1670 | # |
| 1671 | data = self.safe_list(response, 'data', []) |
| 1672 | pagination = self.safe_dict(response, 'pagination', {}) |
| 1673 | cursor = self.safe_string(pagination, 'cursor') |
| 1674 | result = [] |
| 1675 | dataLength = len(data) |
| 1676 | for i in range(0, dataLength): |
| 1677 | entry = data[i] |
| 1678 | if (cursor is not None) and (i == dataLength - 1): |
| 1679 | entry = self.extend(entry, {'cursor': cursor}) |
| 1680 | result.append(entry) |
| 1681 | return self.parse_transactions(result, currency, since, limit) |
no test coverage detected