(self, item: dict, currency: Currency = None)
| 1645 | return self.parse_order_book(response, market['symbol'], None, 'bids', 'asks', 'price', 'size') |
| 1646 | |
| 1647 | def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry: |
| 1648 | # |
| 1649 | # { |
| 1650 | # "id": "6a6075bc-7183-5fd9-bc9d-894e238aa527", |
| 1651 | # "sender": { |
| 1652 | # "address": "dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art", |
| 1653 | # "subaccountNumber": 0 |
| 1654 | # }, |
| 1655 | # "recipient": { |
| 1656 | # "address": "dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0", |
| 1657 | # "subaccountNumber": 1 |
| 1658 | # }, |
| 1659 | # "size": "0.000001", |
| 1660 | # "createdAt": "2025-07-29T09:43:02.105Z", |
| 1661 | # "createdAtHeight": "45116125", |
| 1662 | # "symbol": "USDC", |
| 1663 | # "type": "TRANSFER_OUT", |
| 1664 | # "transactionHash": "92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF" |
| 1665 | # } |
| 1666 | # |
| 1667 | currencyId = self.safe_string(item, 'symbol') |
| 1668 | code = self.safe_currency_code(currencyId, currency) |
| 1669 | currency = self.safe_currency(currencyId, currency) |
| 1670 | type = self.safe_string_upper(item, 'type') |
| 1671 | direction = None |
| 1672 | if type is not None: |
| 1673 | if type == 'TRANSFER_IN' or type == 'DEPOSIT': |
| 1674 | direction = 'in' |
| 1675 | elif type == 'TRANSFER_OUT' or type == 'WITHDRAWAL': |
| 1676 | direction = 'out' |
| 1677 | amount = self.safe_string(item, 'size') |
| 1678 | timestamp = self.parse8601(self.safe_string(item, 'createdAt')) |
| 1679 | sender = self.safe_dict(item, 'sender') |
| 1680 | recipient = self.safe_dict(item, 'recipient') |
| 1681 | return self.safe_ledger_entry({ |
| 1682 | 'info': item, |
| 1683 | 'id': self.safe_string(item, 'id'), |
| 1684 | 'direction': direction, |
| 1685 | 'account': self.safe_string(sender, 'address'), |
| 1686 | 'referenceAccount': self.safe_string(recipient, 'address'), |
| 1687 | 'referenceId': self.safe_string(item, 'transactionHash'), |
| 1688 | 'type': self.parse_ledger_entry_type(type), |
| 1689 | 'currency': code, |
| 1690 | 'amount': self.parse_number(amount), |
| 1691 | 'timestamp': timestamp, |
| 1692 | 'datetime': self.iso8601(timestamp), |
| 1693 | 'before': None, |
| 1694 | 'after': None, |
| 1695 | 'status': None, |
| 1696 | 'fee': None, |
| 1697 | }, currency) |
| 1698 | |
| 1699 | def parse_ledger_entry_type(self, type): |
| 1700 | ledgerType = { |
nothing calls this directly
no test coverage detected