Skip to content

Commit

Permalink
Specify UBI payouts in export for personal wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
louilinn committed Sep 25, 2023
1 parent 324820d commit 18e9983
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/utils/fileExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import core from '~/services/core';
import resolveTxHash from '~/services/transfer';
import resolveUsernames from '~/services/username';
import web3 from '~/services/web3';
import { ZERO_ADDRESS } from '~/utils/constants';
import { formatCirclesValue } from '~/utils/format';

const NUMBER_OF_DECIMALS = 2;
Expand Down Expand Up @@ -110,10 +111,16 @@ const formatTransactions = async (transactions, safeAddress) => {

// construct csv transaction
return transactionData.map((data, index) => {
data.name = namesBySafe[data.otherSafe]
? namesBySafe[data.otherSafe].username
: '-';
data.paymentNote = `"${notes[index].replaceAll('"', '""')}"`;
if (data.otherSafe === ZERO_ADDRESS) {
// UBI transaction
data.name = 'CirclesUBI';
data.paymentNote = 'UBI payout';
} else {
data.name = namesBySafe[data.otherSafe]
? namesBySafe[data.otherSafe].username
: '-';
data.paymentNote = `"${notes[index].replaceAll('"', '""')}"`;
}

return `${data.date};${data.name};${data.otherSafe};${data.paymentNote};${data.amount}`;
});
Expand Down

0 comments on commit 18e9983

Please sign in to comment.