From 0eb1e1b5a64f205c4eab8ae1a77b578e88b3aca8 Mon Sep 17 00:00:00 2001 From: Alexander Lill Date: Sat, 15 Jun 2024 14:51:07 +0200 Subject: [PATCH] Support new kraken subtypes Adds support for new types "migration" and "(de)allocation. See https://support.kraken.com/hc/en-us/articles/360001169383-How-to-interpret-Ledger-history-fields --- src/ledger_processor.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ledger_processor.py b/src/ledger_processor.py index e1c12b3..784dfac 100644 --- a/src/ledger_processor.py +++ b/src/ledger_processor.py @@ -639,7 +639,10 @@ def __is_staking_transfer(self, transaction): subtype == "spottostaking" or \ subtype == "stakingfromspot" or \ subtype == "stakingtospot" or \ - subtype == "spotfromstaking": + subtype == "spotfromstaking" or \ + subtype == "allocation" or \ + subtype == "deallocation" or \ + subtype == "migration": return True return False @@ -685,6 +688,13 @@ def _process_transaction(self, transaction_id, transaction): else: self.__print_transaction_debug_info(f"Can't process unknown case [DDT-NS] ({parsing_info}, {transaction_types}): ", transaction) return [], [] + elif parsing_info == "dup" and transaction_types == {"earn"}: + if self.__is_staking_transfer(transaction): + print(f"Ignoring staking transfer... ({parsing_info}, {transaction_types})") + return [], [] + else: + self.__print_transaction_debug_info(f"Can't process unknown case [DE-NS] ({parsing_info}, {transaction_types}): ", transaction) + return [], [] elif parsing_info == "nondup" and transaction_types == {"withdrawal"}: return self._process_fiat_withdrawal(transaction_id, transaction) else: