Skip to content

Commit

Permalink
Merge pull request #231 from jayr0d/optional_csv_files
Browse files Browse the repository at this point in the history
Make in, out, and intra CSV files optional
  • Loading branch information
eprbell committed Apr 6, 2024
2 parents 3ef125c + d2f89f7 commit 210d2a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/configuration_file.md
Expand Up @@ -525,7 +525,7 @@ transaction age | candle used

Accuracy will improve once new CSV data is released, which is typically 2 weeks after the end of a quarter. Also, the Kraken REST API is very slow. It may take 20-30 seconds per transaction to retrieve prices for the latest quarter.

##### Note on Unified CSV File
##### Note on Unified CSV File
The unified CSV file is a CSV file that contains all the candles for all the assets on the Kraken exchange. It is used to retrieve the price for the transaction if the transaction is older than the latest quarter. The plugin will prompt you to download the unified CSV file if it is needed for the transaction. You can also manually download the file from <!-- markdown-link-check-disable -->[Kraken Exchange](https://support.kraken.com/hc/en-us/articles/360047124832-Downloadable-historical-OHLCVT-Open-High-Low-Close-Volume-Trades-data)<!-- markdown-link-check-enable --> and put it in `.dali_cache/kraken/csv/`.

### Binance Locked CCXT
Expand Down
12 changes: 6 additions & 6 deletions src/dali/plugin/input/csv/manual.py
Expand Up @@ -80,16 +80,16 @@ class InputPlugin(AbstractInputPlugin):

def __init__(
self,
in_csv_file: str,
out_csv_file: str,
intra_csv_file: str,
in_csv_file: Optional[str] = None,
out_csv_file: Optional[str] = None,
intra_csv_file: Optional[str] = None,
native_fiat: Optional[str] = None,
) -> None:
super().__init__(account_holder="", native_fiat=native_fiat)

self.__in_csv_file: str = in_csv_file
self.__out_csv_file: str = out_csv_file
self.__intra_csv_file: str = intra_csv_file
self.__in_csv_file: Optional[str] = in_csv_file
self.__out_csv_file: Optional[str] = out_csv_file
self.__intra_csv_file: Optional[str] = intra_csv_file

self.__logger: logging.Logger = create_logger(self.__MANUAL)

Expand Down
5 changes: 3 additions & 2 deletions src/dali/plugin/input/csv/trezor_v2.py
Expand Up @@ -90,8 +90,9 @@ def load(self, country: AbstractCountry) -> List[AbstractTransaction]:
self.__logger.warning("Possible dusting attack (fee > 0, total = 0), skipping transaction: %s", raw_data)
continue
if line[self.__AMOUNT_UNIT] in self._POSSIBLE_DUST_ATTACKERS:
self.__logger.warning("Possible dusting attack (amount unit %s is suspicious), skipping transaction: %s",
line[self.__AMOUNT_UNIT], raw_data)
self.__logger.warning(
"Possible dusting attack (amount unit %s is suspicious), skipping transaction: %s", line[self.__AMOUNT_UNIT], raw_data
)
continue
if transaction_type in {_RECV, _SENT}:
result.append(
Expand Down

0 comments on commit 210d2a0

Please sign in to comment.