2016-10-06 15:17:10 +02:00
|
|
|
/*
|
|
|
|
This file is part of TALER
|
2021-08-23 08:24:59 +02:00
|
|
|
Copyright (C) 2014-2021 Taler Systems SA
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
TALER is free software; you can redistribute it and/or modify it under the
|
|
|
|
terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 3, or (at your option) any later version.
|
|
|
|
|
|
|
|
TALER is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file include/taler_auditordb_plugin.h
|
|
|
|
* @brief Low-level (statement-level) database access for the auditor
|
|
|
|
* @author Florian Dold
|
|
|
|
* @author Christian Grothoff
|
|
|
|
*/
|
|
|
|
#ifndef TALER_AUDITORDB_PLUGIN_H
|
|
|
|
#define TALER_AUDITORDB_PLUGIN_H
|
|
|
|
|
|
|
|
#include <jansson.h>
|
|
|
|
#include <gnunet/gnunet_util_lib.h>
|
2017-06-24 23:06:44 +02:00
|
|
|
#include <gnunet/gnunet_db_lib.h>
|
2016-10-06 15:17:10 +02:00
|
|
|
#include "taler_auditordb_lib.h"
|
2016-10-08 23:37:55 +02:00
|
|
|
#include "taler_signatures.h"
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
|
2018-10-28 10:26:32 +01:00
|
|
|
/**
|
|
|
|
* Function called with information about exchanges this
|
|
|
|
* auditor is monitoring.
|
|
|
|
*
|
|
|
|
* @param cls closure
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param exchange_url base URL of the exchange's API
|
|
|
|
*/
|
|
|
|
typedef void
|
2020-03-07 00:28:07 +01:00
|
|
|
(*TALER_AUDITORDB_ExchangeCallback)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const char *exchange_url);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
|
|
|
|
2016-11-03 13:01:36 +01:00
|
|
|
/**
|
|
|
|
* Function called with the results of select_historic_denom_revenue()
|
|
|
|
*
|
|
|
|
* @param cls closure
|
|
|
|
* @param denom_pub_hash hash of the denomination key
|
|
|
|
* @param revenue_timestamp when did this profit get realized
|
|
|
|
* @param revenue_balance what was the total profit made from
|
|
|
|
* deposit fees, melting fees, refresh fees
|
|
|
|
* and coins that were never returned?
|
2019-07-25 19:26:25 +02:00
|
|
|
* @param loss_balance what was the total loss
|
2016-11-04 00:34:09 +01:00
|
|
|
* @return sets the return value of select_denomination_info(),
|
|
|
|
* #GNUNET_OK to continue,
|
|
|
|
* #GNUNET_NO to stop processing further rows
|
|
|
|
* #GNUNET_SYSERR or other values on error.
|
2016-11-03 13:01:36 +01:00
|
|
|
*/
|
2021-10-22 22:04:35 +02:00
|
|
|
typedef enum GNUNET_GenericReturnValue
|
2020-03-07 00:28:07 +01:00
|
|
|
(*TALER_AUDITORDB_HistoricDenominationRevenueDataCallback)(
|
|
|
|
void *cls,
|
2021-10-22 22:04:35 +02:00
|
|
|
const struct TALER_DenominationHash *denom_pub_hash,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp revenue_timestamp,
|
2020-03-07 00:28:07 +01:00
|
|
|
const struct TALER_Amount *revenue_balance,
|
|
|
|
const struct TALER_Amount *loss_balance);
|
2016-11-03 13:01:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function called with the results of select_historic_reserve_revenue()
|
|
|
|
*
|
|
|
|
* @param cls closure
|
|
|
|
* @param start_time beginning of aggregated time interval
|
|
|
|
* @param end_time end of aggregated time interval
|
|
|
|
* @param reserve_profits total profits made
|
2016-11-04 00:34:09 +01:00
|
|
|
*
|
|
|
|
* @return sets the return value of select_denomination_info(),
|
|
|
|
* #GNUNET_OK to continue,
|
|
|
|
* #GNUNET_NO to stop processing further rows
|
|
|
|
* #GNUNET_SYSERR or other values on error.
|
2016-11-03 13:01:36 +01:00
|
|
|
*/
|
2021-10-22 22:04:35 +02:00
|
|
|
typedef enum GNUNET_GenericReturnValue
|
2020-03-07 00:28:07 +01:00
|
|
|
(*TALER_AUDITORDB_HistoricReserveRevenueDataCallback)(
|
|
|
|
void *cls,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp start_time,
|
|
|
|
struct GNUNET_TIME_Timestamp end_time,
|
2020-03-07 00:28:07 +01:00
|
|
|
const struct TALER_Amount *reserve_profits);
|
2016-11-03 13:01:36 +01:00
|
|
|
|
|
|
|
|
2017-09-30 20:29:19 +02:00
|
|
|
/**
|
|
|
|
* Structure for remembering the wire auditor's progress over the
|
|
|
|
* various tables and (auditor) transactions.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_WireProgressPoint
|
2019-08-24 22:49:35 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Time until which we have confirmed that all wire transactions
|
|
|
|
* that the exchange should do, have indeed been done.
|
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp last_timestamp;
|
2019-10-06 16:54:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* reserves_close uuid until which we have checked
|
|
|
|
* reserve closures.
|
|
|
|
*/
|
|
|
|
uint64_t last_reserve_close_uuid;
|
2019-08-24 22:49:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure for remembering the wire auditor's progress over the
|
|
|
|
* various tables and (auditor) transactions per wire account.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_WireAccountProgressPoint
|
2017-09-30 20:29:19 +02:00
|
|
|
{
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last reserve_in transfer the wire auditor processed
|
2017-09-30 20:29:19 +02:00
|
|
|
*/
|
|
|
|
uint64_t last_reserve_in_serial_id;
|
|
|
|
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last wire_out the wire auditor processed
|
2017-09-30 20:29:19 +02:00
|
|
|
*/
|
2017-10-12 20:46:42 +02:00
|
|
|
uint64_t last_wire_out_serial_id;
|
2017-11-19 22:12:30 +01:00
|
|
|
|
2017-09-30 20:29:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-03-15 13:12:45 +01:00
|
|
|
/**
|
2018-10-27 21:27:23 +02:00
|
|
|
* Structure for remembering the auditor's progress over the various
|
|
|
|
* tables and (auditor) transactions when analyzing reserves.
|
2017-03-15 13:12:45 +01:00
|
|
|
*/
|
2018-10-27 21:27:23 +02:00
|
|
|
struct TALER_AUDITORDB_ProgressPointReserve
|
2017-03-15 13:12:45 +01:00
|
|
|
{
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last reserve_in transfer the auditor processed
|
2017-03-15 13:12:45 +01:00
|
|
|
*/
|
|
|
|
uint64_t last_reserve_in_serial_id;
|
|
|
|
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last reserve_out the auditor processed
|
2017-03-15 13:12:45 +01:00
|
|
|
*/
|
|
|
|
uint64_t last_reserve_out_serial_id;
|
|
|
|
|
2017-04-04 15:38:58 +02:00
|
|
|
/**
|
2020-01-18 23:49:37 +01:00
|
|
|
* serial ID of the last recoup entry the auditor processed when
|
2017-04-04 15:38:58 +02:00
|
|
|
* considering reserves.
|
|
|
|
*/
|
2020-01-18 23:49:37 +01:00
|
|
|
uint64_t last_reserve_recoup_serial_id;
|
2017-04-04 15:38:58 +02:00
|
|
|
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last reserve_close
|
2017-04-04 15:38:58 +02:00
|
|
|
* entry the auditor processed.
|
|
|
|
*/
|
|
|
|
uint64_t last_reserve_close_serial_id;
|
|
|
|
|
2018-10-27 21:27:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-10-28 10:26:32 +01:00
|
|
|
/**
|
|
|
|
* Structure for remembering the auditor's progress over the various
|
|
|
|
* tables and (auditor) transactions when analyzing reserves.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_ProgressPointDepositConfirmation
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* serial ID of the last deposit_confirmation the auditor processed
|
|
|
|
*/
|
|
|
|
uint64_t last_deposit_confirmation_serial_id;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-10-27 21:27:23 +02:00
|
|
|
/**
|
|
|
|
* Structure for remembering the auditor's progress over the various
|
|
|
|
* tables and (auditor) transactions when analyzing aggregations.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_ProgressPointAggregation
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last prewire transfer the auditor processed
|
2018-10-27 21:27:23 +02:00
|
|
|
*/
|
|
|
|
uint64_t last_wire_out_serial_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure for remembering the auditor's progress over the various
|
|
|
|
* tables and (auditor) transactions when analyzing coins.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_ProgressPointCoin
|
|
|
|
{
|
2017-03-20 02:45:33 +01:00
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last withdraw the auditor processed
|
2017-03-20 02:45:33 +01:00
|
|
|
*/
|
|
|
|
uint64_t last_withdraw_serial_id;
|
|
|
|
|
2017-03-15 13:12:45 +01:00
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last deposit the auditor processed
|
2017-03-15 13:12:45 +01:00
|
|
|
*/
|
|
|
|
uint64_t last_deposit_serial_id;
|
|
|
|
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last refresh the auditor processed
|
2017-03-15 13:12:45 +01:00
|
|
|
*/
|
|
|
|
uint64_t last_melt_serial_id;
|
|
|
|
|
|
|
|
/**
|
2018-10-28 10:26:32 +01:00
|
|
|
* serial ID of the last refund the auditor processed
|
2017-03-15 13:12:45 +01:00
|
|
|
*/
|
|
|
|
uint64_t last_refund_serial_id;
|
|
|
|
|
2019-07-24 14:13:25 +02:00
|
|
|
/**
|
2020-01-18 23:49:37 +01:00
|
|
|
* Serial ID of the last recoup operation the auditor processed.
|
2019-07-24 14:13:25 +02:00
|
|
|
*/
|
2020-01-18 23:49:37 +01:00
|
|
|
uint64_t last_recoup_serial_id;
|
2019-07-24 14:13:25 +02:00
|
|
|
|
|
|
|
/**
|
2020-01-18 23:49:37 +01:00
|
|
|
* Serial ID of the last recoup-of-refresh operation the auditor processed.
|
2019-07-24 14:13:25 +02:00
|
|
|
*/
|
2020-01-18 23:49:37 +01:00
|
|
|
uint64_t last_recoup_refresh_serial_id;
|
2019-07-24 14:13:25 +02:00
|
|
|
|
2017-03-15 13:12:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-10-27 19:26:17 +02:00
|
|
|
/**
|
|
|
|
* Information about a signing key of an exchange.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_ExchangeSigningKey
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Public master key of the exchange that certified @e master_sig.
|
|
|
|
*/
|
|
|
|
struct TALER_MasterPublicKeyP master_public_key;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When does @e exchange_pub start to be used?
|
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp ep_start;
|
2018-10-27 19:26:17 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When will the exchange stop signing with @e exchange_pub?
|
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp ep_expire;
|
2018-10-27 19:26:17 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When does the signing key expire (for legal disputes)?
|
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp ep_end;
|
2018-10-27 19:26:17 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* What is the public offline signing key this is all about?
|
|
|
|
*/
|
|
|
|
struct TALER_ExchangePublicKeyP exchange_pub;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signature by the offline master key affirming the above.
|
|
|
|
*/
|
|
|
|
struct TALER_MasterSignatureP master_sig;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-10-20 19:40:09 +02:00
|
|
|
/**
|
|
|
|
* Information about a deposit confirmation we received from
|
|
|
|
* a merchant.
|
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_DepositConfirmation
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hash over the contract for which this deposit is made.
|
|
|
|
*/
|
2021-10-22 22:04:35 +02:00
|
|
|
struct TALER_PrivateContractHash h_contract_terms;
|
2018-10-20 19:40:09 +02:00
|
|
|
|
2021-11-06 19:57:34 +01:00
|
|
|
/**
|
|
|
|
* Hash over the extensions for the deposit.
|
|
|
|
*/
|
|
|
|
struct TALER_ExtensionContractHash h_extensions;
|
|
|
|
|
2018-10-20 19:40:09 +02:00
|
|
|
/**
|
|
|
|
* Hash over the wiring information of the merchant.
|
|
|
|
*/
|
2021-10-22 22:04:35 +02:00
|
|
|
struct TALER_MerchantWireHash h_wire;
|
2018-10-20 19:40:09 +02:00
|
|
|
|
|
|
|
/**
|
2020-05-07 20:22:02 +02:00
|
|
|
* Time when this deposit confirmation was generated by the exchange.
|
2018-10-20 19:40:09 +02:00
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp exchange_timestamp;
|
2018-10-20 19:40:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* How much time does the @e merchant have to issue a refund
|
|
|
|
* request? Zero if refunds are not allowed. After this time, the
|
|
|
|
* coin cannot be refunded. Note that the wire transfer will not be
|
|
|
|
* performed by the exchange until the refund deadline. This value
|
|
|
|
* is taken from the original deposit request.
|
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp refund_deadline;
|
2018-10-20 19:40:09 +02:00
|
|
|
|
2021-11-06 19:43:47 +01:00
|
|
|
/**
|
|
|
|
* How much time does the @e exchange have to wire the funds?
|
|
|
|
*/
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp wire_deadline;
|
2021-11-06 19:43:47 +01:00
|
|
|
|
2018-10-20 19:40:09 +02:00
|
|
|
/**
|
|
|
|
* Amount to be deposited, excluding fee. Calculated from the
|
|
|
|
* amount with fee and the fee from the deposit request.
|
|
|
|
*/
|
|
|
|
struct TALER_Amount amount_without_fee;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The coin's public key. This is the value that must have been
|
|
|
|
* signed (blindly) by the Exchange. The deposit request is to be
|
|
|
|
* signed by the corresponding private key (using EdDSA).
|
|
|
|
*/
|
|
|
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Merchant's public key. Allows the merchant to later refund
|
|
|
|
* the transaction or to inquire about the wire transfer identifier.
|
|
|
|
*/
|
|
|
|
struct TALER_MerchantPublicKeyP merchant;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signature from the exchange of type
|
|
|
|
* #TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT.
|
|
|
|
*/
|
|
|
|
struct TALER_ExchangeSignatureP exchange_sig;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Public signing key from the exchange matching @e exchange_sig.
|
|
|
|
*/
|
2018-10-21 20:52:26 +02:00
|
|
|
struct TALER_ExchangePublicKeyP exchange_pub;
|
2018-10-20 19:40:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exchange master signature over @e exchange_sig.
|
|
|
|
*/
|
|
|
|
struct TALER_MasterSignatureP master_sig;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Master public key of the exchange corresponding to @e master_sig.
|
|
|
|
* Identifies the exchange this is about.
|
|
|
|
*/
|
|
|
|
struct TALER_MasterPublicKeyP master_public_key;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-04 17:36:56 +01:00
|
|
|
/**
|
|
|
|
* Function called with deposit confirmations stored in
|
|
|
|
* the auditor's database.
|
|
|
|
*
|
|
|
|
* @param cls closure
|
|
|
|
* @param serial_id location of the @a dc in the database
|
|
|
|
* @param dc the deposit confirmation itself
|
2020-10-03 16:08:01 +02:00
|
|
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop iterating
|
2018-11-04 17:36:56 +01:00
|
|
|
*/
|
2021-10-22 22:04:35 +02:00
|
|
|
typedef enum GNUNET_GenericReturnValue
|
2020-03-07 00:28:07 +01:00
|
|
|
(*TALER_AUDITORDB_DepositConfirmationCallback)(
|
|
|
|
void *cls,
|
|
|
|
uint64_t serial_id,
|
|
|
|
const struct TALER_AUDITORDB_DepositConfirmation *dc);
|
2018-11-04 17:36:56 +01:00
|
|
|
|
|
|
|
|
2016-10-06 15:17:10 +02:00
|
|
|
/**
|
|
|
|
* @brief The plugin API, returned from the plugin's "init" function.
|
|
|
|
* The argument given to "init" is simply a configuration handle.
|
2016-10-08 23:37:55 +02:00
|
|
|
*
|
|
|
|
* Functions starting with "get_" return one result, functions starting
|
|
|
|
* with "select_" return multiple results via callbacks.
|
2016-10-06 15:17:10 +02:00
|
|
|
*/
|
|
|
|
struct TALER_AUDITORDB_Plugin
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Closure for all callbacks.
|
|
|
|
*/
|
|
|
|
void *cls;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the library which generated this plugin. Set by the
|
|
|
|
* plugin loader.
|
|
|
|
*/
|
|
|
|
char *library_name;
|
|
|
|
|
|
|
|
/**
|
2021-08-23 08:24:59 +02:00
|
|
|
* Fully connect to the db if the connection does not exist yet
|
|
|
|
* and check that there is no transaction currently running.
|
2016-10-06 15:17:10 +02:00
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
2021-08-23 08:24:59 +02:00
|
|
|
* @return #GNUNET_OK on success
|
|
|
|
* #GNUNET_NO if we rolled back an earlier transaction
|
|
|
|
* #GNUNET_SYSERR if we have no DB connection
|
2016-10-06 15:17:10 +02:00
|
|
|
*/
|
2021-08-23 08:24:59 +02:00
|
|
|
enum GNUNET_GenericReturnValue
|
|
|
|
(*preflight)(void *cls);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2020-01-17 01:55:01 +01:00
|
|
|
* Drop all auditor tables OR deletes recoverable auditor state.
|
|
|
|
* This should only be used by testcases or when restarting the
|
|
|
|
* auditor from scratch.
|
2016-10-06 15:17:10 +02:00
|
|
|
*
|
2020-01-17 01:55:01 +01:00
|
|
|
* @param cls the `struct PostgresClosure` with the plugin-specific state
|
|
|
|
* @param drop_exchangelist drop all tables, including schema versioning
|
|
|
|
* and the exchange and deposit_confirmations table; NOT to be
|
|
|
|
* used when restarting the auditor
|
2016-10-06 15:17:10 +02:00
|
|
|
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
|
|
|
|
*/
|
2021-08-23 08:24:59 +02:00
|
|
|
enum GNUNET_GenericReturnValue
|
|
|
|
(*drop_tables)(void *cls,
|
|
|
|
int drop_exchangelist);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create the necessary tables if they are not present
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
|
|
|
|
*/
|
2021-08-23 08:24:59 +02:00
|
|
|
enum GNUNET_GenericReturnValue
|
|
|
|
(*create_tables)(void *cls);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start a transaction.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @return #GNUNET_OK on success
|
|
|
|
*/
|
2021-08-23 08:24:59 +02:00
|
|
|
enum GNUNET_GenericReturnValue
|
|
|
|
(*start)(void *cls);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Commit a transaction.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-06 15:17:10 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2021-08-23 08:24:59 +02:00
|
|
|
(*commit)(void *cls);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Abort/rollback a transaction.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
*/
|
|
|
|
void
|
2021-08-23 08:24:59 +02:00
|
|
|
(*rollback) (void *cls);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
2016-10-08 23:37:55 +02:00
|
|
|
|
2016-10-06 15:17:10 +02:00
|
|
|
/**
|
|
|
|
* Function called to perform "garbage collection" on the
|
|
|
|
* database, expiring records we no longer require.
|
|
|
|
*
|
|
|
|
* @param cls closure
|
|
|
|
* @return #GNUNET_OK on success,
|
|
|
|
* #GNUNET_SYSERR on DB errors
|
|
|
|
*/
|
2021-10-22 22:04:35 +02:00
|
|
|
enum GNUNET_GenericReturnValue
|
|
|
|
(*gc)(void *cls);
|
2016-10-06 15:17:10 +02:00
|
|
|
|
2016-10-08 23:37:55 +02:00
|
|
|
|
2018-10-28 10:26:32 +01:00
|
|
|
/**
|
|
|
|
* Insert information about an exchange this auditor will be auditing.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param exchange_url public (base) URL of the API of the exchange
|
|
|
|
* @return query result status
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2019-08-25 16:18:24 +02:00
|
|
|
(*insert_exchange)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const char *exchange_url);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete an exchange from the list of exchanges this auditor is auditing.
|
|
|
|
* Warning: this will cascade and delete all knowledge of this auditor related
|
|
|
|
* to this exchange!
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @return query result status
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2019-08-25 16:18:24 +02:00
|
|
|
(*delete_exchange)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtain information about exchanges this auditor is auditing.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
2020-01-17 22:17:48 +01:00
|
|
|
* @param cb function to call with the results
|
|
|
|
* @param cb_cls closure for @a cb
|
2018-10-28 10:26:32 +01:00
|
|
|
* @return query result status
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2019-08-25 16:18:24 +02:00
|
|
|
(*list_exchanges)(void *cls,
|
|
|
|
TALER_AUDITORDB_ExchangeCallback cb,
|
|
|
|
void *cb_cls);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
2018-10-27 19:26:17 +02:00
|
|
|
/**
|
|
|
|
* Insert information about a signing key of the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param sk signing key information to store
|
|
|
|
* @return query result status
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_exchange_signkey)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_AUDITORDB_ExchangeSigningKey *sk);
|
2018-10-27 19:26:17 +02:00
|
|
|
|
|
|
|
|
2018-10-20 19:40:09 +02:00
|
|
|
/**
|
|
|
|
* Insert information about a deposit confirmation into the database.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param dc deposit confirmation information to store
|
|
|
|
* @return query result status
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_deposit_confirmation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_AUDITORDB_DepositConfirmation *dc);
|
2018-10-20 19:40:09 +02:00
|
|
|
|
|
|
|
|
2018-11-04 17:36:56 +01:00
|
|
|
/**
|
2018-11-11 15:46:06 +01:00
|
|
|
* Get information about deposit confirmations from the database.
|
2018-11-04 17:36:56 +01:00
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
2020-01-17 22:17:48 +01:00
|
|
|
* @param master_public_key for which exchange do we want to get deposit confirmations
|
2018-11-04 17:36:56 +01:00
|
|
|
* @param start_id row/serial ID where to start the iteration (0 from
|
|
|
|
* the start, exclusive, i.e. serial_ids must start from 1)
|
|
|
|
* @param cb function to call with results
|
|
|
|
* @param cb_cls closure for @a cb
|
|
|
|
* @return query result status
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*get_deposit_confirmations)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_public_key,
|
|
|
|
uint64_t start_id,
|
|
|
|
TALER_AUDITORDB_DepositConfirmationCallback cb,
|
|
|
|
void *cb_cls);
|
2018-11-04 17:36:56 +01:00
|
|
|
|
|
|
|
|
2016-11-06 14:24:17 +01:00
|
|
|
/**
|
|
|
|
* Insert information about the auditor's progress with an exchange's
|
|
|
|
* data.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
2018-10-27 21:27:23 +02:00
|
|
|
* @param ppc where is the auditor in processing
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-11-06 14:24:17 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_auditor_progress_coin)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointCoin *ppc);
|
2016-11-06 14:24:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about the progress of the auditor. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
2018-10-27 21:27:23 +02:00
|
|
|
* @param ppc where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*update_auditor_progress_coin)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointCoin *ppc);
|
2018-10-27 21:27:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about the progress of the auditor.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param[out] ppc set to where the auditor is in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
|
|
|
(*get_auditor_progress_coin)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_AUDITORDB_ProgressPointCoin *ppc);
|
|
|
|
|
2019-08-25 16:18:24 +02:00
|
|
|
/**
|
|
|
|
* Insert information about the auditor's progress with an exchange's
|
|
|
|
* data.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param ppr where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
2018-10-27 21:27:23 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_auditor_progress_reserve)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointReserve *ppr);
|
2018-10-27 21:27:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about the progress of the auditor. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param ppr where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*update_auditor_progress_reserve)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointReserve *ppr);
|
2018-10-27 21:27:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about the progress of the auditor.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param[out] ppr set to where the auditor is in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*get_auditor_progress_reserve)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_AUDITORDB_ProgressPointReserve *ppr);
|
2018-10-27 21:27:23 +02:00
|
|
|
|
2018-10-28 10:26:32 +01:00
|
|
|
/**
|
|
|
|
* Insert information about the auditor's progress with an exchange's
|
|
|
|
* data.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param ppdc where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_auditor_progress_deposit_confirmation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about the progress of the auditor. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param ppdc where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*update_auditor_progress_deposit_confirmation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about the progress of the auditor.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param[out] ppdc set to where the auditor is in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*get_auditor_progress_deposit_confirmation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
|
2018-10-28 10:26:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2018-10-27 21:27:23 +02:00
|
|
|
* Insert information about the auditor's progress with an exchange's
|
|
|
|
* data.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param ppa where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_auditor_progress_aggregation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
|
2018-10-27 21:27:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about the progress of the auditor. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param ppa where is the auditor in processing
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-11-06 14:24:17 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*update_auditor_progress_aggregation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
|
2016-11-06 14:24:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about the progress of the auditor.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
2018-10-27 21:27:23 +02:00
|
|
|
* @param[out] ppa set to where the auditor is in processing
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-11-06 14:24:17 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*get_auditor_progress_aggregation)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
|
2016-11-06 14:24:17 +01:00
|
|
|
|
|
|
|
|
2017-09-30 20:29:19 +02:00
|
|
|
/**
|
|
|
|
* Insert information about the wire auditor's progress with an exchange's
|
|
|
|
* data.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
2018-04-02 14:24:45 +02:00
|
|
|
* @param account_name name of the wire account we are auditing
|
2017-09-30 20:29:19 +02:00
|
|
|
* @param pp where is the auditor in processing
|
2017-09-30 20:47:52 +02:00
|
|
|
* @param in_wire_off how far are we in the incoming wire transaction history
|
|
|
|
* @param out_wire_off how far are we in the outgoing wire transaction history
|
2017-09-30 20:29:19 +02:00
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_wire_auditor_account_progress)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const char *account_name,
|
|
|
|
const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
|
|
|
|
uint64_t in_wire_off,
|
|
|
|
uint64_t out_wire_off);
|
2017-09-30 20:29:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about the progress of the wire auditor. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
2018-04-02 14:24:45 +02:00
|
|
|
* @param account_name name of the wire account we are auditing
|
2017-09-30 20:29:19 +02:00
|
|
|
* @param pp where is the auditor in processing
|
2017-09-30 20:47:52 +02:00
|
|
|
* @param in_wire_off how far are we in the incoming wire transaction history
|
|
|
|
* @param out_wire_off how far are we in the outgoing wire transaction history
|
2017-09-30 20:29:19 +02:00
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*update_wire_auditor_account_progress)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const char *account_name,
|
|
|
|
const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
|
|
|
|
uint64_t in_wire_off,
|
|
|
|
uint64_t out_wire_off);
|
2019-08-25 16:18:24 +02:00
|
|
|
|
2019-08-24 22:49:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about the progress of the wire auditor.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param account_name name of the wire account we are auditing
|
|
|
|
* @param[out] pp where is the auditor in processing
|
|
|
|
* @param[out] in_wire_off how far are we in the incoming wire transaction history
|
|
|
|
* @param[out] out_wire_off how far are we in the outgoing wire transaction history
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*get_wire_auditor_account_progress)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const char *account_name,
|
|
|
|
struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
|
|
|
|
uint64_t *in_wire_off,
|
|
|
|
uint64_t *out_wire_off);
|
2019-08-24 22:49:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about the wire auditor's progress with an exchange's
|
|
|
|
* data.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param account_name name of the wire account we are auditing
|
|
|
|
* @param pp where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_wire_auditor_progress)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_WireProgressPoint *pp);
|
2017-09-30 20:47:52 +02:00
|
|
|
|
2017-09-30 20:29:19 +02:00
|
|
|
|
2019-08-24 22:49:35 +02:00
|
|
|
/**
|
|
|
|
* Update information about the progress of the wire auditor. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param account_name name of the wire account we are auditing
|
|
|
|
* @param pp where is the auditor in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*update_wire_auditor_progress)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_AUDITORDB_WireProgressPoint *pp);
|
2019-08-24 22:49:35 +02:00
|
|
|
|
2017-09-30 20:29:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about the progress of the wire auditor.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
2018-04-02 14:24:45 +02:00
|
|
|
* @param account_name name of the wire account we are auditing
|
2017-09-30 20:29:19 +02:00
|
|
|
* @param[out] pp set to where the auditor is in processing
|
|
|
|
* @return transaction status code
|
|
|
|
*/
|
|
|
|
enum GNUNET_DB_QueryStatus
|
|
|
|
(*get_wire_auditor_progress)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
2019-08-24 22:49:35 +02:00
|
|
|
struct TALER_AUDITORDB_WireProgressPoint *pp);
|
2017-09-30 20:29:19 +02:00
|
|
|
|
|
|
|
|
2016-10-08 23:37:55 +02:00
|
|
|
/**
|
|
|
|
* Insert information about a reserve. There must not be an
|
|
|
|
* existing record for the reserve.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param reserve_pub public key of the reserve
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param reserve_balance amount stored in the reserve
|
|
|
|
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
|
|
|
|
* due to withdrawals from this reserve
|
|
|
|
* @param expiration_date expiration date of the reserve
|
2019-10-05 15:12:11 +02:00
|
|
|
* @param origin_account where did the money in the reserve originally come from
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*insert_reserve_info)(void *cls,
|
|
|
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *reserve_balance,
|
|
|
|
const struct TALER_Amount *withdraw_fee_balance,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp expiration_date,
|
2019-10-05 15:12:11 +02:00
|
|
|
const char *origin_account);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about a reserve. Destructively updates an
|
|
|
|
* existing record, which must already exist.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param reserve_pub public key of the reserve
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param reserve_balance amount stored in the reserve
|
|
|
|
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
|
|
|
|
* due to withdrawals from this reserve
|
|
|
|
* @param expiration_date expiration date of the reserve
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*update_reserve_info)(void *cls,
|
|
|
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *reserve_balance,
|
|
|
|
const struct TALER_Amount *withdraw_fee_balance,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp expiration_date);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about a reserve.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param reserve_pub public key of the reserve
|
|
|
|
* @param master_pub master public key of the exchange
|
2017-03-15 13:36:47 +01:00
|
|
|
* @param[out] rowid which row did we get the information from
|
2016-10-08 23:37:55 +02:00
|
|
|
* @param[out] reserve_balance amount stored in the reserve
|
|
|
|
* @param[out] withdraw_fee_balance amount the exchange gained in withdraw fees
|
|
|
|
* due to withdrawals from this reserve
|
|
|
|
* @param[out] expiration_date expiration date of the reserve
|
2019-10-05 15:12:11 +02:00
|
|
|
* @param[out] sender_account from where did the money in the reserve originally come from
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*get_reserve_info)(void *cls,
|
|
|
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
2017-03-15 13:36:47 +01:00
|
|
|
uint64_t *rowid,
|
2016-10-08 23:37:55 +02:00
|
|
|
struct TALER_Amount *reserve_balance,
|
|
|
|
struct TALER_Amount *withdraw_fee_balance,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp *expiration_date,
|
2019-10-05 15:12:11 +02:00
|
|
|
char **sender_account);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
2017-03-14 18:00:17 +01:00
|
|
|
/**
|
|
|
|
* Delete information about a reserve.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param reserve_pub public key of the reserve
|
|
|
|
* @param master_pub master public key of the exchange
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2017-03-14 18:00:17 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-14 18:00:17 +01:00
|
|
|
(*del_reserve_info)(void *cls,
|
|
|
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub);
|
|
|
|
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about all reserves. There must not be an
|
|
|
|
* existing record for the @a master_pub.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param reserve_balance amount stored in the reserve
|
|
|
|
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
|
|
|
|
* due to withdrawals from this reserve
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*insert_reserve_summary)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *reserve_balance,
|
|
|
|
const struct TALER_Amount *withdraw_fee_balance);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about all reserves. Destructively updates an
|
|
|
|
* existing record, which must already exist.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param reserve_balance amount stored in the reserve
|
|
|
|
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
|
|
|
|
* due to withdrawals from this reserve
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*update_reserve_summary)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *reserve_balance,
|
|
|
|
const struct TALER_Amount *withdraw_fee_balance);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get summary information about all reserves.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param[out] reserve_balance amount stored in the reserve
|
|
|
|
* @param[out] withdraw_fee_balance amount the exchange gained in withdraw fees
|
|
|
|
* due to withdrawals from this reserve
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*get_reserve_summary)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_Amount *reserve_balance,
|
|
|
|
struct TALER_Amount *withdraw_fee_balance);
|
|
|
|
|
|
|
|
|
2017-03-20 04:17:06 +01:00
|
|
|
/**
|
|
|
|
* Insert information about exchange's wire fee balance. There must not be an
|
|
|
|
* existing record for the same @a master_pub.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param wire_fee_balance amount the exchange gained in wire fees
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2017-03-20 04:17:06 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-20 04:17:06 +01:00
|
|
|
(*insert_wire_fee_summary)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *wire_fee_balance);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about exchange's wire fee balance. Destructively updates an
|
|
|
|
* existing record, which must already exist.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param wire_fee_balance amount the exchange gained in wire fees
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2017-03-20 04:17:06 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-20 04:17:06 +01:00
|
|
|
(*update_wire_fee_summary)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *wire_fee_balance);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get summary information about an exchanges wire fee balance.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master public key of the exchange
|
|
|
|
* @param[out] wire_fee_balance set amount the exchange gained in wire fees
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2017-03-20 04:17:06 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-20 04:17:06 +01:00
|
|
|
(*get_wire_fee_summary)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_Amount *wire_fee_balance);
|
|
|
|
|
|
|
|
|
2016-10-08 23:37:55 +02:00
|
|
|
/**
|
|
|
|
* Insert information about a denomination key's balances. There
|
|
|
|
* must not be an existing record for the denomination key.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param denom_pub_hash hash of the denomination public key
|
2017-03-18 22:20:48 +01:00
|
|
|
* @param denom_balance value of coins outstanding with this denomination key
|
2019-09-02 08:01:55 +02:00
|
|
|
* @param denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance)
|
2017-03-18 22:20:48 +01:00
|
|
|
* @param denom_risk value of coins issued with this denomination key
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param denom_recoup value of coins paid back if this denomination key was revoked
|
2018-10-28 11:30:02 +01:00
|
|
|
* @param num_issued how many coins of this denomination did the exchange blind-sign
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*insert_denomination_balance)(void *cls,
|
2021-10-22 22:04:35 +02:00
|
|
|
const struct
|
|
|
|
TALER_DenominationHash *denom_pub_hash,
|
2017-03-18 22:20:48 +01:00
|
|
|
const struct TALER_Amount *denom_balance,
|
2019-09-02 08:01:55 +02:00
|
|
|
const struct TALER_Amount *denom_loss,
|
2018-10-28 11:30:02 +01:00
|
|
|
const struct TALER_Amount *denom_risk,
|
2020-01-18 23:49:37 +01:00
|
|
|
const struct TALER_Amount *recoup_loss,
|
2018-10-28 11:30:02 +01:00
|
|
|
uint64_t num_issued);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about a denomination key's balances. There
|
|
|
|
* must be an existing record for the denomination key.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param denom_pub_hash hash of the denomination public key
|
2017-03-18 22:20:48 +01:00
|
|
|
* @param denom_balance value of coins outstanding with this denomination key
|
2019-09-02 08:01:55 +02:00
|
|
|
* @param denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance)
|
2017-03-18 22:20:48 +01:00
|
|
|
* @param denom_risk value of coins issued with this denomination key
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param denom_recoup value of coins paid back if this denomination key was revoked
|
2018-10-28 11:30:02 +01:00
|
|
|
* @param num_issued how many coins of this denomination did the exchange blind-sign
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*update_denomination_balance)(void *cls,
|
2021-10-22 22:04:35 +02:00
|
|
|
const struct
|
|
|
|
TALER_DenominationHash *denom_pub_hash,
|
2017-03-18 22:20:48 +01:00
|
|
|
const struct TALER_Amount *denom_balance,
|
2019-09-02 08:01:55 +02:00
|
|
|
const struct TALER_Amount *denom_loss,
|
2018-10-28 11:30:02 +01:00
|
|
|
const struct TALER_Amount *denom_risk,
|
2020-01-18 23:49:37 +01:00
|
|
|
const struct TALER_Amount *recoup_loss,
|
2018-10-28 11:30:02 +01:00
|
|
|
uint64_t num_issued);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about a denomination key's balances.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param denom_pub_hash hash of the denomination public key
|
2017-03-18 22:20:48 +01:00
|
|
|
* @param[out] denom_balance value of coins outstanding with this denomination key
|
2019-09-02 08:01:55 +02:00
|
|
|
* @param[out] denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance)
|
2017-03-18 22:20:48 +01:00
|
|
|
* @param[out] denom_risk value of coins issued with this denomination key
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param[out] denom_recoup value of coins paid back if this denomination key was revoked
|
2018-10-28 11:30:02 +01:00
|
|
|
* @param[out] num_issued how many coins of this denomination did the exchange blind-sign
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*get_denomination_balance)(void *cls,
|
2021-10-22 22:04:35 +02:00
|
|
|
const struct
|
|
|
|
TALER_DenominationHash *denom_pub_hash,
|
2017-03-18 22:20:48 +01:00
|
|
|
struct TALER_Amount *denom_balance,
|
2019-09-02 08:01:55 +02:00
|
|
|
struct TALER_Amount *denom_loss,
|
2018-10-28 11:30:02 +01:00
|
|
|
struct TALER_Amount *denom_risk,
|
2020-01-18 23:49:37 +01:00
|
|
|
struct TALER_Amount *recoup_loss,
|
2018-10-28 11:30:02 +01:00
|
|
|
uint64_t *num_issued);
|
2017-03-18 22:06:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete information about a denomination key's balances.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param denom_pub_hash hash of the denomination public key
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2017-03-18 22:06:27 +01:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-18 22:06:27 +01:00
|
|
|
(*del_denomination_balance)(void *cls,
|
2021-10-22 22:04:35 +02:00
|
|
|
const struct
|
|
|
|
TALER_DenominationHash *denom_pub_hash);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about an exchange's denomination balances. There
|
|
|
|
* must not be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param denom_balance value of coins outstanding with this denomination key
|
|
|
|
* @param deposit_fee_balance total deposit fees collected for this DK
|
|
|
|
* @param melt_fee_balance total melt fees collected for this DK
|
|
|
|
* @param refund_fee_balance total refund fees collected for this DK
|
2017-03-18 22:06:27 +01:00
|
|
|
* @param risk maximum risk exposure of the exchange
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param recoup_loss actual losses from recoup (actualized @a risk)
|
|
|
|
* @param irregular_recoups recoups made of non-revoked coins (reduces
|
2020-01-17 15:00:22 +01:00
|
|
|
* risk, but should never happen)
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-19 01:09:00 +01:00
|
|
|
(*insert_balance_summary)(void *cls,
|
2017-03-20 04:17:06 +01:00
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *denom_balance,
|
|
|
|
const struct TALER_Amount *deposit_fee_balance,
|
|
|
|
const struct TALER_Amount *melt_fee_balance,
|
|
|
|
const struct TALER_Amount *refund_fee_balance,
|
2019-07-25 19:26:25 +02:00
|
|
|
const struct TALER_Amount *risk,
|
2020-01-18 23:49:37 +01:00
|
|
|
const struct TALER_Amount *recoup_loss,
|
|
|
|
const struct TALER_Amount *irregular_recoups);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about an exchange's denomination balances. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param denom_balance value of coins outstanding with this denomination key
|
|
|
|
* @param deposit_fee_balance total deposit fees collected for this DK
|
|
|
|
* @param melt_fee_balance total melt fees collected for this DK
|
|
|
|
* @param refund_fee_balance total refund fees collected for this DK
|
2017-03-18 22:06:27 +01:00
|
|
|
* @param risk maximum risk exposure of the exchange
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param recoup_loss actual losses from recoup (actualized @a risk)
|
|
|
|
* @param irregular_recoups recoups made of non-revoked coins (reduces
|
2020-01-17 15:00:22 +01:00
|
|
|
* risk, but should never happen)
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-19 01:09:00 +01:00
|
|
|
(*update_balance_summary)(void *cls,
|
2017-03-20 04:17:06 +01:00
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *denom_balance,
|
|
|
|
const struct TALER_Amount *deposit_fee_balance,
|
|
|
|
const struct TALER_Amount *melt_fee_balance,
|
|
|
|
const struct TALER_Amount *refund_fee_balance,
|
2019-07-25 19:26:25 +02:00
|
|
|
const struct TALER_Amount *risk,
|
2020-01-18 23:49:37 +01:00
|
|
|
const struct TALER_Amount *recoup_loss,
|
|
|
|
const struct TALER_Amount *irregular_recoups);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about an exchange's denomination balances.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param[out] denom_balance value of coins outstanding with this denomination key
|
|
|
|
* @param[out] deposit_fee_balance total deposit fees collected for this DK
|
|
|
|
* @param[out] melt_fee_balance total melt fees collected for this DK
|
|
|
|
* @param[out] refund_fee_balance total refund fees collected for this DK
|
2017-03-18 22:06:27 +01:00
|
|
|
* @param[out] risk maximum risk exposure of the exchange
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param[out] recoup_loss actual losses from recoup (actualized @a risk)
|
|
|
|
* @param[out] irregular_recoups recoups made of non-revoked coins (reduces
|
2020-01-17 15:00:22 +01:00
|
|
|
* risk, but should never happen)
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2017-03-19 01:09:00 +01:00
|
|
|
(*get_balance_summary)(void *cls,
|
2017-03-20 04:17:06 +01:00
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_Amount *denom_balance,
|
|
|
|
struct TALER_Amount *deposit_fee_balance,
|
|
|
|
struct TALER_Amount *melt_fee_balance,
|
|
|
|
struct TALER_Amount *refund_fee_balance,
|
2019-07-25 19:26:25 +02:00
|
|
|
struct TALER_Amount *risk,
|
2020-01-18 23:49:37 +01:00
|
|
|
struct TALER_Amount *recoup_loss,
|
|
|
|
struct TALER_Amount *irregular_recoup);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about an exchange's historic
|
|
|
|
* revenue about a denomination key.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param denom_pub_hash hash of the denomination key
|
|
|
|
* @param revenue_timestamp when did this profit get realized
|
|
|
|
* @param revenue_balance what was the total profit made from
|
|
|
|
* deposit fees, melting fees, refresh fees
|
|
|
|
* and coins that were never returned?
|
2020-01-18 23:49:37 +01:00
|
|
|
* @param recoup_loss_balance total losses from recoups of revoked denominations
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_historic_denom_revenue)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
2021-10-22 22:04:35 +02:00
|
|
|
const struct TALER_DenominationHash *denom_pub_hash,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp revenue_timestamp,
|
2020-03-07 00:28:07 +01:00
|
|
|
const struct TALER_Amount *revenue_balance,
|
|
|
|
const struct TALER_Amount *recoup_loss_balance);
|
2017-03-18 23:03:00 +01:00
|
|
|
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtain all of the historic denomination key revenue
|
|
|
|
* of the given @a master_pub.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param cb function to call with the results
|
|
|
|
* @param cb_cls closure for @a cb
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*select_historic_denom_revenue)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb,
|
|
|
|
void *cb_cls);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about an exchange's historic revenue from reserves.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param start_time beginning of aggregated time interval
|
|
|
|
* @param end_time end of aggregated time interval
|
|
|
|
* @param reserve_profits total profits made
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*insert_historic_reserve_revenue)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
2021-12-14 16:04:32 +01:00
|
|
|
struct GNUNET_TIME_Timestamp start_time,
|
|
|
|
struct GNUNET_TIME_Timestamp end_time,
|
2020-03-07 00:28:07 +01:00
|
|
|
const struct TALER_Amount *reserve_profits);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return information about an exchange's historic revenue from reserves.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param cb function to call with results
|
|
|
|
* @param cb_cls closure for @a cb
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2020-03-07 00:28:07 +01:00
|
|
|
(*select_historic_reserve_revenue)(
|
|
|
|
void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb,
|
|
|
|
void *cb_cls);
|
2016-10-08 23:37:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert information about the predicted exchange's bank
|
|
|
|
* account balance.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param balance what the bank account balance of the exchange should show
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*insert_predicted_result)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *balance);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update information about an exchange's predicted balance. There
|
|
|
|
* must be an existing record for the exchange.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param balance what the bank account balance of the exchange should show
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*update_predicted_result)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
const struct TALER_Amount *balance);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an exchange's predicted balance.
|
|
|
|
*
|
|
|
|
* @param cls the @e cls of this struct with the plugin-specific state
|
|
|
|
* @param master_pub master key of the exchange
|
|
|
|
* @param[out] balance expected bank account balance of the exchange
|
2017-06-24 23:06:44 +02:00
|
|
|
* @return transaction status code
|
2016-10-08 23:37:55 +02:00
|
|
|
*/
|
2017-06-24 23:06:44 +02:00
|
|
|
enum GNUNET_DB_QueryStatus
|
2016-10-08 23:37:55 +02:00
|
|
|
(*get_predicted_balance)(void *cls,
|
|
|
|
const struct TALER_MasterPublicKeyP *master_pub,
|
|
|
|
struct TALER_Amount *balance);
|
|
|
|
|
2016-11-06 13:39:22 +01:00
|
|
|
|
2016-10-06 15:17:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _TALER_AUDITOR_DB_H */
|