From 525a66bcca5ee58814573d3810c0fbc02e937883 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 27 Feb 2024 15:46:45 +0100 Subject: wallet-core: types for observability --- packages/taler-wallet-core/src/wallet.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'packages/taler-wallet-core/src/wallet.ts') 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; + readonly oc: ObservabilityContext; +} + export const EXCHANGE_COINS_LOCK = "exchange-coins-lock"; export const EXCHANGE_RESERVES_LOCK = "exchange-reserves-lock"; -- cgit v1.2.3