From 277a5c641df336d8b5b2d9bd6559e45f0b02aa79 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 29 Feb 2024 18:37:13 +0100 Subject: wallet-core: improve config handling, test builtin exchange config --- packages/taler-util/src/wallet-types.ts | 52 ++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 19bebfb19..4fb9b77e7 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -462,10 +462,60 @@ export interface GetCurrencySpecificationResponse { currencySpecification: CurrencySpecification; } +export interface BuiltinExchange { + exchangeBaseUrl: string; + currencyHint?: string; +} + +export interface PartialWalletRunConfig { + builtin?: Partial; + testing?: Partial; + features?: Partial; +} + +export interface WalletRunConfig { + /** + * Initialization values useful for a complete startup. + * + * These are values may be overridden by different wallets + */ + builtin: { + exchanges: BuiltinExchange[]; + }; + + /** + * Unsafe options which it should only be used to create + * testing environment. + */ + testing: { + /** + * Allow withdrawal of denominations even though they are about to expire. + */ + denomselAllowLate: boolean; + devModeActive: boolean; + insecureTrustExchange: boolean; + preventThrottling: boolean; + skipDefaults: boolean; + emitObservabilityEvents?: boolean; + }; + + /** + * Configurations values that may be safe to show to the user + */ + features: { + allowHttp: boolean; + }; +} + export interface InitRequest { - skipDefaults?: boolean; + config?: PartialWalletRunConfig; } +export const codecForInitRequest = (): Codec => + buildCodecForObject() + .property("config", codecForAny()) + .build("InitRequest"); + export interface InitResponse { versionInfo: WalletCoreVersion; } -- cgit v1.2.3