diff options
author | uvok | 2025-04-15 13:34:53 +0200 |
---|---|---|
committer | uvok | 2025-04-15 13:34:53 +0200 |
commit | d86d0ecaddc27b85053758fab55c3f72562dfd2a (patch) | |
tree | 515cf16dbcbc2c2e1e8d041622a02af1bb09a89f | |
parent | 206c2fe18c322e94c3f0a18bee981c14b2a0cd56 (diff) |
Documentation
-rw-r--r-- | ledger_action.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ledger_action.py b/ledger_action.py index 751d6b8..952692b 100644 --- a/ledger_action.py +++ b/ledger_action.py @@ -1,9 +1,23 @@ from dataclasses import dataclass from decimal import Decimal -from typing import Optional @dataclass class LedgerAction: + """ + A structured representation of a ledger row for cryptocurrency transactions. + + The `LedgerAction` class encapsulates details of each action recorded in the ledger, + whether it's a deposit, trade, or other types of transactions. + + Attributes: + type (str): The type of action, e.g., "trade" or "deposit". + asset (str): The cryptocurrency or fiat asset associated with the action. + amount (Decimal): The amount involved in the action. Positive for deposits, negative for withdrawals. + fee (Decimal): The transaction fee (if applicable). + date (str): The date of the action in string format (typically "YYYY-MM-DD"). + refid (str): A reference ID used to group related rows (e.g., EUR-crypto trades). + """ + type: str asset: str amount: Decimal |