From ed0da1fdb3e85a0d19148b3ec9eb481e8c06c025 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 8 Apr 2019 23:53:52 +0200 Subject: /history-range. Implementing the "lib" and "testing-lib" functions to use it. --- src/include/taler_bank_service.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/include/taler_bank_service.h') diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h index 2f4a06023..2cebbe6e7 100644 --- a/src/include/taler_bank_service.h +++ b/src/include/taler_bank_service.h @@ -101,6 +101,7 @@ struct TALER_BANK_AdminAddIncomingHandle; * 0 if the bank's reply is bogus (fails to follow the protocol) * @param ec detailed error code * @param serial_id unique ID of the wire transfer in the bank's records; UINT64_MAX on error + * @param timestamp time when the transaction was made. * @param json detailed response from the HTTPD, or NULL if reply was not in JSON */ typedef void @@ -108,6 +109,7 @@ typedef void unsigned int http_status, enum TALER_ErrorCode ec, uint64_t serial_id, + struct GNUNET_TIME_Absolute timestamp, const json_t *json); @@ -281,6 +283,41 @@ TALER_BANK_history (struct GNUNET_CURL_Context *ctx, void *hres_cb_cls); +/** + * Request the wire transfer history of a bank account, + * using time stamps to narrow the results. + * + * @param ctx curl context for the event loop + * @param bank_base_url URL of the bank (used to execute this + * request) + * @param auth authentication data to use + * @param account_number which account number should we query + * @param direction what kinds of wire transfers should be + * returned + * @param ascending if GNUNET_YES, history elements will + * be returned in chronological order. + * @param start_date threshold for oldest result. + * @param end_date threshold for youngest result. + * @param hres_cb the callback to call with the transaction + * history + * @param hres_cb_cls closure for the above callback + * @return NULL if the inputs are invalid (i.e. zero value for + * @e num_results). In this case, the callback is not + * called. + */ +struct TALER_BANK_HistoryHandle * +TALER_BANK_history_range (struct GNUNET_CURL_Context *ctx, + const char *bank_base_url, + const struct TALER_BANK_AuthenticationData *auth, + uint64_t account_number, + enum TALER_BANK_Direction direction, + unsigned int ascending, + struct GNUNET_TIME_Absolute start_date, + struct GNUNET_TIME_Absolute end_date, + TALER_BANK_HistoryResultCallback hres_cb, + void *hres_cb_cls); + + /** * Cancel an history request. This function cannot be used on a request * handle if the last response (anything with a status code other than -- cgit v1.2.3