From 18e998316893239b115b9ed947598ed4c31e3e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louise=20Linn=C3=A9?= Date: Mon, 25 Sep 2023 15:58:57 +0200 Subject: [PATCH] Specify UBI payouts in export for personal wallets --- src/utils/fileExports.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/utils/fileExports.js b/src/utils/fileExports.js index 2cffca25..5984c6b8 100644 --- a/src/utils/fileExports.js +++ b/src/utils/fileExports.js @@ -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; @@ -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}`; });