be verbose for refreshes too
This commit is contained in:
parent
c5906abf10
commit
b837fd7f53
@ -37,6 +37,7 @@ import {
|
|||||||
ReserveCreationDetail,
|
ReserveCreationDetail,
|
||||||
VerbosePayCoinDetails,
|
VerbosePayCoinDetails,
|
||||||
VerboseWithdrawDetails,
|
VerboseWithdrawDetails,
|
||||||
|
VerboseRefreshDetails,
|
||||||
} from "../types/history";
|
} from "../types/history";
|
||||||
import { assertUnreachable } from "../util/assertUnreachable";
|
import { assertUnreachable } from "../util/assertUnreachable";
|
||||||
import { TransactionHandle, Store } from "../util/query";
|
import { TransactionHandle, Store } from "../util/query";
|
||||||
@ -329,6 +330,31 @@ export async function getHistory(
|
|||||||
} else {
|
} else {
|
||||||
amountRefreshedEffective = Amounts.sum(amountsEffective).amount;
|
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({
|
history.push({
|
||||||
type: HistoryEventType.Refreshed,
|
type: HistoryEventType.Refreshed,
|
||||||
refreshGroupId: rg.refreshGroupId,
|
refreshGroupId: rg.refreshGroupId,
|
||||||
@ -340,6 +366,7 @@ export async function getHistory(
|
|||||||
numInputCoins,
|
numInputCoins,
|
||||||
numOutputCoins,
|
numOutputCoins,
|
||||||
numRefreshedInputCoins,
|
numRefreshedInputCoins,
|
||||||
|
verboseDetails,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -466,12 +466,11 @@ export interface HistoryPaymentAbortedEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface VerbosePayCoinDetails {
|
export interface VerbosePayCoinDetails {
|
||||||
coins:
|
coins: {
|
||||||
{
|
value: string;
|
||||||
value: string,
|
contribution: string;
|
||||||
contribution: string;
|
denomPub: string;
|
||||||
denomPub: string;
|
}[];
|
||||||
}[],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -549,6 +548,13 @@ export interface HistoryRefunded {
|
|||||||
amountRefundedEffective: string;
|
amountRefundedEffective: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface VerboseRefreshDetails {
|
||||||
|
outputCoins: {
|
||||||
|
denomPub: string;
|
||||||
|
value: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event to indicate that a group of refresh sessions has completed.
|
* Event to indicate that a group of refresh sessions has completed.
|
||||||
*/
|
*/
|
||||||
@ -583,6 +589,8 @@ export interface HistoryRefreshedEvent {
|
|||||||
* more refresh session IDs.
|
* more refresh session IDs.
|
||||||
*/
|
*/
|
||||||
refreshGroupId: string;
|
refreshGroupId: string;
|
||||||
|
|
||||||
|
verboseDetails: VerboseRefreshDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VerboseWithdrawDetails {
|
export interface VerboseWithdrawDetails {
|
||||||
|
Loading…
Reference in New Issue
Block a user