summaryrefslogtreecommitdiff
path: root/src/wire/plugin_wire_template.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-05-04 18:35:53 +0200
committerChristian Grothoff <christian@grothoff.org>2017-05-04 18:35:53 +0200
commitf4df63e448c9bcd990ec9a41eb6cb19a36246099 (patch)
treec53f8f31dfc346b416cbfeb43a715b4060e19bc3 /src/wire/plugin_wire_template.c
parent234dbcc7b71ac98e7f63393e454377d1e2ae11c7 (diff)
downloadexchange-f4df63e448c9bcd990ec9a41eb6cb19a36246099.tar.gz
exchange-f4df63e448c9bcd990ec9a41eb6cb19a36246099.tar.bz2
exchange-f4df63e448c9bcd990ec9a41eb6cb19a36246099.zip
adding support for transaction history to wire plugin API (#4959)
Diffstat (limited to 'src/wire/plugin_wire_template.c')
-rw-r--r--src/wire/plugin_wire_template.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/wire/plugin_wire_template.c b/src/wire/plugin_wire_template.c
index 95db1583e..e94b2f05b 100644
--- a/src/wire/plugin_wire_template.c
+++ b/src/wire/plugin_wire_template.c
@@ -220,6 +220,52 @@ template_execute_wire_transfer_cancel (void *cls,
/**
+ * Query transfer history of an account. We use the variable-size
+ * @a start_off to indicate which transfers we are interested in as
+ * different banking systems may have different ways to identify
+ * transfers. The @a start_off value must thus match the value of
+ * a `row_off` argument previously given to the @a hres_cb. Use
+ * NULL to query transfers from the beginning of time (with
+ * positive @a num_results) or from the latest committed transfers
+ * (with negative @a num_results).
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param direction what kinds of wire transfers should be returned
+ * @param start_off from which row on do we want to get results, use NULL for the latest; exclusive
+ * @param start_off_len number of bytes in @a start_off; must be `sizeof(uint64_t)`.
+ * @param num_results how many results do we want; negative numbers to go into the past,
+ * positive numbers to go into the future starting at @a start_row;
+ * must not be zero.
+ * @param hres_cb the callback to call with the transaction history
+ * @param hres_cb_cls closure for the above callback
+ */
+static struct TALER_WIRE_HistoryHandle *
+template_get_history (void *cls,
+ enum TALER_BANK_Direction direction,
+ const void *start_off,
+ size_t start_off_len,
+ int64_t num_results,
+ TALER_WIRE_HistoryResultCallback hres_cb,
+ void *hres_cb_cls)
+{
+ GNUNET_break (0);
+ return NULL;
+}
+
+
+/**
+ * Cancel going over the account's history.
+ *
+ * @param whh operation to cancel
+ */
+static void
+template_get_history_cancel (struct TALER_WIRE_HistoryHandle *whh)
+{
+ GNUNET_break (0);
+}
+
+
+/**
* Initialize template-wire subsystem.
*
* @param cls a configuration instance
@@ -270,6 +316,8 @@ libtaler_plugin_wire_template_init (void *cls)
plugin->prepare_wire_transfer_cancel = &template_prepare_wire_transfer_cancel;
plugin->execute_wire_transfer = &template_execute_wire_transfer;
plugin->execute_wire_transfer_cancel = &template_execute_wire_transfer_cancel;
+ plugin->get_history = &template_get_history;
+ plugin->get_history_cancel = &template_get_history_cancel;
return plugin;
}