aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-09-05 10:04:56 -0300
committerSebastian <sebasjm@gmail.com>2022-09-05 13:04:31 -0300
commite0e33a88db7641775de16f5425bfc08e461a4f75 (patch)
tree678c656c07e0940706d71c06a5bb6650fee2a8c8 /packages/taler-wallet-core/src/wallet.ts
parent4a0512884d27f9cf576af00f5a58191b1d189188 (diff)
downloadwallet-core-e0e33a88db7641775de16f5425bfc08e461a4f75.tar.gz
wallet-core-e0e33a88db7641775de16f5425bfc08e461a4f75.tar.bz2
wallet-core-e0e33a88db7641775de16f5425bfc08e461a4f75.zip
adding informantion about the service worker version on the setting page
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index b3fee6bff..688985521 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -86,6 +86,7 @@ import {
TalerErrorCode,
URL,
WalletNotification,
+ WalletCoreVersion,
} from "@gnu-taler/taler-util";
import { TalerCryptoInterface } from "./crypto/cryptoImplementation.js";
import {
@@ -206,6 +207,7 @@ import {
} from "./util/promiseUtils.js";
import { DbAccess, GetReadWriteAccess } from "./util/query.js";
import { TimerAPI, TimerGroup } from "./util/timer.js";
+import { WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, WALLET_EXCHANGE_PROTOCOL_VERSION, WALLET_MERCHANT_PROTOCOL_VERSION } from "./versions.js";
import { WalletCoreApiClient } from "./wallet-api-types.js";
const builtinAuditors: AuditorTrustRecord[] = [
@@ -714,6 +716,11 @@ export async function getClientFromWalletState(
return client;
}
+declare const __VERSION__: string;
+declare const __GIT_HASH__: string;
+
+const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "dev";
+const GIT_HASH = typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined;
/**
* Implementation of the "wallet-core" API.
*/
@@ -1064,6 +1071,16 @@ async function dispatchRequestInternal(
await acceptPeerPullPayment(ws, req);
return {};
}
+ case "getVersion": {
+ const version: WalletCoreVersion = {
+ hash: GIT_HASH,
+ version: VERSION,
+ exchange: WALLET_EXCHANGE_PROTOCOL_VERSION,
+ merchant: WALLET_MERCHANT_PROTOCOL_VERSION,
+ bank: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
+ }
+ return version;
+ }
}
throw TalerError.fromDetail(
TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN,