(self, item: dict, currency: Currency = None)
| 1575 | return self.parse_ledger(result, currency, since, limit) |
| 1576 | |
| 1577 | def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry: |
| 1578 | # |
| 1579 | # { |
| 1580 | # "id": "1951255127004282880", |
| 1581 | # "type": "TRANSFER", |
| 1582 | # "status": "COMPLETED", |
| 1583 | # "amount": "-3.0000000000000000", |
| 1584 | # "fee": "0", |
| 1585 | # "asset": 1, |
| 1586 | # "time": 1754050449502, |
| 1587 | # "accountId": 100009, |
| 1588 | # "counterpartyAccountId": 100023 |
| 1589 | # } |
| 1590 | # |
| 1591 | timestamp = self.safe_integer(item, 'time') |
| 1592 | assetId = self.safe_string(item, 'asset') |
| 1593 | code = self.get_extended_currency_code_by_id(assetId, currency) |
| 1594 | ledgerCurrency = self.safe_currency(code, currency) |
| 1595 | amountString = self.safe_string(item, 'amount') |
| 1596 | direction = None |
| 1597 | if amountString is not None: |
| 1598 | direction = 'out' if Precise.string_lt(amountString, '0') else 'in' |
| 1599 | fee = None |
| 1600 | feeCost = self.safe_string(item, 'fee') |
| 1601 | if feeCost is not None: |
| 1602 | fee = { |
| 1603 | 'currency': code, |
| 1604 | 'cost': self.parse_number(Precise.string_abs(feeCost)), |
| 1605 | } |
| 1606 | return self.safe_ledger_entry({ |
| 1607 | 'info': item, |
| 1608 | 'id': self.safe_string(item, 'id'), |
| 1609 | 'timestamp': timestamp, |
| 1610 | 'datetime': self.iso8601(timestamp), |
| 1611 | 'direction': direction, |
| 1612 | 'account': self.safe_string(item, 'accountId'), |
| 1613 | 'referenceId': self.safe_string(item, 'transactionHash'), |
| 1614 | 'referenceAccount': self.safe_string(item, 'counterpartyAccountId'), |
| 1615 | 'type': self.parse_transaction_type(self.safe_string(item, 'type')), |
| 1616 | 'currency': code, |
| 1617 | 'amount': None if (amountString is None) else self.parse_number(Precise.string_abs(amountString)), |
| 1618 | 'before': None, |
| 1619 | 'after': None, |
| 1620 | 'status': self.parse_transaction_status(self.safe_string(item, 'status')), |
| 1621 | 'fee': fee, |
| 1622 | }, ledgerCurrency) |
| 1623 | |
| 1624 | def fetch_transactions(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]: |
| 1625 | """ |
nothing calls this directly
no test coverage detected