aboutsummaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-11 13:48:44 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-11 13:48:44 +0100
commit58983d7455dd0529be0b7e6ba599845956c75ea4 (patch)
treeef8816e298d4c4d144dfe11044457763ab4be7af /src/exchange
parente682f4213e4798593fcbc39b778d231be35bf6f9 (diff)
add asset_type to /keys response
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/exchange.conf8
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c18
2 files changed, 26 insertions, 0 deletions
diff --git a/src/exchange/exchange.conf b/src/exchange/exchange.conf
index 30e5b0b9..d662cdd0 100644
--- a/src/exchange/exchange.conf
+++ b/src/exchange/exchange.conf
@@ -47,6 +47,14 @@ BASE_URL = http://localhost:8081/
# How long should the aggregator sleep if it has nothing to do?
AGGREGATOR_IDLE_SLEEP_INTERVAL = 60 s
+# What type of asset is the exchange managing? Used to adjust
+# the user-interface of the wallet.
+# Possibilities include: "fiat", "regional" and "crypto".
+# In the future (and already permitted but not yet supported by wallets)
+# we also expect to have "stock" and "future" (and more).
+# Default is "fiat".
+ASSET_TYPE = "fiat"
+
# FIXME: document!
ROUTER_IDLE_SLEEP_INTERVAL = 60 s
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index b37c68d9..b11832e7 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -457,6 +457,11 @@ static struct GNUNET_SCHEDULER_Task *keys_tt;
static struct GNUNET_TIME_Relative signkey_legal_duration;
/**
+ * What type of asset are we dealing with here?
+ */
+static char *asset_type;
+
+/**
* RSA security module public key, all zero if not known.
*/
static struct TALER_SecurityModulePublicKeyP denom_rsa_sm_pub;
@@ -1279,6 +1284,17 @@ TEH_keys_init ()
"SIGNKEY_LEGAL_DURATION");
return GNUNET_SYSERR;
}
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (TEH_cfg,
+ "exchange",
+ "ASSET_TYPE",
+ &asset_type))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
+ "exchange",
+ "ASSET_TYPE");
+ asset_type = GNUNET_strdup ("fiat");
+ }
keys_eh = TEH_plugin->event_listen (TEH_plugin->cls,
GNUNET_TIME_UNIT_FOREVER_REL,
&es,
@@ -1856,6 +1872,8 @@ create_krd (struct TEH_KeyStateHandle *ksh,
TEH_base_url),
GNUNET_JSON_pack_string ("currency",
TEH_currency),
+ GNUNET_JSON_pack_string ("asset_type",
+ asset_type),
GNUNET_JSON_pack_data_auto ("master_public_key",
&TEH_master_public_key),
GNUNET_JSON_pack_time_rel ("reserve_closing_delay",