aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-04-28 23:42:14 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-04-28 23:42:14 +0200
commit89067a16dd9958d2d868090ef1d14a6512a0e68b (patch)
tree80c9d4583ad74e7faefef85e58aa7e0540a0f594 /src
parentd6bf24902a34f2094363121c8d9f4d54db6f7b6c (diff)
downloadwallet-core-89067a16dd9958d2d868090ef1d14a6512a0e68b.tar.xz
show earliest deposit expiration when withdrawing
Diffstat (limited to 'src')
-rw-r--r--src/pages/confirm-create-reserve.tsx3
-rw-r--r--src/types.ts1
-rw-r--r--src/wallet.ts9
3 files changed, 12 insertions, 1 deletions
diff --git a/src/pages/confirm-create-reserve.tsx b/src/pages/confirm-create-reserve.tsx
index 6b618c273..2f341bb4e 100644
--- a/src/pages/confirm-create-reserve.tsx
+++ b/src/pages/confirm-create-reserve.tsx
@@ -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">
diff --git a/src/types.ts b/src/types.ts
index 4707edd95..e357dfa26 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -253,6 +253,7 @@ export interface ReserveCreationInfo {
wireFees: ExchangeWireFeesRecord;
isAudited: boolean;
isTrusted: boolean;
+ earliestDepositExpiration: number;
}
diff --git a/src/wallet.ts b/src/wallet.ts
index bc3cd59fc..4c44b5d24 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -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;