[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: add wallet config on the top
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: add wallet config on the top |
Date: |
Wed, 19 Apr 2023 17:58:41 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 45bbe7ba1 add wallet config on the top
45bbe7ba1 is described below
commit 45bbe7ba127dc07ae06b420faca591c03402a3f5
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Apr 19 12:58:35 2023 -0300
add wallet config on the top
---
packages/taler-wallet-core/src/wallet-api-types.ts | 79 ++++++++++++----------
packages/taler-wallet-core/src/wallet.ts | 6 +-
2 files changed, 44 insertions(+), 41 deletions(-)
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts
b/packages/taler-wallet-core/src/wallet-api-types.ts
index 94348f095..e85c6ffc3 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -198,6 +198,7 @@ export enum WalletApiOperation {
}
// group: Initialization
+
type EmptyObject = Record<string, never>;
/**
* Initialize wallet-core.
@@ -216,6 +217,47 @@ export type GetVersionOp = {
response: WalletCoreVersion;
};
+/**
+ * Configurations options for the Wallet
+ *
+ * All missing values of the config will be replaced with default values
+ * Default values are defined by Wallet.getDefaultConfig()
+ */
+export type WalletConfigParameter = RecursivePartial<WalletConfig>;
+
+export interface WalletConfig {
+ /**
+ * Initialization values useful for a complete startup.
+ *
+ * These are values may be overridden by different wallets
+ */
+ builtin: {
+ exchanges: string[];
+ auditors: AuditorTrustRecord[];
+ };
+
+ /**
+ * 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;
+ };
+
+ /**
+ * Configurations values that may be safe to show to the user
+ */
+ features: {
+ batchWithdrawal: boolean;
+ allowHttp: boolean;
+ };
+}
+
// group: Basic Wallet Information
/**
@@ -965,7 +1007,7 @@ export interface WalletCoreApiClient {
type Primitives = string | number | boolean;
-export type RecursivePartial<T extends object> = {
+type RecursivePartial<T extends object> = {
[P in keyof T]?: T[P] extends Array<infer U extends object>
? Array<RecursivePartial<U>>
: T[P] extends Array<infer J extends Primitives>
@@ -974,38 +1016,3 @@ export type RecursivePartial<T extends object> = {
? RecursivePartial<T[P]>
: T[P];
} & object;
-
-export type WalletConfigParameter = RecursivePartial<WalletConfig>;
-
-export interface WalletConfig {
- /**
- * Initialization values useful for a complete startup.
- *
- * These are values may be overridden by different wallets
- */
- builtin: {
- exchanges: string[];
- auditors: AuditorTrustRecord[];
- };
-
- /**
- * 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;
- };
-
- /**
- * Configurations values that may be safe to show to the user
- */
- features: {
- batchWithdrawal: boolean;
- allowHttp: boolean;
- };
-}
diff --git a/packages/taler-wallet-core/src/wallet.ts
b/packages/taler-wallet-core/src/wallet.ts
index 45b33ce45..d554e5b83 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -270,7 +270,6 @@ import {
WALLET_MERCHANT_PROTOCOL_VERSION,
} from "./versions.js";
import {
- RecursivePartial,
WalletApiOperation,
WalletConfig,
WalletConfigParameter,
@@ -1822,10 +1821,7 @@ class InternalWalletStateImpl implements
InternalWalletState {
* @param override
* @returns
*/
-function deepMerge<T extends object>(
- full: T,
- override: RecursivePartial<T>,
-): T {
+function deepMerge<T extends object>(full: T, override: any): T {
const keys = Object.keys(full);
const result = { ...full };
for (const k of keys) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: add wallet config on the top,
gnunet <=