Skip to content

Commit

Permalink
applies changes to sign
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabib committed Dec 5, 2024
1 parent 3a03919 commit 991265c
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import { formatTokenV2 } from "$lib/utils/token.utils";
import { replacePlaceholders } from "$lib/utils/i18n.utils";
import { AccountTransactionType } from "$lib/types/transaction";

Check warning on line 30 in frontend/src/lib/components/header/ExportIcpTransactionsButton.svelte

View workflow job for this annotation

GitHub Actions / svelte-lint

'AccountTransactionType' is defined but never used. Allowed unused vars must match /^_/u
import { transactionFee } from "$lib/api/icp-ledger.api";

Check warning on line 31 in frontend/src/lib/components/header/ExportIcpTransactionsButton.svelte

View workflow job for this annotation

GitHub Actions / svelte-lint

'transactionFee' is defined but never used. Allowed unused vars must match /^_/u
const dispatcher = createEventDispatcher<{
nnsExportIcpTransactionsCsvTriggered: void;
Expand Down Expand Up @@ -100,15 +101,20 @@
},
],
data: transactions.map((transaction) => {
const { to, from, type, tokenAmount, timestampNanos } =
mapIcpTransactionToReport({
accountIdentifier: account.identifier,
transaction,
neuronAccounts,
swapCanisterAccounts: $swapCanisterAccountsStore ?? new Set(),
});
const amountsSymbol =
type === AccountTransactionType.Receive ? "+" : "-";
const {
to,
from,
type,
tokenAmount,
timestampNanos,
transactionDirection,
} = mapIcpTransactionToReport({
accountIdentifier: account.identifier,
transaction,
neuronAccounts,
swapCanisterAccounts: $swapCanisterAccountsStore ?? new Set(),
});
const sign = transactionDirection === "credit" ? "+" : "-";
const amount = formatTokenV2({ value: tokenAmount, detailed: true });
return {
Expand All @@ -118,7 +124,7 @@
to,
from,
type: transactionName({ type, i18n: $i18n }),
amount: `${amountsSymbol}${amount}`,
amount: `${sign}${amount}`,
timestamp:
timestampNanos !== undefined
? nanoSecondsToDateTime(timestampNanos)
Expand Down

0 comments on commit 991265c

Please sign in to comment.