aboutsummaryrefslogtreecommitdiff
path: root/src/kyclogic
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-09-01 17:37:00 +0200
committerChristian Grothoff <christian@grothoff.org>2024-09-01 17:37:00 +0200
commit0188860eddca95d80d2253c7e2893daf3b3d6dca (patch)
treeb6cc9c5ab4b9d3aad7fd7fe9bdabadd1d2e87345 /src/kyclogic
parent6996910aeee8fad4f0d249590b46570d514d2eb3 (diff)
introduce zero_limits for #9039/#9040 to signal clients that they must do KYC before even attempting to work with an exchange
Diffstat (limited to 'src/kyclogic')
-rw-r--r--src/kyclogic/kyclogic_api.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
index 5f5b45f92..16cd16c72 100644
--- a/src/kyclogic/kyclogic_api.c
+++ b/src/kyclogic/kyclogic_api.c
@@ -3585,4 +3585,37 @@ TALER_KYCLOGIC_get_hard_limits ()
}
+json_t *
+TALER_KYCLOGIC_get_zero_limits ()
+{
+ const struct TALER_KYCLOGIC_KycRule *rules
+ = default_rules.kyc_rules;
+ unsigned int num_rules
+ = default_rules.num_kyc_rules;
+ json_t *zero_limits;
+
+ zero_limits = json_array ();
+ GNUNET_assert (NULL != zero_limits);
+ for (unsigned int i = 0; i<num_rules; i++)
+ {
+ const struct TALER_KYCLOGIC_KycRule *rule = &rules[i];
+ json_t *zero_limit;
+
+ if (! rule->exposed)
+ continue;
+ if (rule->verboten)
+ continue; /* see: hard_limits */
+ if (! TALER_amount_is_zero (&rule->threshold))
+ continue;
+ zero_limit = GNUNET_JSON_PACK (
+ TALER_JSON_pack_kycte ("operation_type",
+ rule->trigger));
+ GNUNET_assert (0 ==
+ json_array_append_new (zero_limits,
+ zero_limit));
+ }
+ return zero_limits;
+}
+
+
/* end of kyclogic_api.c */