exchange

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

get_aggregation_transient_by_wtid.h (2435B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2026 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_aggregation_transient_by_wtid.h
     18  * @brief implementation of the get_aggregation_transient_by_wtid function
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_GET_AGGREGATION_TRANSIENT_BY_WTID_H
     22 #define EXCHANGE_DATABASE_GET_AGGREGATION_TRANSIENT_BY_WTID_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "exchangedb_lib.h"
     26 
     27 
     28 /**
     29  * Obtain what the exchange itself says about a wire transfer it has aggregated
     30  * but not executed: how much it is holding, and whether it is holding it for
     31  * legitimization reasons.
     32  *
     33  * `aggregation_transient` is updated in place and deleted on payout, so it has
     34  * no serial ID and `taler-auditor-sync` cannot replicate it.  This is
     35  * therefore only usable for an exchange-internal audit (`-i`), where it serves
     36  * to check the auditor's own inference about the account against the reason
     37  * the exchange actually recorded.
     38  *
     39  * @param pg the database context
     40  * @param wire_target_h_payto account the transfer should go to
     41  * @param wtid wire transfer identifier to look up
     42  * @param[out] amount set to the amount the exchange says it is holding
     43  * @param[out] legitimization_measure_serial_id set to the measure the exchange
     44  *        is waiting for, or 0 if the exchange claims no legitimization reason
     45  * @return #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the exchange has no
     46  *         transient aggregation for @a wtid
     47  */
     48 enum GNUNET_DB_QueryStatus
     49 TALER_EXCHANGEDB_get_aggregation_transient_by_wtid (
     50   struct TALER_EXCHANGEDB_PostgresContext *pg,
     51   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     52   const struct TALER_WireTransferIdentifierRawP *wtid,
     53   struct TALER_Amount *amount,
     54   uint64_t *legitimization_measure_serial_id);
     55 
     56 #endif