diff options
author | Florian Dold <florian@dold.me> | 2024-02-29 18:37:13 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-02-29 23:24:06 +0100 |
commit | 277a5c641df336d8b5b2d9bd6559e45f0b02aa79 (patch) | |
tree | 49cbdadaf04b5630cdae3e2a89e6d3a74d30632b /packages/taler-util/src | |
parent | 206780bb0ee763bcf50a3f4f9f78579a8adcdb3a (diff) | |
download | wallet-core-277a5c641df336d8b5b2d9bd6559e45f0b02aa79.tar.gz wallet-core-277a5c641df336d8b5b2d9bd6559e45f0b02aa79.tar.bz2 wallet-core-277a5c641df336d8b5b2d9bd6559e45f0b02aa79.zip |
wallet-core: improve config handling, test builtin exchange config
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 52 |
1 files changed, 51 insertions, 1 deletions
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<WalletRunConfig["builtin"]>; + testing?: Partial<WalletRunConfig["testing"]>; + features?: Partial<WalletRunConfig["features"]>; +} + +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<InitRequest> => + buildCodecForObject<InitRequest>() + .property("config", codecForAny()) + .build("InitRequest"); + export interface InitResponse { versionInfo: WalletCoreVersion; } |