Skip to content

Commit

Permalink
Support new kraken subtypes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AlexanderLill committed Jun 15, 2024
1 parent 9b56dd1 commit 0eb1e1b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ledger_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0eb1e1b

Please sign in to comment.