show earliest deposit expiration when withdrawing

This commit is contained in:
Florian Dold 2017-04-28 23:42:14 +02:00
parent d6bf24902a
commit 89067a16dd
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
3 changed files with 12 additions and 1 deletions

View File

@ -194,6 +194,7 @@ function renderReserveCreationDetails(rci: ReserveCreationInfo|null) {
<h3>Overview</h3>
<p>{i18n.str`Withdrawal fees: ${withdrawFeeStr}`}</p>
<p>{i18n.str`Rounding loss: ${overheadStr}`}</p>
<p>{i18n.str`Earliest expiration (for deposit): ${moment.unix(rci.earliestDepositExpiration).fromNow()}`}</p>
<h3>Coin Fees</h3>
<table className="pure-table">
<thead>
@ -439,7 +440,7 @@ class ExchangeSelection extends ImplicitStateComponent<ExchangeSelectionProps> {
{i18n.str`Change Exchange Provider`}
</button>
<br/>
<Collapsible initiallyCollapsed={true} title="Fee Details">
<Collapsible initiallyCollapsed={true} title="Fee and Spending Details">
{renderReserveCreationDetails(this.reserveCreationInfo())}
</Collapsible>
<Collapsible initiallyCollapsed={true} title="Auditor Details">

View File

@ -253,6 +253,7 @@ export interface ReserveCreationInfo {
wireFees: ExchangeWireFeesRecord;
isAudited: boolean;
isTrusted: boolean;
earliestDepositExpiration: number;
}

View File

@ -1377,6 +1377,14 @@ export class Wallet {
let {isTrusted, isAudited} = await this.getExchangeTrust(exchangeInfo);
let earliestDepositExpiration = Infinity;;
for (let denom of selectedDenoms) {
let expireDeposit = getTalerStampSec(denom.stampExpireDeposit)!;
if (expireDeposit < earliestDepositExpiration) {
earliestDepositExpiration = expireDeposit;
}
}
let ret: ReserveCreationInfo = {
exchangeInfo,
selectedDenoms,
@ -1385,6 +1393,7 @@ export class Wallet {
isAudited,
isTrusted,
withdrawFee: acc,
earliestDepositExpiration,
overhead: Amounts.sub(amount, actualCoinCost).amount,
};
return ret;