aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/exchanges.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-10-12 15:58:10 -0300
committerSebastian <sebasjm@gmail.com>2022-10-12 15:58:10 -0300
commit610df1c9cf8ec91815130ac2a426f8f5b7d1ed0c (patch)
tree826f37de26f433c0842f6e5a793c454b60824fa8 /packages/taler-wallet-core/src/operations/exchanges.ts
parentcb44202440313ea4405fbc74f4588144134a0821 (diff)
downloadwallet-core-610df1c9cf8ec91815130ac2a426f8f5b7d1ed0c.tar.xz
create a fee description timeline for global fee and wire fees
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts19
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index a26c14fcc..3da16e303 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -30,6 +30,7 @@ import {
encodeCrock,
ExchangeAuditor,
ExchangeDenomination,
+ ExchangeGlobalFees,
ExchangeSignKeyJson,
ExchangeWireJson,
GlobalFees,
@@ -274,7 +275,8 @@ async function validateGlobalFees(
ws: InternalWalletState,
fees: GlobalFees[],
masterPub: string,
-): Promise<GlobalFees[]> {
+): Promise<ExchangeGlobalFees[]> {
+ const egf: ExchangeGlobalFees[] = [];
for (const gf of fees) {
logger.trace("validating exchange global fees");
let isValid = false;
@@ -291,9 +293,22 @@ async function validateGlobalFees(
if (!isValid) {
throw Error("exchange global fees signature invalid: " + gf.master_sig);
}
+ egf.push({
+ accountFee: Amounts.parseOrThrow(gf.account_fee),
+ historyFee: Amounts.parseOrThrow(gf.history_fee),
+ purseFee: Amounts.parseOrThrow(gf.purse_fee),
+ kycFee: Amounts.parseOrThrow(gf.kyc_fee),
+ startDate: gf.start_date,
+ endDate: gf.end_date,
+ signature: gf.master_sig,
+ historyTimeout: gf.history_expiration,
+ kycTimeout: gf.account_kyc_timeout,
+ purseLimit: gf.purse_account_limit,
+ purseTimeout: gf.purse_timeout,
+ });
}
- return fees;
+ return egf;
}
export interface ExchangeInfo {