exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

get_wire_fees.h (2999B)


      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_wire_fees.h
     18  * @brief implementation of the get_wire_fees function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_GET_WIRE_FEES_H
     22 #define EXCHANGE_DATABASE_GET_WIRE_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 wire fees.
     31  *
     32  * @param cls closure
     33  * @param fees the wire fees we charge
     34  * @param start_date from when are these fees valid (start date)
     35  * @param end_date until when are these fees valid (end date, exclusive)
     36  * @param master_sig master key signature affirming that this is the correct
     37  *                   fee (of purpose #TALER_SIGNATURE_MASTER_WIRE_FEES)
     38  */
     39 typedef void
     40 (*TALER_EXCHANGEDB_WireFeeCallback)(
     41   void *cls,
     42   const struct TALER_WireFeeSet *fees,
     43   struct GNUNET_TIME_Timestamp start_date,
     44   struct GNUNET_TIME_Timestamp end_date,
     45   const struct TALER_MasterSignatureP *master_sig);
     46 
     47 
     48 /* Callback typedefs */
     49 /**
     50  * Provide information about wire fees.
     51  *
     52  * @param cls closure
     53  * @param fees the wire fees we charge
     54  * @param start_date from when are these fees valid (start date)
     55  * @param end_date until when are these fees valid (end date, exclusive)
     56  * @param master_sig master key signature affirming that this is the correct
     57  *                   fee (of purpose #TALER_SIGNATURE_MASTER_WIRE_FEES)
     58  */
     59 typedef void
     60 (*TALER_EXCHANGEDB_WireFeeCallback)(
     61   void *cls,
     62   const struct TALER_WireFeeSet *fees,
     63   struct GNUNET_TIME_Timestamp start_date,
     64   struct GNUNET_TIME_Timestamp end_date,
     65   const struct TALER_MasterSignatureP *master_sig);
     66 
     67 /**
     68  * Obtain information about the fee structure of the exchange for
     69  * a given @a wire_method
     70  *
     71  * @param pg the database context
     72  * @param wire_method which wire method to obtain fees for
     73  * @param cb function to call on each account
     74  * @param cb_cls closure for @a cb
     75  * @return transaction status code
     76  */
     77 enum GNUNET_DB_QueryStatus
     78 TALER_TALER_EXCHANGEDB_get_wire_fees (struct TALER_EXCHANGEDB_PostgresContext *
     79                                       pg,
     80                                       const char *wire_method,
     81                                       TALER_EXCHANGEDB_WireFeeCallback cb,
     82                                       void *cb_cls);
     83 
     84 #endif