Skip to content

Conversation

@FrancoETrujillo
Copy link

Plugin to process transactions exported from the Crypto.com app.
I did my best to map the transactions correctly, but could have misinterpreted any of them.

@FrancoETrujillo
Copy link
Author

Since Crypto.com tax was deprecated. I created this plugin for my use case and wanted to share in case it is of value for the project.

@eprbell
Copy link
Owner

eprbell commented Apr 4, 2025

Thanks! Appreciate the contribution. We'll review it soon.

Copy link
Owner

@eprbell eprbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good: just a few minor nits.

@@ -0,0 +1,248 @@
import math
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the Copyright/Apache license header to this file.

) -> None:
super().__init__(account_holder=account_holder, native_fiat=native_fiat)
self.__in_csv_file: Optional[str] = in_csv_file
self.__logger: logging.Logger = create_logger(self.__CRYPTO_COM_APP)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Append account holder to log name.

):
self.raw_data = raw_data
self.timestamp = time
self.abs_float_amount = abs(float(amount))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use RP2Decimal instead of float throughout the file to avoid precision problems.

assert result.asset == "CRO"
assert result.timestamp == "2022-03-31 00:03:00+0000"
assert result.transaction_type.lower() == Keyword.INCOME.value.lower()
assert math.isclose(float(result.crypto_in), float(transaction.amount), rel_tol=1e-9)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After switching to RP2Decimal, use is_equal_within_precision instead of isclose (seej https://github.com/eprbell/rp2/blob/main/src/rp2/out_transaction.py#L99). Same thing in the rest of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants