aboutsummaryrefslogtreecommitdiff
path: root/src/wallet-impl/reserves.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet-impl/reserves.ts')
-rw-r--r--src/wallet-impl/reserves.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet-impl/reserves.ts b/src/wallet-impl/reserves.ts
index c9cd10ca2..d70f02576 100644
--- a/src/wallet-impl/reserves.ts
+++ b/src/wallet-impl/reserves.ts
@@ -502,6 +502,8 @@ async function depleteReserve(
const withdrawalSessionId = encodeCrock(randomBytes(32));
+ const totalCoinValue = Amounts.sum(denomsForWithdraw.map(x => x.value)).amount;
+
const withdrawalRecord: WithdrawalSessionRecord = {
withdrawSessionId: withdrawalSessionId,
exchangeBaseUrl: reserve.exchangeBaseUrl,
@@ -509,15 +511,14 @@ async function depleteReserve(
type: "reserve",
reservePub: reserve.reservePub,
},
- withdrawalAmount: Amounts.toString(withdrawAmount),
+ rawWithdrawalAmount: withdrawAmount,
startTimestamp: getTimestampNow(),
denoms: denomsForWithdraw.map(x => x.denomPub),
withdrawn: denomsForWithdraw.map(x => false),
planchets: denomsForWithdraw.map(x => undefined),
+ totalCoinValue,
};
- const totalCoinValue = Amounts.sum(denomsForWithdraw.map(x => x.value))
- .amount;
const totalCoinWithdrawFee = Amounts.sum(
denomsForWithdraw.map(x => x.feeWithdraw),
).amount;