exchange

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

select_reserves_in_above_serial_id_by_account.h (3513B)


      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/select_reserves_in_above_serial_id_by_account.h
     18  * @brief implementation of the select_reserves_in_above_serial_id_by_account function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H
     22 #define EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /* Callback typedefs */
     30 /**
     31  * Function called with details about incoming wire transfers.
     32  *
     33  * @param cls closure
     34  * @param rowid unique serial ID for the refresh session in our DB
     35  * @param reserve_pub public key of the reserve (also the wire subject)
     36  * @param credit amount that was received
     37  * @param sender_account_details information about the sender's bank account, in payto://-format
     38  * @param wire_reference unique identifier for the wire transfer
     39  * @param execution_date when did we receive the funds
     40  * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
     41  */
     42 typedef enum GNUNET_GenericReturnValue
     43 (*TALER_EXCHANGEDB_ReserveInCallback)(
     44   void *cls,
     45   uint64_t rowid,
     46   const struct TALER_ReservePublicKeyP *reserve_pub,
     47   const struct TALER_Amount *credit,
     48   const struct TALER_FullPayto sender_account_details,
     49   uint64_t wire_reference,
     50   struct GNUNET_TIME_Timestamp execution_date);
     51 
     52 /**
     53  * Select inbound wire transfers into reserves_in above @a serial_id
     54  * in monotonically increasing order by account.
     55  *
     56  * @param pg the database context
     57  * @param account_name name of the account to select by
     58  * @param serial_id highest serial ID to exclude (select strictly larger)
     59  * @param cb function to call on each result
     60  * @param cb_cls closure for @a cb
     61  * @return transaction status code
     62  */
     63 enum GNUNET_DB_QueryStatus
     64 TALER_TALER_EXCHANGEDB_select_reserves_in_above_serial_id_by_account (struct
     65                                                                       TALER_EXCHANGEDB_PostgresContext
     66                                                                       *pg,
     67                                                                       const char
     68                                                                       *
     69                                                                       account_name,
     70                                                                       uint64_t
     71                                                                       serial_id,
     72                                                                       TALER_EXCHANGEDB_ReserveInCallback
     73                                                                       cb,
     74                                                                       void *
     75                                                                       cb_cls);
     76 
     77 #endif