commit 7faa13dc25d469fccd54cc5632cbffc740028de0
parent 0e228171141035740e25f1d73b472b986132304d
Author: Florian Dold <florian@dold.me>
Date: Tue, 20 Aug 2024 17:10:03 +0200
dynamically read currency from config in sample AML measure program
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/kyclogic/taler-exchange-helper-measure-test-form b/src/kyclogic/taler-exchange-helper-measure-test-form
@@ -95,12 +95,16 @@ echo "$J" >> /dev/null
# New rules apply for 30 days.
EXPIRATION=$((3600 * 30 + $(date +%s)))
+# Read currency from the config
+CURRENCY=$(taler-config -c $CONF -s taler -o currency)
+
# Finally, output the new rules.
# See https://docs.taler.net/taler-exchange-manual.html#tsref-type-AmlOutcome
# for the required output format.
jq -n \
--argjson expiration "$EXPIRATION" \
+ --arg currency "$CURRENCY" \
'{ "to_investigate": false,
"new_rules" : {
"new_check" : "info-oauth-test-passed",
@@ -108,7 +112,7 @@ jq -n \
"rules" : [
{
"operation_type": "WITHDRAW",
- "threshold" : "EUR:1000",
+ "threshold" : "\($currency):1000",
"timeframe" : { "d_us" : 3600000000 },
"measures" : [ "verboten" ],
"display_priority" : 1,
@@ -117,7 +121,7 @@ jq -n \
},
{
"operation_type": "DEPOSIT",
- "threshold" : "EUR:1000",
+ "threshold" : "\($currency):1000",
"timeframe" : { "d_us" : 3600000000 },
"measures" : [ "verboten" ],
"display_priority" : 1,
@@ -126,7 +130,7 @@ jq -n \
},
{
"operation_type": "AGGREGATE",
- "threshold" : "EUR:1000",
+ "threshold" : "\($currency):1000",
"timeframe" : { "d_us" : 3600000000 },
"measures" : [ "verboten" ],
"display_priority" : 1,
@@ -135,7 +139,7 @@ jq -n \
},
{
"operation_type": "MERGE",
- "threshold" : "EUR:1000",
+ "threshold" : "\($currency):1000",
"timeframe" : { "d_us" : 3600000000 },
"measures" : [ "verboten" ],
"display_priority" : 1,
@@ -144,7 +148,7 @@ jq -n \
},
{
"operation_type": "BALANCE",
- "threshold" : "EUR:1000",
+ "threshold" : "\($currency):1000",
"timeframe" : { "d_us" : 3600000000 },
"measures" : [ "verboten" ],
"display_priority" : 1,
@@ -153,7 +157,7 @@ jq -n \
},
{
"operation_type": "CLOSE",
- "threshold" : "EUR:1000",
+ "threshold" : "\($currency):1000",
"timeframe" : { "d_us" : 3600000000 },
"measures" : [ "verboten" ],
"display_priority" : 1,