summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-27 15:46:45 +0100
committerFlorian Dold <florian@dold.me>2024-02-27 15:46:45 +0100
commit525a66bcca5ee58814573d3810c0fbc02e937883 (patch)
tree44b14f7b7cd8f61faad73ed0bc7c47aee9f9b2f0 /packages/taler-wallet-core/src/wallet.ts
parent11f36c77a1e5722cab5459fbf4ec6752781e84c8 (diff)
downloadwallet-core-525a66bcca5ee58814573d3810c0fbc02e937883.tar.gz
wallet-core-525a66bcca5ee58814573d3810c0fbc02e937883.tar.bz2
wallet-core-525a66bcca5ee58814573d3810c0fbc02e937883.zip
wallet-core: types for observability
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 bab054f4b..779eefe26 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -27,6 +27,7 @@ import {
AmountString,
Amounts,
AsyncCondition,
+ CancellationToken,
CoinDumpJson,
CoinStatus,
CoreApiResponse,
@@ -41,6 +42,7 @@ import {
ListGlobalCurrencyAuditorsResponse,
ListGlobalCurrencyExchangesResponse,
Logger,
+ ObservabilityContext,
OpenedPromise,
PrepareWithdrawExchangeRequest,
PrepareWithdrawExchangeResponse,
@@ -269,6 +271,21 @@ import {
const logger = new Logger("wallet.ts");
+/**
+ * Execution context for code that is run in the wallet.
+ *
+ * Typically the excecution context is either for a wallet-core
+ * request handler or for a shepherded task.
+ */
+export interface WalletExecutionContext {
+ readonly ws: InternalWalletState;
+ readonly cryptoApi: TalerCryptoInterface;
+ readonly cancellationToken: CancellationToken;
+ readonly http: HttpRequestLibrary;
+ readonly db: DbAccess<typeof WalletStoresV1>;
+ readonly oc: ObservabilityContext;
+}
+
export const EXCHANGE_COINS_LOCK = "exchange-coins-lock";
export const EXCHANGE_RESERVES_LOCK = "exchange-reserves-lock";