Skip to content

Commit

Permalink
Bugfix with breaking change
Browse files Browse the repository at this point in the history
A few transaction ware not imported correctly if u choosed to use the fiat valuation from cake. I recomend to re-import everything with this new version.

As allwas, make a CoinTracking backup before, then delete all Cake data and re-import them afterwards.
  • Loading branch information
geldmacher committed Apr 30, 2022
1 parent 5338265 commit 64fffd9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cake-to-cointracking-converter",
"version": "5.2.0",
"version": "6.0.0",
"description": "CLI script to translate Cake export data to a valid CoinTracking import",
"main": "./processCsv.js",
"scripts": {
Expand Down
18 changes: 9 additions & 9 deletions services/generateCtRecordsFromCakeDataRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ const generateCtRecordsFromCakeDataRow = (row, translatedCtTypes, useCtFiatValua
data['Trade-Group'] = 'Liquidity Mining';
data['Buy Currency'] = row['Buy Coin/Asset'];
data['Buy Amount'] = row['Buy Amount'].replace('-','');
data['Buy Value in your Account Currency'] = useCtFiatValuation ? row['Buy FIAT value'].replace('-','') : '';
data['Buy Value in your Account Currency'] = useCtFiatValuation ? '' : row['Buy FIAT value'].replace('-','');
data['Sell Currency'] = row['Sell Coin/Asset'];
data['Sell Amount'] = row['Sell Amount'].replace('-','');
data['Sell Value in your Account Currency'] = useCtFiatValuation ? row['Sell FIAT value'].replace('-','') : '';
data['Sell Value in your Account Currency'] = useCtFiatValuation ? '' : row['Sell FIAT value'].replace('-','');
break;
case 'Freezer liquidity mining bonus':
data['Type'] = translatedCtTypes.income;
Expand All @@ -62,37 +62,37 @@ const generateCtRecordsFromCakeDataRow = (row, translatedCtTypes, useCtFiatValua
data['Trade-Group'] = 'Swap';
data['Buy Currency'] = row['Buy Coin/Asset'];
data['Buy Amount'] = row['Buy Amount'].replace('-','');
data['Buy Value in your Account Currency'] = useCtFiatValuation ? row['Buy FIAT value'].replace('-','') : '';
data['Buy Value in your Account Currency'] = useCtFiatValuation ? '' : row['Buy FIAT value'].replace('-','');
data['Sell Currency'] = row['Sell Coin/Asset'];
data['Sell Amount'] = row['Sell Amount'].replace('-','');
data['Sell Value in your Account Currency'] = useCtFiatValuation ? row['Sell FIAT value'].replace('-','') : '';
data['Sell Value in your Account Currency'] = useCtFiatValuation ? '' : row['Sell FIAT value'].replace('-','');
break;
case 'Swap trade (DeFiChain DEX)': // Custom operation (@see ./augmentDexSwapRecords.js)
data['Type'] = translatedCtTypes.trade;
data['Trade-Group'] = 'Swap';
data['Buy Currency'] = row['Buy Coin/Asset'];
data['Buy Amount'] = row['Buy Amount'].replace('-','');
data['Buy Value in your Account Currency'] = useCtFiatValuation ? row['Buy FIAT value'].replace('-','') : '';
data['Buy Value in your Account Currency'] = useCtFiatValuation ? '' : row['Buy FIAT value'].replace('-','');
data['Sell Currency'] = row['Sell Coin/Asset'];
data['Sell Amount'] = row['Sell Amount'].replace('-','');
data['Sell Value in your Account Currency'] = useCtFiatValuation ? row['Sell FIAT value'].replace('-','') : '';
data['Sell Value in your Account Currency'] = useCtFiatValuation ? '' : row['Sell FIAT value'].replace('-','');
break;
case 'Swap trade fee (DeFiChain DEX)': // Custom operation (@see ./augmentDexSwapRecords.js)
data['Type'] = translatedCtTypes.other_fee;
data['Trade-Group'] = 'Swap';
data['Sell Currency'] = row['Sell Coin/Asset'];
data['Sell Amount'] = row['Sell Amount'].replace('-','');
data['Sell Value in your Account Currency'] = useCtFiatValuation ? row['Sell FIAT value'].replace('-','') : '';
data['Sell Value in your Account Currency'] = useCtFiatValuation ? '' : row['Sell FIAT value'].replace('-','');
break;
case 'Discount trade': // Custom operation (@see ./augmentDiscountRecords.js)
data['Type'] = translatedCtTypes.trade;
data['Trade-Group'] = 'Discount';
data['Buy Currency'] = row['Buy Coin/Asset'];
data['Buy Amount'] = row['Buy Amount'].replace('-','');
data['Buy Value in your Account Currency'] = useCtFiatValuation ? row['Buy FIAT value'].replace('-','') : '';
data['Buy Value in your Account Currency'] = useCtFiatValuation ? '' : row['Buy FIAT value'].replace('-','');
data['Sell Currency'] = row['Sell Coin/Asset'];
data['Sell Amount'] = row['Sell Amount'].replace('-','');
data['Sell Value in your Account Currency'] = useCtFiatValuation ? row['Sell FIAT value'].replace('-','') : '';
data['Sell Value in your Account Currency'] = useCtFiatValuation ? '' : row['Sell FIAT value'].replace('-','');
break;
case 'Deposit':
// Deposit operations with a reference ID are handled via DeFiChain DEX
Expand Down

0 comments on commit 64fffd9

Please sign in to comment.