diff options
author | Florian Dold <florian@dold.me> | 2024-02-27 15:46:45 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-02-27 15:46:45 +0100 |
commit | 525a66bcca5ee58814573d3810c0fbc02e937883 (patch) | |
tree | 44b14f7b7cd8f61faad73ed0bc7c47aee9f9b2f0 /packages/taler-wallet-core | |
parent | 11f36c77a1e5722cab5459fbf4ec6752781e84c8 (diff) | |
download | wallet-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')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 17 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/withdraw.ts | 5 |
2 files changed, 17 insertions, 5 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"; diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index 25c1e5129..541525c6b 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -1975,11 +1975,6 @@ export async function getWithdrawalDetailsForUri( 2, )}`, ); - ws.notify({ - type: NotificationType.WithdrawalOperationTransition, - operationId: info.operationId, - state: resp.type === "fail" ? info.status : resp.body.status, - }); ongoingChecks[talerWithdrawUri] = false; }); } |