diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-01-20 12:00:57 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-01-20 12:00:57 +0100 |
commit | b837fd7f53d885601a8c5f668da233b240387638 (patch) | |
tree | a3719210835316a947530aabc70bcc95261594ff /src/operations/history.ts | |
parent | c5906abf106d22cc35b8facdda4313b6125160b9 (diff) | |
download | wallet-core-b837fd7f53d885601a8c5f668da233b240387638.tar.xz |
be verbose for refreshes too
Diffstat (limited to 'src/operations/history.ts')
-rw-r--r-- | src/operations/history.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/operations/history.ts b/src/operations/history.ts index 54874f64f..97e3269e8 100644 --- a/src/operations/history.ts +++ b/src/operations/history.ts @@ -37,6 +37,7 @@ import { ReserveCreationDetail, VerbosePayCoinDetails, VerboseWithdrawDetails, + VerboseRefreshDetails, } from "../types/history"; import { assertUnreachable } from "../util/assertUnreachable"; import { TransactionHandle, Store } from "../util/query"; @@ -329,6 +330,31 @@ export async function getHistory( } else { amountRefreshedEffective = Amounts.sum(amountsEffective).amount; } + const outputCoins: { + value: string; + denomPub: string, + }[] = []; + for (const rs of rg.refreshSessionPerCoin) { + if (!rs) { + continue; + } + for (const nd of rs.newDenoms) { + if (!nd) { + continue; + } + const d = await tx.get(Stores.denominations, [rs.exchangeBaseUrl, nd]); + if (!d) { + continue; + } + outputCoins.push({ + denomPub: d.denomPub, + value: Amounts.toString(d.value), + }); + } + } + const verboseDetails: VerboseRefreshDetails = { + outputCoins: outputCoins, + } history.push({ type: HistoryEventType.Refreshed, refreshGroupId: rg.refreshGroupId, @@ -340,6 +366,7 @@ export async function getHistory( numInputCoins, numOutputCoins, numRefreshedInputCoins, + verboseDetails, }); }); |