get_global_fees.h (3487B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file src/include/exchange-database/get_global_fees.h 18 * @brief implementation of the get_global_fees function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_GET_GLOBAL_FEES_H 22 #define EXCHANGE_DATABASE_GET_GLOBAL_FEES_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Provide information about global fees. 31 * 32 * @param cls closure 33 * @param fees the global fees we charge 34 * @param purse_timeout when do purses time out 35 * @param history_expiration how long are account histories preserved 36 * @param purse_account_limit how many purses are free per account 37 * @param start_date from when are these fees valid (start date) 38 * @param end_date until when are these fees valid (end date, exclusive) 39 * @param master_sig master key signature affirming that this is the correct 40 * fee (of purpose #TALER_SIGNATURE_MASTER_GLOBAL_FEES) 41 */ 42 typedef void 43 (*TALER_EXCHANGEDB_GlobalFeeCallback)( 44 void *cls, 45 const struct TALER_GlobalFeeSet *fees, 46 struct GNUNET_TIME_Relative purse_timeout, 47 struct GNUNET_TIME_Relative history_expiration, 48 uint32_t purse_account_limit, 49 struct GNUNET_TIME_Timestamp start_date, 50 struct GNUNET_TIME_Timestamp end_date, 51 const struct TALER_MasterSignatureP *master_sig); 52 53 54 /* Callback typedefs */ 55 /** 56 * Provide information about global fees. 57 * 58 * @param cls closure 59 * @param fees the global fees we charge 60 * @param purse_timeout when do purses time out 61 * @param history_expiration how long are account histories preserved 62 * @param purse_account_limit how many purses are free per account 63 * @param start_date from when are these fees valid (start date) 64 * @param end_date until when are these fees valid (end date, exclusive) 65 * @param master_sig master key signature affirming that this is the correct 66 * fee (of purpose #TALER_SIGNATURE_MASTER_GLOBAL_FEES) 67 */ 68 typedef void 69 (*TALER_EXCHANGEDB_GlobalFeeCallback)( 70 void *cls, 71 const struct TALER_GlobalFeeSet *fees, 72 struct GNUNET_TIME_Relative purse_timeout, 73 struct GNUNET_TIME_Relative history_expiration, 74 uint32_t purse_account_limit, 75 struct GNUNET_TIME_Timestamp start_date, 76 struct GNUNET_TIME_Timestamp end_date, 77 const struct TALER_MasterSignatureP *master_sig); 78 79 /** 80 * Obtain global fees from database. 81 * 82 * @param pg the database context 83 * @param cb function to call on each fee entry 84 * @param cb_cls closure for @a cb 85 * @return status of the transaction 86 */ 87 enum GNUNET_DB_QueryStatus 88 TALER_TALER_EXCHANGEDB_get_global_fees (struct 89 TALER_EXCHANGEDB_PostgresContext *pg, 90 TALER_EXCHANGEDB_GlobalFeeCallback cb, 91 void *cb_cls); 92 93 #endif