commit 5c3cb57728603765b5c52ae4a8b88baca06e658b
parent bc5edc5011a4398ef023f5c67bdc20b9a5d447b3
Author: MS <ms@taler.net>
Date: Thu, 5 Oct 2023 11:35:28 +0200
bank: GET /monitor.
Diffstat:
| M | core/api-corebank.rst | | | 84 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 83 insertions(+), 1 deletion(-)
diff --git a/core/api-corebank.rst b/core/api-corebank.rst
@@ -788,7 +788,7 @@ Cashouts
}
- :http:statuscode:`200 Ok`:
+ :http:statuscode:`200 OK`:
Response is a `CashoutConversionResponse`.
:http:statuscode:`400 Bad request`:
Both parameters have been provided and the calculation is not correct,
@@ -907,6 +907,88 @@ Cashouts
The cashout operation was not found.
Aborted cashout operations will also not be found.
+
+Monitor
+-------
+
+.. http:get:: /monitor
+
+ When the bank has cashouts, this call lets the bank administrator monitor
+ the cashin and cashout operations that were made from and to an external
+ currency. It shows as well figures related to (internal) payments made
+ by a Taler exchange component to merchant bank accounts.
+
+ **Request:**
+
+ :query timeframe: this parameter admits one of the following values. It is optional,
+ defaulting to 'hour'.
+
+ * hour
+ * day
+ * month
+ * year
+ * decade
+
+ :query which: this parameter points at a particular element of the *timeframe* parameter. Following are the admitted values for each one. It is optional, defaulting to the last snapshot taken of the *timeframe* parameter.
+
+ * hour: from 00 to 23
+ * day: from 1 to the last day of the current month.
+ * month: from 1 to 12
+ * year: Gregorian year in the YYYY format.
+ * decade: the least Y0 digits of a Gregorian year. Banks should treat such decades as starting from the year 2000. For example, if Y=2, this decade denotes the years 2020 to 2029.
+
+ **Response:**
+
+ :http:statuscode:`200 OK`:
+ the bank responds with `MonitorResponse`.
+
+ .. note::
+
+ API consumers may combine the values in the response with other
+ factors to serve different views to their users.
+
+ :http:statuscode:`400 Bad Request`:
+ this error may indicate that the *which* parameter is not appropriate for the selected *timeframe*. For example, timeframe=month and which=20 would result in this error.
+
+ .. ts:def:: MonitorResponse
+
+ interface MonitorResponse {
+
+ // This number identifies how many cashin operations
+ // took place in the timeframe specified in the request.
+ // This number corresponds to how many withdrawals have
+ // been initiated by a wallet owner. Note: wallet owners
+ // are NOT required to be customers of the libeufin-bank.
+ cashinCount: number;
+
+ // This amount accounts how much external currency has been
+ // spent to withdraw Taler coins in the internal currency.
+ // The exact amount of internal currency being created can be
+ // calculated using the advertised conversion rates.
+ cashinExternalVolume: Amount;
+
+ // This number identifies how many cashout operations were
+ // confirmed in the timeframe speficied in the request.
+ cashoutCount: number;
+
+ // This amount corresponds to how much *external* currency was
+ // paid by the libeufin-bank administrator to fulfill all the
+ // confirmed cashouts related to the timeframe specified in the
+ // request.
+ cashoutExternalVolume: Amount;
+
+ // This number identifies how many payments were made by a
+ // Taler exchange to a merchant bank account in the internal
+ // currency, in the timeframe specified in the request.
+ talerPayoutCount: number;
+
+ // This amount accounts the overall *internal* currency that
+ // has been paid by a Taler exchange to a merchant internal
+ // bank account, in the timeframe specified in the request.
+ talerPayoutInternalVolume: Amount;
+ }
+
+
Taler Bank Integration API
--------------------------