iterate_kycauth_in_above_serial_id_by_account.h (3856B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 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/iterate_kycauth_in_above_serial_id_by_account.h 18 * @brief implementation of the iterate_kycauth_in_above_serial_id_by_account function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_ITERATE_KYCAUTH_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H 22 #define EXCHANGE_DATABASE_ITERATE_KYCAUTH_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 that 32 * established an account key for KYC authentication. 33 * 34 * @param cls closure 35 * @param rowid unique serial ID of the entry in kycauths_in 36 * @param account_pub public key the transfer associated with the account 37 * @param credit amount that was received 38 * @param sender_account_details information about the sender's bank account, 39 * in payto://-format; NULL if the exchange has no wire_targets row 40 * for the debited account 41 * @param wire_reference unique identifier for the wire transfer 42 * @param execution_date when did we receive the funds 43 * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop 44 */ 45 #ifndef TALER_EXCHANGEDB_KYCAUTH_IN_RESULT_CLOSURE 46 /** 47 * Type of the closure for #TALER_EXCHANGEDB_KycauthInCallback. 48 */ 49 #define TALER_EXCHANGEDB_KYCAUTH_IN_RESULT_CLOSURE void 50 #endif 51 typedef enum GNUNET_GenericReturnValue 52 (*TALER_EXCHANGEDB_KycauthInCallback)( 53 TALER_EXCHANGEDB_KYCAUTH_IN_RESULT_CLOSURE *cls, 54 uint64_t rowid, 55 const union TALER_AccountPublicKeyP *account_pub, 56 const struct TALER_Amount *credit, 57 const struct TALER_FullPayto sender_account_details, 58 uint64_t wire_reference, 59 struct GNUNET_TIME_Timestamp execution_date); 60 61 /** 62 * Select inbound wire transfers into kycauths_in above @a serial_id 63 * in monotonically increasing order by account. 64 * 65 * @param pg the database context 66 * @param account_name name of the account to select by 67 * @param serial_id lowest serial ID to include (the row itself is returned, 68 * so callers resuming from a progress point pass last seen + 1) 69 * @param cb function to call on each result 70 * @param cb_cls closure for @a cb 71 * @return transaction status code 72 */ 73 enum GNUNET_DB_QueryStatus 74 TALER_EXCHANGEDB_iterate_kycauth_in_above_serial_id_by_account (struct 75 TALER_EXCHANGEDB_PostgresContext 76 *pg, 77 const char * 78 account_name, 79 uint64_t 80 serial_id, 81 TALER_EXCHANGEDB_KycauthInCallback 82 cb, 83 TALER_EXCHANGEDB_KYCAUTH_IN_RESULT_CLOSURE 84 *cb_cls); 85 86 #endif