aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/exchanges.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-03-07 12:09:38 +0100
committerFlorian Dold <florian@dold.me>2022-03-07 12:09:38 +0100
commit0290c5fd379a4b4262d8835d4131b7c4e8a2f2f2 (patch)
tree233cbe5e18925339daedfaffb2882d390b3479a5 /packages/taler-wallet-core/src/operations/exchanges.ts
parent2cfefa93920eba7bc4bfa3ca788a7bcf74c149f5 (diff)
downloadwallet-core-0290c5fd379a4b4262d8835d4131b7c4e8a2f2f2.tar.xz
address protocol changes in the exchange
The exchange now has a wad fee and truncates the payto hash in signatures
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index c50afc215..9d4a56fff 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -266,6 +266,7 @@ async function validateWireInfo(
sig: x.sig,
startStamp,
wireFee: Amounts.parseOrThrow(x.wire_fee),
+ wadFee: Amounts.parseOrThrow(x.wad_fee),
};
let isValid = false;
if (ws.insecureTrustExchange) {
@@ -451,7 +452,8 @@ export async function downloadTosFromAcceptedFormat(
ws: InternalWalletState,
baseUrl: string,
timeout: Duration,
- acceptedFormat?: string[]): Promise<ExchangeTosDownloadResult> {
+ acceptedFormat?: string[],
+): Promise<ExchangeTosDownloadResult> {
let tosFound: ExchangeTosDownloadResult | undefined;
//Remove this when exchange supports multiple content-type in accept header
if (acceptedFormat)
@@ -467,7 +469,7 @@ export async function downloadTosFromAcceptedFormat(
break;
}
}
- if (tosFound !== undefined) return tosFound
+ if (tosFound !== undefined) return tosFound;
// If none of the specified format was found try text/plain
return await downloadExchangeWithTermsOfService(
baseUrl,
@@ -550,8 +552,12 @@ async function updateExchangeFromUrlImpl(
logger.info("finished validating exchange /wire info");
-
- const tosDownload = await downloadTosFromAcceptedFormat(ws, baseUrl, timeout, acceptedFormat)
+ const tosDownload = await downloadTosFromAcceptedFormat(
+ ws,
+ baseUrl,
+ timeout,
+ acceptedFormat,
+ );
let recoupGroupId: string | undefined;