select_reserves_in_above_serial_id.h (3220B)
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.h 18 * @brief implementation of the select_reserves_in_above_serial_id function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_H 22 #define EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_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 #ifndef TALER_EXCHANGEDB_RESERVE_IN_RESULT_CLOSURE 43 /** 44 * Type of the closure for #TALER_EXCHANGEDB_ReserveInCallback. 45 */ 46 #define TALER_EXCHANGEDB_RESERVE_IN_RESULT_CLOSURE void 47 #endif 48 typedef enum GNUNET_GenericReturnValue 49 (*TALER_EXCHANGEDB_ReserveInCallback)( 50 TALER_EXCHANGEDB_RESERVE_IN_RESULT_CLOSURE *cls, 51 uint64_t rowid, 52 const struct TALER_ReservePublicKeyP *reserve_pub, 53 const struct TALER_Amount *credit, 54 const struct TALER_FullPayto sender_account_details, 55 uint64_t wire_reference, 56 struct GNUNET_TIME_Timestamp execution_date); 57 58 /** 59 * Select inbound wire transfers into reserves_in above @a serial_id 60 * in monotonically increasing order. 61 * 62 * @param pg the database context 63 * @param serial_id highest serial ID to exclude (select strictly larger) 64 * @param cb function to call on each result 65 * @param cb_cls closure for @a cb 66 * @return transaction status code 67 */ 68 enum GNUNET_DB_QueryStatus 69 TALER_EXCHANGEDB_select_reserves_in_above_serial_id (struct 70 TALER_EXCHANGEDB_PostgresContext 71 *pg, 72 uint64_t serial_id, 73 TALER_EXCHANGEDB_ReserveInCallback 74 cb, 75 TALER_EXCHANGEDB_RESERVE_IN_RESULT_CLOSURE 76 *cb_cls); 77 78 #endif