commit 19536e05e64c348b7cfde78482f5b151d628dac4 parent a4e4fecc43026e754364d4f1e4383c331e664d2c Author: Christian Grothoff <grothoff@gnunet.org> Date: Sun, 12 Apr 2026 19:54:11 +0200 move headers that are not being installed out of include/taler Diffstat:
927 files changed, 12916 insertions(+), 12917 deletions(-)
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c @@ -19,15 +19,15 @@ * @author Christian Grothoff */ #include "report-lib.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/start.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/get_denomination_by_serial.h" -#include "taler/exchange-database/get_denomination_info.h" -#include "taler/exchange-database/iterate_denomination_info.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/start.h" +#include "auditor-database/preflight.h" +#include "auditor-database/start.h" +#include "exchange-database/commit.h" +#include "exchange-database/get_denomination_by_serial.h" +#include "exchange-database/get_denomination_info.h" +#include "exchange-database/iterate_denomination_info.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" +#include "exchange-database/start.h" /** * Handle to access the exchange's database. diff --git a/src/auditor/taler-auditor-dbinit.c b/src/auditor/taler-auditor-dbinit.c @@ -23,9 +23,9 @@ #include <gnunet/gnunet_util_lib.h> #include "taler/taler_util.h" #include "taler/taler_auditordb_lib.h" -#include "taler/auditor-database/gc.h" -#include "taler/auditor-database/drop_tables.h" -#include "taler/auditor-database/create_tables.h" +#include "auditor-database/gc.h" +#include "auditor-database/drop_tables.h" +#include "auditor-database/create_tables.h" /** diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c @@ -69,7 +69,7 @@ #include "taler-auditor-httpd_get-monitoring-fee-time-inconsistency.h" #include "taler-auditor-httpd_get-monitoring-balances.h" #include "taler-auditor-httpd_get-monitoring-progress.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/preflight.h" /** * Auditor protocol version string. diff --git a/src/auditor/taler-auditor-httpd_delete-generic.c b/src/auditor/taler-auditor-httpd_delete-generic.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_delete-generic.h" -#include "taler/auditor-database/delete_generic.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/delete_generic.h" +#include "auditor-database/preflight.h" MHD_RESULT diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.h" -#include "taler/auditor-database/get_amount_arithmetic_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_amount_arithmetic_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-bad-sig-losses.c b/src/auditor/taler-auditor-httpd_get-monitoring-bad-sig-losses.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-bad-sig-losses.h" -#include "taler/auditor-database/get_bad_sig_losses.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_bad_sig_losses.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-balances.c b/src/auditor/taler-auditor-httpd_get-monitoring-balances.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-balances.h" -#include "taler/auditor-database/get_balances.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_balances.h" +#include "auditor-database/preflight.h" /** * Add balance to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-closure-lags.c b/src/auditor/taler-auditor-httpd_get-monitoring-closure-lags.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-closure-lags.h" -#include "taler/auditor-database/get_auditor_closure_lags.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_auditor_closure_lags.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-coin-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-coin-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-coin-inconsistency.h" -#include "taler/auditor-database/get_coin_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_coin_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c @@ -24,8 +24,8 @@ #include \ "taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.h" #include \ - "taler/auditor-database/get_denomination_key_validity_withdraw_inconsistency.h" -#include "taler/auditor-database/preflight.h" + "auditor-database/get_denomination_key_validity_withdraw_inconsistency.h" +#include "auditor-database/preflight.h" /** * Add denomination-key-validity-withdraw-inconsistency to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-denomination-pending.c b/src/auditor/taler-auditor-httpd_get-monitoring-denomination-pending.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-denomination-pending.h" -#include "taler/auditor-database/get_denomination_pending.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_denomination_pending.h" +#include "auditor-database/preflight.h" /** * Add denomination-pending to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-denominations-without-sigs.c b/src/auditor/taler-auditor-httpd_get-monitoring-denominations-without-sigs.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-denominations-without-sigs.h" -#include "taler/auditor-database/get_denominations_without_sigs.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_denominations_without_sigs.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-deposit-confirmations.c b/src/auditor/taler-auditor-httpd_get-monitoring-deposit-confirmations.c @@ -28,8 +28,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-deposit-confirmations.h" -#include "taler/auditor-database/get_deposit_confirmations.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_deposit_confirmations.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-early-aggregation.c b/src/auditor/taler-auditor-httpd_get-monitoring-early-aggregation.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-early-aggregation.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/select_early_aggregations.h" +#include "auditor-database/preflight.h" +#include "auditor-database/select_early_aggregations.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-emergency-by-count.c b/src/auditor/taler-auditor-httpd_get-monitoring-emergency-by-count.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-emergency-by-count.h" -#include "taler/auditor-database/get_emergency_by_count.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_emergency_by_count.h" +#include "auditor-database/preflight.h" /** * Add emergency-by-count to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-emergency.c b/src/auditor/taler-auditor-httpd_get-monitoring-emergency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-emergency.h" -#include "taler/auditor-database/get_emergency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_emergency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-fee-time-inconsistency.h" -#include "taler/auditor-database/get_fee_time_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_fee_time_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c b/src/auditor/taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c @@ -24,8 +24,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-historic-denomination-revenue.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/select_historic_denom_revenue.h" +#include "auditor-database/preflight.h" +#include "auditor-database/select_historic_denom_revenue.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-historic-reserve-summary.c b/src/auditor/taler-auditor-httpd_get-monitoring-historic-reserve-summary.c @@ -24,8 +24,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-historic-reserve-summary.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/select_historic_reserve_revenue.h" +#include "auditor-database/preflight.h" +#include "auditor-database/select_historic_reserve_revenue.h" /** * Add historic-reserve-summary to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.h" -#include "taler/auditor-database/get_misattribution_in_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_misattribution_in_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-pending-deposits.c b/src/auditor/taler-auditor-httpd_get-monitoring-pending-deposits.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-pending-deposits.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/select_pending_deposits.h" +#include "auditor-database/preflight.h" +#include "auditor-database/select_pending_deposits.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-progress.c b/src/auditor/taler-auditor-httpd_get-monitoring-progress.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-progress.h" -#include "taler/auditor-database/get_progress_points.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_progress_points.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c b/src/auditor/taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.h" -#include "taler/auditor-database/get_purse_not_closed_inconsistencies.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_purse_not_closed_inconsistencies.h" +#include "auditor-database/preflight.h" /** * Add purse-not-closed-inconsistencies to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-purses.c b/src/auditor/taler-auditor-httpd_get-monitoring-purses.c @@ -24,8 +24,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-purses.h" -#include "taler/auditor-database/get_purses.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_purses.h" +#include "auditor-database/preflight.h" /** * Add purses to the list. diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c @@ -24,8 +24,8 @@ #include \ "taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.h" #include \ - "taler/auditor-database/get_reserve_balance_insufficient_inconsistency.h" -#include "taler/auditor-database/preflight.h" + "auditor-database/get_reserve_balance_insufficient_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c @@ -24,8 +24,8 @@ #include \ "taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.h" #include \ - "taler/auditor-database/get_reserve_balance_summary_wrong_inconsistency.h" -#include "taler/auditor-database/preflight.h" + "auditor-database/get_reserve_balance_summary_wrong_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.h" -#include "taler/auditor-database/get_reserve_in_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_reserve_in_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.h" -#include "taler/auditor-database/get_reserve_not_closed_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_reserve_not_closed_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-reserves.c b/src/auditor/taler-auditor-httpd_get-monitoring-reserves.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-reserves.h" -#include "taler/auditor-database/get_reserves.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_reserves.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-row-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-row-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-row-inconsistency.h" -#include "taler/auditor-database/get_row_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_row_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c b/src/auditor/taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.h" -#include "taler/auditor-database/get_row_minor_inconsistencies.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_row_minor_inconsistencies.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-wire-format-inconsistency.h" -#include "taler/auditor-database/get_wire_format_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_wire_format_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c b/src/auditor/taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_get-monitoring-wire-out-inconsistency.h" -#include "taler/auditor-database/get_wire_out_inconsistency.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/get_wire_out_inconsistency.h" +#include "auditor-database/preflight.h" /** diff --git a/src/auditor/taler-auditor-httpd_patch-generic-suppressed.c b/src/auditor/taler-auditor-httpd_patch-generic-suppressed.c @@ -22,8 +22,8 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_patch-generic-suppressed.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/update_generic_suppressed.h" +#include "auditor-database/preflight.h" +#include "auditor-database/update_generic_suppressed.h" MHD_RESULT diff --git a/src/auditor/taler-auditor-httpd_put-deposit-confirmation.c b/src/auditor/taler-auditor-httpd_put-deposit-confirmation.c @@ -29,10 +29,10 @@ #include "taler/taler_mhd_lib.h" #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_put-deposit-confirmation.h" -#include "taler/exchange-database/lookup_signkey_revocation.h" -#include "taler/auditor-database/insert_deposit_confirmation.h" -#include "taler/auditor-database/insert_exchange_signkey.h" -#include "taler/auditor-database/preflight.h" +#include "exchange-database/lookup_signkey_revocation.h" +#include "auditor-database/insert_deposit_confirmation.h" +#include "auditor-database/insert_exchange_signkey.h" +#include "auditor-database/preflight.h" GNUNET_NETWORK_STRUCT_BEGIN diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c @@ -20,210 +20,210 @@ */ #include "taler/platform.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/test_aml_officer.h" -#include "taler/exchange-database/abort_shard.h" -#include "taler/exchange-database/activate_signing_key.h" -#include "taler/exchange-database/add_denomination_key.h" -#include "taler/exchange-database/add_policy_fulfillment_proof.h" -#include "taler/exchange-database/aggregate.h" -#include "taler/exchange-database/batch_ensure_coin_known.h" -#include "taler/exchange-database/begin_revolving_shard.h" -#include "taler/exchange-database/begin_shard.h" -#include "taler/exchange-database/clear_aml_lock.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/complete_shard.h" -#include "taler/exchange-database/compute_shard.h" -#include "taler/exchange-database/count_known_coins.h" -#include "taler/exchange-database/create_aggregation_transient.h" -#include "taler/exchange-database/create_tables.h" -#include "taler/exchange-database/delete_aggregation_transient.h" -#include "taler/exchange-database/delete_shard_locks.h" -#include "taler/exchange-database/disable_rules.h" -#include "taler/exchange-database/do_check_deposit_idempotent.h" -#include "taler/exchange-database/do_deposit.h" -#include "taler/exchange-database/do_purse_delete.h" -#include "taler/exchange-database/do_purse_deposit.h" -#include "taler/exchange-database/do_purse_merge.h" -#include "taler/exchange-database/do_recoup.h" -#include "taler/exchange-database/do_recoup_refresh.h" -#include "taler/exchange-database/do_refresh.h" -#include "taler/exchange-database/do_refund.h" -#include "taler/exchange-database/do_reserve_open.h" -#include "taler/exchange-database/do_reserve_purse.h" -#include "taler/exchange-database/do_withdraw.h" -#include "taler/exchange-database/drain_kyc_alert.h" -#include "taler/exchange-database/drop_tables.h" -#include "taler/exchange-database/enable_rules.h" -#include "taler/exchange-database/ensure_coin_known.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/expire_purse.h" -#include "taler/exchange-database/find_aggregation_transient.h" -#include "taler/exchange-database/gc.h" -#include "taler/exchange-database/get_coin_denomination.h" -#include "taler/exchange-database/get_coin_transactions.h" -#include "taler/exchange-database/get_denomination_by_serial.h" -#include "taler/exchange-database/get_denomination_info.h" -#include "taler/exchange-database/get_denomination_revocation.h" -#include "taler/exchange-database/get_drain_profit.h" -#include "taler/exchange-database/get_expired_reserves.h" -#include "taler/exchange-database/get_extension_manifest.h" -#include "taler/exchange-database/get_global_fee.h" -#include "taler/exchange-database/get_global_fees.h" -#include "taler/exchange-database/get_known_coin.h" -#include "taler/exchange-database/get_kyc_rules.h" -#include "taler/exchange-database/get_old_coin_by_h_blind.h" -#include "taler/exchange-database/get_pending_kyc_requirement_process.h" -#include "taler/exchange-database/get_policy_details.h" -#include "taler/exchange-database/get_purse_deposit.h" -#include "taler/exchange-database/get_purse_request.h" -#include "taler/exchange-database/get_ready_deposit.h" -#include "taler/exchange-database/get_refresh.h" -#include "taler/exchange-database/get_reserve_balance.h" -#include "taler/exchange-database/get_reserve_by_h_planchets.h" -#include "taler/exchange-database/get_reserve_history.h" -#include "taler/exchange-database/get_signature_for_known_coin.h" -#include "taler/exchange-database/get_unfinished_close_requests.h" -#include "taler/exchange-database/get_wire_accounts.h" -#include "taler/exchange-database/get_wire_fee.h" -#include "taler/exchange-database/get_wire_fees.h" -#include "taler/exchange-database/get_wire_hash_for_contract.h" -#include "taler/exchange-database/get_withdraw.h" -#include "taler/exchange-database/have_deposit2.h" -#include "taler/exchange-database/inject_auditor_triggers.h" -#include "taler/exchange-database/insert_active_legitimization_measure.h" -#include "taler/exchange-database/insert_aml_decision.h" -#include "taler/exchange-database/insert_aml_officer.h" -#include "taler/exchange-database/insert_aml_program_failure.h" -#include "taler/exchange-database/insert_auditor_denom_sig.h" -#include "taler/exchange-database/insert_auditor.h" -#include "taler/exchange-database/insert_close_request.h" -#include "taler/exchange-database/insert_contract.h" -#include "taler/exchange-database/insert_denomination_info.h" -#include "taler/exchange-database/insert_denomination_revocation.h" -#include "taler/exchange-database/insert_drain_profit.h" -#include "taler/exchange-database/insert_global_fee.h" -#include "taler/exchange-database/insert_kyc_failure.h" -#include "taler/exchange-database/insert_kyc_requirement_process.h" -#include "taler/exchange-database/insert_partner.h" -#include "taler/exchange-database/insert_purse_request.h" -#include "taler/exchange-database/insert_records_by_table.h" -#include "taler/exchange-database/insert_reserve_closed.h" -#include "taler/exchange-database/insert_reserve_open_deposit.h" -#include "taler/exchange-database/insert_sanction_list_hit.h" -#include "taler/exchange-database/insert_signkey_revocation.h" -#include "taler/exchange-database/insert_successor_measure.h" -#include "taler/exchange-database/insert_wire_fee.h" -#include "taler/exchange-database/insert_wire.h" -#include "taler/exchange-database/iterate_active_auditors.h" -#include "taler/exchange-database/iterate_active_signkeys.h" -#include "taler/exchange-database/iterate_auditor_denominations.h" -#include "taler/exchange-database/iterate_denomination_info.h" -#include "taler/exchange-database/iterate_denominations.h" -#include "taler/exchange-database/iterate_kyc_reference.h" -#include "taler/exchange-database/iterate_reserve_close_info.h" -#include "taler/exchange-database/kycauth_in_insert.h" -#include "taler/exchange-database/kyc_provider_account_lookup.h" -#include "taler/exchange-database/lookup_active_legitimization.h" -#include "taler/exchange-database/lookup_aml_file_number.h" -#include "taler/exchange-database/lookup_aml_history.h" -#include "taler/exchange-database/lookup_aml_officer.h" -#include "taler/exchange-database/lookup_auditor_status.h" -#include "taler/exchange-database/lookup_auditor_timestamp.h" -#include "taler/exchange-database/lookup_completed_legitimization.h" -#include "taler/exchange-database/lookup_denomination_key.h" -#include "taler/exchange-database/lookup_global_fee_by_time.h" -#include "taler/exchange-database/lookup_h_payto_by_access_token.h" -#include "taler/exchange-database/lookup_kyc_history.h" -#include "taler/exchange-database/lookup_kyc_process_by_account.h" -#include "taler/exchange-database/lookup_kyc_requirement_by_row.h" -#include "taler/exchange-database/lookup_kyc_status_by_token.h" -#include "taler/exchange-database/lookup_pending_legitimization.h" -#include "taler/exchange-database/lookup_records_by_table.h" -#include "taler/exchange-database/lookup_rules_by_access_token.h" -#include "taler/exchange-database/lookup_serial_by_table.h" -#include "taler/exchange-database/lookup_signing_key.h" -#include "taler/exchange-database/lookup_signkey_revocation.h" -#include "taler/exchange-database/lookup_transfer_by_deposit.h" -#include "taler/exchange-database/lookup_wire_fee_by_time.h" -#include "taler/exchange-database/lookup_wire_timestamp.h" -#include "taler/exchange-database/lookup_wire_transfer.h" -#include "taler/exchange-database/mark_refresh_reveal_success.h" -#include "taler/exchange-database/persist_kyc_attributes.h" -#include "taler/exchange-database/persist_policy_details.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/profit_drains_get_pending.h" -#include "taler/exchange-database/profit_drains_set_finished.h" -#include "taler/exchange-database/release_revolving_shard.h" -#include "taler/exchange-database/reserves_get.h" -#include "taler/exchange-database/reserves_get_origin.h" -#include "taler/exchange-database/reserves_in_insert.h" -#include "taler/exchange-database/reserves_update.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/select_account_merges_above_serial_id.h" -#include "taler/exchange-database/select_aggregation_amounts_for_kyc_check.h" -#include "taler/exchange-database/select_aggregations_above_serial.h" -#include "taler/exchange-database/select_aggregation_transient.h" -#include "taler/exchange-database/select_all_kyc_attributes.h" -#include "taler/exchange-database/select_all_purse_decisions_above_serial_id.h" -#include "taler/exchange-database/select_all_purse_deletions_above_serial_id.h" -#include "taler/exchange-database/select_aml_attributes.h" -#include "taler/exchange-database/select_aml_decisions.h" -#include "taler/exchange-database/select_aml_measures.h" -#include "taler/exchange-database/select_aml_statistics.h" -#include "taler/exchange-database/select_auditor_denom_sig.h" -#include "taler/exchange-database/select_batch_deposits_missing_wire.h" -#include "taler/exchange-database/select_coin_deposits_above_serial_id.h" -#include "taler/exchange-database/select_contract_by_purse.h" -#include "taler/exchange-database/select_contract.h" -#include "taler/exchange-database/select_deposit_amounts_for_kyc_check.h" -#include "taler/exchange-database/select_exchange_credit_transfers.h" -#include "taler/exchange-database/select_exchange_debit_transfers.h" -#include "taler/exchange-database/select_exchange_kycauth_transfers.h" -#include "taler/exchange-database/select_kyc_accounts.h" -#include "taler/exchange-database/select_kyc_attributes.h" -#include "taler/exchange-database/select_merge_amounts_for_kyc_check.h" -#include "taler/exchange-database/select_purse_by_merge_pub.h" -#include "taler/exchange-database/select_purse_decisions_above_serial_id.h" -#include "taler/exchange-database/select_purse_deposits_above_serial_id.h" -#include "taler/exchange-database/select_purse_deposits_by_purse.h" -#include "taler/exchange-database/select_purse.h" -#include "taler/exchange-database/select_purse_merge.h" -#include "taler/exchange-database/select_purse_merges_above_serial_id.h" -#include "taler/exchange-database/select_purse_requests_above_serial_id.h" -#include "taler/exchange-database/select_recoup_above_serial_id.h" -#include "taler/exchange-database/select_recoup_refresh_above_serial_id.h" -#include "taler/exchange-database/select_refreshes_above_serial_id.h" -#include "taler/exchange-database/select_refunds_above_serial_id.h" -#include "taler/exchange-database/select_refunds_by_coin.h" -#include "taler/exchange-database/select_reserve_closed_above_serial_id.h" -#include "taler/exchange-database/select_reserve_close_info.h" -#include "taler/exchange-database/select_reserve_open_above_serial_id.h" -#include "taler/exchange-database/select_reserves_in_above_serial_id.h" -#include "taler/exchange-database/select_wire_out_above_serial_id_by_account.h" -#include "taler/exchange-database/select_wire_out_above_serial_id.h" -#include "taler/exchange-database/select_withdrawals_above_serial_id.h" -#include "taler/exchange-database/select_withdraw_amounts_for_kyc_check.h" -#include "taler/exchange-database/set_aml_lock.h" -#include "taler/exchange-database/set_extension_manifest.h" -#include "taler/exchange-database/set_purse_balance.h" -#include "taler/exchange-database/start_deferred_wire_out.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/start_read_committed.h" -#include "taler/exchange-database/start_read_only.h" -#include "taler/exchange-database/store_wire_transfer_out.h" -#include "taler/exchange-database/test_aml_officer.h" -#include "taler/exchange-database/trigger_kyc_rule_for_account.h" -#include "taler/exchange-database/update_aggregation_transient.h" -#include "taler/exchange-database/update_auditor.h" -#include "taler/exchange-database/update_kyc_process_by_row.h" -#include "taler/exchange-database/update_wire.h" -#include "taler/exchange-database/wad_in_insert.h" -#include "taler/exchange-database/wire_prepare_data_get.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" -#include "taler/exchange-database/wire_prepare_data_mark_failed.h" -#include "taler/exchange-database/wire_prepare_data_mark_finished.h" +#include "exchange-database/preflight.h" +#include "exchange-database/test_aml_officer.h" +#include "exchange-database/abort_shard.h" +#include "exchange-database/activate_signing_key.h" +#include "exchange-database/add_denomination_key.h" +#include "exchange-database/add_policy_fulfillment_proof.h" +#include "exchange-database/aggregate.h" +#include "exchange-database/batch_ensure_coin_known.h" +#include "exchange-database/begin_revolving_shard.h" +#include "exchange-database/begin_shard.h" +#include "exchange-database/clear_aml_lock.h" +#include "exchange-database/commit.h" +#include "exchange-database/complete_shard.h" +#include "exchange-database/compute_shard.h" +#include "exchange-database/count_known_coins.h" +#include "exchange-database/create_aggregation_transient.h" +#include "exchange-database/create_tables.h" +#include "exchange-database/delete_aggregation_transient.h" +#include "exchange-database/delete_shard_locks.h" +#include "exchange-database/disable_rules.h" +#include "exchange-database/do_check_deposit_idempotent.h" +#include "exchange-database/do_deposit.h" +#include "exchange-database/do_purse_delete.h" +#include "exchange-database/do_purse_deposit.h" +#include "exchange-database/do_purse_merge.h" +#include "exchange-database/do_recoup.h" +#include "exchange-database/do_recoup_refresh.h" +#include "exchange-database/do_refresh.h" +#include "exchange-database/do_refund.h" +#include "exchange-database/do_reserve_open.h" +#include "exchange-database/do_reserve_purse.h" +#include "exchange-database/do_withdraw.h" +#include "exchange-database/drain_kyc_alert.h" +#include "exchange-database/drop_tables.h" +#include "exchange-database/enable_rules.h" +#include "exchange-database/ensure_coin_known.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/expire_purse.h" +#include "exchange-database/find_aggregation_transient.h" +#include "exchange-database/gc.h" +#include "exchange-database/get_coin_denomination.h" +#include "exchange-database/get_coin_transactions.h" +#include "exchange-database/get_denomination_by_serial.h" +#include "exchange-database/get_denomination_info.h" +#include "exchange-database/get_denomination_revocation.h" +#include "exchange-database/get_drain_profit.h" +#include "exchange-database/get_expired_reserves.h" +#include "exchange-database/get_extension_manifest.h" +#include "exchange-database/get_global_fee.h" +#include "exchange-database/get_global_fees.h" +#include "exchange-database/get_known_coin.h" +#include "exchange-database/get_kyc_rules.h" +#include "exchange-database/get_old_coin_by_h_blind.h" +#include "exchange-database/get_pending_kyc_requirement_process.h" +#include "exchange-database/get_policy_details.h" +#include "exchange-database/get_purse_deposit.h" +#include "exchange-database/get_purse_request.h" +#include "exchange-database/get_ready_deposit.h" +#include "exchange-database/get_refresh.h" +#include "exchange-database/get_reserve_balance.h" +#include "exchange-database/get_reserve_by_h_planchets.h" +#include "exchange-database/get_reserve_history.h" +#include "exchange-database/get_signature_for_known_coin.h" +#include "exchange-database/get_unfinished_close_requests.h" +#include "exchange-database/get_wire_accounts.h" +#include "exchange-database/get_wire_fee.h" +#include "exchange-database/get_wire_fees.h" +#include "exchange-database/get_wire_hash_for_contract.h" +#include "exchange-database/get_withdraw.h" +#include "exchange-database/have_deposit2.h" +#include "exchange-database/inject_auditor_triggers.h" +#include "exchange-database/insert_active_legitimization_measure.h" +#include "exchange-database/insert_aml_decision.h" +#include "exchange-database/insert_aml_officer.h" +#include "exchange-database/insert_aml_program_failure.h" +#include "exchange-database/insert_auditor_denom_sig.h" +#include "exchange-database/insert_auditor.h" +#include "exchange-database/insert_close_request.h" +#include "exchange-database/insert_contract.h" +#include "exchange-database/insert_denomination_info.h" +#include "exchange-database/insert_denomination_revocation.h" +#include "exchange-database/insert_drain_profit.h" +#include "exchange-database/insert_global_fee.h" +#include "exchange-database/insert_kyc_failure.h" +#include "exchange-database/insert_kyc_requirement_process.h" +#include "exchange-database/insert_partner.h" +#include "exchange-database/insert_purse_request.h" +#include "exchange-database/insert_records_by_table.h" +#include "exchange-database/insert_reserve_closed.h" +#include "exchange-database/insert_reserve_open_deposit.h" +#include "exchange-database/insert_sanction_list_hit.h" +#include "exchange-database/insert_signkey_revocation.h" +#include "exchange-database/insert_successor_measure.h" +#include "exchange-database/insert_wire_fee.h" +#include "exchange-database/insert_wire.h" +#include "exchange-database/iterate_active_auditors.h" +#include "exchange-database/iterate_active_signkeys.h" +#include "exchange-database/iterate_auditor_denominations.h" +#include "exchange-database/iterate_denomination_info.h" +#include "exchange-database/iterate_denominations.h" +#include "exchange-database/iterate_kyc_reference.h" +#include "exchange-database/iterate_reserve_close_info.h" +#include "exchange-database/kycauth_in_insert.h" +#include "exchange-database/kyc_provider_account_lookup.h" +#include "exchange-database/lookup_active_legitimization.h" +#include "exchange-database/lookup_aml_file_number.h" +#include "exchange-database/lookup_aml_history.h" +#include "exchange-database/lookup_aml_officer.h" +#include "exchange-database/lookup_auditor_status.h" +#include "exchange-database/lookup_auditor_timestamp.h" +#include "exchange-database/lookup_completed_legitimization.h" +#include "exchange-database/lookup_denomination_key.h" +#include "exchange-database/lookup_global_fee_by_time.h" +#include "exchange-database/lookup_h_payto_by_access_token.h" +#include "exchange-database/lookup_kyc_history.h" +#include "exchange-database/lookup_kyc_process_by_account.h" +#include "exchange-database/lookup_kyc_requirement_by_row.h" +#include "exchange-database/lookup_kyc_status_by_token.h" +#include "exchange-database/lookup_pending_legitimization.h" +#include "exchange-database/lookup_records_by_table.h" +#include "exchange-database/lookup_rules_by_access_token.h" +#include "exchange-database/lookup_serial_by_table.h" +#include "exchange-database/lookup_signing_key.h" +#include "exchange-database/lookup_signkey_revocation.h" +#include "exchange-database/lookup_transfer_by_deposit.h" +#include "exchange-database/lookup_wire_fee_by_time.h" +#include "exchange-database/lookup_wire_timestamp.h" +#include "exchange-database/lookup_wire_transfer.h" +#include "exchange-database/mark_refresh_reveal_success.h" +#include "exchange-database/persist_kyc_attributes.h" +#include "exchange-database/persist_policy_details.h" +#include "exchange-database/preflight.h" +#include "exchange-database/profit_drains_get_pending.h" +#include "exchange-database/profit_drains_set_finished.h" +#include "exchange-database/release_revolving_shard.h" +#include "exchange-database/reserves_get.h" +#include "exchange-database/reserves_get_origin.h" +#include "exchange-database/reserves_in_insert.h" +#include "exchange-database/reserves_update.h" +#include "exchange-database/rollback.h" +#include "exchange-database/select_account_merges_above_serial_id.h" +#include "exchange-database/select_aggregation_amounts_for_kyc_check.h" +#include "exchange-database/select_aggregations_above_serial.h" +#include "exchange-database/select_aggregation_transient.h" +#include "exchange-database/select_all_kyc_attributes.h" +#include "exchange-database/select_all_purse_decisions_above_serial_id.h" +#include "exchange-database/select_all_purse_deletions_above_serial_id.h" +#include "exchange-database/select_aml_attributes.h" +#include "exchange-database/select_aml_decisions.h" +#include "exchange-database/select_aml_measures.h" +#include "exchange-database/select_aml_statistics.h" +#include "exchange-database/select_auditor_denom_sig.h" +#include "exchange-database/select_batch_deposits_missing_wire.h" +#include "exchange-database/select_coin_deposits_above_serial_id.h" +#include "exchange-database/select_contract_by_purse.h" +#include "exchange-database/select_contract.h" +#include "exchange-database/select_deposit_amounts_for_kyc_check.h" +#include "exchange-database/select_exchange_credit_transfers.h" +#include "exchange-database/select_exchange_debit_transfers.h" +#include "exchange-database/select_exchange_kycauth_transfers.h" +#include "exchange-database/select_kyc_accounts.h" +#include "exchange-database/select_kyc_attributes.h" +#include "exchange-database/select_merge_amounts_for_kyc_check.h" +#include "exchange-database/select_purse_by_merge_pub.h" +#include "exchange-database/select_purse_decisions_above_serial_id.h" +#include "exchange-database/select_purse_deposits_above_serial_id.h" +#include "exchange-database/select_purse_deposits_by_purse.h" +#include "exchange-database/select_purse.h" +#include "exchange-database/select_purse_merge.h" +#include "exchange-database/select_purse_merges_above_serial_id.h" +#include "exchange-database/select_purse_requests_above_serial_id.h" +#include "exchange-database/select_recoup_above_serial_id.h" +#include "exchange-database/select_recoup_refresh_above_serial_id.h" +#include "exchange-database/select_refreshes_above_serial_id.h" +#include "exchange-database/select_refunds_above_serial_id.h" +#include "exchange-database/select_refunds_by_coin.h" +#include "exchange-database/select_reserve_closed_above_serial_id.h" +#include "exchange-database/select_reserve_close_info.h" +#include "exchange-database/select_reserve_open_above_serial_id.h" +#include "exchange-database/select_reserves_in_above_serial_id.h" +#include "exchange-database/select_wire_out_above_serial_id_by_account.h" +#include "exchange-database/select_wire_out_above_serial_id.h" +#include "exchange-database/select_withdrawals_above_serial_id.h" +#include "exchange-database/select_withdraw_amounts_for_kyc_check.h" +#include "exchange-database/set_aml_lock.h" +#include "exchange-database/set_extension_manifest.h" +#include "exchange-database/set_purse_balance.h" +#include "exchange-database/start_deferred_wire_out.h" +#include "exchange-database/start.h" +#include "exchange-database/start_read_committed.h" +#include "exchange-database/start_read_only.h" +#include "exchange-database/store_wire_transfer_out.h" +#include "exchange-database/test_aml_officer.h" +#include "exchange-database/trigger_kyc_rule_for_account.h" +#include "exchange-database/update_aggregation_transient.h" +#include "exchange-database/update_auditor.h" +#include "exchange-database/update_kyc_process_by_row.h" +#include "exchange-database/update_wire.h" +#include "exchange-database/wad_in_insert.h" +#include "exchange-database/wire_prepare_data_get.h" +#include "exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/wire_prepare_data_mark_failed.h" +#include "exchange-database/wire_prepare_data_mark_finished.h" /** diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c @@ -26,24 +26,24 @@ #include "taler/taler_signatures.h" #include "taler/taler_dbevents.h" #include "report-lib.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/insert_amount_arithmetic_inconsistency.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_bad_sig_losses.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/insert_coin_inconsistency.h" -#include "taler/auditor-database/insert_fee_time_inconsistency.h" -#include "taler/auditor-database/insert_row_inconsistency.h" -#include "taler/auditor-database/insert_wire_out_inconsistency.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/exchange-database/get_coin_transactions.h" -#include "taler/exchange-database/get_known_coin.h" -#include "taler/exchange-database/get_wire_fee.h" -#include "taler/exchange-database/lookup_wire_transfer.h" -#include "taler/exchange-database/select_wire_out_above_serial_id.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/insert_amount_arithmetic_inconsistency.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_bad_sig_losses.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/insert_coin_inconsistency.h" +#include "auditor-database/insert_fee_time_inconsistency.h" +#include "auditor-database/insert_row_inconsistency.h" +#include "auditor-database/insert_wire_out_inconsistency.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "exchange-database/get_coin_transactions.h" +#include "exchange-database/get_known_coin.h" +#include "exchange-database/get_wire_fee.h" +#include "exchange-database/lookup_wire_transfer.h" +#include "exchange-database/select_wire_out_above_serial_id.h" /** * Return value from main(). diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c @@ -23,39 +23,39 @@ #include "report-lib.h" #include "taler/taler_dbevents.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/auditor-database/del_denomination_balance.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/get_denomination_balance.h" -#include "taler/auditor-database/insert_amount_arithmetic_inconsistency.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_bad_sig_losses.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/insert_denomination_balance.h" -#include "taler/auditor-database/insert_denominations_without_sigs.h" -#include "taler/auditor-database/insert_emergency.h" -#include "taler/auditor-database/insert_emergency_by_count.h" -#include "taler/auditor-database/insert_historic_denom_revenue.h" -#include "taler/auditor-database/insert_row_inconsistency.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/auditor-database/update_denomination_balance.h" -#include "taler/exchange-database/count_known_coins.h" -#include "taler/exchange-database/get_coin_transactions.h" -#include "taler/exchange-database/get_denomination_revocation.h" -#include "taler/exchange-database/get_known_coin.h" -#include "taler/exchange-database/iterate_denomination_info.h" -#include "taler/exchange-database/select_auditor_denom_sig.h" -#include "taler/exchange-database/select_coin_deposits_above_serial_id.h" -#include "taler/exchange-database/select_purse_decisions_above_serial_id.h" -#include "taler/exchange-database/select_purse_deposits_above_serial_id.h" -#include "taler/exchange-database/select_purse_deposits_by_purse.h" -#include "taler/exchange-database/select_recoup_above_serial_id.h" -#include "taler/exchange-database/select_recoup_refresh_above_serial_id.h" -#include "taler/exchange-database/select_refreshes_above_serial_id.h" -#include "taler/exchange-database/select_refunds_above_serial_id.h" -#include "taler/exchange-database/select_withdrawals_above_serial_id.h" +#include "auditor-database/del_denomination_balance.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/get_denomination_balance.h" +#include "auditor-database/insert_amount_arithmetic_inconsistency.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_bad_sig_losses.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/insert_denomination_balance.h" +#include "auditor-database/insert_denominations_without_sigs.h" +#include "auditor-database/insert_emergency.h" +#include "auditor-database/insert_emergency_by_count.h" +#include "auditor-database/insert_historic_denom_revenue.h" +#include "auditor-database/insert_row_inconsistency.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "auditor-database/update_denomination_balance.h" +#include "exchange-database/count_known_coins.h" +#include "exchange-database/get_coin_transactions.h" +#include "exchange-database/get_denomination_revocation.h" +#include "exchange-database/get_known_coin.h" +#include "exchange-database/iterate_denomination_info.h" +#include "exchange-database/select_auditor_denom_sig.h" +#include "exchange-database/select_coin_deposits_above_serial_id.h" +#include "exchange-database/select_purse_decisions_above_serial_id.h" +#include "exchange-database/select_purse_deposits_above_serial_id.h" +#include "exchange-database/select_purse_deposits_by_purse.h" +#include "exchange-database/select_recoup_above_serial_id.h" +#include "exchange-database/select_recoup_refresh_above_serial_id.h" +#include "exchange-database/select_refreshes_above_serial_id.h" +#include "exchange-database/select_refunds_above_serial_id.h" +#include "exchange-database/select_withdrawals_above_serial_id.h" /** diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c @@ -31,16 +31,16 @@ #include "taler/taler_dbevents.h" #include <jansson.h> #include <inttypes.h> -#include "taler/auditor-database/delete_generic.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/get_deposit_confirmations.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/exchange-database/have_deposit2.h" +#include "auditor-database/delete_generic.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/get_deposit_confirmations.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "exchange-database/have_deposit2.h" /* -- diff --git a/src/auditor/taler-helper-auditor-purses.c b/src/auditor/taler-helper-auditor-purses.c @@ -26,30 +26,30 @@ #include "taler/taler_signatures.h" #include "report-lib.h" #include "taler/taler_dbevents.h" -#include "taler/auditor-database/delete_purse_info.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/get_purse_info.h" -#include "taler/auditor-database/insert_amount_arithmetic_inconsistency.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_bad_sig_losses.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/insert_purse_info.h" -#include "taler/auditor-database/insert_purse_not_closed_inconsistencies.h" -#include "taler/auditor-database/insert_row_inconsistency.h" -#include "taler/auditor-database/select_purse_expired.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/auditor-database/update_purse_info.h" -#include "taler/exchange-database/get_global_fee.h" -#include "taler/exchange-database/select_account_merges_above_serial_id.h" -#include "taler/exchange-database/select_all_purse_decisions_above_serial_id.h" -#include "taler/exchange-database/select_all_purse_deletions_above_serial_id.h" -#include "taler/exchange-database/select_purse.h" -#include "taler/exchange-database/select_purse_deposits_above_serial_id.h" -#include "taler/exchange-database/select_purse_merges_above_serial_id.h" -#include "taler/exchange-database/select_purse_requests_above_serial_id.h" +#include "auditor-database/delete_purse_info.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/get_purse_info.h" +#include "auditor-database/insert_amount_arithmetic_inconsistency.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_bad_sig_losses.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/insert_purse_info.h" +#include "auditor-database/insert_purse_not_closed_inconsistencies.h" +#include "auditor-database/insert_row_inconsistency.h" +#include "auditor-database/select_purse_expired.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "auditor-database/update_purse_info.h" +#include "exchange-database/get_global_fee.h" +#include "exchange-database/select_account_merges_above_serial_id.h" +#include "exchange-database/select_all_purse_decisions_above_serial_id.h" +#include "exchange-database/select_all_purse_deletions_above_serial_id.h" +#include "exchange-database/select_purse.h" +#include "exchange-database/select_purse_deposits_above_serial_id.h" +#include "exchange-database/select_purse_merges_above_serial_id.h" +#include "exchange-database/select_purse_requests_above_serial_id.h" /** diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c @@ -23,38 +23,38 @@ #include "report-lib.h" #include "taler/taler_dbevents.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/select_reserve_close_request_info.h" -#include "taler/auditor-database/del_reserve_info.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/get_reserve_info.h" -#include "taler/auditor-database/insert_amount_arithmetic_inconsistency.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_bad_sig_losses.h" -#include "taler/auditor-database/insert_balance.h" +#include "exchange-database/select_reserve_close_request_info.h" +#include "auditor-database/del_reserve_info.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/get_reserve_info.h" +#include "auditor-database/insert_amount_arithmetic_inconsistency.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_bad_sig_losses.h" +#include "auditor-database/insert_balance.h" #include \ - "taler/auditor-database/insert_denomination_key_validity_withdraw_inconsistency.h" + "auditor-database/insert_denomination_key_validity_withdraw_inconsistency.h" #include \ - "taler/auditor-database/insert_reserve_balance_insufficient_inconsistency.h" + "auditor-database/insert_reserve_balance_insufficient_inconsistency.h" #include \ - "taler/auditor-database/insert_reserve_balance_summary_wrong_inconsistency.h" -#include "taler/auditor-database/insert_reserve_info.h" -#include "taler/auditor-database/insert_reserve_not_closed_inconsistency.h" -#include "taler/auditor-database/insert_row_inconsistency.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/auditor-database/update_reserve_info.h" -#include "taler/exchange-database/get_denomination_revocation.h" -#include "taler/exchange-database/get_wire_fee.h" -#include "taler/exchange-database/reserves_get.h" -#include "taler/exchange-database/select_account_merges_above_serial_id.h" -#include "taler/exchange-database/select_purse_decisions_above_serial_id.h" -#include "taler/exchange-database/select_recoup_above_serial_id.h" -#include "taler/exchange-database/select_reserve_closed_above_serial_id.h" -#include "taler/exchange-database/select_reserve_open_above_serial_id.h" -#include "taler/exchange-database/select_reserves_in_above_serial_id.h" -#include "taler/exchange-database/select_withdrawals_above_serial_id.h" + "auditor-database/insert_reserve_balance_summary_wrong_inconsistency.h" +#include "auditor-database/insert_reserve_info.h" +#include "auditor-database/insert_reserve_not_closed_inconsistency.h" +#include "auditor-database/insert_row_inconsistency.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "auditor-database/update_reserve_info.h" +#include "exchange-database/get_denomination_revocation.h" +#include "exchange-database/get_wire_fee.h" +#include "exchange-database/reserves_get.h" +#include "exchange-database/select_account_merges_above_serial_id.h" +#include "exchange-database/select_purse_decisions_above_serial_id.h" +#include "exchange-database/select_recoup_above_serial_id.h" +#include "exchange-database/select_reserve_closed_above_serial_id.h" +#include "exchange-database/select_reserve_open_above_serial_id.h" +#include "exchange-database/select_reserves_in_above_serial_id.h" +#include "exchange-database/select_withdrawals_above_serial_id.h" /** * Use a 1 day grace period to deal with clocks not being perfectly synchronized. diff --git a/src/auditor/taler-helper-auditor-transfer.c b/src/auditor/taler-helper-auditor-transfer.c @@ -28,24 +28,24 @@ #include "taler/taler_json_lib.h" #include "report-lib.h" #include "taler/taler_dbevents.h" -#include "taler/auditor-database/delete_early_aggregation.h" -#include "taler/auditor-database/delete_pending_deposit.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/insert_early_aggregation.h" -#include "taler/auditor-database/insert_pending_deposit.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/start.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/select_aggregations_above_serial.h" -#include "taler/exchange-database/select_batch_deposits_missing_wire.h" -#include "taler/exchange-database/start_read_only.h" +#include "auditor-database/delete_early_aggregation.h" +#include "auditor-database/delete_pending_deposit.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/insert_early_aggregation.h" +#include "auditor-database/insert_pending_deposit.h" +#include "auditor-database/preflight.h" +#include "auditor-database/start.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" +#include "exchange-database/select_aggregations_above_serial.h" +#include "exchange-database/select_batch_deposits_missing_wire.h" +#include "exchange-database/start_read_only.h" /** diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c @@ -32,27 +32,27 @@ #include "report-lib.h" #include "taler/taler_dbevents.h" #include \ - "taler/exchange-database/select_reserves_in_above_serial_id_by_account.h" -#include "taler/auditor-database/delete_reserve_in_inconsistency.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/insert_misattribution_in_inconsistency.h" -#include "taler/auditor-database/insert_reserve_in_inconsistency.h" -#include "taler/auditor-database/insert_row_inconsistency.h" -#include "taler/auditor-database/insert_row_minor_inconsistencies.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/select_reserve_in_inconsistency.h" -#include "taler/auditor-database/start.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" + "exchange-database/select_reserves_in_above_serial_id_by_account.h" +#include "auditor-database/delete_reserve_in_inconsistency.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/insert_misattribution_in_inconsistency.h" +#include "auditor-database/insert_reserve_in_inconsistency.h" +#include "auditor-database/insert_row_inconsistency.h" +#include "auditor-database/insert_row_minor_inconsistencies.h" +#include "auditor-database/preflight.h" +#include "auditor-database/select_reserve_in_inconsistency.h" +#include "auditor-database/start.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" #include \ - "taler/exchange-database/select_reserves_in_above_serial_id_by_account.h" -#include "taler/exchange-database/start_read_only.h" + "exchange-database/select_reserves_in_above_serial_id_by_account.h" +#include "exchange-database/start_read_only.h" /** * How much time do we allow the aggregator to lag behind? If diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c @@ -40,28 +40,28 @@ #include "taler/taler_signatures.h" #include "report-lib.h" #include "taler/taler_dbevents.h" -#include "taler/auditor-database/delete_auditor_closure_lag.h" -#include "taler/auditor-database/delete_wire_out_inconsistency_if_matching.h" -#include "taler/auditor-database/event_listen.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/insert_auditor_closure_lags.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/insert_row_inconsistency.h" -#include "taler/auditor-database/insert_row_minor_inconsistencies.h" -#include "taler/auditor-database/insert_wire_format_inconsistency.h" -#include "taler/auditor-database/insert_wire_out_inconsistency.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/start.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" -#include "taler/exchange-database/get_drain_profit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/select_reserve_closed_above_serial_id.h" -#include "taler/exchange-database/select_wire_out_above_serial_id_by_account.h" -#include "taler/exchange-database/start_read_only.h" +#include "auditor-database/delete_auditor_closure_lag.h" +#include "auditor-database/delete_wire_out_inconsistency_if_matching.h" +#include "auditor-database/event_listen.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/insert_auditor_closure_lags.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/insert_row_inconsistency.h" +#include "auditor-database/insert_row_minor_inconsistencies.h" +#include "auditor-database/insert_wire_format_inconsistency.h" +#include "auditor-database/insert_wire_out_inconsistency.h" +#include "auditor-database/preflight.h" +#include "auditor-database/start.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" +#include "exchange-database/get_drain_profit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" +#include "exchange-database/select_reserve_closed_above_serial_id.h" +#include "exchange-database/select_wire_out_above_serial_id_by_account.h" +#include "exchange-database/start_read_only.h" /** diff --git a/src/auditordb/create_tables.c b/src/auditordb/create_tables.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/create_tables.h" +#include "auditor-database/create_tables.h" #include "pg_helper.h" diff --git a/src/auditordb/del_denomination_balance.c b/src/auditordb/del_denomination_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/del_denomination_balance.h" +#include "auditor-database/del_denomination_balance.h" #include "pg_helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/del_reserve_info.c b/src/auditordb/del_reserve_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/del_reserve_info.h" +#include "auditor-database/del_reserve_info.h" #include "pg_helper.h" diff --git a/src/auditordb/delete_auditor_closure_lag.c b/src/auditordb/delete_auditor_closure_lag.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/delete_auditor_closure_lag.h" +#include "auditor-database/delete_auditor_closure_lag.h" #include "pg_helper.h" diff --git a/src/auditordb/delete_early_aggregation.c b/src/auditordb/delete_early_aggregation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/delete_early_aggregation.h" +#include "auditor-database/delete_early_aggregation.h" #include "pg_helper.h" diff --git a/src/auditordb/delete_generic.c b/src/auditordb/delete_generic.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/delete_generic.h" +#include "auditor-database/delete_generic.h" struct Preparations { diff --git a/src/auditordb/delete_pending_deposit.c b/src/auditordb/delete_pending_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/delete_pending_deposit.h" +#include "auditor-database/delete_pending_deposit.h" #include "pg_helper.h" diff --git a/src/auditordb/delete_purse_info.c b/src/auditordb/delete_purse_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/delete_purse_info.h" +#include "auditor-database/delete_purse_info.h" #include "pg_helper.h" diff --git a/src/auditordb/delete_reserve_in_inconsistency.c b/src/auditordb/delete_reserve_in_inconsistency.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/delete_reserve_in_inconsistency.h" +#include "auditor-database/delete_reserve_in_inconsistency.h" #include "pg_helper.h" diff --git a/src/auditordb/delete_wire_out_inconsistency_if_matching.c b/src/auditordb/delete_wire_out_inconsistency_if_matching.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/delete_wire_out_inconsistency_if_matching.h" +#include "auditor-database/delete_wire_out_inconsistency_if_matching.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/drop_tables.c b/src/auditordb/drop_tables.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/drop_tables.h" +#include "auditor-database/drop_tables.h" #include "pg_helper.h" enum GNUNET_GenericReturnValue diff --git a/src/auditordb/event_listen.c b/src/auditordb/event_listen.c @@ -20,7 +20,7 @@ */ #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/event_listen.h" +#include "auditor-database/event_listen.h" #include "pg_helper.h" diff --git a/src/auditordb/event_notify.c b/src/auditordb/event_notify.c @@ -20,7 +20,7 @@ */ #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/event_notify.h" +#include "auditor-database/event_notify.h" #include "pg_helper.h" diff --git a/src/auditordb/gc.c b/src/auditordb/gc.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/gc.h" +#include "auditor-database/gc.h" #include "pg_helper.h" diff --git a/src/auditordb/get_amount_arithmetic_inconsistency.c b/src/auditordb/get_amount_arithmetic_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_amount_arithmetic_inconsistency.h" +#include "auditor-database/get_amount_arithmetic_inconsistency.h" /** * Closure for #deposit_confirmation_cb(). diff --git a/src/auditordb/get_auditor_closure_lags.c b/src/auditordb/get_auditor_closure_lags.c @@ -17,7 +17,7 @@ #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_auditor_closure_lags.h" +#include "auditor-database/get_auditor_closure_lags.h" struct ClosureLagsContext diff --git a/src/auditordb/get_auditor_progress.c b/src/auditordb/get_auditor_progress.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_auditor_progress.h" +#include "auditor-database/get_auditor_progress.h" #include "pg_helper.h" diff --git a/src/auditordb/get_bad_sig_losses.c b/src/auditordb/get_bad_sig_losses.c @@ -16,7 +16,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_bad_sig_losses.h" +#include "auditor-database/get_bad_sig_losses.h" struct BadSigLossesContext diff --git a/src/auditordb/get_balance.c b/src/auditordb/get_balance.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_balance.h" +#include "auditor-database/get_balance.h" #include "pg_helper.h" diff --git a/src/auditordb/get_balances.c b/src/auditordb/get_balances.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_balances.h" +#include "auditor-database/get_balances.h" struct BalancesContext diff --git a/src/auditordb/get_coin_inconsistency.c b/src/auditordb/get_coin_inconsistency.c @@ -18,7 +18,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_coin_inconsistency.h" +#include "auditor-database/get_coin_inconsistency.h" /** * Closure for #deposit_confirmation_cb(). diff --git a/src/auditordb/get_denomination_balance.c b/src/auditordb/get_denomination_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_denomination_balance.h" +#include "auditor-database/get_denomination_balance.h" #include "pg_helper.h" diff --git a/src/auditordb/get_denomination_key_validity_withdraw_inconsistency.c b/src/auditordb/get_denomination_key_validity_withdraw_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" #include \ - "taler/auditor-database/get_denomination_key_validity_withdraw_inconsistency.h" + "auditor-database/get_denomination_key_validity_withdraw_inconsistency.h" /** diff --git a/src/auditordb/get_denomination_pending.c b/src/auditordb/get_denomination_pending.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_denomination_pending.h" +#include "auditor-database/get_denomination_pending.h" struct DenominationPendingContext diff --git a/src/auditordb/get_denominations_without_sigs.c b/src/auditordb/get_denominations_without_sigs.c @@ -16,7 +16,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_denominations_without_sigs.h" +#include "auditor-database/get_denominations_without_sigs.h" struct DenominationsWithoutSigsContext diff --git a/src/auditordb/get_deposit_confirmations.c b/src/auditordb/get_deposit_confirmations.c @@ -20,7 +20,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_deposit_confirmations.h" +#include "auditor-database/get_deposit_confirmations.h" #include "pg_helper.h" diff --git a/src/auditordb/get_emergency.c b/src/auditordb/get_emergency.c @@ -16,7 +16,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_emergency.h" +#include "auditor-database/get_emergency.h" /** * Closure for #emergency_cb(). diff --git a/src/auditordb/get_emergency_by_count.c b/src/auditordb/get_emergency_by_count.c @@ -16,7 +16,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_emergency_by_count.h" +#include "auditor-database/get_emergency_by_count.h" /** diff --git a/src/auditordb/get_exchange_signkeys.c b/src/auditordb/get_exchange_signkeys.c @@ -18,7 +18,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_exchange_signkeys.h" +#include "auditor-database/get_exchange_signkeys.h" struct ExchangeSignkeysContext diff --git a/src/auditordb/get_fee_time_inconsistency.c b/src/auditordb/get_fee_time_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_fee_time_inconsistency.h" +#include "auditor-database/get_fee_time_inconsistency.h" /** diff --git a/src/auditordb/get_misattribution_in_inconsistency.c b/src/auditordb/get_misattribution_in_inconsistency.c @@ -18,7 +18,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_misattribution_in_inconsistency.h" +#include "auditor-database/get_misattribution_in_inconsistency.h" struct MisattributionInInconsistencyContext diff --git a/src/auditordb/get_progress_points.c b/src/auditordb/get_progress_points.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_progress_points.h" +#include "auditor-database/get_progress_points.h" #include "pg_helper.h" diff --git a/src/auditordb/get_purse_info.c b/src/auditordb/get_purse_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_purse_info.h" +#include "auditor-database/get_purse_info.h" #include "pg_helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/get_purse_not_closed_inconsistencies.c b/src/auditordb/get_purse_not_closed_inconsistencies.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_purse_not_closed_inconsistencies.h" +#include "auditor-database/get_purse_not_closed_inconsistencies.h" /** diff --git a/src/auditordb/get_purses.c b/src/auditordb/get_purses.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_purses.h" +#include "auditor-database/get_purses.h" struct PursesContext diff --git a/src/auditordb/get_reserve_balance_insufficient_inconsistency.c b/src/auditordb/get_reserve_balance_insufficient_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" #include \ - "taler/auditor-database/get_reserve_balance_insufficient_inconsistency.h" + "auditor-database/get_reserve_balance_insufficient_inconsistency.h" /** diff --git a/src/auditordb/get_reserve_balance_summary_wrong_inconsistency.c b/src/auditordb/get_reserve_balance_summary_wrong_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" #include \ - "taler/auditor-database/get_reserve_balance_summary_wrong_inconsistency.h" + "auditor-database/get_reserve_balance_summary_wrong_inconsistency.h" struct ReserveBalanceSummaryWrongInconsistencyContext diff --git a/src/auditordb/get_reserve_in_inconsistency.c b/src/auditordb/get_reserve_in_inconsistency.c @@ -17,7 +17,7 @@ #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_reserve_in_inconsistency.h" +#include "auditor-database/get_reserve_in_inconsistency.h" struct ReserveInInconsistencyContext diff --git a/src/auditordb/get_reserve_info.c b/src/auditordb/get_reserve_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_reserve_info.h" +#include "auditor-database/get_reserve_info.h" #include "pg_helper.h" diff --git a/src/auditordb/get_reserve_not_closed_inconsistency.c b/src/auditordb/get_reserve_not_closed_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_reserve_not_closed_inconsistency.h" +#include "auditor-database/get_reserve_not_closed_inconsistency.h" struct ReserveNotClosedInconsistencyContext diff --git a/src/auditordb/get_reserves.c b/src/auditordb/get_reserves.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_reserves.h" +#include "auditor-database/get_reserves.h" struct ReservesContext diff --git a/src/auditordb/get_row_inconsistency.c b/src/auditordb/get_row_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_row_inconsistency.h" +#include "auditor-database/get_row_inconsistency.h" /** * Closure for #deposit_confirmation_cb(). diff --git a/src/auditordb/get_row_minor_inconsistencies.c b/src/auditordb/get_row_minor_inconsistencies.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_row_minor_inconsistencies.h" +#include "auditor-database/get_row_minor_inconsistencies.h" struct RowMinorInconsistenciesContext diff --git a/src/auditordb/get_wire_fee_summary.c b/src/auditordb/get_wire_fee_summary.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/get_wire_fee_summary.h" +#include "auditor-database/get_wire_fee_summary.h" #include "pg_helper.h" diff --git a/src/auditordb/get_wire_format_inconsistency.c b/src/auditordb/get_wire_format_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_wire_format_inconsistency.h" +#include "auditor-database/get_wire_format_inconsistency.h" struct WireFormatInconsistencyContext diff --git a/src/auditordb/get_wire_out_inconsistency.c b/src/auditordb/get_wire_out_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/get_wire_out_inconsistency.h" +#include "auditor-database/get_wire_out_inconsistency.h" struct WireOutInconsistencyContext diff --git a/src/auditordb/insert_amount_arithmetic_inconsistency.c b/src/auditordb/insert_amount_arithmetic_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_amount_arithmetic_inconsistency.h" +#include "auditor-database/insert_amount_arithmetic_inconsistency.h" enum GNUNET_DB_QueryStatus AUDITORDB_insert_amount_arithmetic_inconsistency (struct diff --git a/src/auditordb/insert_auditor_closure_lags.c b/src/auditordb/insert_auditor_closure_lags.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_auditor_closure_lags.h" +#include "auditor-database/insert_auditor_closure_lags.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_auditor_progress.c b/src/auditordb/insert_auditor_progress.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_auditor_progress.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_bad_sig_losses.c b/src/auditordb/insert_bad_sig_losses.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_bad_sig_losses.h" +#include "auditor-database/insert_bad_sig_losses.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_balance.c b/src/auditordb/insert_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_balance.h" +#include "auditor-database/insert_balance.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_coin_inconsistency.c b/src/auditordb/insert_coin_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_coin_inconsistency.h" +#include "auditor-database/insert_coin_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_denomination_balance.c b/src/auditordb/insert_denomination_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_denomination_balance.h" +#include "auditor-database/insert_denomination_balance.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_denomination_key_validity_withdraw_inconsistency.c b/src/auditordb/insert_denomination_key_validity_withdraw_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" #include \ - "taler/auditor-database/insert_denomination_key_validity_withdraw_inconsistency.h" + "auditor-database/insert_denomination_key_validity_withdraw_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_denomination_pending.c b/src/auditordb/insert_denomination_pending.c @@ -18,7 +18,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_denomination_pending.h" +#include "auditor-database/insert_denomination_pending.h" enum GNUNET_DB_QueryStatus AUDITORDB_insert_denomination_pending (struct AUDITORDB_PostgresContext *pg, diff --git a/src/auditordb/insert_denominations_without_sigs.c b/src/auditordb/insert_denominations_without_sigs.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_denominations_without_sigs.h" +#include "auditor-database/insert_denominations_without_sigs.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_deposit_confirmation.c b/src/auditordb/insert_deposit_confirmation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_deposit_confirmation.h" +#include "auditor-database/insert_deposit_confirmation.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_early_aggregation.c b/src/auditordb/insert_early_aggregation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_early_aggregation.h" +#include "auditor-database/insert_early_aggregation.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_emergency.c b/src/auditordb/insert_emergency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_emergency.h" +#include "auditor-database/insert_emergency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_emergency_by_count.c b/src/auditordb/insert_emergency_by_count.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_emergency_by_count.h" +#include "auditor-database/insert_emergency_by_count.h" enum GNUNET_DB_QueryStatus AUDITORDB_insert_emergency_by_count (struct AUDITORDB_PostgresContext *pg, diff --git a/src/auditordb/insert_exchange_signkey.c b/src/auditordb/insert_exchange_signkey.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_exchange_signkey.h" +#include "auditor-database/insert_exchange_signkey.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_fee_time_inconsistency.c b/src/auditordb/insert_fee_time_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_fee_time_inconsistency.h" +#include "auditor-database/insert_fee_time_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_historic_denom_revenue.c b/src/auditordb/insert_historic_denom_revenue.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_historic_denom_revenue.h" +#include "auditor-database/insert_historic_denom_revenue.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_historic_reserve_revenue.c b/src/auditordb/insert_historic_reserve_revenue.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_historic_reserve_revenue.h" +#include "auditor-database/insert_historic_reserve_revenue.h" #include "pg_helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_misattribution_in_inconsistency.c b/src/auditordb/insert_misattribution_in_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_misattribution_in_inconsistency.h" +#include "auditor-database/insert_misattribution_in_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_pending_deposit.c b/src/auditordb/insert_pending_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_pending_deposit.h" +#include "auditor-database/insert_pending_deposit.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_purse_info.c b/src/auditordb/insert_purse_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_purse_info.h" +#include "auditor-database/insert_purse_info.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_purse_not_closed_inconsistencies.c b/src/auditordb/insert_purse_not_closed_inconsistencies.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_purse_not_closed_inconsistencies.h" +#include "auditor-database/insert_purse_not_closed_inconsistencies.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_reserve_balance_insufficient_inconsistency.c b/src/auditordb/insert_reserve_balance_insufficient_inconsistency.c @@ -19,7 +19,7 @@ #include "pg_helper.h" #include \ - "taler/auditor-database/insert_reserve_balance_insufficient_inconsistency.h" + "auditor-database/insert_reserve_balance_insufficient_inconsistency.h" enum GNUNET_DB_QueryStatus AUDITORDB_insert_reserve_balance_insufficient_inconsistency (struct diff --git a/src/auditordb/insert_reserve_balance_summary_wrong_inconsistency.c b/src/auditordb/insert_reserve_balance_summary_wrong_inconsistency.c @@ -19,7 +19,7 @@ #include "pg_helper.h" #include \ - "taler/auditor-database/insert_reserve_balance_summary_wrong_inconsistency.h" + "auditor-database/insert_reserve_balance_summary_wrong_inconsistency.h" enum GNUNET_DB_QueryStatus AUDITORDB_insert_reserve_balance_summary_wrong_inconsistency (struct diff --git a/src/auditordb/insert_reserve_in_inconsistency.c b/src/auditordb/insert_reserve_in_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_reserve_in_inconsistency.h" +#include "auditor-database/insert_reserve_in_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_reserve_info.c b/src/auditordb/insert_reserve_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/insert_reserve_info.h" +#include "auditor-database/insert_reserve_info.h" #include "pg_helper.h" diff --git a/src/auditordb/insert_reserve_not_closed_inconsistency.c b/src/auditordb/insert_reserve_not_closed_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_reserve_not_closed_inconsistency.h" +#include "auditor-database/insert_reserve_not_closed_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_row_inconsistency.c b/src/auditordb/insert_row_inconsistency.c @@ -16,7 +16,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_row_inconsistency.h" +#include "auditor-database/insert_row_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_row_minor_inconsistencies.c b/src/auditordb/insert_row_minor_inconsistencies.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_row_minor_inconsistencies.h" +#include "auditor-database/insert_row_minor_inconsistencies.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_wire_format_inconsistency.c b/src/auditordb/insert_wire_format_inconsistency.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_wire_format_inconsistency.h" +#include "auditor-database/insert_wire_format_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/insert_wire_out_inconsistency.c b/src/auditordb/insert_wire_out_inconsistency.c @@ -18,7 +18,7 @@ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/insert_wire_out_inconsistency.h" +#include "auditor-database/insert_wire_out_inconsistency.h" enum GNUNET_DB_QueryStatus AUDITORDB_insert_wire_out_inconsistency (struct AUDITORDB_PostgresContext *pg, diff --git a/src/auditordb/lookup_reserve_in_inconsistency.c b/src/auditordb/lookup_reserve_in_inconsistency.c @@ -17,7 +17,7 @@ #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/lookup_reserve_in_inconsistency.h" +#include "auditor-database/lookup_reserve_in_inconsistency.h" enum GNUNET_DB_QueryStatus diff --git a/src/auditordb/preflight.c b/src/auditordb/preflight.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/preflight.h" #include "pg_helper.h" diff --git a/src/auditordb/select_early_aggregations.c b/src/auditordb/select_early_aggregations.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/select_early_aggregations.h" +#include "auditor-database/select_early_aggregations.h" #include "pg_helper.h" diff --git a/src/auditordb/select_historic_denom_revenue.c b/src/auditordb/select_historic_denom_revenue.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/select_historic_denom_revenue.h" +#include "auditor-database/select_historic_denom_revenue.h" #include "pg_helper.h" diff --git a/src/auditordb/select_historic_reserve_revenue.c b/src/auditordb/select_historic_reserve_revenue.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/select_historic_reserve_revenue.h" +#include "auditor-database/select_historic_reserve_revenue.h" #include "pg_helper.h" diff --git a/src/auditordb/select_pending_deposits.c b/src/auditordb/select_pending_deposits.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/select_pending_deposits.h" +#include "auditor-database/select_pending_deposits.h" #include "pg_helper.h" diff --git a/src/auditordb/select_purse_expired.c b/src/auditordb/select_purse_expired.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/select_purse_expired.h" +#include "auditor-database/select_purse_expired.h" #include "pg_helper.h" diff --git a/src/auditordb/select_reserve_in_inconsistency.c b/src/auditordb/select_reserve_in_inconsistency.c @@ -21,7 +21,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/select_reserve_in_inconsistency.h" +#include "auditor-database/select_reserve_in_inconsistency.h" #include "pg_helper.h" diff --git a/src/auditordb/start.c b/src/auditordb/start.c @@ -19,8 +19,8 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/start.h" -#include "taler/auditor-database/preflight.h" +#include "auditor-database/start.h" +#include "auditor-database/preflight.h" #include "pg_helper.h" diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c @@ -21,24 +21,24 @@ */ #include <gnunet/gnunet_db_lib.h> #include "taler/taler_auditordb_lib.h" -#include "taler/auditor-database/create_tables.h" -#include "taler/auditor-database/del_reserve_info.h" -#include "taler/auditor-database/delete_auditor_closure_lag.h" -#include "taler/auditor-database/drop_tables.h" -#include "taler/auditor-database/gc.h" -#include "taler/auditor-database/get_denomination_balance.h" -#include "taler/auditor-database/get_reserve_info.h" -#include "taler/auditor-database/insert_auditor_closure_lags.h" -#include "taler/auditor-database/insert_denomination_balance.h" -#include "taler/auditor-database/insert_historic_denom_revenue.h" -#include "taler/auditor-database/insert_historic_reserve_revenue.h" -#include "taler/auditor-database/insert_reserve_info.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/select_historic_denom_revenue.h" -#include "taler/auditor-database/select_historic_reserve_revenue.h" -#include "taler/auditor-database/start.h" -#include "taler/auditor-database/update_denomination_balance.h" -#include "taler/auditor-database/update_reserve_info.h" +#include "auditor-database/create_tables.h" +#include "auditor-database/del_reserve_info.h" +#include "auditor-database/delete_auditor_closure_lag.h" +#include "auditor-database/drop_tables.h" +#include "auditor-database/gc.h" +#include "auditor-database/get_denomination_balance.h" +#include "auditor-database/get_reserve_info.h" +#include "auditor-database/insert_auditor_closure_lags.h" +#include "auditor-database/insert_denomination_balance.h" +#include "auditor-database/insert_historic_denom_revenue.h" +#include "auditor-database/insert_historic_reserve_revenue.h" +#include "auditor-database/insert_reserve_info.h" +#include "auditor-database/preflight.h" +#include "auditor-database/select_historic_denom_revenue.h" +#include "auditor-database/select_historic_reserve_revenue.h" +#include "auditor-database/start.h" +#include "auditor-database/update_denomination_balance.h" +#include "auditor-database/update_reserve_info.h" /** * Currency we use, must match CURRENCY in "test-auditor-db-postgres.conf". diff --git a/src/auditordb/test_auditordb_checkpoints.c b/src/auditordb/test_auditordb_checkpoints.c @@ -21,16 +21,16 @@ #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_db_lib.h> #include "taler/taler_auditordb_lib.h" -#include "taler/auditor-database/create_tables.h" -#include "taler/auditor-database/drop_tables.h" -#include "taler/auditor-database/get_auditor_progress.h" -#include "taler/auditor-database/get_balance.h" -#include "taler/auditor-database/insert_auditor_progress.h" -#include "taler/auditor-database/insert_balance.h" -#include "taler/auditor-database/preflight.h" -#include "taler/auditor-database/start.h" -#include "taler/auditor-database/update_auditor_progress.h" -#include "taler/auditor-database/update_balance.h" +#include "auditor-database/create_tables.h" +#include "auditor-database/drop_tables.h" +#include "auditor-database/get_auditor_progress.h" +#include "auditor-database/get_balance.h" +#include "auditor-database/insert_auditor_progress.h" +#include "auditor-database/insert_balance.h" +#include "auditor-database/preflight.h" +#include "auditor-database/start.h" +#include "auditor-database/update_auditor_progress.h" +#include "auditor-database/update_balance.h" /** diff --git a/src/auditordb/update_auditor_progress.c b/src/auditordb/update_auditor_progress.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/update_auditor_progress.h" +#include "auditor-database/update_auditor_progress.h" #include "pg_helper.h" diff --git a/src/auditordb/update_balance.c b/src/auditordb/update_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/update_balance.h" +#include "auditor-database/update_balance.h" #include "pg_helper.h" diff --git a/src/auditordb/update_denomination_balance.c b/src/auditordb/update_denomination_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/update_denomination_balance.h" +#include "auditor-database/update_denomination_balance.h" #include "pg_helper.h" diff --git a/src/auditordb/update_generic_suppressed.c b/src/auditordb/update_generic_suppressed.c @@ -15,7 +15,7 @@ */ #include "taler/taler_pq_lib.h" #include "pg_helper.h" -#include "taler/auditor-database/update_generic_suppressed.h" +#include "auditor-database/update_generic_suppressed.h" struct Preparations { diff --git a/src/auditordb/update_purse_info.c b/src/auditordb/update_purse_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/update_purse_info.h" +#include "auditor-database/update_purse_info.h" #include "pg_helper.h" diff --git a/src/auditordb/update_reserve_info.c b/src/auditordb/update_reserve_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/update_reserve_info.h" +#include "auditor-database/update_reserve_info.h" #include "pg_helper.h" diff --git a/src/auditordb/update_wire_fee_summary.c b/src/auditordb/update_wire_fee_summary.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/auditor-database/update_wire_fee_summary.h" +#include "auditor-database/update_wire_fee_summary.h" #include "pg_helper.h" diff --git a/src/benchmark/taler-aggregator-benchmark.c b/src/benchmark/taler-aggregator-benchmark.c @@ -30,15 +30,15 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_error_codes.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/insert_refund.h" -#include "taler/exchange-database/do_deposit.h" -#include "taler/exchange-database/insert_wire_fee.h" -#include "taler/exchange-database/insert_denomination_info.h" -#include "taler/exchange-database/ensure_coin_known.h" +#include "exchange-database/rollback.h" +#include "exchange-database/start.h" +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/insert_refund.h" +#include "exchange-database/do_deposit.h" +#include "exchange-database/insert_wire_fee.h" +#include "exchange-database/insert_denomination_info.h" +#include "exchange-database/ensure_coin_known.h" /** * Exit code. diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c @@ -23,14 +23,14 @@ #include <gnunet/gnunet_util_lib.h> #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/gc.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/create_tables.h" -#include "taler/exchange-database/delete_shard_locks.h" -#include "taler/exchange-database/disable_rules.h" -#include "taler/exchange-database/enable_rules.h" -#include "taler/exchange-database/drop_tables.h" -#include "taler/exchange-database/inject_auditor_triggers.h" +#include "exchange-database/gc.h" +#include "exchange-database/preflight.h" +#include "exchange-database/create_tables.h" +#include "exchange-database/delete_shard_locks.h" +#include "exchange-database/disable_rules.h" +#include "exchange-database/enable_rules.h" +#include "exchange-database/drop_tables.h" +#include "exchange-database/inject_auditor_triggers.h" /** * Return value from main(). diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c @@ -28,29 +28,29 @@ #include "taler/taler_kyclogic_lib.h" #include "taler/taler_bank_service.h" #include "taler/taler_dbevents.h" -#include "taler/exchange-database/release_revolving_shard.h" -#include "taler/exchange-database/begin_revolving_shard.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/drain_kyc_alert.h" -#include "taler/exchange-database/get_ready_deposit.h" -#include "taler/exchange-database/start_deferred_wire_out.h" -#include "taler/exchange-database/aggregate.h" -#include "taler/exchange-database/create_aggregation_transient.h" -#include "taler/exchange-database/select_aggregation_transient.h" -#include "taler/exchange-database/find_aggregation_transient.h" -#include "taler/exchange-database/get_wire_fee.h" -#include "taler/exchange-database/trigger_kyc_rule_for_account.h" -#include "taler/exchange-database/select_aggregation_amounts_for_kyc_check.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" -#include "taler/exchange-database/store_wire_transfer_out.h" -#include "taler/exchange-database/delete_aggregation_transient.h" -#include "taler/exchange-database/update_aggregation_transient.h" -#include "taler/exchange-database/event_notify.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" -#include "taler/exchange-database/update_rules.h" +#include "exchange-database/release_revolving_shard.h" +#include "exchange-database/begin_revolving_shard.h" +#include "exchange-database/start.h" +#include "exchange-database/preflight.h" +#include "exchange-database/commit.h" +#include "exchange-database/rollback.h" +#include "exchange-database/drain_kyc_alert.h" +#include "exchange-database/get_ready_deposit.h" +#include "exchange-database/start_deferred_wire_out.h" +#include "exchange-database/aggregate.h" +#include "exchange-database/create_aggregation_transient.h" +#include "exchange-database/select_aggregation_transient.h" +#include "exchange-database/find_aggregation_transient.h" +#include "exchange-database/get_wire_fee.h" +#include "exchange-database/trigger_kyc_rule_for_account.h" +#include "exchange-database/select_aggregation_amounts_for_kyc_check.h" +#include "exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/store_wire_transfer_out.h" +#include "exchange-database/delete_aggregation_transient.h" +#include "exchange-database/update_aggregation_transient.h" +#include "exchange-database/event_notify.h" +#include "exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/update_rules.h" /** * How often do we retry after serialization failures? diff --git a/src/exchange/taler-exchange-closer.c b/src/exchange/taler-exchange-closer.c @@ -26,16 +26,16 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_bank_service.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/get_wire_fee.h" -#include "taler/exchange-database/insert_reserve_closed.h" -#include "taler/exchange-database/get_unfinished_close_requests.h" -#include "taler/exchange-database/get_expired_reserves.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/start.h" +#include "exchange-database/preflight.h" +#include "exchange-database/commit.h" +#include "exchange-database/rollback.h" +#include "exchange-database/get_wire_fee.h" +#include "exchange-database/insert_reserve_closed.h" +#include "exchange-database/get_unfinished_close_requests.h" +#include "exchange-database/get_expired_reserves.h" +#include "exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/wire_prepare_data_insert.h" /** diff --git a/src/exchange/taler-exchange-drain.c b/src/exchange/taler-exchange-drain.c @@ -26,14 +26,14 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_bank_service.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/profit_drains_get_pending.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" -#include "taler/exchange-database/profit_drains_set_finished.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/start.h" +#include "exchange-database/preflight.h" +#include "exchange-database/commit.h" +#include "exchange-database/rollback.h" +#include "exchange-database/profit_drains_get_pending.h" +#include "exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/profit_drains_set_finished.h" +#include "exchange-database/wire_prepare_data_insert.h" /** * The exchange's configuration. diff --git a/src/exchange/taler-exchange-expire.c b/src/exchange/taler-exchange-expire.c @@ -26,15 +26,15 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_bank_service.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/complete_shard.h" -#include "taler/exchange-database/abort_shard.h" -#include "taler/exchange-database/begin_shard.h" -#include "taler/exchange-database/expire_purse.h" -#include "taler/exchange-database/start.h" +#include "exchange-database/start.h" +#include "exchange-database/preflight.h" +#include "exchange-database/commit.h" +#include "exchange-database/rollback.h" +#include "exchange-database/complete_shard.h" +#include "exchange-database/abort_shard.h" +#include "exchange-database/begin_shard.h" +#include "exchange-database/expire_purse.h" +#include "exchange-database/start.h" /** diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -83,8 +83,8 @@ #include "taler-exchange-httpd_get-transfers-WTID.h" #include "taler/taler_extensions.h" #include <gnunet/gnunet_mhd_compat.h> -#include "taler/exchange-database/test_aml_officer.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/test_aml_officer.h" +#include "exchange-database/preflight.h" /** * Backlog for listen operation on unix domain sockets. diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c b/src/exchange/taler-exchange-httpd_common_kyc.c @@ -19,26 +19,26 @@ * @author Christian Grothoff */ #include "taler-exchange-httpd.h" -#include "taler/exchange-database/trigger_kyc_rule_for_account.h" +#include "exchange-database/trigger_kyc_rule_for_account.h" #include "taler-exchange-httpd_common_kyc.h" #include "taler/taler_attributes.h" #include "taler/taler_error_codes.h" #include "taler/taler_kyclogic_lib.h" #include "taler/taler_exchangedb_lib.h" #include <gnunet/gnunet_common.h> -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/get_kyc_rules.h" -#include "taler/exchange-database/insert_aml_decision.h" -#include "taler/exchange-database/insert_kyc_failure.h" -#include "taler/exchange-database/insert_kyc_requirement_process.h" -#include "taler/exchange-database/lookup_active_legitimization.h" -#include "taler/exchange-database/persist_kyc_attributes.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/update_rules.h" -#include "taler/exchange-database/account_history.h" -#include "taler/exchange-database/persist_aml_program_result.h" +#include "exchange-database/commit.h" +#include "exchange-database/get_kyc_rules.h" +#include "exchange-database/insert_aml_decision.h" +#include "exchange-database/insert_kyc_failure.h" +#include "exchange-database/insert_kyc_requirement_process.h" +#include "exchange-database/lookup_active_legitimization.h" +#include "exchange-database/persist_kyc_attributes.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" +#include "exchange-database/start.h" +#include "exchange-database/update_rules.h" +#include "exchange-database/account_history.h" +#include "exchange-database/persist_aml_program_result.h" /** diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c @@ -28,12 +28,12 @@ #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_db.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/ensure_coin_known.h" -#include "taler/exchange-database/get_signature_for_known_coin.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/start.h" +#include "exchange-database/commit.h" +#include "exchange-database/ensure_coin_known.h" +#include "exchange-database/get_signature_for_known_coin.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchange/taler-exchange-httpd_delete-purses-PURSE_PUB.c b/src/exchange/taler-exchange-httpd_delete-purses-PURSE_PUB.c @@ -31,9 +31,9 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/do_purse_delete.h" -#include "taler/exchange-database/event_notify.h" +#include "exchange-database/preflight.h" +#include "exchange-database/do_purse_delete.h" +#include "exchange-database/event_notify.h" MHD_RESULT diff --git a/src/exchange/taler-exchange-httpd_extensions.c b/src/exchange/taler-exchange-httpd_extensions.c @@ -27,12 +27,12 @@ #include "taler/taler_mhd_lib.h" #include "taler/taler_extensions.h" #include <jansson.h> -#include "taler/exchange-database/set_extension_manifest.h" -#include "taler/exchange-database/add_policy_fulfillment_proof.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/get_extension_manifest.h" -#include "taler/exchange-database/get_policy_details.h" +#include "exchange-database/set_extension_manifest.h" +#include "exchange-database/add_policy_fulfillment_proof.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/get_extension_manifest.h" +#include "exchange-database/get_policy_details.h" /** * Handler listening for extensions updates by other exchange diff --git a/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-accounts.c b/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-accounts.c @@ -26,7 +26,7 @@ #include "taler/taler_mhd_lib.h" #include "taler/taler_signatures.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_kyc_accounts.h" +#include "exchange-database/select_kyc_accounts.h" #include "taler-exchange-httpd_get-aml-OFFICER_PUB-accounts.h" diff --git a/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.c b/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.c @@ -27,12 +27,12 @@ #include "taler/taler_kyclogic_lib.h" #include "taler/taler_signatures.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_aml_attributes.h" +#include "exchange-database/select_aml_attributes.h" #include \ "taler-exchange-httpd_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.h" #include "taler-exchange-httpd_get-metrics.h" -#include "taler/exchange-database/lookup_aml_file_number.h" -#include "taler/exchange-database/lookup_aml_history.h" +#include "exchange-database/lookup_aml_file_number.h" +#include "exchange-database/lookup_aml_history.h" /** * Maximum number of records we return in one request. diff --git a/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-decisions.c b/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-decisions.c @@ -25,7 +25,7 @@ #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_aml_decisions.h" +#include "exchange-database/select_aml_decisions.h" #include "taler-exchange-httpd_post-aml-OFFICER_PUB-decision.h" #include "taler-exchange-httpd_get-metrics.h" diff --git a/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-kyc-statistics-NAMES.c b/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-kyc-statistics-NAMES.c @@ -25,7 +25,7 @@ #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_aml_statistics.h" +#include "exchange-database/select_aml_statistics.h" #include "taler-exchange-httpd_get-aml-OFFICER_PUB-kyc-statistics-NAMES.h" #include "taler-exchange-httpd_get-metrics.h" diff --git a/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-legitimizations.c b/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-legitimizations.c @@ -25,7 +25,7 @@ #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_aml_measures.h" +#include "exchange-database/select_aml_measures.h" #include "taler-exchange-httpd_get-aml-OFFICER_PUB-legitimizations.h" #include "taler-exchange-httpd_get-metrics.h" diff --git a/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-transfers.c b/src/exchange/taler-exchange-httpd_get-aml-OFFICER_PUB-transfers.c @@ -25,11 +25,11 @@ #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_exchange_kycauth_transfers.h" +#include "exchange-database/select_exchange_kycauth_transfers.h" #include "taler-exchange-httpd_get-aml-OFFICER_PUB-transfers.h" #include "taler-exchange-httpd_get-metrics.h" -#include "taler/exchange-database/select_exchange_credit_transfers.h" -#include "taler/exchange-database/select_exchange_debit_transfers.h" +#include "exchange-database/select_exchange_credit_transfers.h" +#include "exchange-database/select_exchange_debit_transfers.h" enum TransferType diff --git a/src/exchange/taler-exchange-httpd_get-coins-COIN_PUB-history.c b/src/exchange/taler-exchange-httpd_get-coins-COIN_PUB-history.c @@ -26,7 +26,7 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_get-coins-COIN_PUB-history.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/get_coin_transactions.h" +#include "exchange-database/get_coin_transactions.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-contracts-CONTRACT_PUB.c b/src/exchange/taler-exchange-httpd_get-contracts-CONTRACT_PUB.c @@ -25,7 +25,7 @@ #include "taler-exchange-httpd_get-contracts-CONTRACT_PUB.h" #include "taler-exchange-httpd_mhd.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/select_contract.h" +#include "exchange-database/select_contract.h" MHD_RESULT diff --git a/src/exchange/taler-exchange-httpd_get-deposits.c b/src/exchange/taler-exchange-httpd_get-deposits.c @@ -31,9 +31,9 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_get-deposits.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/lookup_transfer_by_deposit.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" +#include "exchange-database/lookup_transfer_by_deposit.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-keys.c b/src/exchange/taler-exchange-httpd_get-keys.c @@ -24,21 +24,21 @@ #include "taler/taler_kyclogic_lib.h" #include "taler/taler_dbevents.h" #include "taler-exchange-httpd.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/preflight.h" #include "taler-exchange-httpd_get-config.h" #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_responses.h" #include "taler/taler_extensions.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/event_notify.h" -#include "taler/exchange-database/get_global_fees.h" -#include "taler/exchange-database/get_wire_accounts.h" -#include "taler/exchange-database/get_wire_fees.h" -#include "taler/exchange-database/iterate_active_auditors.h" -#include "taler/exchange-database/iterate_active_signkeys.h" -#include "taler/exchange-database/iterate_auditor_denominations.h" -#include "taler/exchange-database/iterate_denominations.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/event_notify.h" +#include "exchange-database/get_global_fees.h" +#include "exchange-database/get_wire_accounts.h" +#include "exchange-database/get_wire_fees.h" +#include "exchange-database/iterate_active_auditors.h" +#include "exchange-database/iterate_active_signkeys.h" +#include "exchange-database/iterate_auditor_denominations.h" +#include "exchange-database/iterate_denominations.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c b/src/exchange/taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c @@ -33,9 +33,9 @@ #include "taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.h" #include "taler-exchange-httpd_post-kyc-wallet.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/lookup_kyc_requirement_by_row.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" +#include "exchange-database/lookup_kyc_requirement_by_row.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" /** * Reserve GET request that is long-polling. diff --git a/src/exchange/taler-exchange-httpd_get-kyc-info-ACCESS_TOKEN.c b/src/exchange/taler-exchange-httpd_get-kyc-info-ACCESS_TOKEN.c @@ -34,14 +34,14 @@ #include "taler-exchange-httpd_get-kyc-info-ACCESS_TOKEN.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_common_kyc.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/insert_active_legitimization_measure.h" -#include "taler/exchange-database/lookup_h_payto_by_access_token.h" -#include "taler/exchange-database/lookup_kyc_status_by_token.h" -#include "taler/exchange-database/update_rules.h" +#include "exchange-database/rollback.h" +#include "exchange-database/commit.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/insert_active_legitimization_measure.h" +#include "exchange-database/lookup_h_payto_by_access_token.h" +#include "exchange-database/lookup_kyc_status_by_token.h" +#include "exchange-database/update_rules.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-kyc-proof-PROVIDER_NAME.c b/src/exchange/taler-exchange-httpd_get-kyc-proof-PROVIDER_NAME.c @@ -29,7 +29,7 @@ #include "taler-exchange-httpd_common_kyc.h" #include "taler-exchange-httpd_get-kyc-proof-PROVIDER_NAME.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/lookup_kyc_process_by_account.h" +#include "exchange-database/lookup_kyc_process_by_account.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-purses-PURSE_PUB-merge.c b/src/exchange/taler-exchange-httpd_get-purses-PURSE_PUB-merge.c @@ -27,9 +27,9 @@ #include "taler-exchange-httpd_get-purses-PURSE_PUB-merge.h" #include "taler-exchange-httpd_mhd.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/select_purse.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" +#include "exchange-database/select_purse.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB-attest.c b/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB-attest.c @@ -26,7 +26,7 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_get-reserves-RESERVE_PUB-attest.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/select_kyc_attributes.h" +#include "exchange-database/select_kyc_attributes.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB-history.c b/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB-history.c @@ -26,7 +26,7 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_get-reserves-RESERVE_PUB-history.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/get_reserve_history.h" +#include "exchange-database/get_reserve_history.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB.c b/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB.c @@ -29,9 +29,9 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_get-reserves-RESERVE_PUB.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/get_reserve_balance.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" +#include "exchange-database/get_reserve_balance.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" /** diff --git a/src/exchange/taler-exchange-httpd_get-transfers-WTID.c b/src/exchange/taler-exchange-httpd_get-transfers-WTID.c @@ -27,9 +27,9 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" -#include "taler/exchange-database/select_refunds_by_coin.h" -#include "taler/exchange-database/get_wire_fee.h" -#include "taler/exchange-database/lookup_wire_transfer.h" +#include "exchange-database/select_refunds_by_coin.h" +#include "exchange-database/get_wire_fee.h" +#include "exchange-database/lookup_wire_transfer.h" /** diff --git a/src/exchange/taler-exchange-httpd_kyc-webhook.c b/src/exchange/taler-exchange-httpd_kyc-webhook.c @@ -29,7 +29,7 @@ #include "taler-exchange-httpd_common_kyc.h" #include "taler-exchange-httpd_kyc-webhook.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/kyc_provider_account_lookup.h" +#include "exchange-database/kyc_provider_account_lookup.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-aml-OFFICER_PUB-decision.c b/src/exchange/taler-exchange-httpd_post-aml-OFFICER_PUB-decision.c @@ -30,7 +30,7 @@ #include "taler-exchange-httpd_common_kyc.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_post-aml-OFFICER_PUB-decision.h" -#include "taler/exchange-database/insert_aml_decision.h" +#include "exchange-database/insert_aml_decision.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-auditors-AUDITOR_PUB-H_DENOM_PUB.c b/src/exchange/taler-exchange-httpd_post-auditors-AUDITOR_PUB-H_DENOM_PUB.c @@ -27,9 +27,9 @@ #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd_post-auditors-AUDITOR_PUB-H_DENOM_PUB.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/lookup_denomination_key.h" -#include "taler/exchange-database/insert_auditor_denom_sig.h" -#include "taler/exchange-database/lookup_auditor_status.h" +#include "exchange-database/lookup_denomination_key.h" +#include "exchange-database/insert_auditor_denom_sig.h" +#include "exchange-database/lookup_auditor_status.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-batch-deposit.c b/src/exchange/taler-exchange-httpd_post-batch-deposit.c @@ -35,12 +35,12 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/select_deposit_amounts_for_kyc_check.h" -#include "taler/exchange-database/do_check_deposit_idempotent.h" -#include "taler/exchange-database/do_deposit.h" -#include "taler/exchange-database/get_wire_hash_for_contract.h" -#include "taler/exchange-database/persist_policy_details.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/select_deposit_amounts_for_kyc_check.h" +#include "exchange-database/do_check_deposit_idempotent.h" +#include "exchange-database/do_deposit.h" +#include "exchange-database/get_wire_hash_for_contract.h" +#include "exchange-database/persist_policy_details.h" +#include "exchange-database/preflight.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-coins-COIN_PUB-refund.c b/src/exchange/taler-exchange-httpd_post-coins-COIN_PUB-refund.c @@ -32,8 +32,8 @@ #include "taler-exchange-httpd_post-coins-COIN_PUB-refund.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/get_coin_denomination.h" -#include "taler/exchange-database/do_refund.h" +#include "exchange-database/get_coin_denomination.h" +#include "exchange-database/do_refund.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-kyc-start-ID.c b/src/exchange/taler-exchange-httpd_post-kyc-start-ID.c @@ -29,10 +29,10 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_post-kyc-start-ID.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/update_kyc_process_by_row.h" -#include "taler/exchange-database/get_pending_kyc_requirement_process.h" -#include "taler/exchange-database/insert_kyc_requirement_process.h" -#include "taler/exchange-database/lookup_pending_legitimization.h" +#include "exchange-database/update_kyc_process_by_row.h" +#include "exchange-database/get_pending_kyc_requirement_process.h" +#include "exchange-database/insert_kyc_requirement_process.h" +#include "exchange-database/lookup_pending_legitimization.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c b/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c @@ -20,10 +20,10 @@ */ #include "taler-exchange-httpd_common_kyc.h" #include "taler-exchange-httpd_post-kyc-upload-ID.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/insert_kyc_requirement_process.h" -#include "taler/exchange-database/lookup_completed_legitimization.h" -#include "taler/exchange-database/lookup_pending_legitimization.h" +#include "exchange-database/preflight.h" +#include "exchange-database/insert_kyc_requirement_process.h" +#include "exchange-database/lookup_completed_legitimization.h" +#include "exchange-database/lookup_pending_legitimization.h" #define MAX_RETRIES 3 diff --git a/src/exchange/taler-exchange-httpd_post-kyc-wallet.c b/src/exchange/taler-exchange-httpd_post-kyc-wallet.c @@ -29,7 +29,7 @@ #include "taler-exchange-httpd_common_kyc.h" #include "taler-exchange-httpd_post-kyc-wallet.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/preflight.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-aml-officers.c b/src/exchange/taler-exchange-httpd_post-management-aml-officers.c @@ -27,7 +27,7 @@ #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/insert_aml_officer.h" +#include "exchange-database/insert_aml_officer.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-auditors-AUDITOR_PUB-disable.c b/src/exchange/taler-exchange-httpd_post-management-auditors-AUDITOR_PUB-disable.c @@ -28,8 +28,8 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/update_auditor.h" -#include "taler/exchange-database/lookup_auditor_timestamp.h" +#include "exchange-database/update_auditor.h" +#include "exchange-database/lookup_auditor_timestamp.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-auditors.c b/src/exchange/taler-exchange-httpd_post-management-auditors.c @@ -28,9 +28,9 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/update_auditor.h" -#include "taler/exchange-database/insert_auditor.h" -#include "taler/exchange-database/lookup_auditor_timestamp.h" +#include "exchange-database/update_auditor.h" +#include "exchange-database/insert_auditor.h" +#include "exchange-database/lookup_auditor_timestamp.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-denominations-H_DENOM_PUB-revoke.c b/src/exchange/taler-exchange-httpd_post-management-denominations-H_DENOM_PUB-revoke.c @@ -28,7 +28,7 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/insert_denomination_revocation.h" +#include "exchange-database/insert_denomination_revocation.h" MHD_RESULT diff --git a/src/exchange/taler-exchange-httpd_post-management-drain.c b/src/exchange/taler-exchange-httpd_post-management-drain.c @@ -28,7 +28,7 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/insert_drain_profit.h" +#include "exchange-database/insert_drain_profit.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-extensions.c b/src/exchange/taler-exchange-httpd_post-management-extensions.c @@ -29,8 +29,8 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_extensions.h" #include "taler/taler_dbevents.h" -#include "taler/exchange-database/set_extension_manifest.h" -#include "taler/exchange-database/event_notify.h" +#include "exchange-database/set_extension_manifest.h" +#include "exchange-database/event_notify.h" /** * Extension carries the necessary data for a particular extension. diff --git a/src/exchange/taler-exchange-httpd_post-management-global-fees.c b/src/exchange/taler-exchange-httpd_post-management-global-fees.c @@ -28,8 +28,8 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/lookup_global_fee_by_time.h" -#include "taler/exchange-database/insert_global_fee.h" +#include "exchange-database/lookup_global_fee_by_time.h" +#include "exchange-database/insert_global_fee.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-keys.c b/src/exchange/taler-exchange-httpd_post-management-keys.c @@ -28,10 +28,10 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/lookup_signing_key.h" -#include "taler/exchange-database/activate_signing_key.h" -#include "taler/exchange-database/add_denomination_key.h" -#include "taler/exchange-database/lookup_denomination_key.h" +#include "exchange-database/lookup_signing_key.h" +#include "exchange-database/activate_signing_key.h" +#include "exchange-database/add_denomination_key.h" +#include "exchange-database/lookup_denomination_key.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-partners.c b/src/exchange/taler-exchange-httpd_post-management-partners.c @@ -27,7 +27,7 @@ #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/insert_partner.h" +#include "exchange-database/insert_partner.h" MHD_RESULT diff --git a/src/exchange/taler-exchange-httpd_post-management-signkeys-EXCHANGE_PUB-revoke.c b/src/exchange/taler-exchange-httpd_post-management-signkeys-EXCHANGE_PUB-revoke.c @@ -28,7 +28,7 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/insert_signkey_revocation.h" +#include "exchange-database/insert_signkey_revocation.h" MHD_RESULT diff --git a/src/exchange/taler-exchange-httpd_post-management-wire-disable.c b/src/exchange/taler-exchange-httpd_post-management-wire-disable.c @@ -28,8 +28,8 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/update_wire.h" -#include "taler/exchange-database/lookup_wire_timestamp.h" +#include "exchange-database/update_wire.h" +#include "exchange-database/lookup_wire_timestamp.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-wire-fee.c b/src/exchange/taler-exchange-httpd_post-management-wire-fee.c @@ -28,8 +28,8 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/lookup_wire_fee_by_time.h" -#include "taler/exchange-database/insert_wire_fee.h" +#include "exchange-database/lookup_wire_fee_by_time.h" +#include "exchange-database/insert_wire_fee.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-management-wire.c b/src/exchange/taler-exchange-httpd_post-management-wire.c @@ -28,9 +28,9 @@ #include "taler-exchange-httpd_management.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/update_wire.h" -#include "taler/exchange-database/insert_wire.h" -#include "taler/exchange-database/lookup_wire_timestamp.h" +#include "exchange-database/update_wire.h" +#include "exchange-database/insert_wire.h" +#include "exchange-database/lookup_wire_timestamp.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-melt.c b/src/exchange/taler-exchange-httpd_post-melt.c @@ -23,16 +23,16 @@ #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include "taler-exchange-httpd.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/preflight.h" #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include "taler-exchange-httpd_post-melt.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" #include "taler/taler_util.h" -#include "taler/exchange-database/do_refresh.h" -#include "taler/exchange-database/get_coin_denomination.h" -#include "taler/exchange-database/get_refresh.h" +#include "exchange-database/do_refresh.h" +#include "exchange-database/get_coin_denomination.h" +#include "exchange-database/get_refresh.h" /** * The different type of errors that might occur, sorted by name. diff --git a/src/exchange/taler-exchange-httpd_post-purses-PURSE_PUB-create.c b/src/exchange/taler-exchange-httpd_post-purses-PURSE_PUB-create.c @@ -31,14 +31,14 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/select_contract_by_purse.h" -#include "taler/exchange-database/do_purse_deposit.h" -#include "taler/exchange-database/get_purse_deposit.h" -#include "taler/exchange-database/get_purse_request.h" -#include "taler/exchange-database/insert_contract.h" -#include "taler/exchange-database/insert_purse_request.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/select_contract_by_purse.h" +#include "exchange-database/do_purse_deposit.h" +#include "exchange-database/get_purse_deposit.h" +#include "exchange-database/get_purse_request.h" +#include "exchange-database/insert_contract.h" +#include "exchange-database/insert_purse_request.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-purses-PURSE_PUB-deposit.c b/src/exchange/taler-exchange-httpd_post-purses-PURSE_PUB-deposit.c @@ -33,12 +33,12 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/select_purse.h" -#include "taler/exchange-database/do_purse_deposit.h" -#include "taler/exchange-database/event_notify.h" -#include "taler/exchange-database/get_purse_deposit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/select_purse.h" +#include "exchange-database/do_purse_deposit.h" +#include "exchange-database/event_notify.h" +#include "exchange-database/get_purse_deposit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-purses-PURSE_PUB-merge.c b/src/exchange/taler-exchange-httpd_post-purses-PURSE_PUB-merge.c @@ -35,11 +35,11 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/select_purse_merge.h" -#include "taler/exchange-database/do_purse_merge.h" -#include "taler/exchange-database/event_notify.h" -#include "taler/exchange-database/get_purse_request.h" -#include "taler/exchange-database/select_merge_amounts_for_kyc_check.h" +#include "exchange-database/select_purse_merge.h" +#include "exchange-database/do_purse_merge.h" +#include "exchange-database/event_notify.h" +#include "exchange-database/get_purse_request.h" +#include "exchange-database/select_merge_amounts_for_kyc_check.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-recoup-refresh.c b/src/exchange/taler-exchange-httpd_post-recoup-refresh.c @@ -32,8 +32,8 @@ #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/get_old_coin_by_h_blind.h" -#include "taler/exchange-database/do_recoup_refresh.h" +#include "exchange-database/get_old_coin_by_h_blind.h" +#include "exchange-database/do_recoup_refresh.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-recoup-withdraw.c b/src/exchange/taler-exchange-httpd_post-recoup-withdraw.c @@ -32,8 +32,8 @@ #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/get_reserve_by_h_planchets.h" -#include "taler/exchange-database/do_recoup.h" +#include "exchange-database/get_reserve_by_h_planchets.h" +#include "exchange-database/do_recoup.h" /** * Closure for #recoup_transaction. diff --git a/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.c b/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.c @@ -28,7 +28,7 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/select_kyc_attributes.h" +#include "exchange-database/select_kyc_attributes.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c b/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c @@ -29,9 +29,9 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_post-reserves-RESERVE_PUB-close.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/select_reserve_close_info.h" -#include "taler/exchange-database/insert_close_request.h" -#include "taler/exchange-database/iterate_reserve_close_info.h" +#include "exchange-database/select_reserve_close_info.h" +#include "exchange-database/insert_close_request.h" +#include "exchange-database/iterate_reserve_close_info.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-open.c b/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-open.c @@ -27,9 +27,9 @@ #include "taler-exchange-httpd_get-keys.h" #include "taler-exchange-httpd_post-reserves-RESERVE_PUB-open.h" #include "taler-exchange-httpd_responses.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/do_reserve_open.h" -#include "taler/exchange-database/insert_reserve_open_deposit.h" +#include "exchange-database/rollback.h" +#include "exchange-database/do_reserve_open.h" +#include "exchange-database/insert_reserve_open_deposit.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-purse.c b/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-purse.c @@ -33,14 +33,14 @@ #include "taler-exchange-httpd_responses.h" #include "taler/taler_exchangedb_lib.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/select_purse_merge.h" -#include "taler/exchange-database/do_reserve_purse.h" -#include "taler/exchange-database/get_purse_request.h" -#include "taler/exchange-database/insert_contract.h" -#include "taler/exchange-database/insert_purse_request.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/select_contract_by_purse.h" -#include "taler/exchange-database/select_merge_amounts_for_kyc_check.h" +#include "exchange-database/select_purse_merge.h" +#include "exchange-database/do_reserve_purse.h" +#include "exchange-database/get_purse_request.h" +#include "exchange-database/insert_contract.h" +#include "exchange-database/insert_purse_request.h" +#include "exchange-database/rollback.h" +#include "exchange-database/select_contract_by_purse.h" +#include "exchange-database/select_merge_amounts_for_kyc_check.h" /** diff --git a/src/exchange/taler-exchange-httpd_post-reveal-melt.c b/src/exchange/taler-exchange-httpd_post-reveal-melt.c @@ -29,8 +29,8 @@ #include "taler-exchange-httpd_post-reveal-melt.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/mark_refresh_reveal_success.h" -#include "taler/exchange-database/get_refresh.h" +#include "exchange-database/mark_refresh_reveal_success.h" +#include "exchange-database/get_refresh.h" #define KAPPA_MINUS_1 (TALER_CNC_KAPPA - 1) diff --git a/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c b/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c @@ -29,7 +29,7 @@ #include "taler-exchange-httpd_post-reveal-withdraw.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" -#include "taler/exchange-database/get_withdraw.h" +#include "exchange-database/get_withdraw.h" /** * State for an /reveal-withdraw operation. diff --git a/src/exchange/taler-exchange-httpd_post-withdraw.c b/src/exchange/taler-exchange-httpd_post-withdraw.c @@ -26,7 +26,7 @@ #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include "taler-exchange-httpd.h" -#include "taler/exchange-database/select_withdraw_amounts_for_kyc_check.h" +#include "exchange-database/select_withdraw_amounts_for_kyc_check.h" #include "taler/taler_json_lib.h" #include "taler/taler_kyclogic_lib.h" #include "taler/taler_mhd_lib.h" @@ -35,10 +35,10 @@ #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_get-keys.h" #include "taler/taler_util.h" -#include "taler/exchange-database/do_withdraw.h" -#include "taler/exchange-database/get_withdraw.h" -#include "taler/exchange-database/reserves_get_origin.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/do_withdraw.h" +#include "exchange-database/get_withdraw.h" +#include "exchange-database/reserves_get_origin.h" +#include "exchange-database/rollback.h" /** * The different type of errors that might occur, sorted by name. diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h @@ -32,7 +32,7 @@ #include "taler-exchange-httpd.h" #include "taler-exchange-httpd_db.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/ensure_coin_known.h" +#include "exchange-database/ensure_coin_known.h" /** diff --git a/src/exchange/taler-exchange-router.c b/src/exchange/taler-exchange-router.c @@ -29,13 +29,13 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_bank_service.h" -#include "taler/exchange-database/release_revolving_shard.h" +#include "exchange-database/release_revolving_shard.h" // FIXME: weird to have commit but not start? -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/begin_revolving_shard.h" -#include "taler/exchange-database/release_revolving_shard.h" -#include "taler/exchange-database/release_revolving_shard.h" +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/begin_revolving_shard.h" +#include "exchange-database/release_revolving_shard.h" +#include "exchange-database/release_revolving_shard.h" // FIXME #7271: revisit how (and if) we do sharding! diff --git a/src/exchange/taler-exchange-sanctionscheck.c b/src/exchange/taler-exchange-sanctionscheck.c @@ -28,16 +28,16 @@ #include "taler/taler_json_lib.h" #include "taler/taler_kyclogic_lib.h" #include <math.h> -#include "taler/exchange-database/release_revolving_shard.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/insert_sanction_list_hit.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/select_all_kyc_attributes.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/start.h" +#include "exchange-database/release_revolving_shard.h" +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/insert_sanction_list_hit.h" +#include "exchange-database/start.h" +#include "exchange-database/rollback.h" +#include "exchange-database/select_all_kyc_attributes.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/start.h" /** * Account we are currently checking. diff --git a/src/exchange/taler-exchange-transfer.c b/src/exchange/taler-exchange-transfer.c @@ -25,19 +25,19 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_bank_service.h" -#include "taler/exchange-database/begin_shard.h" -#include "taler/exchange-database/complete_shard.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/insert_sanction_list_hit.h" -#include "taler/exchange-database/start_read_committed.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/wire_prepare_data_mark_finished.h" -#include "taler/exchange-database/wire_prepare_data_mark_failed.h" -#include "taler/exchange-database/wire_prepare_data_get.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/wire_prepare_data_mark_finished.h" +#include "exchange-database/begin_shard.h" +#include "exchange-database/complete_shard.h" +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/insert_sanction_list_hit.h" +#include "exchange-database/start_read_committed.h" +#include "exchange-database/rollback.h" +#include "exchange-database/wire_prepare_data_mark_finished.h" +#include "exchange-database/wire_prepare_data_mark_failed.h" +#include "exchange-database/wire_prepare_data_get.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/wire_prepare_data_mark_finished.h" /** diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c @@ -26,18 +26,18 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_json_lib.h" #include "taler/taler_bank_service.h" -#include "taler/exchange-database/begin_shard.h" -#include "taler/exchange-database/abort_shard.h" -#include "taler/exchange-database/complete_shard.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/kycauth_in_insert.h" -#include "taler/exchange-database/wad_in_insert.h" -#include "taler/exchange-database/reserves_in_insert.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/wad_in_insert.h" +#include "exchange-database/begin_shard.h" +#include "exchange-database/abort_shard.h" +#include "exchange-database/complete_shard.h" +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/kycauth_in_insert.h" +#include "exchange-database/wad_in_insert.h" +#include "exchange-database/reserves_in_insert.h" +#include "exchange-database/rollback.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/wad_in_insert.h" /** * How long to wait for an HTTP reply if there diff --git a/src/exchangedb/abort_shard.c b/src/exchangedb/abort_shard.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/abort_shard.h" +#include "exchange-database/abort_shard.h" #include "helper.h" diff --git a/src/exchangedb/account_history.c b/src/exchangedb/account_history.c @@ -22,11 +22,11 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_kyclogic_lib.h" #include "taler/taler_json_lib.h" -#include "taler/exchange-database/lookup_aml_history.h" -#include "taler/exchange-database/lookup_kyc_history.h" -#include "taler/exchange-database/get_kyc_rules.h" -#include "taler/exchange-database/select_aml_attributes.h" -#include "taler/exchange-database/account_history.h" +#include "exchange-database/lookup_aml_history.h" +#include "exchange-database/lookup_kyc_history.h" +#include "exchange-database/get_kyc_rules.h" +#include "exchange-database/select_aml_attributes.h" +#include "exchange-database/account_history.h" #include <gnunet/gnunet_common.h> /** diff --git a/src/exchangedb/activate_signing_key.c b/src/exchangedb/activate_signing_key.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/activate_signing_key.h" +#include "exchange-database/activate_signing_key.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/add_denomination_key.c b/src/exchangedb/add_denomination_key.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/add_denomination_key.h" +#include "exchange-database/add_denomination_key.h" #include "helper.h" diff --git a/src/exchangedb/add_policy_fulfillment_proof.c b/src/exchangedb/add_policy_fulfillment_proof.c @@ -22,7 +22,7 @@ #include "taler/taler_error_codes.h" /* UNNECESSARY? */ #include "taler/taler_dbevents.h" /* UNNECESSARY? */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/add_policy_fulfillment_proof.h" +#include "exchange-database/add_policy_fulfillment_proof.h" #include "helper.h" diff --git a/src/exchangedb/aggregate.c b/src/exchangedb/aggregate.c @@ -20,8 +20,8 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/compute_shard.h" -#include "taler/exchange-database/aggregate.h" +#include "exchange-database/compute_shard.h" +#include "exchange-database/aggregate.h" #include "helper.h" diff --git a/src/exchangedb/batch_ensure_coin_known.c b/src/exchangedb/batch_ensure_coin_known.c @@ -23,7 +23,7 @@ */ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/batch_ensure_coin_known.h" +#include "exchange-database/batch_ensure_coin_known.h" #include "helper.h" diff --git a/src/exchangedb/begin_revolving_shard.c b/src/exchangedb/begin_revolving_shard.c @@ -19,11 +19,11 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/begin_revolving_shard.h" -#include "taler/exchange-database/commit.h" +#include "exchange-database/begin_revolving_shard.h" +#include "exchange-database/commit.h" #include "helper.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/start.h" +#include "exchange-database/rollback.h" enum GNUNET_DB_QueryStatus TALER_EXCHANGEDB_begin_revolving_shard (struct diff --git a/src/exchangedb/begin_shard.c b/src/exchangedb/begin_shard.c @@ -19,11 +19,11 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/begin_shard.h" +#include "exchange-database/begin_shard.h" #include "helper.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/commit.h" +#include "exchange-database/start.h" +#include "exchange-database/rollback.h" +#include "exchange-database/commit.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/clear_aml_lock.c b/src/exchangedb/clear_aml_lock.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/clear_aml_lock.h" +#include "exchange-database/clear_aml_lock.h" #include "helper.h" diff --git a/src/exchangedb/commit.c b/src/exchangedb/commit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/commit.h" +#include "exchange-database/commit.h" #include "helper.h" diff --git a/src/exchangedb/complete_shard.c b/src/exchangedb/complete_shard.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/complete_shard.h" +#include "exchange-database/complete_shard.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/compute_shard.c b/src/exchangedb/compute_shard.c @@ -18,7 +18,7 @@ * @brief Implementation of the compute_shard function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/compute_shard.h" +#include "exchange-database/compute_shard.h" #include "helper.h" diff --git a/src/exchangedb/count_known_coins.c b/src/exchangedb/count_known_coins.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/count_known_coins.h" +#include "exchange-database/count_known_coins.h" #include "helper.h" long long diff --git a/src/exchangedb/create_aggregation_transient.c b/src/exchangedb/create_aggregation_transient.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/create_aggregation_transient.h" +#include "exchange-database/create_aggregation_transient.h" #include "helper.h" diff --git a/src/exchangedb/create_tables.c b/src/exchangedb/create_tables.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/create_tables.h" +#include "exchange-database/create_tables.h" #include "helper.h" diff --git a/src/exchangedb/delete_aggregation_transient.c b/src/exchangedb/delete_aggregation_transient.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/delete_aggregation_transient.h" +#include "exchange-database/delete_aggregation_transient.h" #include "helper.h" diff --git a/src/exchangedb/delete_shard_locks.c b/src/exchangedb/delete_shard_locks.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_shard_locks function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/delete_shard_locks.h" +#include "exchange-database/delete_shard_locks.h" #include "helper.h" diff --git a/src/exchangedb/disable_rules.c b/src/exchangedb/disable_rules.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/disable_rules.h" +#include "exchange-database/disable_rules.h" #include "helper.h" diff --git a/src/exchangedb/do_check_deposit_idempotent.c b/src/exchangedb/do_check_deposit_idempotent.c @@ -19,9 +19,9 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_check_deposit_idempotent.h" +#include "exchange-database/do_check_deposit_idempotent.h" #include "helper.h" -#include "taler/exchange-database/compute_shard.h" +#include "exchange-database/compute_shard.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/do_deposit.c b/src/exchangedb/do_deposit.c @@ -19,9 +19,9 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_deposit.h" +#include "exchange-database/do_deposit.h" #include "helper.h" -#include "taler/exchange-database/compute_shard.h" +#include "exchange-database/compute_shard.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/do_purse_delete.c b/src/exchangedb/do_purse_delete.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_purse_delete.h" +#include "exchange-database/do_purse_delete.h" #include "helper.h" diff --git a/src/exchangedb/do_purse_deposit.c b/src/exchangedb/do_purse_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_purse_deposit.h" +#include "exchange-database/do_purse_deposit.h" #include "helper.h" diff --git a/src/exchangedb/do_purse_merge.c b/src/exchangedb/do_purse_merge.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_purse_merge.h" +#include "exchange-database/do_purse_merge.h" #include "helper.h" diff --git a/src/exchangedb/do_recoup.c b/src/exchangedb/do_recoup.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_recoup.h" +#include "exchange-database/do_recoup.h" #include "helper.h" diff --git a/src/exchangedb/do_recoup_refresh.c b/src/exchangedb/do_recoup_refresh.c @@ -20,7 +20,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_recoup_refresh.h" +#include "exchange-database/do_recoup_refresh.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/do_refresh.c b/src/exchangedb/do_refresh.c @@ -20,7 +20,7 @@ */ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_refresh.h" +#include "exchange-database/do_refresh.h" #include "helper.h" diff --git a/src/exchangedb/do_refund.c b/src/exchangedb/do_refund.c @@ -20,9 +20,9 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_refund.h" +#include "exchange-database/do_refund.h" #include "helper.h" -#include "taler/exchange-database/compute_shard.h" +#include "exchange-database/compute_shard.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/do_reserve_open.c b/src/exchangedb/do_reserve_open.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_reserve_open.h" +#include "exchange-database/do_reserve_open.h" #include "helper.h" diff --git a/src/exchangedb/do_reserve_purse.c b/src/exchangedb/do_reserve_purse.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_reserve_purse.h" +#include "exchange-database/do_reserve_purse.h" #include "helper.h" diff --git a/src/exchangedb/do_withdraw.c b/src/exchangedb/do_withdraw.c @@ -20,7 +20,7 @@ */ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/do_withdraw.h" +#include "exchange-database/do_withdraw.h" #include "helper.h" #include <gnunet/gnunet_time_lib.h> diff --git a/src/exchangedb/drain_kyc_alert.c b/src/exchangedb/drain_kyc_alert.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/drain_kyc_alert.h" +#include "exchange-database/drain_kyc_alert.h" #include "helper.h" diff --git a/src/exchangedb/drop_tables.c b/src/exchangedb/drop_tables.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/drop_tables.h" +#include "exchange-database/drop_tables.h" #include "helper.h" diff --git a/src/exchangedb/enable_rules.c b/src/exchangedb/enable_rules.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/enable_rules.h" +#include "exchange-database/enable_rules.h" #include "helper.h" diff --git a/src/exchangedb/ensure_coin_known.c b/src/exchangedb/ensure_coin_known.c @@ -20,7 +20,7 @@ */ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/ensure_coin_known.h" +#include "exchange-database/ensure_coin_known.h" #include "helper.h" diff --git a/src/exchangedb/event_listen.c b/src/exchangedb/event_listen.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_dbevents.h" -#include "taler/exchange-database/event_listen.h" +#include "exchange-database/event_listen.h" #include "helper.h" /** diff --git a/src/exchangedb/event_listen_cancel.c b/src/exchangedb/event_listen_cancel.c @@ -18,7 +18,7 @@ * @brief Implementation of the event_listen_cancel function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/event_listen_cancel.h" +#include "exchange-database/event_listen_cancel.h" #include "helper.h" diff --git a/src/exchangedb/event_notify.c b/src/exchangedb/event_notify.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_dbevents.h" -#include "taler/exchange-database/event_notify.h" +#include "exchange-database/event_notify.h" #include "helper.h" diff --git a/src/exchangedb/exchangedb_transactions.c b/src/exchangedb/exchangedb_transactions.c @@ -18,7 +18,7 @@ * @brief Logic to compute transaction totals of a transaction list for a coin * @author Christian Grothoff */ -#include "taler/exchange-database/free_coin_transaction_list.h" +#include "exchange-database/free_coin_transaction_list.h" enum GNUNET_GenericReturnValue diff --git a/src/exchangedb/expire_purse.c b/src/exchangedb/expire_purse.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/expire_purse.h" +#include "exchange-database/expire_purse.h" #include "helper.h" diff --git a/src/exchangedb/find_aggregation_transient.c b/src/exchangedb/find_aggregation_transient.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/find_aggregation_transient.h" +#include "exchange-database/find_aggregation_transient.h" #include "helper.h" diff --git a/src/exchangedb/free_coin_transaction_list.c b/src/exchangedb/free_coin_transaction_list.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/platform.h" -#include "taler/exchange-database/free_coin_transaction_list.h" +#include "exchange-database/free_coin_transaction_list.h" void diff --git a/src/exchangedb/free_reserve_history.c b/src/exchangedb/free_reserve_history.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/platform.h" -#include "taler/exchange-database/free_reserve_history.h" +#include "exchange-database/free_reserve_history.h" void diff --git a/src/exchangedb/gc.c b/src/exchangedb/gc.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/gc.h" +#include "exchange-database/gc.h" #include "helper.h" diff --git a/src/exchangedb/get_coin_denomination.c b/src/exchangedb/get_coin_denomination.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_coin_denomination.h" +#include "exchange-database/get_coin_denomination.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_coin_transactions.c b/src/exchangedb/get_coin_transactions.c @@ -21,11 +21,11 @@ #include "taler/taler_error_codes.h" #include "taler/taler_exchangedb_lib.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_coin_transactions.h" +#include "exchange-database/get_coin_transactions.h" #include "helper.h" -#include "taler/exchange-database/start_read_committed.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/start_read_committed.h" +#include "exchange-database/commit.h" +#include "exchange-database/rollback.h" /** diff --git a/src/exchangedb/get_denomination_by_serial.c b/src/exchangedb/get_denomination_by_serial.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_denomination_by_serial.h" +#include "exchange-database/get_denomination_by_serial.h" #include "helper.h" diff --git a/src/exchangedb/get_denomination_info.c b/src/exchangedb/get_denomination_info.c @@ -21,7 +21,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_denomination_info.h" +#include "exchange-database/get_denomination_info.h" #include "helper.h" diff --git a/src/exchangedb/get_denomination_revocation.c b/src/exchangedb/get_denomination_revocation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_denomination_revocation.h" +#include "exchange-database/get_denomination_revocation.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_drain_profit.c b/src/exchangedb/get_drain_profit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_drain_profit.h" +#include "exchange-database/get_drain_profit.h" #include "helper.h" diff --git a/src/exchangedb/get_expired_reserves.c b/src/exchangedb/get_expired_reserves.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_expired_reserves.h" +#include "exchange-database/get_expired_reserves.h" #include "helper.h" diff --git a/src/exchangedb/get_extension_manifest.c b/src/exchangedb/get_extension_manifest.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_extension_manifest.h" +#include "exchange-database/get_extension_manifest.h" #include "helper.h" /** diff --git a/src/exchangedb/get_global_fee.c b/src/exchangedb/get_global_fee.c @@ -21,7 +21,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_global_fee.h" +#include "exchange-database/get_global_fee.h" #include "helper.h" diff --git a/src/exchangedb/get_global_fees.c b/src/exchangedb/get_global_fees.c @@ -21,7 +21,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_global_fees.h" +#include "exchange-database/get_global_fees.h" #include "helper.h" diff --git a/src/exchangedb/get_known_coin.c b/src/exchangedb/get_known_coin.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_known_coin.h" +#include "exchange-database/get_known_coin.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_kyc_rules.c b/src/exchangedb/get_kyc_rules.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_kyc_rules.h" +#include "exchange-database/get_kyc_rules.h" #include "helper.h" diff --git a/src/exchangedb/get_old_coin_by_h_blind.c b/src/exchangedb/get_old_coin_by_h_blind.c @@ -20,7 +20,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_old_coin_by_h_blind.h" +#include "exchange-database/get_old_coin_by_h_blind.h" #include "helper.h" diff --git a/src/exchangedb/get_pending_kyc_requirement_process.c b/src/exchangedb/get_pending_kyc_requirement_process.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_pending_kyc_requirement_process.h" +#include "exchange-database/get_pending_kyc_requirement_process.h" #include "helper.h" diff --git a/src/exchangedb/get_policy_details.c b/src/exchangedb/get_policy_details.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_policy_details.h" +#include "exchange-database/get_policy_details.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_purse_deposit.c b/src/exchangedb/get_purse_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_purse_deposit.h" +#include "exchange-database/get_purse_deposit.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_purse_request.c b/src/exchangedb/get_purse_request.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_purse_request.h" +#include "exchange-database/get_purse_request.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_ready_deposit.c b/src/exchangedb/get_ready_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_ready_deposit.h" +#include "exchange-database/get_ready_deposit.h" #include "helper.h" diff --git a/src/exchangedb/get_refresh.c b/src/exchangedb/get_refresh.c @@ -19,7 +19,7 @@ * @author get_refresh */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_refresh.h" +#include "exchange-database/get_refresh.h" #include "helper.h" diff --git a/src/exchangedb/get_reserve_balance.c b/src/exchangedb/get_reserve_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_reserve_balance.h" +#include "exchange-database/get_reserve_balance.h" #include "helper.h" diff --git a/src/exchangedb/get_reserve_by_h_planchets.c b/src/exchangedb/get_reserve_by_h_planchets.c @@ -20,7 +20,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_reserve_by_h_planchets.h" +#include "exchange-database/get_reserve_by_h_planchets.h" #include "helper.h" diff --git a/src/exchangedb/get_reserve_history.c b/src/exchangedb/get_reserve_history.c @@ -20,10 +20,10 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_reserve_history.h" -#include "taler/exchange-database/start_read_committed.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/get_reserve_history.h" +#include "exchange-database/start_read_committed.h" +#include "exchange-database/commit.h" +#include "exchange-database/rollback.h" #include "helper.h" /** diff --git a/src/exchangedb/get_signature_for_known_coin.c b/src/exchangedb/get_signature_for_known_coin.c @@ -19,7 +19,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_signature_for_known_coin.h" +#include "exchange-database/get_signature_for_known_coin.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_unfinished_close_requests.c b/src/exchangedb/get_unfinished_close_requests.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_unfinished_close_requests.h" +#include "exchange-database/get_unfinished_close_requests.h" #include "helper.h" diff --git a/src/exchangedb/get_wire_accounts.c b/src/exchangedb/get_wire_accounts.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_wire_accounts.h" +#include "exchange-database/get_wire_accounts.h" #include "helper.h" diff --git a/src/exchangedb/get_wire_fee.c b/src/exchangedb/get_wire_fee.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_wire_fee.h" +#include "exchange-database/get_wire_fee.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/get_wire_fees.c b/src/exchangedb/get_wire_fees.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_wire_fees.h" +#include "exchange-database/get_wire_fees.h" #include "helper.h" /** diff --git a/src/exchangedb/get_wire_hash_for_contract.c b/src/exchangedb/get_wire_hash_for_contract.c @@ -20,7 +20,7 @@ */ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_wire_hash_for_contract.h" +#include "exchange-database/get_wire_hash_for_contract.h" #include "helper.h" diff --git a/src/exchangedb/get_withdraw.c b/src/exchangedb/get_withdraw.c @@ -19,7 +19,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/get_withdraw.h" +#include "exchange-database/get_withdraw.h" #include "helper.h" diff --git a/src/exchangedb/have_deposit2.c b/src/exchangedb/have_deposit2.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/have_deposit2.h" +#include "exchange-database/have_deposit2.h" #include "helper.h" diff --git a/src/exchangedb/inject_auditor_triggers.c b/src/exchangedb/inject_auditor_triggers.c @@ -19,9 +19,9 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/gc.h" +#include "exchange-database/gc.h" #include "helper.h" -#include "taler/exchange-database/inject_auditor_triggers.h" +#include "exchange-database/inject_auditor_triggers.h" /** diff --git a/src/exchangedb/insert_active_legitimization_measure.c b/src/exchangedb/insert_active_legitimization_measure.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_active_legitimization_measure.h" +#include "exchange-database/insert_active_legitimization_measure.h" #include "helper.h" diff --git a/src/exchangedb/insert_aml_decision.c b/src/exchangedb/insert_aml_decision.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_aml_decision.h" +#include "exchange-database/insert_aml_decision.h" #include "helper.h" #include <gnunet/gnunet_pq_lib.h> diff --git a/src/exchangedb/insert_aml_officer.c b/src/exchangedb/insert_aml_officer.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_aml_officer.h" +#include "exchange-database/insert_aml_officer.h" #include "helper.h" diff --git a/src/exchangedb/insert_aml_program_failure.c b/src/exchangedb/insert_aml_program_failure.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_aml_program_failure.h" +#include "exchange-database/insert_aml_program_failure.h" #include "helper.h" diff --git a/src/exchangedb/insert_auditor.c b/src/exchangedb/insert_auditor.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_auditor.h" +#include "exchange-database/insert_auditor.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/insert_auditor_denom_sig.c b/src/exchangedb/insert_auditor_denom_sig.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_auditor_denom_sig.h" +#include "exchange-database/insert_auditor_denom_sig.h" #include "helper.h" diff --git a/src/exchangedb/insert_close_request.c b/src/exchangedb/insert_close_request.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_close_request.h" +#include "exchange-database/insert_close_request.h" #include "helper.h" diff --git a/src/exchangedb/insert_contract.c b/src/exchangedb/insert_contract.c @@ -19,8 +19,8 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_contract.h" -#include "taler/exchange-database/select_contract_by_purse.h" +#include "exchange-database/insert_contract.h" +#include "exchange-database/select_contract_by_purse.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/insert_denomination_info.c b/src/exchangedb/insert_denomination_info.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_denomination_info.h" +#include "exchange-database/insert_denomination_info.h" #include "helper.h" diff --git a/src/exchangedb/insert_denomination_revocation.c b/src/exchangedb/insert_denomination_revocation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_denomination_revocation.h" +#include "exchange-database/insert_denomination_revocation.h" #include "helper.h" diff --git a/src/exchangedb/insert_drain_profit.c b/src/exchangedb/insert_drain_profit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_drain_profit.h" +#include "exchange-database/insert_drain_profit.h" #include "helper.h" diff --git a/src/exchangedb/insert_global_fee.c b/src/exchangedb/insert_global_fee.c @@ -21,9 +21,9 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_global_fee.h" +#include "exchange-database/insert_global_fee.h" #include "helper.h" -#include "taler/exchange-database/get_global_fee.h" +#include "exchange-database/get_global_fee.h" enum GNUNET_DB_QueryStatus TALER_EXCHANGEDB_insert_global_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, diff --git a/src/exchangedb/insert_kyc_failure.c b/src/exchangedb/insert_kyc_failure.c @@ -22,9 +22,9 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" /* UNNECESSARY? */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_kyc_failure.h" +#include "exchange-database/insert_kyc_failure.h" #include "helper.h" -#include "taler/exchange-database/event_notify.h" /* UNNECESSARY? */ +#include "exchange-database/event_notify.h" /* UNNECESSARY? */ enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/insert_kyc_requirement_process.c b/src/exchangedb/insert_kyc_requirement_process.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_kyc_requirement_process.h" +#include "exchange-database/insert_kyc_requirement_process.h" #include "helper.h" #include <gnunet/gnunet_pq_lib.h> diff --git a/src/exchangedb/insert_partner.c b/src/exchangedb/insert_partner.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_partner.h" +#include "exchange-database/insert_partner.h" #include "helper.h" diff --git a/src/exchangedb/insert_purse_request.c b/src/exchangedb/insert_purse_request.c @@ -19,8 +19,8 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_purse_request.h" -#include "taler/exchange-database/get_purse_request.h" +#include "exchange-database/insert_purse_request.h" +#include "exchange-database/get_purse_request.h" #include "helper.h" diff --git a/src/exchangedb/insert_records_by_table.c b/src/exchangedb/insert_records_by_table.c @@ -26,7 +26,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_records_by_table.h" +#include "exchange-database/insert_records_by_table.h" #include "helper.h" #include <gnunet/gnunet_pq_lib.h> diff --git a/src/exchangedb/insert_refund.c b/src/exchangedb/insert_refund.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_refund.h" +#include "exchange-database/insert_refund.h" #include "helper.h" diff --git a/src/exchangedb/insert_reserve_closed.c b/src/exchangedb/insert_reserve_closed.c @@ -19,10 +19,10 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_reserve_closed.h" +#include "exchange-database/insert_reserve_closed.h" #include "helper.h" -#include "taler/exchange-database/reserves_get.h" -#include "taler/exchange-database/reserves_update.h" +#include "exchange-database/reserves_get.h" +#include "exchange-database/reserves_update.h" enum GNUNET_DB_QueryStatus TALER_EXCHANGEDB_insert_reserve_closed ( diff --git a/src/exchangedb/insert_reserve_open_deposit.c b/src/exchangedb/insert_reserve_open_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_reserve_open_deposit.h" +#include "exchange-database/insert_reserve_open_deposit.h" #include "helper.h" diff --git a/src/exchangedb/insert_sanction_list_hit.c b/src/exchangedb/insert_sanction_list_hit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_sanction_list_hit.h" +#include "exchange-database/insert_sanction_list_hit.h" #include "helper.h" diff --git a/src/exchangedb/insert_signkey_revocation.c b/src/exchangedb/insert_signkey_revocation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_signkey_revocation.h" +#include "exchange-database/insert_signkey_revocation.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/insert_successor_measure.c b/src/exchangedb/insert_successor_measure.c @@ -19,7 +19,7 @@ * @author Florian Dold */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_successor_measure.h" +#include "exchange-database/insert_successor_measure.h" #include "helper.h" #include <gnunet/gnunet_pq_lib.h> diff --git a/src/exchangedb/insert_wire.c b/src/exchangedb/insert_wire.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_wire.h" +#include "exchange-database/insert_wire.h" #include "helper.h" diff --git a/src/exchangedb/insert_wire_fee.c b/src/exchangedb/insert_wire_fee.c @@ -19,9 +19,9 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/insert_wire_fee.h" +#include "exchange-database/insert_wire_fee.h" #include "helper.h" -#include "taler/exchange-database/get_wire_fee.h" +#include "exchange-database/get_wire_fee.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/iterate_active_auditors.c b/src/exchangedb/iterate_active_auditors.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_active_auditors.h" +#include "exchange-database/iterate_active_auditors.h" #include "helper.h" diff --git a/src/exchangedb/iterate_active_signkeys.c b/src/exchangedb/iterate_active_signkeys.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_active_signkeys.h" +#include "exchange-database/iterate_active_signkeys.h" #include "helper.h" diff --git a/src/exchangedb/iterate_auditor_denominations.c b/src/exchangedb/iterate_auditor_denominations.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_auditor_denominations.h" +#include "exchange-database/iterate_auditor_denominations.h" #include "helper.h" /** diff --git a/src/exchangedb/iterate_denomination_info.c b/src/exchangedb/iterate_denomination_info.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_denomination_info.h" +#include "exchange-database/iterate_denomination_info.h" #include "helper.h" diff --git a/src/exchangedb/iterate_denominations.c b/src/exchangedb/iterate_denominations.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_denominations.h" +#include "exchange-database/iterate_denominations.h" #include "helper.h" diff --git a/src/exchangedb/iterate_kyc_reference.c b/src/exchangedb/iterate_kyc_reference.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_kyc_reference.h" +#include "exchange-database/iterate_kyc_reference.h" #include "helper.h" diff --git a/src/exchangedb/iterate_reserve_close_info.c b/src/exchangedb/iterate_reserve_close_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/iterate_reserve_close_info.h" +#include "exchange-database/iterate_reserve_close_info.h" #include "helper.h" /** diff --git a/src/exchangedb/kyc_provider_account_lookup.c b/src/exchangedb/kyc_provider_account_lookup.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/kyc_provider_account_lookup.h" +#include "exchange-database/kyc_provider_account_lookup.h" #include "helper.h" diff --git a/src/exchangedb/kycauth_in_insert.c b/src/exchangedb/kycauth_in_insert.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/kycauth_in_insert.h" +#include "exchange-database/kycauth_in_insert.h" #include "helper.h" diff --git a/src/exchangedb/lookup_active_legitimization.c b/src/exchangedb/lookup_active_legitimization.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_active_legitimization.h" +#include "exchange-database/lookup_active_legitimization.h" #include "helper.h" diff --git a/src/exchangedb/lookup_aml_file_number.c b/src/exchangedb/lookup_aml_file_number.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_aml_file_number.h" +#include "exchange-database/lookup_aml_file_number.h" #include "helper.h" diff --git a/src/exchangedb/lookup_aml_history.c b/src/exchangedb/lookup_aml_history.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_aml_history.h" +#include "exchange-database/lookup_aml_history.h" #include "helper.h" diff --git a/src/exchangedb/lookup_aml_officer.c b/src/exchangedb/lookup_aml_officer.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_aml_officer.h" +#include "exchange-database/lookup_aml_officer.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/lookup_auditor_status.c b/src/exchangedb/lookup_auditor_status.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_auditor_status.h" +#include "exchange-database/lookup_auditor_status.h" #include "helper.h" diff --git a/src/exchangedb/lookup_auditor_timestamp.c b/src/exchangedb/lookup_auditor_timestamp.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_auditor_timestamp.h" +#include "exchange-database/lookup_auditor_timestamp.h" #include "helper.h" diff --git a/src/exchangedb/lookup_completed_legitimization.c b/src/exchangedb/lookup_completed_legitimization.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_completed_legitimization.h" +#include "exchange-database/lookup_completed_legitimization.h" #include "helper.h" diff --git a/src/exchangedb/lookup_denomination_key.c b/src/exchangedb/lookup_denomination_key.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_denomination_key.h" +#include "exchange-database/lookup_denomination_key.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/lookup_global_fee_by_time.c b/src/exchangedb/lookup_global_fee_by_time.c @@ -21,7 +21,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_global_fee_by_time.h" +#include "exchange-database/lookup_global_fee_by_time.h" #include "helper.h" /** diff --git a/src/exchangedb/lookup_h_payto_by_access_token.c b/src/exchangedb/lookup_h_payto_by_access_token.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_h_payto_by_access_token.h" +#include "exchange-database/lookup_h_payto_by_access_token.h" #include "helper.h" diff --git a/src/exchangedb/lookup_kyc_history.c b/src/exchangedb/lookup_kyc_history.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_kyc_history.h" +#include "exchange-database/lookup_kyc_history.h" #include "helper.h" /** diff --git a/src/exchangedb/lookup_kyc_process_by_account.c b/src/exchangedb/lookup_kyc_process_by_account.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_kyc_process_by_account.h" +#include "exchange-database/lookup_kyc_process_by_account.h" #include "helper.h" diff --git a/src/exchangedb/lookup_kyc_requirement_by_row.c b/src/exchangedb/lookup_kyc_requirement_by_row.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_kyc_requirement_by_row.h" +#include "exchange-database/lookup_kyc_requirement_by_row.h" #include "helper.h" diff --git a/src/exchangedb/lookup_kyc_status_by_token.c b/src/exchangedb/lookup_kyc_status_by_token.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_kyc_status_by_token.h" +#include "exchange-database/lookup_kyc_status_by_token.h" #include "helper.h" diff --git a/src/exchangedb/lookup_pending_legitimization.c b/src/exchangedb/lookup_pending_legitimization.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_pending_legitimization.h" +#include "exchange-database/lookup_pending_legitimization.h" #include "helper.h" diff --git a/src/exchangedb/lookup_records_by_table.c b/src/exchangedb/lookup_records_by_table.c @@ -26,7 +26,7 @@ #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_records_by_table.h" +#include "exchange-database/lookup_records_by_table.h" #include "helper.h" #include <gnunet/gnunet_pq_lib.h> diff --git a/src/exchangedb/lookup_rules_by_access_token.c b/src/exchangedb/lookup_rules_by_access_token.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_rules_by_access_token.h" +#include "exchange-database/lookup_rules_by_access_token.h" #include "helper.h" diff --git a/src/exchangedb/lookup_serial_by_table.c b/src/exchangedb/lookup_serial_by_table.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_serial_by_table.h" +#include "exchange-database/lookup_serial_by_table.h" #include "helper.h" diff --git a/src/exchangedb/lookup_signing_key.c b/src/exchangedb/lookup_signing_key.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_signing_key.h" +#include "exchange-database/lookup_signing_key.h" #include "helper.h" diff --git a/src/exchangedb/lookup_signkey_revocation.c b/src/exchangedb/lookup_signkey_revocation.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_signkey_revocation.h" +#include "exchange-database/lookup_signkey_revocation.h" #include "helper.h" diff --git a/src/exchangedb/lookup_transfer_by_deposit.c b/src/exchangedb/lookup_transfer_by_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_transfer_by_deposit.h" +#include "exchange-database/lookup_transfer_by_deposit.h" #include "helper.h" diff --git a/src/exchangedb/lookup_wire_fee_by_time.c b/src/exchangedb/lookup_wire_fee_by_time.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_wire_fee_by_time.h" +#include "exchange-database/lookup_wire_fee_by_time.h" #include "helper.h" diff --git a/src/exchangedb/lookup_wire_timestamp.c b/src/exchangedb/lookup_wire_timestamp.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_wire_timestamp.h" +#include "exchange-database/lookup_wire_timestamp.h" #include "helper.h" diff --git a/src/exchangedb/lookup_wire_transfer.c b/src/exchangedb/lookup_wire_transfer.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/lookup_wire_transfer.h" +#include "exchange-database/lookup_wire_transfer.h" #include "helper.h" /** diff --git a/src/exchangedb/mark_refresh_reveal_success.c b/src/exchangedb/mark_refresh_reveal_success.c @@ -19,7 +19,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/mark_refresh_reveal_success.h" +#include "exchange-database/mark_refresh_reveal_success.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/persist_aml_program_result.c b/src/exchangedb/persist_aml_program_result.c @@ -20,10 +20,10 @@ */ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_kyclogic_lib.h" -#include "taler/exchange-database/insert_aml_decision.h" -#include "taler/exchange-database/insert_aml_program_failure.h" -#include "taler/exchange-database/insert_successor_measure.h" -#include "taler/exchange-database/persist_aml_program_result.h" +#include "exchange-database/insert_aml_decision.h" +#include "exchange-database/insert_aml_program_failure.h" +#include "exchange-database/insert_successor_measure.h" +#include "exchange-database/persist_aml_program_result.h" #include "helper.h" #include <gnunet/gnunet_common.h> diff --git a/src/exchangedb/persist_kyc_attributes.c b/src/exchangedb/persist_kyc_attributes.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/persist_kyc_attributes.h" +#include "exchange-database/persist_kyc_attributes.h" #include "helper.h" diff --git a/src/exchangedb/persist_policy_details.c b/src/exchangedb/persist_policy_details.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/persist_policy_details.h" +#include "exchange-database/persist_policy_details.h" #include "helper.h" diff --git a/src/exchangedb/pg.c b/src/exchangedb/pg.c @@ -28,7 +28,7 @@ #include <libpq-fe.h> #include "helper.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/preflight.h" /** * Set to 1 to enable Postgres auto_explain module. This will diff --git a/src/exchangedb/preflight.c b/src/exchangedb/preflight.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/preflight.h" #include "helper.h" diff --git a/src/exchangedb/profit_drains_get_pending.c b/src/exchangedb/profit_drains_get_pending.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/profit_drains_get_pending.h" +#include "exchange-database/profit_drains_get_pending.h" #include "helper.h" diff --git a/src/exchangedb/profit_drains_set_finished.c b/src/exchangedb/profit_drains_set_finished.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/profit_drains_set_finished.h" +#include "exchange-database/profit_drains_set_finished.h" #include "helper.h" diff --git a/src/exchangedb/release_revolving_shard.c b/src/exchangedb/release_revolving_shard.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/release_revolving_shard.h" +#include "exchange-database/release_revolving_shard.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/reserves_get.c b/src/exchangedb/reserves_get.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/reserves_get.h" +#include "exchange-database/reserves_get.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/reserves_get_origin.c b/src/exchangedb/reserves_get_origin.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/reserves_get_origin.h" +#include "exchange-database/reserves_get_origin.h" #include "helper.h" diff --git a/src/exchangedb/reserves_in_insert.c b/src/exchangedb/reserves_in_insert.c @@ -20,13 +20,13 @@ * @author Joseph Xu */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/reserves_in_insert.h" +#include "exchange-database/reserves_in_insert.h" #include "helper.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/start_read_committed.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/start.h" +#include "exchange-database/start_read_committed.h" +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" /** diff --git a/src/exchangedb/reserves_update.c b/src/exchangedb/reserves_update.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/reserves_update.h" +#include "exchange-database/reserves_update.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/rollback.c b/src/exchangedb/rollback.c @@ -18,7 +18,7 @@ * @brief Implementation of the rollback function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/rollback.h" +#include "exchange-database/rollback.h" #include "helper.h" diff --git a/src/exchangedb/select_account_merges_above_serial_id.c b/src/exchangedb/select_account_merges_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_account_merges_above_serial_id.h" +#include "exchange-database/select_account_merges_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_aggregation_amounts_for_kyc_check.c b/src/exchangedb/select_aggregation_amounts_for_kyc_check.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aggregation_amounts_for_kyc_check.h" +#include "exchange-database/select_aggregation_amounts_for_kyc_check.h" #include "helper.h" diff --git a/src/exchangedb/select_aggregation_transient.c b/src/exchangedb/select_aggregation_transient.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aggregation_transient.h" +#include "exchange-database/select_aggregation_transient.h" #include "helper.h" diff --git a/src/exchangedb/select_aggregations_above_serial.c b/src/exchangedb/select_aggregations_above_serial.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aggregations_above_serial.h" +#include "exchange-database/select_aggregations_above_serial.h" #include "helper.h" /** diff --git a/src/exchangedb/select_all_kyc_attributes.c b/src/exchangedb/select_all_kyc_attributes.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_all_kyc_attributes.h" +#include "exchange-database/select_all_kyc_attributes.h" #include "helper.h" /** diff --git a/src/exchangedb/select_all_purse_decisions_above_serial_id.c b/src/exchangedb/select_all_purse_decisions_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_all_purse_decisions_above_serial_id.h" +#include "exchange-database/select_all_purse_decisions_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_all_purse_deletions_above_serial_id.c b/src/exchangedb/select_all_purse_deletions_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_all_purse_deletions_above_serial_id.h" +#include "exchange-database/select_all_purse_deletions_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_aml_attributes.c b/src/exchangedb/select_aml_attributes.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aml_attributes.h" +#include "exchange-database/select_aml_attributes.h" #include "helper.h" diff --git a/src/exchangedb/select_aml_decisions.c b/src/exchangedb/select_aml_decisions.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aml_decisions.h" +#include "exchange-database/select_aml_decisions.h" #include "helper.h" diff --git a/src/exchangedb/select_aml_measures.c b/src/exchangedb/select_aml_measures.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aml_measures.h" +#include "exchange-database/select_aml_measures.h" #include "helper.h" diff --git a/src/exchangedb/select_aml_statistics.c b/src/exchangedb/select_aml_statistics.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_aml_statistics.h" +#include "exchange-database/select_aml_statistics.h" #include "helper.h" diff --git a/src/exchangedb/select_auditor_denom_sig.c b/src/exchangedb/select_auditor_denom_sig.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_auditor_denom_sig.h" +#include "exchange-database/select_auditor_denom_sig.h" #include "helper.h" diff --git a/src/exchangedb/select_batch_deposits_missing_wire.c b/src/exchangedb/select_batch_deposits_missing_wire.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_batch_deposits_missing_wire.h" +#include "exchange-database/select_batch_deposits_missing_wire.h" #include "helper.h" /** diff --git a/src/exchangedb/select_coin_deposits_above_serial_id.c b/src/exchangedb/select_coin_deposits_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_coin_deposits_above_serial_id.h" +#include "exchange-database/select_coin_deposits_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_contract.c b/src/exchangedb/select_contract.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_contract.h" +#include "exchange-database/select_contract.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/select_contract_by_purse.c b/src/exchangedb/select_contract_by_purse.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_contract_by_purse.h" +#include "exchange-database/select_contract_by_purse.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/select_deposit_amounts_for_kyc_check.c b/src/exchangedb/select_deposit_amounts_for_kyc_check.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_deposit_amounts_for_kyc_check.h" +#include "exchange-database/select_deposit_amounts_for_kyc_check.h" #include "helper.h" /** diff --git a/src/exchangedb/select_exchange_credit_transfers.c b/src/exchangedb/select_exchange_credit_transfers.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_exchange_credit_transfers.h" +#include "exchange-database/select_exchange_credit_transfers.h" #include "helper.h" /** diff --git a/src/exchangedb/select_exchange_debit_transfers.c b/src/exchangedb/select_exchange_debit_transfers.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_exchange_debit_transfers.h" +#include "exchange-database/select_exchange_debit_transfers.h" #include "helper.h" diff --git a/src/exchangedb/select_exchange_kycauth_transfers.c b/src/exchangedb/select_exchange_kycauth_transfers.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_exchange_kycauth_transfers.h" +#include "exchange-database/select_exchange_kycauth_transfers.h" #include "helper.h" /** diff --git a/src/exchangedb/select_kyc_accounts.c b/src/exchangedb/select_kyc_accounts.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_kyc_accounts.h" +#include "exchange-database/select_kyc_accounts.h" #include "helper.h" diff --git a/src/exchangedb/select_kyc_attributes.c b/src/exchangedb/select_kyc_attributes.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_kyc_attributes.h" +#include "exchange-database/select_kyc_attributes.h" #include "helper.h" diff --git a/src/exchangedb/select_merge_amounts_for_kyc_check.c b/src/exchangedb/select_merge_amounts_for_kyc_check.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_merge_amounts_for_kyc_check.h" +#include "exchange-database/select_merge_amounts_for_kyc_check.h" #include "helper.h" diff --git a/src/exchangedb/select_purse.c b/src/exchangedb/select_purse.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse.h" +#include "exchange-database/select_purse.h" #include "helper.h" diff --git a/src/exchangedb/select_purse_by_merge_pub.c b/src/exchangedb/select_purse_by_merge_pub.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_by_merge_pub.h" +#include "exchange-database/select_purse_by_merge_pub.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/select_purse_decisions_above_serial_id.c b/src/exchangedb/select_purse_decisions_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_decisions_above_serial_id.h" +#include "exchange-database/select_purse_decisions_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_purse_deposits_above_serial_id.c b/src/exchangedb/select_purse_deposits_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_deposits_above_serial_id.h" +#include "exchange-database/select_purse_deposits_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_purse_deposits_by_purse.c b/src/exchangedb/select_purse_deposits_by_purse.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_deposits_by_purse.h" +#include "exchange-database/select_purse_deposits_by_purse.h" #include "helper.h" /** diff --git a/src/exchangedb/select_purse_merge.c b/src/exchangedb/select_purse_merge.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_merge.h" +#include "exchange-database/select_purse_merge.h" #include "helper.h" diff --git a/src/exchangedb/select_purse_merges_above_serial_id.c b/src/exchangedb/select_purse_merges_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_merges_above_serial_id.h" +#include "exchange-database/select_purse_merges_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_purse_requests_above_serial_id.c b/src/exchangedb/select_purse_requests_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_purse_requests_above_serial_id.h" +#include "exchange-database/select_purse_requests_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_recoup_above_serial_id.c b/src/exchangedb/select_recoup_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_recoup_above_serial_id.h" +#include "exchange-database/select_recoup_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_recoup_refresh_above_serial_id.c b/src/exchangedb/select_recoup_refresh_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_recoup_refresh_above_serial_id.h" +#include "exchange-database/select_recoup_refresh_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_refreshes_above_serial_id.c b/src/exchangedb/select_refreshes_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_refreshes_above_serial_id.h" +#include "exchange-database/select_refreshes_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_refunds_above_serial_id.c b/src/exchangedb/select_refunds_above_serial_id.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_refunds_above_serial_id.h" +#include "exchange-database/select_refunds_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_refunds_by_coin.c b/src/exchangedb/select_refunds_by_coin.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_refunds_by_coin.h" +#include "exchange-database/select_refunds_by_coin.h" #include "helper.h" diff --git a/src/exchangedb/select_reserve_close_info.c b/src/exchangedb/select_reserve_close_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_reserve_close_info.h" +#include "exchange-database/select_reserve_close_info.h" #include "helper.h" diff --git a/src/exchangedb/select_reserve_close_request_info.c b/src/exchangedb/select_reserve_close_request_info.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_reserve_close_request_info.h" +#include "exchange-database/select_reserve_close_request_info.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/select_reserve_closed_above_serial_id.c b/src/exchangedb/select_reserve_closed_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_reserve_closed_above_serial_id.h" +#include "exchange-database/select_reserve_closed_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_reserve_open_above_serial_id.c b/src/exchangedb/select_reserve_open_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_reserve_open_above_serial_id.h" +#include "exchange-database/select_reserve_open_above_serial_id.h" #include "helper.h" diff --git a/src/exchangedb/select_reserves_in_above_serial_id.c b/src/exchangedb/select_reserves_in_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_reserves_in_above_serial_id.h" +#include "exchange-database/select_reserves_in_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_reserves_in_above_serial_id_by_account.c b/src/exchangedb/select_reserves_in_above_serial_id_by_account.c @@ -20,7 +20,7 @@ */ #include "taler/taler_pq_lib.h" #include \ - "taler/exchange-database/select_reserves_in_above_serial_id_by_account.h" + "exchange-database/select_reserves_in_above_serial_id_by_account.h" #include "helper.h" diff --git a/src/exchangedb/select_wire_out_above_serial_id.c b/src/exchangedb/select_wire_out_above_serial_id.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_wire_out_above_serial_id.h" +#include "exchange-database/select_wire_out_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/select_wire_out_above_serial_id_by_account.c b/src/exchangedb/select_wire_out_above_serial_id_by_account.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_wire_out_above_serial_id_by_account.h" +#include "exchange-database/select_wire_out_above_serial_id_by_account.h" #include "helper.h" /** diff --git a/src/exchangedb/select_withdraw_amounts_for_kyc_check.c b/src/exchangedb/select_withdraw_amounts_for_kyc_check.c @@ -19,8 +19,8 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_withdraw_amounts_for_kyc_check.h" -#include "taler/exchange-database/select_aggregation_amounts_for_kyc_check.h" +#include "exchange-database/select_withdraw_amounts_for_kyc_check.h" +#include "exchange-database/select_aggregation_amounts_for_kyc_check.h" #include "helper.h" diff --git a/src/exchangedb/select_withdrawals_above_serial_id.c b/src/exchangedb/select_withdrawals_above_serial_id.c @@ -20,7 +20,7 @@ * @author Özgür Kesim */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/select_withdrawals_above_serial_id.h" +#include "exchange-database/select_withdrawals_above_serial_id.h" #include "helper.h" /** diff --git a/src/exchangedb/set_aml_lock.c b/src/exchangedb/set_aml_lock.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/set_aml_lock.h" +#include "exchange-database/set_aml_lock.h" #include "helper.h" diff --git a/src/exchangedb/set_extension_manifest.c b/src/exchangedb/set_extension_manifest.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/set_extension_manifest.h" +#include "exchange-database/set_extension_manifest.h" #include "helper.h" diff --git a/src/exchangedb/set_purse_balance.c b/src/exchangedb/set_purse_balance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/set_purse_balance.h" +#include "exchange-database/set_purse_balance.h" #include "helper.h" diff --git a/src/exchangedb/start.c b/src/exchangedb/start.c @@ -18,8 +18,8 @@ * @brief Implementation of the start function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/start.h" +#include "exchange-database/preflight.h" +#include "exchange-database/start.h" #include "helper.h" enum GNUNET_GenericReturnValue diff --git a/src/exchangedb/start_deferred_wire_out.c b/src/exchangedb/start_deferred_wire_out.c @@ -18,10 +18,10 @@ * @brief Implementation of the start_deferred_wire_out function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/start_deferred_wire_out.h" +#include "exchange-database/start_deferred_wire_out.h" #include "helper.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/rollback.h" +#include "exchange-database/preflight.h" +#include "exchange-database/rollback.h" enum GNUNET_GenericReturnValue TALER_TALER_EXCHANGEDB_start_deferred_wire_out (struct diff --git a/src/exchangedb/start_read_committed.c b/src/exchangedb/start_read_committed.c @@ -18,8 +18,8 @@ * @brief Implementation of the start_read_committed function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/start_read_committed.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/start_read_committed.h" +#include "exchange-database/preflight.h" #include "helper.h" enum GNUNET_GenericReturnValue diff --git a/src/exchangedb/start_read_only.c b/src/exchangedb/start_read_only.c @@ -18,8 +18,8 @@ * @brief Implementation of the start_read_only function for Postgres * @author Christian Grothoff */ -#include "taler/exchange-database/start_read_only.h" -#include "taler/exchange-database/preflight.h" +#include "exchange-database/start_read_only.h" +#include "exchange-database/preflight.h" #include "helper.h" enum GNUNET_GenericReturnValue diff --git a/src/exchangedb/store_wire_transfer_out.c b/src/exchangedb/store_wire_transfer_out.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/store_wire_transfer_out.h" +#include "exchange-database/store_wire_transfer_out.h" #include "helper.h" diff --git a/src/exchangedb/test_aml_officer.c b/src/exchangedb/test_aml_officer.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/test_aml_officer.h" +#include "exchange-database/test_aml_officer.h" #include "helper.h" diff --git a/src/exchangedb/trigger_kyc_rule_for_account.c b/src/exchangedb/trigger_kyc_rule_for_account.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/trigger_kyc_rule_for_account.h" +#include "exchange-database/trigger_kyc_rule_for_account.h" #include "helper.h" diff --git a/src/exchangedb/update_aggregation_transient.c b/src/exchangedb/update_aggregation_transient.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/update_aggregation_transient.h" +#include "exchange-database/update_aggregation_transient.h" #include "helper.h" diff --git a/src/exchangedb/update_auditor.c b/src/exchangedb/update_auditor.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/update_auditor.h" +#include "exchange-database/update_auditor.h" #include "helper.h" diff --git a/src/exchangedb/update_kyc_process_by_row.c b/src/exchangedb/update_kyc_process_by_row.c @@ -20,7 +20,7 @@ */ #include "taler/taler_error_codes.h" #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/update_kyc_process_by_row.h" +#include "exchange-database/update_kyc_process_by_row.h" #include "helper.h" diff --git a/src/exchangedb/update_rules.c b/src/exchangedb/update_rules.c @@ -21,19 +21,19 @@ #include "taler/taler_exchangedb_lib.h" #include "taler/taler_kyclogic_lib.h" #include "taler/taler_dbevents.h" -#include "taler/exchange-database/start.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/set_aml_lock.h" -#include "taler/exchange-database/clear_aml_lock.h" -#include "taler/exchange-database/persist_aml_program_result.h" -#include "taler/exchange-database/insert_successor_measure.h" -#include "taler/exchange-database/event_notify.h" -#include "taler/exchange-database/event_listen.h" -#include "taler/exchange-database/event_listen_cancel.h" -#include "taler/exchange-database/lookup_rules_by_access_token.h" -#include "taler/exchange-database/update_rules.h" -#include "taler/exchange-database/account_history.h" +#include "exchange-database/start.h" +#include "exchange-database/rollback.h" +#include "exchange-database/commit.h" +#include "exchange-database/set_aml_lock.h" +#include "exchange-database/clear_aml_lock.h" +#include "exchange-database/persist_aml_program_result.h" +#include "exchange-database/insert_successor_measure.h" +#include "exchange-database/event_notify.h" +#include "exchange-database/event_listen.h" +#include "exchange-database/event_listen_cancel.h" +#include "exchange-database/lookup_rules_by_access_token.h" +#include "exchange-database/update_rules.h" +#include "exchange-database/account_history.h" #include "helper.h" #include <gnunet/gnunet_common.h> diff --git a/src/exchangedb/update_wire.c b/src/exchangedb/update_wire.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/update_wire.h" +#include "exchange-database/update_wire.h" #include "helper.h" diff --git a/src/exchangedb/wad_in_insert.c b/src/exchangedb/wad_in_insert.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/wad_in_insert.h" +#include "exchange-database/wad_in_insert.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/wire_prepare_data_get.c b/src/exchangedb/wire_prepare_data_get.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/wire_prepare_data_get.h" +#include "exchange-database/wire_prepare_data_get.h" #include "helper.h" /** diff --git a/src/exchangedb/wire_prepare_data_insert.c b/src/exchangedb/wire_prepare_data_insert.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/wire_prepare_data_insert.h" +#include "exchange-database/wire_prepare_data_insert.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/exchangedb/wire_prepare_data_mark_failed.c b/src/exchangedb/wire_prepare_data_mark_failed.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/wire_prepare_data_mark_failed.h" +#include "exchange-database/wire_prepare_data_mark_failed.h" #include "helper.h" diff --git a/src/exchangedb/wire_prepare_data_mark_finished.c b/src/exchangedb/wire_prepare_data_mark_finished.c @@ -19,7 +19,7 @@ * @author Christian Grothoff */ #include "taler/taler_pq_lib.h" -#include "taler/exchange-database/wire_prepare_data_mark_finished.h" +#include "exchange-database/wire_prepare_data_mark_finished.h" #include "helper.h" enum GNUNET_DB_QueryStatus diff --git a/src/include/taler/auditor-database/create_tables.h b/src/include/auditor-database/create_tables.h diff --git a/src/include/auditor-database/del_denomination_balance.h b/src/include/auditor-database/del_denomination_balance.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/del_denomination_balance.h + * @brief implementation of the del_denomination_balance function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_DEL_DENOMINATION_BALANCE_H +#define AUDITOR_DATABASE_DEL_DENOMINATION_BALANCE_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Delete information about a denomination key's balances. + * + * @param pg the database context + * @param denom_pub_hash hash of the denomination public key + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_del_denomination_balance (struct AUDITORDB_PostgresContext *pg, + const struct TALER_DenominationHashP * + denom_pub_hash); + +#endif diff --git a/src/include/taler/auditor-database/del_reserve_info.h b/src/include/auditor-database/del_reserve_info.h diff --git a/src/include/auditor-database/delete_auditor_closure_lag.h b/src/include/auditor-database/delete_auditor_closure_lag.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/delete_auditor_closure_lag.h + * @brief implementation of the delete_auditor_closure_lag function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_DELETE_AUDITOR_CLOSURE_LAG_H +#define AUDITOR_DATABASE_DELETE_AUDITOR_CLOSURE_LAG_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * A previously missing wire transfer may have been found. Remove an alert + * (if we raised one). + * + * @param pg the database context + * @param amount wire transfer amount + * @param wtid wire transfer subject + * @param credit_account_uri destination account + * @return #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no matching alert was + * found + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_delete_auditor_closure_lag (struct AUDITORDB_PostgresContext *pg, + const struct TALER_Amount *amount, + const struct + TALER_WireTransferIdentifierRawP *wtid, + struct TALER_FullPayto credit_account_uri) +; + +#endif diff --git a/src/include/auditor-database/delete_early_aggregation.h b/src/include/auditor-database/delete_early_aggregation.h @@ -0,0 +1,41 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/delete_early_aggregation.h + * @brief implementation of the delete_early_aggregation function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_DELETE_EARLY_AGGREGATION_H +#define AUDITOR_DATABASE_DELETE_EARLY_AGGREGATION_H + +#include "taler/taler_auditordb_lib.h" + + +/** + * Delete a row from the early aggregation table. + * Usually done when the expected aggregation + * was finally detected. + * + * @param pg the database context + * @param batch_deposit_serial_id which entry to delete + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_delete_early_aggregation (struct AUDITORDB_PostgresContext *pg, + uint64_t batch_deposit_serial_id); + + +#endif diff --git a/src/include/taler/auditor-database/delete_generic.h b/src/include/auditor-database/delete_generic.h diff --git a/src/include/auditor-database/delete_pending_deposit.h b/src/include/auditor-database/delete_pending_deposit.h @@ -0,0 +1,41 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/delete_pending_deposit.h + * @brief implementation of the delete_pending_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_DELETE_PENDING_DEPOSIT_H +#define AUDITOR_DATABASE_DELETE_PENDING_DEPOSIT_H + +#include "taler/taler_auditordb_lib.h" + + +/** + * Delete a row from the pending deposit table. + * Usually done when the respective wire transfer + * was finally detected. + * + * @param pg the database context + * @param batch_deposit_serial_id which entry to delete + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_delete_pending_deposit (struct AUDITORDB_PostgresContext *pg, + uint64_t batch_deposit_serial_id); + + +#endif diff --git a/src/include/auditor-database/delete_purse_info.h b/src/include/auditor-database/delete_purse_info.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/delete_purse_info.h + * @brief implementation of the delete_purse_info function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_DELETE_PURSE_INFO_H +#define AUDITOR_DATABASE_DELETE_PURSE_INFO_H + +#include "taler/taler_auditordb_lib.h" + + +/** + * Delete information about a purse. + * + * @param pg the database context + * @param purse_pub public key of the reserve + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_delete_purse_info (struct AUDITORDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub); + + +#endif diff --git a/src/include/auditor-database/delete_reserve_in_inconsistency.h b/src/include/auditor-database/delete_reserve_in_inconsistency.h @@ -0,0 +1,38 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/delete_reserve_in_inconsistency.h + * @brief implementation of the delete_reserve_in_inconsistency function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_DELETE_RESERVE_IN_INCONSISTENCY_H +#define AUDITOR_DATABASE_DELETE_RESERVE_IN_INCONSISTENCY_H + +#include "taler/taler_auditordb_lib.h" + + +/** + * Delete information about an reserve-in-inconsistency from the database. + * + * @param pg the database context + * @param row_id row of the inconsistency in our table + * @return query result status + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_delete_reserve_in_inconsistency (struct AUDITORDB_PostgresContext *pg, + uint64_t row_id); + +#endif diff --git a/src/include/taler/auditor-database/delete_wire_out_inconsistency_if_matching.h b/src/include/auditor-database/delete_wire_out_inconsistency_if_matching.h diff --git a/src/include/taler/auditor-database/drop_tables.h b/src/include/auditor-database/drop_tables.h diff --git a/src/include/taler/auditor-database/event_listen.h b/src/include/auditor-database/event_listen.h diff --git a/src/include/taler/auditor-database/event_notify.h b/src/include/auditor-database/event_notify.h diff --git a/src/include/taler/auditor-database/gc.h b/src/include/auditor-database/gc.h diff --git a/src/include/taler/auditor-database/get_amount_arithmetic_inconsistency.h b/src/include/auditor-database/get_amount_arithmetic_inconsistency.h diff --git a/src/include/taler/auditor-database/get_auditor_closure_lags.h b/src/include/auditor-database/get_auditor_closure_lags.h diff --git a/src/include/taler/auditor-database/get_auditor_progress.h b/src/include/auditor-database/get_auditor_progress.h diff --git a/src/include/taler/auditor-database/get_bad_sig_losses.h b/src/include/auditor-database/get_bad_sig_losses.h diff --git a/src/include/auditor-database/get_balance.h b/src/include/auditor-database/get_balance.h @@ -0,0 +1,44 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/get_balance.h + * @brief implementation of the get_balance function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_GET_BALANCE_H +#define AUDITOR_DATABASE_GET_BALANCE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Get summary information about balance tracked by the auditor. + * + * @param pg the database context + * @param balance_key key of the balance to store + * @param[out] balance_value set to amount stored under @a balance_key + * @param ... NULL terminated list of additional key-value pairs to fetch + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_get_balance (struct AUDITORDB_PostgresContext *pg, + const char *balance_key, + struct TALER_Amount *balance_value, + ...); + +#endif diff --git a/src/include/taler/auditor-database/get_balances.h b/src/include/auditor-database/get_balances.h diff --git a/src/include/taler/auditor-database/get_coin_inconsistency.h b/src/include/auditor-database/get_coin_inconsistency.h diff --git a/src/include/taler/auditor-database/get_denomination_balance.h b/src/include/auditor-database/get_denomination_balance.h diff --git a/src/include/taler/auditor-database/get_denomination_key_validity_withdraw_inconsistency.h b/src/include/auditor-database/get_denomination_key_validity_withdraw_inconsistency.h diff --git a/src/include/taler/auditor-database/get_denomination_pending.h b/src/include/auditor-database/get_denomination_pending.h diff --git a/src/include/taler/auditor-database/get_denominations_without_sigs.h b/src/include/auditor-database/get_denominations_without_sigs.h diff --git a/src/include/taler/auditor-database/get_deposit_confirmations.h b/src/include/auditor-database/get_deposit_confirmations.h diff --git a/src/include/taler/auditor-database/get_emergency.h b/src/include/auditor-database/get_emergency.h diff --git a/src/include/taler/auditor-database/get_emergency_by_count.h b/src/include/auditor-database/get_emergency_by_count.h diff --git a/src/include/taler/auditor-database/get_exchange_signkeys.h b/src/include/auditor-database/get_exchange_signkeys.h diff --git a/src/include/taler/auditor-database/get_fee_time_inconsistency.h b/src/include/auditor-database/get_fee_time_inconsistency.h diff --git a/src/include/taler/auditor-database/get_misattribution_in_inconsistency.h b/src/include/auditor-database/get_misattribution_in_inconsistency.h diff --git a/src/include/auditor-database/get_progress_points.h b/src/include/auditor-database/get_progress_points.h @@ -0,0 +1,66 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/get_progress_points.h + * @brief implementation of the get_progress_points function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_GET_PROGRESS_POINTS_H +#define AUDITOR_DATABASE_GET_PROGRESS_POINTS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Information about progress of the audit. + */ +struct TALER_AUDITORDB_Progress +{ + char *progress_key; + uint64_t progress_offset; +}; + +typedef enum GNUNET_GenericReturnValue +(*TALER_AUDITORDB_ProgressPointsCallback)( + void *cls, + const struct TALER_AUDITORDB_Progress *pp); + + +/* Callback typedefs */ +typedef enum GNUNET_GenericReturnValue +(*TALER_AUDITORDB_ProgressPointsCallback)( + void *cls, + const struct TALER_AUDITORDB_Progress *pp); + +/** + * Get information about progress from the database. + * + * @param pg the database context + * @param progress_key only return this particular progress point + * @param cb function to call with results + * @param cb_cls closure for @a cb + * @return query result status + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_get_progress_points (struct AUDITORDB_PostgresContext *pg, + const char *progress_key, + TALER_AUDITORDB_ProgressPointsCallback cb, + void *cb_cls); + + +#endif diff --git a/src/include/auditor-database/get_purse_info.h b/src/include/auditor-database/get_purse_info.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/get_purse_info.h + * @brief implementation of the get_purse_info function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_GET_PURSE_INFO_H +#define AUDITOR_DATABASE_GET_PURSE_INFO_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Get information about a purse. + * + * @param pg the database context + * @param purse_pub public key of the purse + * @param[out] rowid which row did we get the information from + * @param[out] balance set to balance of the purse + * @param[out] expiration_date expiration date of the purse + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_get_purse_info (struct AUDITORDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP *purse_pub, + uint64_t *rowid, + struct TALER_Amount *balance, + struct GNUNET_TIME_Timestamp *expiration_date); + +#endif diff --git a/src/include/taler/auditor-database/get_purse_not_closed_inconsistencies.h b/src/include/auditor-database/get_purse_not_closed_inconsistencies.h diff --git a/src/include/taler/auditor-database/get_purses.h b/src/include/auditor-database/get_purses.h diff --git a/src/include/taler/auditor-database/get_reserve_balance_insufficient_inconsistency.h b/src/include/auditor-database/get_reserve_balance_insufficient_inconsistency.h diff --git a/src/include/taler/auditor-database/get_reserve_balance_summary_wrong_inconsistency.h b/src/include/auditor-database/get_reserve_balance_summary_wrong_inconsistency.h diff --git a/src/include/taler/auditor-database/get_reserve_in_inconsistency.h b/src/include/auditor-database/get_reserve_in_inconsistency.h diff --git a/src/include/taler/auditor-database/get_reserve_info.h b/src/include/auditor-database/get_reserve_info.h diff --git a/src/include/taler/auditor-database/get_reserve_not_closed_inconsistency.h b/src/include/auditor-database/get_reserve_not_closed_inconsistency.h diff --git a/src/include/taler/auditor-database/get_reserves.h b/src/include/auditor-database/get_reserves.h diff --git a/src/include/taler/auditor-database/get_row_inconsistency.h b/src/include/auditor-database/get_row_inconsistency.h diff --git a/src/include/taler/auditor-database/get_row_minor_inconsistencies.h b/src/include/auditor-database/get_row_minor_inconsistencies.h diff --git a/src/include/taler/auditor-database/get_wire_fee_summary.h b/src/include/auditor-database/get_wire_fee_summary.h diff --git a/src/include/taler/auditor-database/get_wire_format_inconsistency.h b/src/include/auditor-database/get_wire_format_inconsistency.h diff --git a/src/include/taler/auditor-database/get_wire_out_inconsistency.h b/src/include/auditor-database/get_wire_out_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_amount_arithmetic_inconsistency.h b/src/include/auditor-database/insert_amount_arithmetic_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_auditor_closure_lags.h b/src/include/auditor-database/insert_auditor_closure_lags.h diff --git a/src/include/taler/auditor-database/insert_auditor_progress.h b/src/include/auditor-database/insert_auditor_progress.h diff --git a/src/include/taler/auditor-database/insert_bad_sig_losses.h b/src/include/auditor-database/insert_bad_sig_losses.h diff --git a/src/include/taler/auditor-database/insert_balance.h b/src/include/auditor-database/insert_balance.h diff --git a/src/include/taler/auditor-database/insert_coin_inconsistency.h b/src/include/auditor-database/insert_coin_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_denomination_balance.h b/src/include/auditor-database/insert_denomination_balance.h diff --git a/src/include/taler/auditor-database/insert_denomination_key_validity_withdraw_inconsistency.h b/src/include/auditor-database/insert_denomination_key_validity_withdraw_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_denomination_pending.h b/src/include/auditor-database/insert_denomination_pending.h diff --git a/src/include/taler/auditor-database/insert_denominations_without_sigs.h b/src/include/auditor-database/insert_denominations_without_sigs.h diff --git a/src/include/taler/auditor-database/insert_deposit_confirmation.h b/src/include/auditor-database/insert_deposit_confirmation.h diff --git a/src/include/auditor-database/insert_early_aggregation.h b/src/include/auditor-database/insert_early_aggregation.h @@ -0,0 +1,47 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/insert_early_aggregation.h + * @brief implementation of the insert_early_aggregation function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_INSERT_EARLY_AGGREGATION_H +#define AUDITOR_DATABASE_INSERT_EARLY_AGGREGATION_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Insert new row into the early aggregation table. This can happen simply + * because of when the taler-helper-auditor-transfer looks at which of the + * two tables. If it is cleared in the next iteration, this is perfectly + * expected. + * + * @param pg the database context + * @param batch_deposit_serial_id where in the batch deposit table are we + * @param tracking_serial_id where in the tracking table are we + * @param total_amount value of all missing deposits, including fees + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_insert_early_aggregation (struct AUDITORDB_PostgresContext *pg, + uint64_t batch_deposit_serial_id, + uint64_t tracking_serial_id, + const struct TALER_Amount *total_amount); + +#endif diff --git a/src/include/taler/auditor-database/insert_emergency.h b/src/include/auditor-database/insert_emergency.h diff --git a/src/include/taler/auditor-database/insert_emergency_by_count.h b/src/include/auditor-database/insert_emergency_by_count.h diff --git a/src/include/taler/auditor-database/insert_exchange_signkey.h b/src/include/auditor-database/insert_exchange_signkey.h diff --git a/src/include/taler/auditor-database/insert_fee_time_inconsistency.h b/src/include/auditor-database/insert_fee_time_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_historic_denom_revenue.h b/src/include/auditor-database/insert_historic_denom_revenue.h diff --git a/src/include/taler/auditor-database/insert_historic_reserve_revenue.h b/src/include/auditor-database/insert_historic_reserve_revenue.h diff --git a/src/include/taler/auditor-database/insert_misattribution_in_inconsistency.h b/src/include/auditor-database/insert_misattribution_in_inconsistency.h diff --git a/src/include/auditor-database/insert_pending_deposit.h b/src/include/auditor-database/insert_pending_deposit.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/insert_pending_deposit.h + * @brief implementation of the insert_pending_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_INSERT_PENDING_DEPOSIT_H +#define AUDITOR_DATABASE_INSERT_PENDING_DEPOSIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Insert new row into the pending deposits table. + * + * @param pg the database context + * @param batch_deposit_serial_id where in the table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param deadline what was the requested wire transfer deadline + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_insert_pending_deposit (struct AUDITORDB_PostgresContext *pg, + uint64_t batch_deposit_serial_id, + const struct TALER_FullPaytoHashP * + wire_target_h_payto, + const struct TALER_Amount *total_amount, + struct GNUNET_TIME_Timestamp deadline); + + +#endif diff --git a/src/include/auditor-database/insert_purse_info.h b/src/include/auditor-database/insert_purse_info.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/insert_purse_info.h + * @brief implementation of the insert_purse_info function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_INSERT_PURSE_INFO_H +#define AUDITOR_DATABASE_INSERT_PURSE_INFO_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Insert information about a purse. There must not be an + * existing record for the purse. + * + * @param pg the database context + * @param purse_pub public key of the purse + * @param balance balance of the purse + * @param expiration_date expiration date of the purse + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_insert_purse_info (struct AUDITORDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_Amount *balance, + struct GNUNET_TIME_Timestamp expiration_date); + +#endif diff --git a/src/include/taler/auditor-database/insert_purse_not_closed_inconsistencies.h b/src/include/auditor-database/insert_purse_not_closed_inconsistencies.h diff --git a/src/include/taler/auditor-database/insert_reserve_balance_insufficient_inconsistency.h b/src/include/auditor-database/insert_reserve_balance_insufficient_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_reserve_balance_summary_wrong_inconsistency.h b/src/include/auditor-database/insert_reserve_balance_summary_wrong_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_reserve_in_inconsistency.h b/src/include/auditor-database/insert_reserve_in_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_reserve_info.h b/src/include/auditor-database/insert_reserve_info.h diff --git a/src/include/taler/auditor-database/insert_reserve_not_closed_inconsistency.h b/src/include/auditor-database/insert_reserve_not_closed_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_row_inconsistency.h b/src/include/auditor-database/insert_row_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_row_minor_inconsistencies.h b/src/include/auditor-database/insert_row_minor_inconsistencies.h diff --git a/src/include/taler/auditor-database/insert_wire_format_inconsistency.h b/src/include/auditor-database/insert_wire_format_inconsistency.h diff --git a/src/include/taler/auditor-database/insert_wire_out_inconsistency.h b/src/include/auditor-database/insert_wire_out_inconsistency.h diff --git a/src/include/taler/auditor-database/lookup_reserve_in_inconsistency.h b/src/include/auditor-database/lookup_reserve_in_inconsistency.h diff --git a/src/include/taler/auditor-database/preflight.h b/src/include/auditor-database/preflight.h diff --git a/src/include/auditor-database/select_early_aggregations.h b/src/include/auditor-database/select_early_aggregations.h @@ -0,0 +1,96 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/select_early_aggregations.h + * @brief implementation of the select_early_aggregations function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_SELECT_EARLY_AGGREGATIONS_H +#define AUDITOR_DATABASE_SELECT_EARLY_AGGREGATIONS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Information about an early aggregation event. + */ +struct TALER_AUDITORDB_EarlyAggregation +{ + /** + * Row of the event in the auditor database. + */ + uint64_t row_id; + + /** + * Row of the batch deposit in the exchange database. + */ + uint64_t batch_deposit_serial_id; + + /** + * FIXME + */ + uint64_t tracking_serial_id; + + /** + * Total amount involved. + */ + struct TALER_Amount total; + + /** + * True if this report was previously suppressed. + */ + bool suppressed; +}; + + +/** + * Function to call with information about early aggregations. + * + * @param cls closure + * @param ea event data + * @return #GNUNET_OK to continue to iterate + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_AUDITORDB_EarlyAggregationsCallback)( + void *cls, + const struct TALER_AUDITORDB_EarlyAggregation *ea); + + +/** + * Returns all aggregations that were found that were done + * too early. + * + * @param pg the database context + * @param limit number of rows to return, negative to iterate backwards + * @param offset starting offset, exclusive + * @param return_suppressed true to also return suppressed events + * @param cb function to call with results + * @param cb_cls closure for @a cb + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_select_early_aggregations ( + struct AUDITORDB_PostgresContext *pg, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_EarlyAggregationsCallback cb, + void *cb_cls); + + +#endif diff --git a/src/include/taler/auditor-database/select_historic_denom_revenue.h b/src/include/auditor-database/select_historic_denom_revenue.h diff --git a/src/include/taler/auditor-database/select_historic_reserve_revenue.h b/src/include/auditor-database/select_historic_reserve_revenue.h diff --git a/src/include/auditor-database/select_pending_deposits.h b/src/include/auditor-database/select_pending_deposits.h @@ -0,0 +1,97 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/select_pending_deposits.h + * @brief implementation of the select_pending_deposits function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H +#define AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Function called on deposits that are past their due date + * and have not yet seen a wire transfer. + * + * @param cls closure + * @param row_id row ID of the alert in the auditor database + * @param batch_deposit_serial_id where in the exchange table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param deadline what was the earliest requested wire transfer deadline + * @param suppressed true if this report was suppressed + */ +typedef void +(*TALER_AUDITORDB_WireMissingCallback) ( + void *cls, + uint64_t row_id, + uint64_t batch_deposit_serial_id, + const struct TALER_Amount *total_amount, + const struct TALER_FullPaytoHashP *wire_target_h_payto, + struct GNUNET_TIME_Timestamp deadline, + bool suppressed); + + +/* Callback typedefs */ +/** + * Function called on deposits that are past their due date + * and have not yet seen a wire transfer. + * + * @param cls closure + * @param row_id row ID of the alert in the auditor database + * @param batch_deposit_serial_id where in the exchange table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param deadline what was the earliest requested wire transfer deadline + * @param suppressed true if this report was suppressed + */ +typedef void +(*TALER_AUDITORDB_WireMissingCallback) ( + void *cls, + uint64_t row_id, + uint64_t batch_deposit_serial_id, + const struct TALER_Amount *total_amount, + const struct TALER_FullPaytoHashP *wire_target_h_payto, + struct GNUNET_TIME_Timestamp deadline, + bool suppressed); + +/** + * Return (batch) deposits for which we have not yet + * seen the required wire transfer. + * + * @param pg the database context + * @param deadline only return up to this deadline + * @param limit number of rows to return, negative to iterate backwards + * @param offset starting offset, exclusive + * @param return_suppressed true to also return suppressed events + * @param cb function to call on each entry + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_select_pending_deposits (struct AUDITORDB_PostgresContext *pg, + struct GNUNET_TIME_Absolute deadline, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_WireMissingCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/auditor-database/select_purse_expired.h b/src/include/auditor-database/select_purse_expired.h @@ -0,0 +1,76 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/select_purse_expired.h + * @brief implementation of the select_purse_expired function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_SELECT_PURSE_EXPIRED_H +#define AUDITOR_DATABASE_SELECT_PURSE_EXPIRED_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Function called on expired purses. + * + * @param cls closure + * @param purse_pub public key of the purse + * @param balance amount of money in the purse + * @param expiration_date when did the purse expire? + * @return #GNUNET_OK to continue to iterate + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_AUDITORDB_ExpiredPurseCallback)( + void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_Amount *balance, + struct GNUNET_TIME_Timestamp expiration_date); + + +/* Callback typedefs */ +/** + * Function called on expired purses. + * + * @param cls closure + * @param purse_pub public key of the purse + * @param balance amount of money in the purse + * @param expiration_date when did the purse expire? + * @return #GNUNET_OK to continue to iterate + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_AUDITORDB_ExpiredPurseCallback)( + void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_Amount *balance, + struct GNUNET_TIME_Timestamp expiration_date); + +/** + * Get information about expired purses. + * + * @param pg the database context + * @param cb function to call on expired purses + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_select_purse_expired (struct AUDITORDB_PostgresContext *pg, + TALER_AUDITORDB_ExpiredPurseCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/auditor-database/select_reserve_in_inconsistency.h b/src/include/auditor-database/select_reserve_in_inconsistency.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/select_reserve_in_inconsistency.h + * @brief implementation of the select_reserve_in_inconsistency function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_SELECT_RESERVE_IN_INCONSISTENCY_H +#define AUDITOR_DATABASE_SELECT_RESERVE_IN_INCONSISTENCY_H + +#include "taler/taler_auditordb_lib.h" + + +/** + * Return any reserve incoming inconsistency associated with the + * given @a bank_row_id. + * + * @param pg the database context + * @param bank_row_id row to select by + * @param[out] dc details to return + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_select_reserve_in_inconsistency (struct AUDITORDB_PostgresContext *pg, + uint64_t bank_row_id, + struct + TALER_AUDITORDB_ReserveInInconsistency + *dc); + + +#endif diff --git a/src/include/taler/auditor-database/start.h b/src/include/auditor-database/start.h diff --git a/src/include/auditor-database/template.h b/src/include/auditor-database/template.h @@ -0,0 +1,27 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/template.h + * @brief implementation of the template function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_TEMPLATE_H +#define AUDITOR_DATABASE_TEMPLATE_H + +#include "taler/taler_auditordb_lib.h" + + +#endif diff --git a/src/include/taler/auditor-database/update_auditor_progress.h b/src/include/auditor-database/update_auditor_progress.h diff --git a/src/include/auditor-database/update_balance.h b/src/include/auditor-database/update_balance.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/update_balance.h + * @brief implementation of the update_balance function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_UPDATE_BALANCE_H +#define AUDITOR_DATABASE_UPDATE_BALANCE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Insert information about a balance tracked by the auditor. Destructively updates an + * existing record, which must already exist. + * + * @param pg the database context + * @param balance_key key of the balance to store + * @param balance_amount value to store + * @param ... NULL terminated list of additional key-value pairs to update + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_update_balance (struct AUDITORDB_PostgresContext *pg, + const char *balance_key, + const struct TALER_Amount *balance_amount, + ...); + + +#endif diff --git a/src/include/taler/auditor-database/update_denomination_balance.h b/src/include/auditor-database/update_denomination_balance.h diff --git a/src/include/taler/auditor-database/update_generic_suppressed.h b/src/include/auditor-database/update_generic_suppressed.h diff --git a/src/include/auditor-database/update_purse_info.h b/src/include/auditor-database/update_purse_info.h @@ -0,0 +1,45 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/auditor-database/update_purse_info.h + * @brief implementation of the update_purse_info function for Postgres + * @author Christian Grothoff + */ +#ifndef AUDITOR_DATABASE_UPDATE_PURSE_INFO_H +#define AUDITOR_DATABASE_UPDATE_PURSE_INFO_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_auditordb_lib.h" + + +/** + * Update information about a purse. Destructively updates an + * existing record, which must already exist. + * + * @param pg the database context + * @param purse_pub public key of the purse + * @param balance new balance for the purse + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +AUDITORDB_update_purse_info (struct AUDITORDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_Amount *balance); + + +#endif diff --git a/src/include/taler/auditor-database/update_reserve_info.h b/src/include/auditor-database/update_reserve_info.h diff --git a/src/include/taler/auditor-database/update_wire_fee_summary.h b/src/include/auditor-database/update_wire_fee_summary.h diff --git a/src/include/exchange-database/abort_shard.h b/src/include/exchange-database/abort_shard.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/abort_shard.h + * @brief implementation of the abort_shard function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ABORT_SHARD_H +#define EXCHANGE_DATABASE_ABORT_SHARD_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to abort work on a shard. + * + * @param pg the database context + * @param job_name name of the operation to abort a word shard for + * @param start_row inclusive start row of the shard + * @param end_row exclusive end row of the shard + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_abort_shard (struct TALER_EXCHANGEDB_PostgresContext *pg, + const char *job_name, + uint64_t start_row, + uint64_t end_row); + +#endif diff --git a/src/include/taler/exchange-database/account_history.h b/src/include/exchange-database/account_history.h diff --git a/src/include/exchange-database/activate_signing_key.h b/src/include/exchange-database/activate_signing_key.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/activate_signing_key.h + * @brief implementation of the activate_signing_key function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ACTIVATE_SIGNING_KEY_H +#define EXCHANGE_DATABASE_ACTIVATE_SIGNING_KEY_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Add signing key. + * + * @param pg the database context + * @param exchange_pub the exchange online signing public key + * @param meta meta data about @a exchange_pub + * @param master_sig master signature to add + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_activate_signing_key (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_ExchangePublicKeyP * + exchange_pub, + const struct + TALER_EXCHANGEDB_SignkeyMetaData * + meta, + const struct TALER_MasterSignatureP * + master_sig + ); + +#endif diff --git a/src/include/exchange-database/add_denomination_key.h b/src/include/exchange-database/add_denomination_key.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/add_denomination_key.h + * @brief implementation of the add_denomination_key function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ADD_DENOMINATION_KEY_H +#define EXCHANGE_DATABASE_ADD_DENOMINATION_KEY_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Activate denomination key, turning it into a "current" or "valid" + * denomination key by adding the master signature. + * + * @param pg the database context + * @param h_denom_pub hash of the denomination public key + * @param denom_pub the actual denomination key + * @param meta meta data about the denomination + * @param master_sig master signature to add + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_add_denomination_key (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_DenominationHashP * + h_denom_pub, + const struct + TALER_DenominationPublicKey * + denom_pub, + const struct + TALER_EXCHANGEDB_DenominationKeyMetaData + *meta, + const struct TALER_MasterSignatureP * + master_sig + ); + +#endif diff --git a/src/include/exchange-database/add_policy_fulfillment_proof.h b/src/include/exchange-database/add_policy_fulfillment_proof.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/add_policy_fulfillment_proof.h + * @brief implementation of the add_policy_fulfillment_proof function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ADD_POLICY_FULFILLMENT_PROOF_H +#define EXCHANGE_DATABASE_ADD_POLICY_FULFILLMENT_PROOF_H + +#include "taler/taler_exchangedb_lib.h" +#include "taler/taler_extensions_policy.h" + + +/** + * Add a proof of fulfillment into the policy_fulfillments table + * + * @param pg the database context + * @param fulfillment fullfilment transaction data to be added + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_add_policy_fulfillment_proof ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + struct TALER_PolicyFulfillmentTransactionData *fulfillment); + +#endif diff --git a/src/include/exchange-database/aggregate.h b/src/include/exchange-database/aggregate.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/aggregate.h + * @brief implementation of the aggregate function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_AGGREGATE_H +#define EXCHANGE_DATABASE_AGGREGATE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Aggregate all matching deposits for @a h_payto and + * @a merchant_pub, returning the total amounts. + * + * @param pg the database context + * @param h_payto destination of the wire transfer + * @param merchant_pub public key of the merchant + * @param wtid wire transfer ID to set for the aggregate + * @param[out] total set to the sum of the total deposits minus applicable deposit fees and refunds + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_aggregate (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_FullPaytoHashP *h_payto, + const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_WireTransferIdentifierRawP *wtid, + struct TALER_Amount *total); + +#endif diff --git a/src/include/exchange-database/batch_ensure_coin_known.h b/src/include/exchange-database/batch_ensure_coin_known.h @@ -0,0 +1,115 @@ +/* + This file is part of TALER + Copyright (C) 2022, 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/batch_ensure_coin_known.h + * @brief implementation of the batch_ensure_coin_known function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_BATCH_ENSURE_COIN_KNOWN_H +#define EXCHANGE_DATABASE_BATCH_ENSURE_COIN_KNOWN_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * The conflict that can occur for the age restriction + */ +enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict +{ + /** + * Value OK, no conflict + */ + TALER_AgeCommitmentHashP_NoConflict = 0, + + /** + * Given hash had a value, but NULL (or zero) was expected + */ + TALER_AgeCommitmentHashP_NullExpected = 1, + + /** + * Given hash was NULL, but value was expected + */ + TALER_AgeCommitmentHashP_ValueExpected = 2, + + /** + * Given hash differs from value in the known coin + */ + TALER_AgeCommitmentHashP_ValueDiffers = 3, +}; + +/** + * Per-coin information returned when doing a batch insert. + */ +struct TALER_EXCHANGEDB_CoinInfo +{ + /** + * Row of the coin in the known_coins table. + */ + uint64_t known_coin_id; + + /** + * Hash of the denomination, relevant on @e denom_conflict. + */ + struct TALER_DenominationHashP denom_hash; + + /** + * Hash of the age commitment, relevant on @e age_conflict. + */ + struct TALER_AgeCommitmentHashP h_age_commitment; + + /** + * True if the coin was known previously. + */ + bool existed; + + /** + * True if the known coin has a different denomination; + * application will find denomination of the already + * known coin in @e denom_hash. + */ + bool denom_conflict; + + /** + * Indicates if and what kind of conflict with the age + * restriction of the known coin was present; + * application will find age commitment of the already + * known coin in @e h_age_commitment. + */ + enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict age_conflict; +}; + + +/** + * Make sure the array of given @a coin is known to the database. + * + * @param pg the database context + * @param coin array of coins that must be made known + * @param[out] result array where to store information about each coin + * @param coin_length length of the @a coin and @a result arraysf + * @param batch_size desired (maximum) batch size + * @return database transaction status, non-negative on success + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_batch_ensure_coin_known (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_CoinPublicInfo * + coin, + struct TALER_EXCHANGEDB_CoinInfo * + result, + unsigned int coin_length, + unsigned int batch_size); + +#endif diff --git a/src/include/exchange-database/begin_revolving_shard.h b/src/include/exchange-database/begin_revolving_shard.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/begin_revolving_shard.h + * @brief implementation of the begin_revolving_shard function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_BEGIN_REVOLVING_SHARD_H +#define EXCHANGE_DATABASE_BEGIN_REVOLVING_SHARD_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to grab a revolving work shard on an operation @a op. Runs + * in its own transaction. Returns the oldest inactive shard. + * + * @param pg the database context + * @param job_name name of the operation to grab a revolving shard for + * @param shard_size desired shard size + * @param shard_limit exclusive end of the shard range + * @param[out] start_row inclusive start row of the shard (returned) + * @param[out] end_row inclusive end row of the shard (returned) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_begin_revolving_shard (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *job_name, + uint32_t shard_size, + uint32_t shard_limit, + uint32_t *start_row, + uint32_t *end_row); + +#endif diff --git a/src/include/exchange-database/begin_shard.h b/src/include/exchange-database/begin_shard.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/begin_shard.h + * @brief implementation of the begin_shard function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_BEGIN_SHARD_H +#define EXCHANGE_DATABASE_BEGIN_SHARD_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Function called to grab a work shard on an operation @a op. Runs in its + * own transaction. + * + * @param pg the database context + * @param job_name name of the operation to grab a word shard for + * @param delay minimum age of a shard to grab + * @param shard_size desired shard size + * @param[out] start_row inclusive start row of the shard (returned) + * @param[out] end_row exclusive end row of the shard (returned) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_begin_shard (struct TALER_EXCHANGEDB_PostgresContext *pg, + const char *job_name, + struct GNUNET_TIME_Relative delay, + uint64_t shard_size, + uint64_t *start_row, + uint64_t *end_row); + +#endif diff --git a/src/include/exchange-database/clear_aml_lock.h b/src/include/exchange-database/clear_aml_lock.h @@ -0,0 +1,45 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/clear_aml_lock.h + * @brief implementation of the clear_aml_lock function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_CLEAR_AML_LOCK_H +#define EXCHANGE_DATABASE_CLEAR_AML_LOCK_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Clear a lock on running AML programs for the @a h_payto + * account. Returns 0 if @a h_payto is not known; does not + * actually care if there was a lock. Also does not by + * itself notify clients waiting for the lock, that + * notification the caller must do separately after finishing + * the database update. + * + * @param pg the database context + * @param h_payto account to clear the lock for + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_clear_aml_lock (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_NormalizedPaytoHashP * + h_payto); + +#endif diff --git a/src/include/exchange-database/commit.h b/src/include/exchange-database/commit.h @@ -0,0 +1,36 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/commit.h + * @brief implementation of the commit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_COMMIT_H +#define EXCHANGE_DATABASE_COMMIT_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Commit the current transaction of a database connection. + * + * @param pg the database context + * @return final transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_commit (struct TALER_EXCHANGEDB_PostgresContext *pg); + +#endif diff --git a/src/include/exchange-database/complete_shard.h b/src/include/exchange-database/complete_shard.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/complete_shard.h + * @brief implementation of the complete_shard function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_COMPLETE_SHARD_H +#define EXCHANGE_DATABASE_COMPLETE_SHARD_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to persist that work on a shard was completed. + * + * @param pg the database context + * @param job_name name of the operation to grab a word shard for + * @param start_row inclusive start row of the shard + * @param end_row exclusive end row of the shard + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_complete_shard (struct TALER_EXCHANGEDB_PostgresContext *pg, + const char *job_name, + uint64_t start_row, + uint64_t end_row); + +#endif diff --git a/src/include/exchange-database/compute_shard.h b/src/include/exchange-database/compute_shard.h @@ -0,0 +1,38 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/compute_shard.h + * @brief implementation of the compute_shard function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_COMPUTE_SHARD_H +#define EXCHANGE_DATABASE_COMPUTE_SHARD_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Compute the shard number of a given @a merchant_pub. + * + * @param merchant_pub merchant public key to compute shard for + * @return shard number + */ +uint64_t +TALER_EXCHANGEDB_compute_shard (const struct TALER_MerchantPublicKeyP * + merchant_pub); + + +#endif diff --git a/src/include/exchange-database/count_known_coins.h b/src/include/exchange-database/count_known_coins.h @@ -0,0 +1,39 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/count_known_coins.h + * @brief implementation of the count_known_coins function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_COUNT_KNOWN_COINS_H +#define EXCHANGE_DATABASE_COUNT_KNOWN_COINS_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Count the number of known coins by denomination. + * + * @param pg the database context + * @param denom_pub_hash denomination to count by + * @return number of coins if non-negative, otherwise an `enum GNUNET_DB_QueryStatus` + */ +long long +TALER_EXCHANGEDB_count_known_coins (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_DenominationHashP *denom_pub_hash); + +#endif diff --git a/src/include/exchange-database/create_aggregation_transient.h b/src/include/exchange-database/create_aggregation_transient.h @@ -0,0 +1,59 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/create_aggregation_transient.h + * @brief implementation of the create_aggregation_transient function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_CREATE_AGGREGATION_TRANSIENT_H +#define EXCHANGE_DATABASE_CREATE_AGGREGATION_TRANSIENT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Create a new entry in the transient aggregation table. + * + * @param pg the database context + * @param h_payto destination of the wire transfer + * @param exchange_account_section exchange account to use + * @param merchant_pub public key of the merchant receiving the transfer + * @param wtid the raw wire transfer identifier to be used + * @param kyc_requirement_row row in legitimization_requirements that need to be satisfied to continue, or 0 for none + * @param total amount to be wired in the future + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_create_aggregation_transient (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_FullPaytoHashP * + h_payto, + const char * + exchange_account_section, + const struct + TALER_MerchantPublicKeyP * + merchant_pub, + const struct + TALER_WireTransferIdentifierRawP + *wtid, + uint64_t kyc_requirement_row, + const struct TALER_Amount *total) +; + +#endif diff --git a/src/include/taler/exchange-database/create_tables.h b/src/include/exchange-database/create_tables.h diff --git a/src/include/exchange-database/delete_aggregation_transient.h b/src/include/exchange-database/delete_aggregation_transient.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/delete_aggregation_transient.h + * @brief implementation of the delete_aggregation_transient function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DELETE_AGGREGATION_TRANSIENT_H +#define EXCHANGE_DATABASE_DELETE_AGGREGATION_TRANSIENT_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Delete existing entry in the transient aggregation table. + * @a h_payto is only needed for query performance. + * + * @param pg the database context + * @param h_payto destination of the wire transfer + * @param wtid the raw wire transfer identifier to update + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_delete_aggregation_transient (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_FullPaytoHashP * + h_payto, + const struct + TALER_WireTransferIdentifierRawP + *wtid) +; + +#endif diff --git a/src/include/exchange-database/delete_shard_locks.h b/src/include/exchange-database/delete_shard_locks.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/delete_shard_locks.h + * @brief implementation of the delete_shard_locks function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DELETE_SHARD_LOCKS_H +#define EXCHANGE_DATABASE_DELETE_SHARD_LOCKS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Function called to delete all revolving shards. + * To be used after a crash or when the shard size is + * changed. + * + * @param pg the database context + * @return transaction status code + */ +enum GNUNET_GenericReturnValue +TALER_EXCHANGEDB_delete_shard_locks (struct TALER_EXCHANGEDB_PostgresContext *pg + ); + +#endif diff --git a/src/include/exchange-database/disable_rules.h b/src/include/exchange-database/disable_rules.h @@ -0,0 +1,38 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/disable_rules.h + * @brief implementation of the disable_rules function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DISABLE_RULES_H +#define EXCHANGE_DATABASE_DISABLE_RULES_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Disable (delete/drop) customization rule schema from a deployment. + * + * @param pg the database context + * @param schema name of the schema with customization rules to remove + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_disable_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, + const char *schema); + +#endif diff --git a/src/include/exchange-database/do_check_deposit_idempotent.h b/src/include/exchange-database/do_check_deposit_idempotent.h @@ -0,0 +1,47 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_check_deposit_idempotent.h + * @brief implementation of the do_check_deposit_idempotent function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_CHECK_DEPOSIT_IDEMPOTENT_H +#define EXCHANGE_DATABASE_DO_CHECK_DEPOSIT_IDEMPOTENT_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Check ifdeposit operation is idempotent to existing one. + * + * @param pg the database context + * @param bd batch deposit operation details + * @param[in,out] exchange_timestamp time to use for the deposit (possibly updated) + * @param[out] is_idempotent set to true if the request is idempotent + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_check_deposit_idempotent (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_EXCHANGEDB_BatchDeposit *bd, + struct GNUNET_TIME_Timestamp * + exchange_timestamp, + bool *is_idempotent); + +#endif diff --git a/src/include/exchange-database/do_deposit.h b/src/include/exchange-database/do_deposit.h @@ -0,0 +1,56 @@ +/* + This file is part of TALER + Copyright (C) 2022, 2026 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_deposit.h + * @brief implementation of the do_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_DEPOSIT_H +#define EXCHANGE_DATABASE_DO_DEPOSIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Perform deposit operation, checking for sufficient balance + * of the coins and possibly persisting the deposit details. + * + * @param pg the database context + * @param bd batch deposit operation details + * @param deposit_fees array of "bd->num_cids" deposit fees + * of the respective coins + * @param[in,out] exchange_timestamp time to use for the deposit (possibly updated) + * @param[out] accumulated_total_without_fee set to the sum of all deposits + * made for this merchant and contract (minus deposit fees) + * @param[out] balance_ok set to true if the balance was sufficient + * @param[out] bad_balance_index set to the first index of a coin for which the balance was insufficient, + * only used if @a balance_ok is set to false. + * @param[out] in_conflict set to true if the deposit conflicted + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_BatchDeposit *bd, + const struct TALER_Amount deposit_fees[], + struct GNUNET_TIME_Timestamp *exchange_timestamp, + struct TALER_Amount *accumulated_total_without_fee, + bool *balance_ok, + uint32_t *bad_balance_index, + bool *in_conflict); + +#endif diff --git a/src/include/exchange-database/do_purse_delete.h b/src/include/exchange-database/do_purse_delete.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_purse_delete.h + * @brief implementation of the do_purse_delete function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_PURSE_DELETE_H +#define EXCHANGE_DATABASE_DO_PURSE_DELETE_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to explicitly delete a purse. + * + * @param pg the database context + * @param purse_pub purse to delete + * @param purse_sig signature affirming the deletion + * @param[out] decided set to true if the purse was + * already decided and thus could not be deleted + * @param[out] found set to true if the purse was found + * (if false, purse could not be deleted) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_purse_delete (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_PurseContractSignatureP * + purse_sig, + bool *decided, + bool *found); + +#endif diff --git a/src/include/exchange-database/do_purse_deposit.h b/src/include/exchange-database/do_purse_deposit.h @@ -0,0 +1,66 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_purse_deposit.h + * @brief implementation of the do_purse_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_PURSE_DEPOSIT_H +#define EXCHANGE_DATABASE_DO_PURSE_DEPOSIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to execute a transaction crediting + * a purse with @a amount from @a coin_pub. Reduces the + * value of @a coin_pub and increase the balance of + * the @a purse_pub purse. If the balance reaches the + * target amount and the purse has been merged, triggers + * the updates of the reserve/account balance. + * + * @param pg the database context + * @param purse_pub purse to credit + * @param coin_pub coin to deposit (debit) + * @param amount fraction of the coin's value to deposit + * @param coin_sig signature affirming the operation + * @param amount_minus_fee amount to add to the purse + * @param[out] balance_ok set to false if the coin's + * remaining balance is below @a amount; + * in this case, the return value will be + * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure + * @param[out] too_late set to true if it is too late to deposit into the purse + * @param[out] conflict set to true if the deposit failed due to a conflict (coin already spent, + * or deposited into this purse with a different amount) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_purse_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_CoinSpendPublicKeyP * + coin_pub, + const struct TALER_Amount *amount, + const struct TALER_CoinSpendSignatureP * + coin_sig, + const struct TALER_Amount *amount_minus_fee, + bool *balance_ok, + bool *too_late, + bool *conflict); + +#endif diff --git a/src/include/exchange-database/do_purse_merge.h b/src/include/exchange-database/do_purse_merge.h @@ -0,0 +1,62 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_purse_merge.h + * @brief implementation of the do_purse_merge function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_PURSE_MERGE_H +#define EXCHANGE_DATABASE_DO_PURSE_MERGE_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to approve merging a purse into a + * reserve by the respective purse merge key. + * + * @param pg the database context + * @param purse_pub purse to merge + * @param merge_sig signature affirming the merge + * @param merge_timestamp time of the merge + * @param reserve_sig signature of the reserve affirming the merge + * @param partner_url URL of the partner exchange, can be NULL if the reserves lives with us + * @param reserve_pub public key of the reserve to credit + * @param[out] no_partner set to true if @a partner_url is unknown + * @param[out] no_balance set to true if the @a purse_pub is not paid up yet + * @param[out] in_conflict set to true if @a purse_pub was merged into a different reserve already + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_purse_merge (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub + , + const struct TALER_PurseMergeSignatureP * + merge_sig, + const struct GNUNET_TIME_Timestamp + merge_timestamp, + const struct TALER_ReserveSignatureP * + reserve_sig, + const char *partner_url, + const struct TALER_ReservePublicKeyP * + reserve_pub, + bool *no_partner, + bool *no_balance, + bool *in_conflict); + +#endif diff --git a/src/include/exchange-database/do_recoup.h b/src/include/exchange-database/do_recoup.h @@ -0,0 +1,55 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_recoup.h + * @brief implementation of the do_recoup function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_RECOUP_H +#define EXCHANGE_DATABASE_DO_RECOUP_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Perform recoup operation, checking for sufficient deposits + * of the coin and possibly persisting the recoup details. + * + * @param pg the database context + * @param reserve_pub public key of the reserve to credit + * @param withdraw_serial_id row in the withdraw table justifying the recoup + * @param coin_bks coin blinding key secret to persist + * @param coin_pub public key of the coin being recouped + * @param known_coin_id row of the @a coin_pub in the known_coins table + * @param coin_sig signature of the coin requesting the recoup + * @param[in,out] recoup_timestamp recoup timestamp, set if recoup existed + * @param[out] recoup_ok set if the recoup succeeded (balance ok) + * @param[out] internal_failure set on internal failures + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_recoup (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_ReservePublicKeyP *reserve_pub, + uint64_t withdraw_serial_id, + const union GNUNET_CRYPTO_BlindingSecretP *coin_bks, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + uint64_t known_coin_id, + const struct TALER_CoinSpendSignatureP *coin_sig, + struct GNUNET_TIME_Timestamp *recoup_timestamp, + bool *recoup_ok, + bool *internal_failure); + +#endif diff --git a/src/include/exchange-database/do_recoup_refresh.h b/src/include/exchange-database/do_recoup_refresh.h @@ -0,0 +1,64 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_recoup_refresh.h + * @brief implementation of the do_recoup_refresh function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_RECOUP_REFRESH_H +#define EXCHANGE_DATABASE_DO_RECOUP_REFRESH_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Perform recoup-refresh operation, checking for sufficient deposits of the + * coin and possibly persisting the recoup-refresh details. + * + * @param pg the database context + * @param old_coin_pub public key of the old coin to credit + * @param rrc_serial row in the refresh_revealed_coins table justifying the recoup-refresh + * @param coin_bks coin blinding key secret to persist + * @param coin_pub public key of the coin being recouped + * @param known_coin_id row of the @a coin_pub in the known_coins table + * @param coin_sig signature of the coin requesting the recoup + * @param[in,out] recoup_timestamp recoup timestamp, set if recoup existed + * @param[out] recoup_ok set if the recoup-refresh succeeded (balance ok) + * @param[out] internal_failure set on internal failures + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_do_recoup_refresh (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_CoinSpendPublicKeyP * + old_coin_pub, + uint64_t rrc_serial, + const union + GNUNET_CRYPTO_BlindingSecretP * + coin_bks, + const struct + TALER_CoinSpendPublicKeyP *coin_pub, + uint64_t known_coin_id, + const struct + TALER_CoinSpendSignatureP *coin_sig, + struct GNUNET_TIME_Timestamp * + recoup_timestamp, + bool *recoup_ok, + bool *internal_failure); + +#endif diff --git a/src/include/exchange-database/do_refresh.h b/src/include/exchange-database/do_refresh.h @@ -0,0 +1,57 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_refresh.h + * @brief implementation of the do_refresh function for Postgres + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_DO_REFRESH_H +#define EXCHANGE_DATABASE_DO_REFRESH_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Perform refresh operation--introduced with v26 of the API--, + * checking for sufficient balance of the coin and possibly persisting the melt/refresh details. + * + * @param pg the database context + * @param[in,out] refresh refresh operation details; the noreveal_index + * is set in case the coin was already melted before + * @param timestamp the timestamp of this melt operation, helpful for the coin history. + * @param[in,out] zombie_required true if the melt must only succeed + * if the coin is a zombie, set to false if the requirement was satisfied + * @param[out] found set to true if there exists already an entry in the database for + * the calculated commitment hash. + * @param[out] noreveal_index if @e idempotent ist true, the existing value of the noreveal_index. + * @param[out] nonce_reuse set to true if the blinding seed for CS was re-used. + * @param[out] balance_ok set to true if the balance was sufficient + * @param[out] coin_balance if balance_ok is false, set to the remaining value of the coin + * @return query execution status, NO_RESULTS in case of an unknown coin. + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_refresh (struct TALER_EXCHANGEDB_PostgresContext *pg, + struct TALER_EXCHANGEDB_Refresh_vDOLDPLUS *refresh, + const struct GNUNET_TIME_Timestamp *timestamp, + bool *found, + uint32_t *noreveal_index, + bool *zombie_required, + bool *nonce_reuse, + bool *balance_ok, + struct TALER_Amount *coin_balance); + +#endif diff --git a/src/include/exchange-database/do_refund.h b/src/include/exchange-database/do_refund.h @@ -0,0 +1,77 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_refund.h + * @brief implementation of the do_refund function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_REFUND_H +#define EXCHANGE_DATABASE_DO_REFUND_H + +#include "taler/taler_util.h" +#include "exchange-database/free_coin_transaction_list.h" + +/** + * @brief Specification for a refund operation. The combination of + * the coin's public key, the merchant's public key and the + * transaction ID must be unique. While a coin can (theoretically) be + * deposited at the same merchant twice (with partial spending), the + * merchant must either use a different public key or a different + * transaction ID for the two transactions. The same goes for + * refunds, hence we also have a "rtransaction" ID which is disjoint + * from the transaction ID. The same coin must not be used twice at + * the same merchant for the same transaction or rtransaction ID. + */ +struct TALER_EXCHANGEDB_Refund +{ + /** + * Information about the coin that is being refunded. + */ + struct TALER_CoinPublicInfo coin; + + /** + * Details about the refund. + */ + struct TALER_EXCHANGEDB_RefundListEntry details; + +}; + + +/** + * Perform refund operation, checking for sufficient deposits + * of the coin and possibly persisting the refund details. + * + * @param pg the database context + * @param refund refund operation details + * @param deposit_fee deposit fee applicable for the coin, possibly refunded + * @param known_coin_id row of the coin in the known_coins table + * @param[out] not_found set if the deposit was not found + * @param[out] refund_ok set if the refund succeeded (below deposit amount) + * @param[out] gone if the merchant was already paid + * @param[out] conflict set if the refund ID was reused + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_refund (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_Refund *refund, + const struct TALER_Amount *deposit_fee, + uint64_t known_coin_id, + bool *not_found, + bool *refund_ok, + bool *gone, + bool *conflict); + +#endif diff --git a/src/include/taler/exchange-database/do_reserve_open.h b/src/include/exchange-database/do_reserve_open.h diff --git a/src/include/exchange-database/do_reserve_purse.h b/src/include/exchange-database/do_reserve_purse.h @@ -0,0 +1,62 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_reserve_purse.h + * @brief implementation of the do_reserve_purse function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DO_RESERVE_PURSE_H +#define EXCHANGE_DATABASE_DO_RESERVE_PURSE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Function called insert request to merge a purse into a reserve by the + * respective purse merge key. The purse must not have been merged into a + * different reserve. + * + * @param pg the database context + * @param purse_pub purse to merge + * @param merge_sig signature affirming the merge + * @param merge_timestamp time of the merge + * @param reserve_sig signature of the reserve affirming the merge + * @param purse_fee amount to charge the reserve for the purse creation, NULL to use the quota + * @param reserve_pub public key of the reserve to credit + * @param[out] in_conflict set to true if @a purse_pub was merged into a different reserve already + * @param[out] no_reserve set to true if @a reserve_pub is not a known reserve + * @param[out] insufficient_funds set to true if @a reserve_pub has insufficient capacity to create another purse + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_reserve_purse (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_PurseMergeSignatureP * + merge_sig, + const struct GNUNET_TIME_Timestamp + merge_timestamp, + const struct TALER_ReserveSignatureP * + reserve_sig, + const struct TALER_Amount *purse_fee, + const struct TALER_ReservePublicKeyP * + reserve_pub, + bool *in_conflict, + bool *no_reserve, + bool *insufficient_funds); + +#endif diff --git a/src/include/exchange-database/do_withdraw.h b/src/include/exchange-database/do_withdraw.h @@ -0,0 +1,59 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/do_withdraw.h + * @brief implementation of the do_withdraw function for Postgres + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_DO_WITHDRAW_H +#define EXCHANGE_DATABASE_DO_WITHDRAW_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/free_reserve_history.h" + +/** + * Perform reserve update as part of an age-withdraw operation, checking for + * sufficient balance and fulfillment of age requirements. Finally persisting + * the withdrawal details. + * + * @param pg the database context + * @param withdraw the withdraw data + * @param now the timestamp of the withdraw + * @param[out] balance_ok set to true if the balance was sufficient + * @param[out] reserve_balance set to original balance of the reserve + * @param[out] age_ok set to true if age requirements were met + * @param[out] allowed_maximum_age if @e age_ok is FALSE, this is set to the allowed maximum age + * @param[out] reserve_birthday if @e age_ok is FALSE, this is set to the reserve's birthday + * @param[out] idempotent set to true if an entry already exists for the given h_planchets and reserve_pub + * @param[out] noreveal_index if @e idempotent is true, set to the noreveal_index in the existing record + * @param[out] nonce_reuse set to true if the blinding_seed has been found in the table for a different withdraw + * @return 0 if no reserve was found, 1 if a reserve was found, else the query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_do_withdraw (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_Withdraw *withdraw, + const struct GNUNET_TIME_Timestamp *now, + bool *balance_ok, + struct TALER_Amount *reserve_balance, + bool *age_ok, + uint16_t *allowed_maximum_age, + uint32_t *reserve_birthday, + bool *idempotent, + uint16_t *noreveal_index, + bool *nonce_reuse); + +#endif diff --git a/src/include/exchange-database/drain_kyc_alert.h b/src/include/exchange-database/drain_kyc_alert.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/drain_kyc_alert.h + * @brief implementation of the drain_kyc_alert function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_DRAIN_KYC_ALERT_H +#define EXCHANGE_DATABASE_DRAIN_KYC_ALERT_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Extract next KYC alert. Deletes the alert. + * + * @param pg the database context + * @param trigger_type which type of alert to drain + * @param[out] h_payto set to hash of payto-URI where KYC status changed + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_drain_kyc_alert (struct TALER_EXCHANGEDB_PostgresContext *pg, + uint32_t trigger_type, + struct TALER_NormalizedPaytoHashP *h_payto); + +#endif diff --git a/src/include/taler/exchange-database/drop_tables.h b/src/include/exchange-database/drop_tables.h diff --git a/src/include/exchange-database/enable_rules.h b/src/include/exchange-database/enable_rules.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/enable_rules.h + * @brief implementation of the enable_rules function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ENABLE_RULES_H +#define EXCHANGE_DATABASE_ENABLE_RULES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Enable (create/insert) customization rule schema from a deployment. + * + * @param pg the database context + * @param schema name of the schema with customization rules to remove + * @return transaction status + */ +enum GNUNET_GenericReturnValue +TALER_EXCHANGEDB_enable_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, + const char *schema); + +#endif diff --git a/src/include/exchange-database/ensure_coin_known.h b/src/include/exchange-database/ensure_coin_known.h @@ -0,0 +1,94 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/ensure_coin_known.h + * @brief implementation of the ensure_coin_known function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ENSURE_COIN_KNOWN_H +#define EXCHANGE_DATABASE_ENSURE_COIN_KNOWN_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Possible status codes from making sure a coin is known. + */ +enum TALER_EXCHANGEDB_CoinKnownStatus +{ + /** + * The coin was successfully added. + */ + TALER_EXCHANGEDB_CKS_ADDED = 1, + + /** + * The coin was already present. + */ + TALER_EXCHANGEDB_CKS_PRESENT = 0, + + /** + * Serialization failure. + */ + TALER_EXCHANGEDB_CKS_SOFT_FAIL = -1, + + /** + * Hard database failure. + */ + TALER_EXCHANGEDB_CKS_HARD_FAIL = -2, + + /** + * Conflicting coin (different denomination key) already in database. + */ + TALER_EXCHANGEDB_CKS_DENOM_CONFLICT = -3, + + /** + * Conflicting coin (expected NULL age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL = -4, + + /** + * Conflicting coin (unexpected NULL age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL = -5, + + /** + * Conflicting coin (different age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS = -6, + +}; + + +/** + * Make sure the given @a coin is known to the database. + * + * @param pg the database context + * @param coin the coin that must be made known + * @param[out] known_coin_id set to the unique row of the coin + * @param[out] denom_hash set to the denomination hash of the existing + * coin (for conflict error reporting) + * @param[out] h_age_commitment set to the conflicting age commitment hash on conflict + * @return database transaction status, non-negative on success + */ +enum TALER_EXCHANGEDB_CoinKnownStatus +TALER_EXCHANGEDB_ensure_coin_known (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_CoinPublicInfo *coin, + uint64_t *known_coin_id, + struct TALER_DenominationHashP *denom_hash, + struct TALER_AgeCommitmentHashP * + h_age_commitment) +; + +#endif diff --git a/src/include/taler/exchange-database/event_listen.h b/src/include/exchange-database/event_listen.h diff --git a/src/include/exchange-database/event_listen_cancel.h b/src/include/exchange-database/event_listen_cancel.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/event_listen_cancel.h + * @brief implementation of the event_listen_cancel function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_EVENT_LISTEN_CANCEL_H +#define EXCHANGE_DATABASE_EVENT_LISTEN_CANCEL_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Stop notifications. + * + * @param pg the database context + * @param eh handle to unregister. + */ +void +TALER_TALER_EXCHANGEDB_event_listen_cancel (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + struct GNUNET_DB_EventHandler *eh); + +#endif diff --git a/src/include/taler/exchange-database/event_notify.h b/src/include/exchange-database/event_notify.h diff --git a/src/include/exchange-database/expire_purse.h b/src/include/exchange-database/expire_purse.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/expire_purse.h + * @brief implementation of the expire_purse function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_EXPIRE_PURSE_H +#define EXCHANGE_DATABASE_EXPIRE_PURSE_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Function called to clean up one expired purse. + * + * @param pg the database context + * @param start_time select purse expired after this time + * @param end_time select purse expired before this time + * @return transaction status code (#GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no purse expired in the given time interval). + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_expire_purse (struct TALER_EXCHANGEDB_PostgresContext *pg, + struct GNUNET_TIME_Absolute start_time, + struct GNUNET_TIME_Absolute end_time); + +#endif diff --git a/src/include/exchange-database/find_aggregation_transient.h b/src/include/exchange-database/find_aggregation_transient.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2022, 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/find_aggregation_transient.h + * @brief implementation of the find_aggregation_transient function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_FIND_AGGREGATION_TRANSIENT_H +#define EXCHANGE_DATABASE_FIND_AGGREGATION_TRANSIENT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Find existing entry in the transient aggregation table. + * + * @param pg the database context + * @param h_payto destination of the wire transfer + * @param[out] payto_uri corresponding payto URI, to be freed by caller + * @param[out] wtid wire transfer identifier of transient aggregation + * @param[out] merchant_pub public key of the merchant + * @param[out] total amount aggregated so far + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_find_aggregation_transient (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + struct TALER_FullPayto *payto_uri, + struct + TALER_WireTransferIdentifierRawP * + wtid, + struct TALER_MerchantPublicKeyP * + merchant_pub, + struct TALER_Amount *total); + +#endif diff --git a/src/include/taler/exchange-database/free_coin_transaction_list.h b/src/include/exchange-database/free_coin_transaction_list.h diff --git a/src/include/taler/exchange-database/free_reserve_history.h b/src/include/exchange-database/free_reserve_history.h diff --git a/src/include/taler/exchange-database/gc.h b/src/include/exchange-database/gc.h diff --git a/src/include/exchange-database/get_coin_denomination.h b/src/include/exchange-database/get_coin_denomination.h @@ -0,0 +1,45 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_coin_denomination.h + * @brief implementation of the get_coin_denomination function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_COIN_DENOMINATION_H +#define EXCHANGE_DATABASE_GET_COIN_DENOMINATION_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Retrieve the denomination of a known coin. + * + * @param pg the database context + * @param coin_pub the public key of the coin to search for + * @param[out] known_coin_id set to the ID of the coin in the known_coins table + * @param[out] denom_hash where to store the hash of the coins denomination + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_coin_denomination (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_CoinSpendPublicKeyP * + coin_pub, + uint64_t *known_coin_id, + struct TALER_DenominationHashP * + denom_hash); + +#endif diff --git a/src/include/exchange-database/get_coin_transactions.h b/src/include/exchange-database/get_coin_transactions.h @@ -0,0 +1,64 @@ +/* + This file is part of TALER + Copyright (C) 2022, 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file get_coin_transactions.h + * @brief implementation of the get_coin_transactions function + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_COIN_TRANSACTIONS_H +#define EXCHANGE_DATABASE_GET_COIN_TRANSACTIONS_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/free_coin_transaction_list.h" + + +/** + * Compile a list of (historic) transactions performed with the given coin + * (melt, refund, recoup and deposit operations). Should return 0 if the @a + * coin_pub is unknown, otherwise determine @a etag_out and if it is past @a + * etag_in return the history after @a start_off. @a etag_out should be set + * to the last row ID of the given @a coin_pub in the coin history table. + * + * @param pg the database context + * @param begin_transaction true to run this in its own transaction(s) + * @param coin_pub coin to investigate + * @param start_off starting offset from which on to return entries + * @param etag_in up to this offset the client already has a response, do not + * return anything unless @a etag_out will be larger + * @param[out] etag_out set to the latest history offset known for this @a coin_pub + * @param[out] balance set to current balance of the coin + * @param[out] h_denom_pub set to denomination public key of the coin + * @param[out] tlp set to list of transactions, set to NULL if coin has no + * transaction history past @a start_off or if @a etag_in is equal + * to the value written to @a etag_out. + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_coin_transactions ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + bool begin_transaction, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + uint64_t start_off, + uint64_t etag_in, + uint64_t *etag_out, + struct TALER_Amount *balance, + struct TALER_DenominationHashP *h_denom_pub, + struct TALER_EXCHANGEDB_TransactionList **tlp) +; + + +#endif diff --git a/src/include/exchange-database/get_denomination_by_serial.h b/src/include/exchange-database/get_denomination_by_serial.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_denomination_by_serial.h + * @brief implementation of the get_denomination_by_serial function for Postgres + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_GET_DENOMINATION_BY_SERIAL_H +#define EXCHANGE_DATABASE_GET_DENOMINATION_BY_SERIAL_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Fetch information about a denomination for a given serial. + * + * @param pg the database context + * @param denom_serial row in the denomination table + * @param[out] issue set to issue information with value, fees and other info about the coin + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_denomination_by_serial (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + uint64_t denom_serial, + struct + TALER_EXCHANGEDB_DenominationKeyInformation + *issue); + +#endif diff --git a/src/include/exchange-database/get_denomination_info.h b/src/include/exchange-database/get_denomination_info.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022,2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_denomination_info.h + * @brief implementation of the get_denomination_info function for Postgres + * @author Christian Grothoff + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_GET_DENOMINATION_INFO_H +#define EXCHANGE_DATABASE_GET_DENOMINATION_INFO_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Fetch information about a denomination key. + * + * @param pg the database context + * @param denom_pub_hash hash of the public key used for signing coins of this denomination + * @param[out] denom_serial row in the denomination table, might be NULL + * @param[out] issue set to issue information with value, fees and other info about the coin + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_denomination_info (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_DenominationHashP * + denom_pub_hash, + uint64_t *denom_serial, + struct + TALER_EXCHANGEDB_DenominationKeyInformation + * + issue); + +#endif diff --git a/src/include/exchange-database/get_denomination_revocation.h b/src/include/exchange-database/get_denomination_revocation.h @@ -0,0 +1,49 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_denomination_revocation.h + * @brief implementation of the get_denomination_revocation function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_DENOMINATION_REVOCATION_H +#define EXCHANGE_DATABASE_GET_DENOMINATION_REVOCATION_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Obtain information about a denomination key's revocation from + * the database. + * + * @param pg the database context + * @param denom_pub_hash hash of the revoked denomination key + * @param[out] master_sig signature affirming the revocation + * @param[out] rowid row where the information is stored + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_denomination_revocation (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_DenominationHashP * + denom_pub_hash, + struct TALER_MasterSignatureP * + master_sig, + uint64_t *rowid); + +#endif diff --git a/src/include/exchange-database/get_drain_profit.h b/src/include/exchange-database/get_drain_profit.h @@ -0,0 +1,55 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_drain_profit.h + * @brief implementation of the get_drain_profit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_DRAIN_PROFIT_H +#define EXCHANGE_DATABASE_GET_DRAIN_PROFIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to get information about a profit drain event. + * + * @param pg the database context + * @param wtid wire transfer ID to look up drain event for + * @param[out] serial set to serial ID of the entry + * @param[out] account_section set to account to drain + * @param[out] payto_uri set to account to wire funds to + * @param[out] request_timestamp set to time of the signature + * @param[out] amount set to amount to wire + * @param[out] master_sig set to signature affirming the operation + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_drain_profit (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_WireTransferIdentifierRawP *wtid + , + uint64_t *serial, + char **account_section, + struct TALER_FullPayto *payto_uri, + struct GNUNET_TIME_Timestamp * + request_timestamp, + struct TALER_Amount *amount, + struct TALER_MasterSignatureP *master_sig); + +#endif diff --git a/src/include/taler/exchange-database/get_expired_reserves.h b/src/include/exchange-database/get_expired_reserves.h diff --git a/src/include/exchange-database/get_extension_manifest.h b/src/include/exchange-database/get_extension_manifest.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_extension_manifest.h + * @brief implementation of the get_extension_manifest function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_EXTENSION_MANIFEST_H +#define EXCHANGE_DATABASE_GET_EXTENSION_MANIFEST_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to get the manifest of an extension + * (age-restriction, policy_extension_...) + * + * @param pg the database context + * @param extension_name the name of the extension + * @param[out] manifest JSON object of the manifest as string + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_extension_manifest (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *extension_name, + char **manifest); + +#endif diff --git a/src/include/exchange-database/get_global_fee.h b/src/include/exchange-database/get_global_fee.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_global_fee.h + * @brief implementation of the get_global_fee function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_GLOBAL_FEE_H +#define EXCHANGE_DATABASE_GET_GLOBAL_FEE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Obtain global fees from database. + * + * @param pg the database context + * @param date for which date do we want the fee? + * @param[out] start_date when does the fee go into effect + * @param[out] end_date when does the fee end being valid + * @param[out] fees how high are the wire fees + * @param[out] purse_timeout set to how long we keep unmerged purses + * @param[out] history_expiration set to how long we keep account histories + * @param[out] purse_account_limit set to the number of free purses per account + * @param[out] master_sig signature over the above by the exchange master key + * @return status of the transaction + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_global_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, + struct GNUNET_TIME_Timestamp date, + struct GNUNET_TIME_Timestamp *start_date, + struct GNUNET_TIME_Timestamp *end_date, + struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative *purse_timeout, + struct GNUNET_TIME_Relative *history_expiration + , + uint32_t *purse_account_limit, + struct TALER_MasterSignatureP *master_sig); + +#endif diff --git a/src/include/exchange-database/get_global_fees.h b/src/include/exchange-database/get_global_fees.h @@ -0,0 +1,93 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_global_fees.h + * @brief implementation of the get_global_fees function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_GLOBAL_FEES_H +#define EXCHANGE_DATABASE_GET_GLOBAL_FEES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Provide information about global fees. + * + * @param cls closure + * @param fees the global fees we charge + * @param purse_timeout when do purses time out + * @param history_expiration how long are account histories preserved + * @param purse_account_limit how many purses are free per account + * @param start_date from when are these fees valid (start date) + * @param end_date until when are these fees valid (end date, exclusive) + * @param master_sig master key signature affirming that this is the correct + * fee (of purpose #TALER_SIGNATURE_MASTER_GLOBAL_FEES) + */ +typedef void +(*TALER_EXCHANGEDB_GlobalFeeCallback)( + void *cls, + const struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative purse_timeout, + struct GNUNET_TIME_Relative history_expiration, + uint32_t purse_account_limit, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_MasterSignatureP *master_sig); + + +/* Callback typedefs */ +/** + * Provide information about global fees. + * + * @param cls closure + * @param fees the global fees we charge + * @param purse_timeout when do purses time out + * @param history_expiration how long are account histories preserved + * @param purse_account_limit how many purses are free per account + * @param start_date from when are these fees valid (start date) + * @param end_date until when are these fees valid (end date, exclusive) + * @param master_sig master key signature affirming that this is the correct + * fee (of purpose #TALER_SIGNATURE_MASTER_GLOBAL_FEES) + */ +typedef void +(*TALER_EXCHANGEDB_GlobalFeeCallback)( + void *cls, + const struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative purse_timeout, + struct GNUNET_TIME_Relative history_expiration, + uint32_t purse_account_limit, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_MasterSignatureP *master_sig); + +/** + * Obtain global fees from database. + * + * @param pg the database context + * @param cb function to call on each fee entry + * @param cb_cls closure for @a cb + * @return status of the transaction + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_get_global_fees (struct + TALER_EXCHANGEDB_PostgresContext *pg, + TALER_EXCHANGEDB_GlobalFeeCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/get_known_coin.h b/src/include/exchange-database/get_known_coin.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_known_coin.h + * @brief implementation of the get_known_coin function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_KNOWN_COIN_H +#define EXCHANGE_DATABASE_GET_KNOWN_COIN_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Retrieve the record for a known coin. + * + * @param pg the database context + * @param coin_pub the public key of the coin to search for + * @param coin_info place holder for the returned coin information object + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_known_coin (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_CoinSpendPublicKeyP * + coin_pub, + struct TALER_CoinPublicInfo *coin_info); + +#endif diff --git a/src/include/exchange-database/get_kyc_rules.h b/src/include/exchange-database/get_kyc_rules.h @@ -0,0 +1,76 @@ +/* + This file is part of TALER + Copyright (C) 2022-2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_kyc_rules.h + * @brief implementation of the get_kyc_rules function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_KYC_RULES_H +#define EXCHANGE_DATABASE_GET_KYC_RULES_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Return KYC rules that apply to the given account. + * + * @param pg the database context + * @param h_payto account identifier + * @param merchant_pub merchant public key used by the client, or NULL + * if not available; if multiple @a reserve_pub values could be returned, + * we should use this one + * @param[out] no_account_pub set to true if no @a account_pub is available + * @param[out] account_pub set to account public key the rules + * apply to (because this key was used in KYC auth) + * @param[out] no_reserve_pub set to true if no @a reserve_pub is available + * @param[out] reserve_pub set to last incoming reserve public key + * of a wire transfer to the exchange from the given @a h_payto + * apply to (because this key was used in KYC auth) + * @param[out] jrules set to the active KYC rules for the + * given account, set to NULL if no custom rules are active + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_kyc_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_NormalizedPaytoHashP *h_payto + , + const struct TALER_MerchantPublicKeyP * + merchant_pub, + bool *no_account_pub, + union TALER_AccountPublicKeyP *account_pub, + bool *no_reserve_pub, + struct TALER_ReservePublicKeyP *reserve_pub, + json_t **jrules); + + +/** + * Return only the KYC rules that apply to the given account. + * + * @param pg the database context + * @param h_payto account identifier + * @param[out] jrules set to the active KYC rules for the + * given account, set to NULL if no custom rules are active + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_get_kyc_rules2 (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_NormalizedPaytoHashP * + h_payto, + json_t **jrules); + +#endif diff --git a/src/include/exchange-database/get_old_coin_by_h_blind.h b/src/include/exchange-database/get_old_coin_by_h_blind.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_old_coin_by_h_blind.h + * @brief implementation of the get_old_coin_by_h_blind function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_OLD_COIN_BY_H_BLIND_H +#define EXCHANGE_DATABASE_GET_OLD_COIN_BY_H_BLIND_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Obtain information about which old coin a coin was refreshed + * given the hash of the blinded (fresh) coin. + * + * @param pg the database context + * @param h_blind_ev hash of the blinded coin + * @param[out] old_coin_pub set to information about the old coin (on success only) + * @param[out] rrc_serial set to serial number of the entry in the database + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_old_coin_by_h_blind (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_BlindedCoinHashP * + h_blind_ev, + struct TALER_CoinSpendPublicKeyP * + old_coin_pub, + uint64_t *rrc_serial); + +#endif diff --git a/src/include/exchange-database/get_pending_kyc_requirement_process.h b/src/include/exchange-database/get_pending_kyc_requirement_process.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_pending_kyc_requirement_process.h + * @brief implementation of the get_pending_kyc_requirement_process function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_PENDING_KYC_REQUIREMENT_PROCESS_H +#define EXCHANGE_DATABASE_GET_PENDING_KYC_REQUIREMENT_PROCESS_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Fetch information about pending KYC requirement process. + * + * @param pg the database context + * @param h_payto account that must be KYC'ed + * @param provider_name provider that must be checked + * @param[out] redirect_url set to redirect URL for the process + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_pending_kyc_requirement_process (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_NormalizedPaytoHashP + * + h_payto, + const char *provider_name, + char **redirect_url); + +#endif diff --git a/src/include/exchange-database/get_policy_details.h b/src/include/exchange-database/get_policy_details.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_policy_details.h + * @brief implementation of the get_policy_details function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_POLICY_DETAILS_H +#define EXCHANGE_DATABASE_GET_POLICY_DETAILS_H + +#include "taler/taler_exchangedb_lib.h" +#include "taler/taler_extensions_policy.h" + + +/** + * Get the details of a policy, referenced by its hash code + * + * @param pg the database context + * @param hc The hash code under which the details to a particular policy should be found + * @param[out] details The found details + * @return query execution status + * */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_policy_details (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct GNUNET_HashCode *hc, + struct TALER_PolicyDetails *details); + +#endif diff --git a/src/include/exchange-database/get_purse_deposit.h b/src/include/exchange-database/get_purse_deposit.h @@ -0,0 +1,55 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_purse_deposit.h + * @brief implementation of the get_purse_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_PURSE_DEPOSIT_H +#define EXCHANGE_DATABASE_GET_PURSE_DEPOSIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to obtain a coin deposit data from + * depositing the coin into a purse. + * + * @param pg the database context + * @param purse_pub purse to credit + * @param coin_pub coin to deposit (debit) + * @param[out] amount set fraction of the coin's value that was deposited (with fee) + * @param[out] h_denom_pub set to hash of denomination of the coin + * @param[out] phac set to hash of age restriction on the coin + * @param[out] coin_sig set to signature affirming the operation + * @param[out] partner_url set to the URL of the partner exchange, or NULL for ourselves, must be freed by caller + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_purse_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_CoinSpendPublicKeyP * + coin_pub, + struct TALER_Amount *amount, + struct TALER_DenominationHashP *h_denom_pub, + struct TALER_AgeCommitmentHashP *phac, + struct TALER_CoinSpendSignatureP *coin_sig, + char **partner_url); + +#endif diff --git a/src/include/exchange-database/get_purse_request.h b/src/include/exchange-database/get_purse_request.h @@ -0,0 +1,62 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + + +/** + * @file src/include/exchange-database/get_purse_request.h + * @brief implementation of the get_purse_request function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_PURSE_REQUEST_H +#define EXCHANGE_DATABASE_GET_PURSE_REQUEST_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to return meta data about a purse by the + * purse public key. + * + * @param pg the database context + * @param purse_pub public key of the purse + * @param[out] merge_pub public key representing the merge capability + * @param[out] purse_expiration when would an unmerged purse expire + * @param[out] h_contract_terms contract associated with the purse + * @param[out] age_limit the age limit for deposits into the purse + * @param[out] target_amount amount to be put into the purse + * @param[out] balance amount put so far into the purse + * @param[out] purse_sig signature of the purse over the initialization data + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_purse_request (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + struct TALER_PurseMergePublicKeyP *merge_pub + , + struct GNUNET_TIME_Timestamp * + purse_expiration, + struct TALER_PrivateContractHashP * + h_contract_terms, + uint32_t *age_limit, + struct TALER_Amount *target_amount, + struct TALER_Amount *balance, + struct TALER_PurseContractSignatureP * + purse_sig); + +#endif diff --git a/src/include/exchange-database/get_ready_deposit.h b/src/include/exchange-database/get_ready_deposit.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_ready_deposit.h + * @brief implementation of the get_ready_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_READY_DEPOSIT_H +#define EXCHANGE_DATABASE_GET_READY_DEPOSIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Obtain information about deposits that are ready to be executed. Such + * deposits must not be marked as "done", the execution time must be + * in the past, and the KYC status must be 'ok'. + * + * @param pg the database context + * @param start_shard_row minimum shard row to select + * @param end_shard_row maximum shard row to select (inclusive) + * @param[out] merchant_pub set to the public key of a merchant with a ready deposit + * @param[out] payto_uri set to the account of the merchant, to be freed by caller + * @param[out] extra_wire_subject_metadata set to additional metadata to include in the wire subject, or NULL for none + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_ready_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, + uint64_t start_shard_row, + uint64_t end_shard_row, + struct TALER_MerchantPublicKeyP * + merchant_pub, + struct TALER_FullPayto *payto_uri, + char **extra_wire_subject_metadata); + +#endif diff --git a/src/include/exchange-database/get_refresh.h b/src/include/exchange-database/get_refresh.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_refresh.h + * @brief implementation of the get_refresh function for Postgres + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_GET_REFRESH_H +#define EXCHANGE_DATABASE_GET_REFRESH_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Lookup refresh refresh commitment data under the given @a rc. + * + * @param pg the database context + * @param rc commitment hash to use to locate the operation + * @param[out] refresh where to store the result; note that + * refresh->session.coin.denom_sig will be set to NULL + * and is not fetched by this routine (as it is not needed by the client) + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_refresh (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_RefreshCommitmentP *rc, + struct TALER_EXCHANGEDB_Refresh_vDOLDPLUS *refresh + ); + +#endif diff --git a/src/include/exchange-database/get_reserve_balance.h b/src/include/exchange-database/get_reserve_balance.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_reserve_balance.h + * @brief implementation of the get_reserve_balance function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_RESERVE_BALANCE_H +#define EXCHANGE_DATABASE_GET_RESERVE_BALANCE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Get the balance of the specified reserve. + * + * @param pg the database context + * @param reserve_pub public key of the reserve + * @param[out] balance set to the reserve balance + * @param[out] origin_account set to URI of the origin account, NULL + * if we have no origin account (reserve created by P2P merge) +* @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_reserve_balance (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_ReservePublicKeyP * + reserve_pub, + struct TALER_Amount *balance, + struct TALER_FullPayto *origin_account); + +#endif diff --git a/src/include/exchange-database/get_reserve_by_h_planchets.h b/src/include/exchange-database/get_reserve_by_h_planchets.h @@ -0,0 +1,49 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_reserve_by_h_planchets.h + * @brief implementation of the get_reserve_by_h_planchets function for Postgres + * @author Christian Grothoff + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_GET_RESERVE_BY_H_PLANCHETS_H +#define EXCHANGE_DATABASE_GET_RESERVE_BY_H_PLANCHETS_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Obtain information about which reserve a coin was generated + * from given the hash of the blinded coin. + * + * @param pg the database context + * @param h_planchets hash that uniquely identifies the withdraw request + * @param[out] reserve_pub set to information about the reserve (on success only) + * @param[out] withdraw_serial_id set to row of the @a h_commitment in withdraw + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_reserve_by_h_planchets (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_HashBlindedPlanchetsP * + h_planchets, + struct TALER_ReservePublicKeyP * + reserve_pub, + uint64_t *withdraw_serial_id); + +#endif diff --git a/src/include/exchange-database/get_reserve_history.h b/src/include/exchange-database/get_reserve_history.h @@ -0,0 +1,59 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file get_reserve_history.h + * @brief implementation of the get_reserve_history function + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_RESERVE_HISTORY_H +#define EXCHANGE_DATABASE_GET_RESERVE_HISTORY_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/free_reserve_history.h" + + +/** + * Compile a list of (historic) transactions performed with the given reserve + * (withdraw, incoming wire, open, close operations). Should return 0 if the @a + * reserve_pub is unknown, otherwise determine @a etag_out and if it is past @a + * etag_in return the history after @a start_off. @a etag_out should be set + * to the last row ID of the given @a reserve_pub in the reserve history table. + * + * @param pg the database context + * @param reserve_pub public key of the reserve + * @param start_off maximum starting offset in history to exclude from returning + * @param etag_in up to this offset the client already has a response, do not + * return anything unless @a etag_out will be larger + * @param[out] etag_out set to the latest history offset known for this @a coin_pub + * @param[out] balance set to the reserve balance + * @param[out] rhp set to known transaction history (NULL if reserve is unknown) + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_reserve_history (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_ReservePublicKeyP * + reserve_pub, + uint64_t start_off, + uint64_t etag_in, + uint64_t *etag_out, + struct TALER_Amount *balance, + struct TALER_EXCHANGEDB_ReserveHistory ** + rhp); + + +#endif diff --git a/src/include/exchange-database/get_signature_for_known_coin.h b/src/include/exchange-database/get_signature_for_known_coin.h @@ -0,0 +1,50 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_signature_for_known_coin.h + * @brief implementation of the get_signature_for_known_coin function for Postgres + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_GET_SIGNATURE_FOR_KNOWN_COIN_H +#define EXCHANGE_DATABASE_GET_SIGNATURE_FOR_KNOWN_COIN_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Retrieve the denomination and the corresponding signature for a known coin. + * + * @param pg the database context + * @param coin_pub the public key of the coin to search for + * @param[out] denom_pub the denomination of the public key, if coin was present + * @param[out] denom_sig the signature with the denomination key of the coin, if coin was present + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_signature_for_known_coin (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_CoinSpendPublicKeyP * + coin_pub, + struct + TALER_DenominationPublicKey * + denom_pub, + struct + TALER_DenominationSignature * + denom_sig); + +#endif diff --git a/src/include/taler/exchange-database/get_unfinished_close_requests.h b/src/include/exchange-database/get_unfinished_close_requests.h diff --git a/src/include/exchange-database/get_wire_accounts.h b/src/include/exchange-database/get_wire_accounts.h @@ -0,0 +1,100 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_wire_accounts.h + * @brief implementation of the get_wire_accounts function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_WIRE_ACCOUNTS_H +#define EXCHANGE_DATABASE_GET_WIRE_ACCOUNTS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Provide information about a wire account. + * + * @param cls closure + * @param payto_uri the exchange bank account URI + * @param conversion_url URL of a conversion service, NULL if there is no conversion + * @param open_banking_gateway open banking gateway service, NULL if unavailable + * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable + * @param debit_restrictions JSON array with debit restrictions on the account + * @param credit_restrictions JSON array with credit restrictions on the account + * @param master_sig master key signature affirming that this is a bank + * account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS) + * @param bank_label label the wallet should use to display the account, can be NULL + * @param priority priority for ordering bank account labels + */ +typedef void +(*TALER_EXCHANGEDB_WireAccountCallback)( + void *cls, + const struct TALER_FullPayto payto_uri, + const char *conversion_url, + const char *open_banking_gateway, + const char *wire_transfer_gateway, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + const struct TALER_MasterSignatureP *master_sig, + const char *bank_label, + int64_t priority); + + +/* Callback typedefs */ +/** + * Provide information about a wire account. + * + * @param cls closure + * @param payto_uri the exchange bank account URI + * @param conversion_url URL of a conversion service, NULL if there is no conversion + * @param open_banking_gateway open banking gateway service, NULL if unavailable + * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable + * @param debit_restrictions JSON array with debit restrictions on the account + * @param credit_restrictions JSON array with credit restrictions on the account + * @param master_sig master key signature affirming that this is a bank + * account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS) + * @param bank_label label the wallet should use to display the account, can be NULL + * @param priority priority for ordering bank account labels + */ +typedef void +(*TALER_EXCHANGEDB_WireAccountCallback)( + void *cls, + const struct TALER_FullPayto payto_uri, + const char *conversion_url, + const char *open_banking_gateway, + const char *wire_transfer_gateway, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + const struct TALER_MasterSignatureP *master_sig, + const char *bank_label, + int64_t priority); + +/** + * Obtain information about the enabled wire accounts of the exchange. + * + * @param pg the database context + * @param cb function to call on each account + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_wire_accounts (struct TALER_EXCHANGEDB_PostgresContext *pg, + TALER_EXCHANGEDB_WireAccountCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/get_wire_fee.h b/src/include/exchange-database/get_wire_fee.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_wire_fee.h + * @brief implementation of the get_wire_fee function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_WIRE_FEE_H +#define EXCHANGE_DATABASE_GET_WIRE_FEE_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Obtain wire fee from database. + * + * @param pg the database context + * @param type type of wire transfer the fee applies for + * @param date for which date do we want the fee? + * @param[out] rowid set to row in the database with the wire fee + * @param[out] start_date when does the fee go into effect + * @param[out] end_date when does the fee end being valid + * @param[out] fees how high are the wire fees + * @param[out] master_sig signature over the above by the exchange master key + * @return status of the transaction + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_wire_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, + const char *type, + struct GNUNET_TIME_Timestamp date, + uint64_t *rowid, + struct GNUNET_TIME_Timestamp *start_date, + struct GNUNET_TIME_Timestamp *end_date, + struct TALER_WireFeeSet *fees, + struct TALER_MasterSignatureP *master_sig); + +#endif diff --git a/src/include/exchange-database/get_wire_fees.h b/src/include/exchange-database/get_wire_fees.h @@ -0,0 +1,84 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_wire_fees.h + * @brief implementation of the get_wire_fees function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_GET_WIRE_FEES_H +#define EXCHANGE_DATABASE_GET_WIRE_FEES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Provide information about wire fees. + * + * @param cls closure + * @param fees the wire fees we charge + * @param start_date from when are these fees valid (start date) + * @param end_date until when are these fees valid (end date, exclusive) + * @param master_sig master key signature affirming that this is the correct + * fee (of purpose #TALER_SIGNATURE_MASTER_WIRE_FEES) + */ +typedef void +(*TALER_EXCHANGEDB_WireFeeCallback)( + void *cls, + const struct TALER_WireFeeSet *fees, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_MasterSignatureP *master_sig); + + +/* Callback typedefs */ +/** + * Provide information about wire fees. + * + * @param cls closure + * @param fees the wire fees we charge + * @param start_date from when are these fees valid (start date) + * @param end_date until when are these fees valid (end date, exclusive) + * @param master_sig master key signature affirming that this is the correct + * fee (of purpose #TALER_SIGNATURE_MASTER_WIRE_FEES) + */ +typedef void +(*TALER_EXCHANGEDB_WireFeeCallback)( + void *cls, + const struct TALER_WireFeeSet *fees, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_MasterSignatureP *master_sig); + +/** + * Obtain information about the fee structure of the exchange for + * a given @a wire_method + * + * @param pg the database context + * @param wire_method which wire method to obtain fees for + * @param cb function to call on each account + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_get_wire_fees (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const char *wire_method, + TALER_EXCHANGEDB_WireFeeCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/get_wire_hash_for_contract.h b/src/include/exchange-database/get_wire_hash_for_contract.h @@ -0,0 +1,52 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_wire_hash_for_contract.h + * @brief implementation of the get_wire_hash_for_contract function for Postgres + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_GET_WIRE_HASH_FOR_CONTRACT_H +#define EXCHANGE_DATABASE_GET_WIRE_HASH_FOR_CONTRACT_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Try to get the salted hash of a merchant's bank account to a deposit + * contract. This is necessary in the event of a conflict with a given + * (merchant_pub, h_contract_terms) during deposit. + * + * @param pg the database context + * @param merchant_pub merchant public key + * @param h_contract_terms hash of the proposal data + * @param[out] h_wire salted hash of a merchant's bank account + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_wire_hash_for_contract (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_MerchantPublicKeyP * + merchant_pub, + const struct + TALER_PrivateContractHashP * + h_contract_terms, + struct TALER_MerchantWireHashP * + h_wire); + +#endif diff --git a/src/include/exchange-database/get_withdraw.h b/src/include/exchange-database/get_withdraw.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/get_withdraw.h + * @brief implementation of the get_withdraw function for Postgres + * @author Özgür KESIM + */ +#ifndef EXCHANGE_DATABASE_GET_WITHDRAW_H +#define EXCHANGE_DATABASE_GET_WITHDRAW_H + +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/free_reserve_history.h" + + +/** + * Locate the response for a withdraw request under a hash that uniquely + * identifies the withdraw operation. Used to ensure idempotency of the + * request. + * + * @param pg the database context + * @param wch hash over all hashes of blinded planchets that uniquely identifies the withdraw operation + * @param[out] wd corresponding details of the previous withdraw request if an entry was found + * @return statement execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_get_withdraw (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_HashBlindedPlanchetsP *wch, + struct TALER_EXCHANGEDB_Withdraw *wd); + +#endif diff --git a/src/include/exchange-database/have_deposit2.h b/src/include/exchange-database/have_deposit2.h @@ -0,0 +1,57 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/have_deposit2.h + * @brief implementation of the have_deposit2 function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_HAVE_DEPOSIT2_H +#define EXCHANGE_DATABASE_HAVE_DEPOSIT2_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Check if we have the specified deposit already in the database. + * + * @param pg the database context + * @param h_contract_terms contract to check for + * @param h_wire wire hash to check for + * @param coin_pub public key of the coin to check for + * @param merchant merchant public key to check for + * @param refund_deadline expected refund deadline + * @param[out] deposit_fee set to the deposit fee the exchange charged + * @param[out] exchange_timestamp set to the time when the exchange received the deposit + * @return 1 if we know this operation, + * 0 if this exact deposit is unknown to us, + * otherwise transaction error status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_have_deposit2 (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PrivateContractHashP * + h_contract_terms, + const struct TALER_MerchantWireHashP *h_wire, + const struct TALER_CoinSpendPublicKeyP *coin_pub + , + const struct TALER_MerchantPublicKeyP *merchant, + struct GNUNET_TIME_Timestamp refund_deadline, + struct TALER_Amount *deposit_fee, + struct GNUNET_TIME_Timestamp *exchange_timestamp + ); + +#endif diff --git a/src/include/exchange-database/inject_auditor_triggers.h b/src/include/exchange-database/inject_auditor_triggers.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/inject_auditor_triggers.h + * @brief implementation of the inject_auditor_triggers function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INJECT_AUDITOR_TRIGGERS_H +#define EXCHANGE_DATABASE_INJECT_AUDITOR_TRIGGERS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to inject auditor triggers into the + * database, triggering the real-time auditor upon + * relevant INSERTs. + * + * @param pg the database context + * @return #GNUNET_OK on success, + * #GNUNET_SYSERR on DB errors + */ +enum GNUNET_GenericReturnValue +TALER_EXCHANGEDB_inject_auditor_triggers (struct + TALER_EXCHANGEDB_PostgresContext *pg); + + +#endif diff --git a/src/include/exchange-database/insert_active_legitimization_measure.h b/src/include/exchange-database/insert_active_legitimization_measure.h @@ -0,0 +1,53 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_active_legitimization_measure.h + * @brief implementation of the insert_active_legitimization_measure function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_ACTIVE_LEGITIMIZATION_MEASURE_H +#define EXCHANGE_DATABASE_INSERT_ACTIVE_LEGITIMIZATION_MEASURE_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Create new active legitimization measure. + * + * + * @param pg the database context + * @param access_token access token that identifies the + * account the legitimization measures apply to + * @param jmeasures new legitimization measures + * @param[out] legitimization_measure_serial_id + * set to new row in legitimization_measures table + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_active_legitimization_measure (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + const struct + TALER_AccountAccessTokenP + * + access_token, + const json_t *jmeasures, + uint64_t * + legitimization_measure_serial_id); + + +#endif diff --git a/src/include/exchange-database/insert_aml_decision.h b/src/include/exchange-database/insert_aml_decision.h @@ -0,0 +1,101 @@ +/* + This file is part of TALER + Copyright (C) 2022, 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_aml_decision.h + * @brief implementation of the insert_aml_decision function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_AML_DECISION_H +#define EXCHANGE_DATABASE_INSERT_AML_DECISION_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert an AML decision. Inserts into AML history and insert or updates AML + * status. + * + * @param pg the database context + * @param payto_uri full URI of the account, optional, + * can be NULL if the backend already knows the account + * @param h_payto account for which the attribute data is stored + * @param decision_time when was the decision made + * @param expiration_time when does the decision expire + * @param properties JSON object with properties to set for the account + * @param new_rules JSON array with new AML/KYC rules + * @param to_investigate true if AML staff should look more into this account + * @param new_measure_name name of the @a jmeasures measure that was triggered, or NULL for none + * @param jmeasures a JSON with LegitimizationMeasures to apply to the + * account, or NULL to not apply any measure right now + * @param justification human-readable text justifying the decision + * @param decider_pub public key of the staff member + * @param decider_sig signature of the staff member + * @param num_events length of the @a events array + * @param events array of events to trigger + * @param enc_attributes_size number of bytes in @a enc_attributes + * @param enc_attributes encrypted attribute data + * @param form_name name of the form from which @a enc_attributes originate, can be NULL + * @param attributes_hash hash of the unencrypted attribute data + * @param attributes_expiration_time when does the attribute data expire + * @param[out] invalid_officer set to TRUE if @a decider_pub is not allowed to make decisions right now + * @param[out] unknown_account set to TRUE if @a h_payto does not refer to a known account and @a jmeasures was given + * @param[out] last_date set to the previous decision time; + * the INSERT is not performed if @a last_date is not before @a decision_time + * @param[out] legitimization_measure_serial_id serial ID of the legitimization measures + * of the decision + * @param[out] is_wallet set to true if @a h_payto is for a wallet + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_aml_decision (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_FullPayto payto_uri, + const struct TALER_NormalizedPaytoHashP * + h_payto + , + struct GNUNET_TIME_Timestamp decision_time + , + struct GNUNET_TIME_Timestamp + expiration_time, + const json_t *properties, + const json_t *new_rules, + bool to_investigate, + const char *new_measure_name, + const json_t *jmeasures, + const char *justification, + const struct TALER_AmlOfficerPublicKeyP * + decider_pub, + const struct TALER_AmlOfficerSignatureP * + decider_sig, + size_t num_events, + const char *events[static num_events], + const char *form_name, + size_t enc_attributes_size, + const void *enc_attributes, + struct GNUNET_HashCode *attributes_hash, + struct GNUNET_TIME_Timestamp + attributes_expiration_time, + bool *invalid_officer, + bool *unknown_account, + struct GNUNET_TIME_Timestamp *last_date, + uint64_t *legitimization_measure_serial_id + , + bool *is_wallet); + + +#endif diff --git a/src/include/exchange-database/insert_aml_officer.h b/src/include/exchange-database/insert_aml_officer.h @@ -0,0 +1,58 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_aml_officer.h + * @brief implementation of the insert_aml_officer function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_AML_OFFICER_H +#define EXCHANGE_DATABASE_INSERT_AML_OFFICER_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert AML staff record. If the time given in + * @a last_change is before the previous change in the + * database, only @e previous_change is returned and + * no actual change is committed to the database. + * + * @param pg the database context + * @param decider_pub public key of the staff member + * @param master_sig offline signature affirming the AML officer + * @param decider_name full name of the staff member + * @param is_active true to enable, false to set as inactive + * @param read_only true to set read-only access + * @param last_change when was the change made effective + * @param[out] previous_change set to the time of the previous change + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_aml_officer (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct TALER_AmlOfficerPublicKeyP * + decider_pub, + const struct TALER_MasterSignatureP * + master_sig, + const char *decider_name, + bool is_active, + bool read_only, + struct GNUNET_TIME_Timestamp last_change, + struct GNUNET_TIME_Timestamp * + previous_change); + +#endif diff --git a/src/include/exchange-database/insert_aml_program_failure.h b/src/include/exchange-database/insert_aml_program_failure.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_aml_program_failure.h + * @brief implementation of the insert_aml_program_failure function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_AML_PROGRAM_FAILURE_H +#define EXCHANGE_DATABASE_INSERT_AML_PROGRAM_FAILURE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Update AML program status to finished (and failed). + * + * @param pg the database context + * @param process_row KYC process row to update + * @param h_payto account for which the attribute data is stored + * @param error_message details about what went wrong + * @param ec error code about the failure + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_aml_program_failure (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + uint64_t process_row, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + const char *error_message, + enum TALER_ErrorCode ec); + + +#endif diff --git a/src/include/exchange-database/insert_auditor.h b/src/include/exchange-database/insert_auditor.h @@ -0,0 +1,47 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_auditor.h + * @brief implementation of the insert_auditor function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_AUDITOR_H +#define EXCHANGE_DATABASE_INSERT_AUDITOR_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert information about an auditor that will audit this exchange. + * + * @param pg the database context + * @param auditor_pub key of the auditor + * @param auditor_url base URL of the auditor's REST service + * @param auditor_name name of the auditor (for humans) + * @param start_date date when the auditor was added by the offline system + * (only to be used for replay detection) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_auditor (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_AuditorPublicKeyP * + auditor_pub, + const char *auditor_url, + const char *auditor_name, + struct GNUNET_TIME_Timestamp start_date); + +#endif diff --git a/src/include/exchange-database/insert_auditor_denom_sig.h b/src/include/exchange-database/insert_auditor_denom_sig.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_auditor_denom_sig.h + * @brief implementation of the insert_auditor_denom_sig function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_AUDITOR_DENOM_SIG_H +#define EXCHANGE_DATABASE_INSERT_AUDITOR_DENOM_SIG_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert information about an auditor auditing a denomination key. + * + * @param pg the database context + * @param h_denom_pub the audited denomination + * @param auditor_pub the auditor's key + * @param auditor_sig signature affirming the auditor's audit activity + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_insert_auditor_denom_sig (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_DenominationHashP * + h_denom_pub, + const struct + TALER_AuditorPublicKeyP * + auditor_pub, + const struct + TALER_AuditorSignatureP * + auditor_sig); + +#endif diff --git a/src/include/taler/exchange-database/insert_close_request.h b/src/include/exchange-database/insert_close_request.h diff --git a/src/include/exchange-database/insert_contract.h b/src/include/exchange-database/insert_contract.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_contract.h + * @brief implementation of the insert_contract function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_CONTRACT_H +#define EXCHANGE_DATABASE_INSERT_CONTRACT_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to persist an encrypted contract associated with a reserve. + * + * @param pg the database context + * @param purse_pub the purse the contract is associated with (must exist) + * @param econtract the encrypted contract + * @param[out] in_conflict set to true if @a econtract + * conflicts with an existing contract; + * in this case, the return value will be + * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_contract (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_EncryptedContract * + econtract, + bool *in_conflict); + +#endif diff --git a/src/include/exchange-database/insert_denomination_info.h b/src/include/exchange-database/insert_denomination_info.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_denomination_info.h + * @brief implementation of the insert_denomination_info function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_DENOMINATION_INFO_H +#define EXCHANGE_DATABASE_INSERT_DENOMINATION_INFO_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Insert a denomination key's public information into the database for + * reference by auditors and other consistency checks. + * + * @param pg the database context + * @param denom_pub the public key used for signing coins of this denomination + * @param issue issuing information with value, fees and other info about the coin + * @return status of the query + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_denomination_info (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_DenominationPublicKey * + denom_pub, + const struct + TALER_EXCHANGEDB_DenominationKeyInformation + *issue); + +#endif diff --git a/src/include/exchange-database/insert_denomination_revocation.h b/src/include/exchange-database/insert_denomination_revocation.h @@ -0,0 +1,49 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_denomination_revocation.h + * @brief implementation of the insert_denomination_revocation function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_DENOMINATION_REVOCATION_H +#define EXCHANGE_DATABASE_INSERT_DENOMINATION_REVOCATION_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Store information that a denomination key was revoked + * in the database. + * + * @param pg the database context + * @param denom_pub_hash hash of the revoked denomination key + * @param master_sig signature affirming the revocation + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_denomination_revocation (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + const struct + TALER_DenominationHashP * + denom_pub_hash, + const struct + TALER_MasterSignatureP * + master_sig); + +#endif diff --git a/src/include/exchange-database/insert_drain_profit.h b/src/include/exchange-database/insert_drain_profit.h @@ -0,0 +1,56 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_drain_profit.h + * @brief implementation of the insert_drain_profit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_DRAIN_PROFIT_H +#define EXCHANGE_DATABASE_INSERT_DRAIN_PROFIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to persist a request to drain profits. + * + * @param pg the database context + * @param wtid wire transfer ID to use + * @param account_section account to drain + * @param payto_uri account to wire funds to + * @param request_timestamp when was the request made + * @param amount amount to wire + * @param master_sig signature affirming the operation + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_drain_profit (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_WireTransferIdentifierRawP * + wtid, + const char *account_section, + const struct TALER_FullPayto payto_uri, + struct GNUNET_TIME_Timestamp + request_timestamp, + const struct TALER_Amount *amount, + const struct TALER_MasterSignatureP * + master_sig) +; + +#endif diff --git a/src/include/exchange-database/insert_global_fee.h b/src/include/exchange-database/insert_global_fee.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_global_fee.h + * @brief implementation of the insert_global_fee function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_GLOBAL_FEE_H +#define EXCHANGE_DATABASE_INSERT_GLOBAL_FEE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert global fee data into database. + * + * @param pg the database context + * @param start_date when does the fees go into effect + * @param end_date when does the fees end being valid + * @param fees how high is are the global fees + * @param purse_timeout when do purses time out + * @param history_expiration how long are account histories preserved + * @param purse_account_limit how many purses are free per account + * @param master_sig signature over the above by the exchange master key + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_global_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative purse_timeout, + struct GNUNET_TIME_Relative + history_expiration, + uint32_t purse_account_limit, + const struct TALER_MasterSignatureP * + master_sig); + +#endif diff --git a/src/include/exchange-database/insert_kyc_failure.h b/src/include/exchange-database/insert_kyc_failure.h @@ -0,0 +1,55 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_kyc_failure.h + * @brief implementation of the insert_kyc_failure function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_KYC_FAILURE_H +#define EXCHANGE_DATABASE_INSERT_KYC_FAILURE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Update KYC process status to finished (and failed). + * + * @param pg the database context + * @param process_row KYC process row to update + * @param h_payto account for which the attribute data is stored + * @param provider_name provider that must be checked + * @param provider_account_id provider account ID + * @param provider_legitimization_id provider legitimization ID + * @param error_message details about what went wrong + * @param ec error code about the failure + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_kyc_failure (struct TALER_EXCHANGEDB_PostgresContext *pg + , + uint64_t process_row, + const struct TALER_NormalizedPaytoHashP * + h_payto, + const char *provider_name, + const char *provider_account_id, + const char *provider_legitimization_id, + const char *error_message, + enum TALER_ErrorCode ec); + + +#endif diff --git a/src/include/exchange-database/insert_kyc_requirement_process.h b/src/include/exchange-database/insert_kyc_requirement_process.h @@ -0,0 +1,62 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_kyc_requirement_process.h + * @brief implementation of the insert_kyc_requirement_process function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_KYC_REQUIREMENT_PROCESS_H +#define EXCHANGE_DATABASE_INSERT_KYC_REQUIREMENT_PROCESS_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Begin KYC requirement process. + * + * @param pg the database context + * @param h_payto account that must be KYC'ed + * @param measure_index which of the measures in + * jmeasures does this KYC process relate to + * @param legitimization_measure_serial_id which + * legitimization measure set does this KYC process + * relate to (uniquely identifies jmeasures) + * @param provider_name provider that must be checked + * @param provider_account_id provider account ID + * @param provider_legitimization_id provider legitimization ID + * @param[out] process_row row the process is stored under + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_kyc_requirement_process (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + uint32_t measure_index, + uint64_t + legitimization_measure_serial_id, + const char *provider_name, + const char *provider_account_id + , + const char * + provider_legitimization_id, + uint64_t *process_row); + +#endif diff --git a/src/include/exchange-database/insert_partner.h b/src/include/exchange-database/insert_partner.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_partner.h + * @brief implementation of the insert_partner function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_PARTNER_H +#define EXCHANGE_DATABASE_INSERT_PARTNER_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Function called to store configuration data about a partner + * exchange that we are federated with. + * + * @param pg the database context + * @param master_pub public offline signing key of the partner exchange + * @param start_date when does the following data start to be valid + * @param end_date when does the validity end (exclusive) + * @param wad_frequency how often do we do exchange-to-exchange settlements? + * @param wad_fee how much do we charge for transfers to the partner + * @param partner_base_url base URL of the partner exchange + * @param master_sig signature with our offline signing key affirming the above + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_partner (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_MasterPublicKeyP *master_pub + , + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + struct GNUNET_TIME_Relative wad_frequency, + const struct TALER_Amount *wad_fee, + const char *partner_base_url, + const struct TALER_MasterSignatureP *master_sig + ); + +#endif diff --git a/src/include/exchange-database/insert_purse_request.h b/src/include/exchange-database/insert_purse_request.h @@ -0,0 +1,69 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_purse_request.h + * @brief implementation of the insert_purse_request function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_PURSE_REQUEST_H +#define EXCHANGE_DATABASE_INSERT_PURSE_REQUEST_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to create a new purse with certain meta data. + * + * @param pg the database context + * @param purse_pub public key of the new purse + * @param merge_pub public key providing the merge capability + * @param purse_expiration time when the purse will expire + * @param h_contract_terms hash of the contract for the purse + * @param age_limit age limit to enforce for payments into the purse + * @param flags flags for the operation + * @param purse_fee fee we are allowed to charge to the reserve (depending on @a flags) + * @param amount target amount (with fees) to be put into the purse + * @param purse_sig signature with @a purse_pub's private key affirming the above + * @param[out] in_conflict set to true if the meta data + * conflicts with an existing purse; + * in this case, the return value will be + * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_purse_request (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_PurseMergePublicKeyP * + merge_pub, + struct GNUNET_TIME_Timestamp + purse_expiration, + const struct TALER_PrivateContractHashP * + h_contract_terms, + uint32_t age_limit, + enum TALER_WalletAccountMergeFlags flags, + const struct TALER_Amount *purse_fee, + const struct TALER_Amount *amount, + const struct + TALER_PurseContractSignatureP * + purse_sig, + bool *in_conflict); + +#endif diff --git a/src/include/exchange-database/insert_records_by_table.h b/src/include/exchange-database/insert_records_by_table.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file insert_records_by_table.h + * @brief implementation of the insert_records_by_table function + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_RECORDS_BY_TABLE_H +#define EXCHANGE_DATABASE_INSERT_RECORDS_BY_TABLE_H + +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/lookup_records_by_table.h" + + +/** + * Insert record set into @a table. Used in exchange-auditor database + * replication. + * + * @param pg the database context + * @param td table data to insert + * @return transaction status code, #GNUNET_DB_STATUS_HARD_ERROR if + * @e table in @a tr is not supported + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_records_by_table ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_TableData *td); + + +#endif diff --git a/src/include/exchange-database/insert_refund.h b/src/include/exchange-database/insert_refund.h @@ -0,0 +1,38 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_refund.h + * @brief implementation of the insert_refund function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_REFUND_H +#define EXCHANGE_DATABASE_INSERT_REFUND_H + +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/do_refund.h" + +/** + * Insert information about refunded coin into the database. + * + * @param pg the database context + * @param refund refund information to store + * @return query result status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_refund (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_Refund *refund); + +#endif diff --git a/src/include/exchange-database/insert_reserve_closed.h b/src/include/exchange-database/insert_reserve_closed.h @@ -0,0 +1,58 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_reserve_closed.h + * @brief implementation of the insert_reserve_closed function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_RESERVE_CLOSED_H +#define EXCHANGE_DATABASE_INSERT_RESERVE_CLOSED_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert reserve close operation into database. + * + * @param pg the database context + * @param reserve_pub which reserve is this about? + * @param execution_date when did we perform the transfer? + * @param receiver_account to which account do we transfer? + * @param wtid wire transfer details + * @param amount_with_fee amount we charged to the reserve + * @param closing_fee how high is the closing fee + * @param close_request_row identifies explicit close request, 0 for none + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_reserve_closed (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_ReservePublicKeyP * + reserve_pub, + struct GNUNET_TIME_Timestamp + execution_date, + const struct TALER_FullPayto + receiver_account, + const struct + TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_Amount * + amount_with_fee, + const struct TALER_Amount *closing_fee, + uint64_t close_request_row); + +#endif diff --git a/src/include/taler/exchange-database/insert_reserve_open_deposit.h b/src/include/exchange-database/insert_reserve_open_deposit.h diff --git a/src/include/exchange-database/insert_sanction_list_hit.h b/src/include/exchange-database/insert_sanction_list_hit.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_sanction_list_hit.h + * @brief implementation of the insert_sanction_list_hit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_SANCTION_LIST_HIT_H +#define EXCHANGE_DATABASE_INSERT_SANCTION_LIST_HIT_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Update sanction list hit status of the given account. + * + * @param pg the database context + * @param h_payto account for which the hit is to be stored + * @param to_investigate true to flag account for investigation, + * false to **preserve** existing status + * @param new_rules new KYC rules to apply to the account, NULL to preserve + * existing rules + * @param account_properties new account properties + * @param num_events length of the @a events array + * @param events array of KYC events to trigger + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_sanction_list_hit (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + bool to_investigate, + const json_t *new_rules, + const json_t *account_properties, + unsigned int num_events, + const char **events); + +#endif diff --git a/src/include/exchange-database/insert_signkey_revocation.h b/src/include/exchange-database/insert_signkey_revocation.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_signkey_revocation.h + * @brief implementation of the insert_signkey_revocation function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_SIGNKEY_REVOCATION_H +#define EXCHANGE_DATABASE_INSERT_SIGNKEY_REVOCATION_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Store information about a revoked online signing key. + * + * @param pg the database context + * @param exchange_pub exchange online signing key that was revoked + * @param master_sig signature affirming the revocation + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_signkey_revocation (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + const struct + TALER_ExchangePublicKeyP * + exchange_pub, + const struct + TALER_MasterSignatureP * + master_sig); + +#endif diff --git a/src/include/exchange-database/insert_successor_measure.h b/src/include/exchange-database/insert_successor_measure.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022, 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_successor_measure.h + * @brief implementation of the insert_successor_measure function for Postgres + * @author Florian Dold + */ +#ifndef EXCHANGE_DATABASE_INSERT_SUCCESSOR_MEASURE_H +#define EXCHANGE_DATABASE_INSERT_SUCCESSOR_MEASURE_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_successor_measure (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + struct GNUNET_TIME_Timestamp + decision_time, + const char *new_measure_name, + const json_t *jmeasures, + bool *unknown_account, + struct GNUNET_TIME_Timestamp * + last_date); + + +#endif diff --git a/src/include/exchange-database/insert_wire.h b/src/include/exchange-database/insert_wire.h @@ -0,0 +1,61 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_wire.h + * @brief implementation of the insert_wire function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_WIRE_H +#define EXCHANGE_DATABASE_INSERT_WIRE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert information about an wire account used by this exchange. + * + * @param pg the database context + * @param payto_uri wire account of the exchange + * @param conversion_url URL of a conversion service, NULL if there is no conversion + * @param open_banking_gateway open banking gateway service, NULL if unavailable + * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable + * @param debit_restrictions JSON array with debit restrictions on the account + * @param credit_restrictions JSON array with credit restrictions on the account + * @param start_date date when the account was added by the offline system + * (only to be used for replay detection) + * @param master_sig public signature affirming the existence of the account, + * must be of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS + * @param bank_label label to show this entry under in the UI, can be NULL + * @param priority determines order in which entries are shown in the UI + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_insert_wire (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_FullPayto payto_uri, + const char *conversion_url, + const char *open_banking_gateway, + const char *wire_transfer_gateway, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + struct GNUNET_TIME_Timestamp start_date, + const struct TALER_MasterSignatureP *master_sig, + const char *bank_label, + int64_t priority); + + +#endif diff --git a/src/include/exchange-database/insert_wire_fee.h b/src/include/exchange-database/insert_wire_fee.h @@ -0,0 +1,49 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/insert_wire_fee.h + * @brief implementation of the insert_wire_fee function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_INSERT_WIRE_FEE_H +#define EXCHANGE_DATABASE_INSERT_WIRE_FEE_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert wire transfer fee into database. + * + * @param pg the database context + * @param type type of wire transfer this fee applies for + * @param start_date when does the fee go into effect + * @param end_date when does the fee end being valid + * @param fees how high are the wire fees + * @param master_sig signature over the above by the exchange master key + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_insert_wire_fee (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *type, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_WireFeeSet *fees, + const struct TALER_MasterSignatureP * + master_sig); + +#endif diff --git a/src/include/exchange-database/iterate_active_auditors.h b/src/include/exchange-database/iterate_active_auditors.h @@ -0,0 +1,75 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/iterate_active_auditors.h + * @brief implementation of the iterate_active_auditors function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ITERATE_ACTIVE_AUDITORS_H +#define EXCHANGE_DATABASE_ITERATE_ACTIVE_AUDITORS_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with information about the exchange's auditors. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param auditor_pub the public key of the auditor + * @param auditor_url URL of the REST API of the auditor + * @param auditor_name human readable official name of the auditor + */ +typedef void +(*TALER_EXCHANGEDB_AuditorsCallback)( + void *cls, + const struct TALER_AuditorPublicKeyP *auditor_pub, + const char *auditor_url, + const char *auditor_name); + + +/* Callback typedefs */ +/** + * Function called with information about the exchange's auditors. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param auditor_pub the public key of the auditor + * @param auditor_url URL of the REST API of the auditor + * @param auditor_name human readable official name of the auditor + */ +typedef void +(*TALER_EXCHANGEDB_AuditorsCallback)( + void *cls, + const struct TALER_AuditorPublicKeyP *auditor_pub, + const char *auditor_url, + const char *auditor_name); + +/** + * Function called to invoke @a cb on every active auditor. Disabled + * auditors are skipped. Runs in its own read-only transaction. + * + * @param pg the database context + * @param cb function to call on each active auditor + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_iterate_active_auditors (struct + TALER_EXCHANGEDB_PostgresContext *pg, + TALER_EXCHANGEDB_AuditorsCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/iterate_active_signkeys.h b/src/include/exchange-database/iterate_active_signkeys.h @@ -0,0 +1,79 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/iterate_active_signkeys.h + * @brief implementation of the iterate_active_signkeys function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ITERATE_ACTIVE_SIGNKEYS_H +#define EXCHANGE_DATABASE_ITERATE_ACTIVE_SIGNKEYS_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Signature of a function called with information about the exchange's + * online signing keys. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param exchange_pub public key of the exchange + * @param meta meta data information about the signing type (expirations) + * @param master_sig master signature affirming the validity of this denomination + */ +typedef void +(*TALER_EXCHANGEDB_ActiveSignkeysCallback)( + void *cls, + const struct TALER_ExchangePublicKeyP *exchange_pub, + const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, + const struct TALER_MasterSignatureP *master_sig); + + +/* Callback typedefs */ +/** + * Signature of a function called with information about the exchange's + * online signing keys. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param exchange_pub public key of the exchange + * @param meta meta data information about the signing type (expirations) + * @param master_sig master signature affirming the validity of this denomination + */ +typedef void +(*TALER_EXCHANGEDB_ActiveSignkeysCallback)( + void *cls, + const struct TALER_ExchangePublicKeyP *exchange_pub, + const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, + const struct TALER_MasterSignatureP *master_sig); + +/** + * Function called to invoke @a cb on every non-revoked exchange signing key + * that has been signed by the master key. Revoked and (for signing!) + * expired keys are skipped. Runs in its own read-only transaction. + * + * @param pg the database context + * @param cb function to call on each signing key + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_iterate_active_signkeys (struct + TALER_EXCHANGEDB_PostgresContext *pg, + TALER_EXCHANGEDB_ActiveSignkeysCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/iterate_auditor_denominations.h b/src/include/exchange-database/iterate_auditor_denominations.h @@ -0,0 +1,81 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/iterate_auditor_denominations.h + * @brief implementation of the iterate_auditor_denominations function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H +#define EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with information about the denominations + * audited by the exchange's auditors. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param auditor_pub the public key of an auditor + * @param h_denom_pub hash of a denomination key audited by this auditor + * @param auditor_sig signature from the auditor affirming this + */ +typedef void +(*TALER_EXCHANGEDB_AuditorDenominationsCallback)( + void *cls, + const struct TALER_AuditorPublicKeyP *auditor_pub, + const struct TALER_DenominationHashP *h_denom_pub, + const struct TALER_AuditorSignatureP *auditor_sig); + + +/* Callback typedefs */ +/** + * Function called with information about the denominations + * audited by the exchange's auditors. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param auditor_pub the public key of an auditor + * @param h_denom_pub hash of a denomination key audited by this auditor + * @param auditor_sig signature from the auditor affirming this + */ +typedef void +(*TALER_EXCHANGEDB_AuditorDenominationsCallback)( + void *cls, + const struct TALER_AuditorPublicKeyP *auditor_pub, + const struct TALER_DenominationHashP *h_denom_pub, + const struct TALER_AuditorSignatureP *auditor_sig); + +/** + * Function called to invoke @a cb on every denomination with an active + * auditor. Disabled auditors and denominations without auditor are + * skipped. Runs in its own read-only transaction. + * + * @param pg the database context + * @param cb function to call on each active auditor + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_iterate_auditor_denominations (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + TALER_EXCHANGEDB_AuditorDenominationsCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/iterate_denomination_info.h b/src/include/exchange-database/iterate_denomination_info.h @@ -0,0 +1,80 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/iterate_denomination_info.h + * @brief implementation of the iterate_denomination_info function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ITERATE_DENOMINATION_INFO_H +#define EXCHANGE_DATABASE_ITERATE_DENOMINATION_INFO_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with information about the exchange's denomination keys. + * Note that the 'master' field in @a issue will not yet be initialized when + * this function is called! + * + * @param cls closure + * @param denom_serial table row of the denomination + * @param denom_pub public key of the denomination + * @param issue detailed information about the denomination (value, expiration times, fees); + */ +typedef void +(*TALER_EXCHANGEDB_DenominationCallback)( + void *cls, + uint64_t denom_serial, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); + + +/* Callback typedefs */ +/** + * Function called with information about the exchange's denomination keys. + * Note that the 'master' field in @a issue will not yet be initialized when + * this function is called! + * + * @param cls closure + * @param denom_serial table row of the denomination + * @param denom_pub public key of the denomination + * @param issue detailed information about the denomination (value, expiration times, fees); + */ +typedef void +(*TALER_EXCHANGEDB_DenominationCallback)( + void *cls, + uint64_t denom_serial, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); + +/** + * Fetch information about all known denomination keys. + * + * @param pg the database context + * @param cb function to call on each denomination key + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_iterate_denomination_info (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + TALER_EXCHANGEDB_DenominationCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/iterate_denominations.h b/src/include/exchange-database/iterate_denominations.h @@ -0,0 +1,68 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/iterate_denominations.h + * @brief implementation of the iterate_denominations function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ITERATE_DENOMINATIONS_H +#define EXCHANGE_DATABASE_ITERATE_DENOMINATIONS_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Signature of a function called with information about the exchange's + * denomination keys. + * + * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param denom_pub public key of the denomination + * @param h_denom_pub hash of @a denom_pub + * @param meta meta data information about the denomination type (value, expirations, fees) + * @param master_sig master signature affirming the validity of this denomination + * @param recoup_possible true if the key was revoked and clients can currently recoup + * coins of this denomination + */ +typedef void +(*TALER_EXCHANGEDB_DenominationsCallback)( + void *cls, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_DenominationHashP *h_denom_pub, + const struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta, + const struct TALER_MasterSignatureP *master_sig, + bool recoup_possible); + + +/** + * Function called to invoke @a cb on every known denomination key (revoked + * and non-revoked) that has been signed by the master key. Runs in its own + * read-only transaction. + * + * + * @param pg the database context + * @param cb function to call on each denomination key + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_iterate_denominations (struct + TALER_EXCHANGEDB_PostgresContext *pg, + TALER_EXCHANGEDB_DenominationsCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/taler/exchange-database/iterate_kyc_reference.h b/src/include/exchange-database/iterate_kyc_reference.h diff --git a/src/include/taler/exchange-database/iterate_reserve_close_info.h b/src/include/exchange-database/iterate_reserve_close_info.h diff --git a/src/include/exchange-database/kyc_provider_account_lookup.h b/src/include/exchange-database/kyc_provider_account_lookup.h @@ -0,0 +1,53 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/kyc_provider_account_lookup.h + * @brief implementation of the kyc_provider_account_lookup function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_KYC_PROVIDER_ACCOUNT_LOOKUP_H +#define EXCHANGE_DATABASE_KYC_PROVIDER_ACCOUNT_LOOKUP_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup an + * @a h_payto by @a provider_legitimization_id. + * + * @param pg the database context + * @param provider_name + * @param provider_legitimization_id legi to look up + * @param[out] h_payto where to write the result + * @param[out] is_wallet set to true if @a h_payto is for a wallet + * @param[out] process_row where to write the row of the entry + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_kyc_provider_account_lookup (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const char *provider_name, + const char * + provider_legitimization_id, + struct TALER_NormalizedPaytoHashP + * + h_payto, + bool *is_wallet, + uint64_t *process_row); + +#endif diff --git a/src/include/exchange-database/kycauth_in_insert.h b/src/include/exchange-database/kycauth_in_insert.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/kycauth_in_insert.h + * @brief implementation of the kycauth_in_insert function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_KYCAUTH_IN_INSERT_H +#define EXCHANGE_DATABASE_KYCAUTH_IN_INSERT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert an incoming KCYAUTH wire transfer into + * the database and update the authentication key + * for the origin account. + * + * @param pg the database context + * @param account_pub public key of the account + * @param credit_amount amount we were credited + * @param execution_date when was the transfer made + * @param debit_account_uri URI of the debit account + * @param section_name section of the exchange bank account that received the transfer + * @param serial_id bank-specific row identifying the transfer + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_kycauth_in_insert (struct TALER_EXCHANGEDB_PostgresContext *pg, + const union TALER_AccountPublicKeyP * + account_pub, + const struct TALER_Amount *credit_amount, + struct GNUNET_TIME_Timestamp execution_date, + const struct TALER_FullPayto + debit_account_uri, + const char *section_name, + uint64_t serial_id); + + +#endif diff --git a/src/include/exchange-database/lookup_active_legitimization.h b/src/include/exchange-database/lookup_active_legitimization.h @@ -0,0 +1,49 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_active_legitimization.h + * @brief implementation of the lookup_active_legitimization function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_ACTIVE_LEGITIMIZATION_H +#define EXCHANGE_DATABASE_LOOKUP_ACTIVE_LEGITIMIZATION_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup measure data for an active legitimization process. + * + * @param pg the database context + * @param legitimization_process_serial_id + * row in legitimization_processes table to access + * @param[out] measure_index set to the measure the + * process is trying to satisfy + * @param[out] jmeasures set to the legitimization + * measures that were put on the account + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_active_legitimization (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + uint64_t + legitimization_process_serial_id, + uint32_t *measure_index, + json_t **jmeasures); + + +#endif diff --git a/src/include/exchange-database/lookup_aml_file_number.h b/src/include/exchange-database/lookup_aml_file_number.h @@ -0,0 +1,47 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_aml_file_number.h + * @brief implementation of the lookup_aml_file_number function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_AML_FILE_NUMBER_H +#define EXCHANGE_DATABASE_LOOKUP_AML_FILE_NUMBER_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup AML file number by the payto address. + * + * @param pg the database context + * @param h_payto account for which to find the row ID + * @param[out] kyc_target_row set to row in the kyc_targets table for @a h_payto + * @param[out] is_wallet set to true if this account is for a wallet + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_aml_file_number (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + uint64_t *kyc_target_row, + bool *is_wallet); + + +#endif diff --git a/src/include/exchange-database/lookup_aml_history.h b/src/include/exchange-database/lookup_aml_history.h @@ -0,0 +1,108 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_aml_history.h + * @brief implementation of the lookup_aml_history function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_AML_HISTORY_H +#define EXCHANGE_DATABASE_LOOKUP_AML_HISTORY_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with historic AML events of an + * account. + * + * @param cls closure + * @param outcome_serial_id row ID of the decision + * @param decision_time when was the decision taken + * @param justification what was the given justification + * @param decider_pub which key signed the decision + * @param jproperties what are the new account properties + * @param jnew_rules what are the new account rules + * @param to_investigate should AML staff investigate + * after the decision + * @param is_active is this the active decision + */ +typedef void +(*TALER_EXCHANGEDB_AmlHistoryCallback) ( + void *cls, + uint64_t outcome_serial_id, + struct GNUNET_TIME_Timestamp decision_time, + const char *justification, + const struct TALER_AmlOfficerPublicKeyP *decider_pub, + const json_t *jproperties, + const json_t *jnew_rules, + bool to_investigate, + bool is_active); + + +/* Callback typedefs */ +/** + * Function called with historic AML events of an + * account. + * + * @param cls closure + * @param outcome_serial_id row ID of the decision + * @param decision_time when was the decision taken + * @param justification what was the given justification + * @param decider_pub which key signed the decision + * @param jproperties what are the new account properties + * @param jnew_rules what are the new account rules + * @param to_investigate should AML staff investigate + * after the decision + * @param is_active is this the active decision + */ +typedef void +(*TALER_EXCHANGEDB_AmlHistoryCallback) ( + void *cls, + uint64_t outcome_serial_id, + struct GNUNET_TIME_Timestamp decision_time, + const char *justification, + const struct TALER_AmlOfficerPublicKeyP *decider_pub, + const json_t *jproperties, + const json_t *jnew_rules, + bool to_investigate, + bool is_active); + +/** + * Lookup AML history for an account identified via + * @a h_payto. + * + * @param pg the database context + * @param h_payto hash of account to lookup history for + * @param offset row ID to start returning results from + * @param limit how many results to return, negative for descending order + * @param cb function to call on results + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_aml_history (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct TALER_NormalizedPaytoHashP * + h_payto, + uint64_t offset, + int64_t limit, + TALER_EXCHANGEDB_AmlHistoryCallback cb, + void *cb_cls); + + +#endif diff --git a/src/include/exchange-database/lookup_aml_officer.h b/src/include/exchange-database/lookup_aml_officer.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_aml_officer.h + * @brief implementation of the lookup_aml_officer function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_AML_OFFICER_H +#define EXCHANGE_DATABASE_LOOKUP_AML_OFFICER_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Fetch AML staff record. + * + * @param pg the database context + * @param decider_pub public key of the staff member + * @param[out] master_sig offline signature affirming the AML officer + * @param[out] decider_name full name of the staff member + * @param[out] is_active true to enable, false to set as inactive + * @param[out] read_only true to set read-only access + * @param[out] last_change when was the change made effective + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_aml_officer (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct TALER_AmlOfficerPublicKeyP * + decider_pub, + struct TALER_MasterSignatureP *master_sig, + char **decider_name, + bool *is_active, + bool *read_only, + struct GNUNET_TIME_Absolute *last_change); + +#endif diff --git a/src/include/exchange-database/lookup_auditor_status.h b/src/include/exchange-database/lookup_auditor_status.h @@ -0,0 +1,44 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_auditor_status.h + * @brief implementation of the lookup_auditor_status function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_AUDITOR_STATUS_H +#define EXCHANGE_DATABASE_LOOKUP_AUDITOR_STATUS_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Lookup current state of an auditor. + * + * @param pg the database context + * @param auditor_pub key to look up information for + * @param[out] auditor_url set to the base URL of the auditor's REST API; memory to be + * released by the caller! + * @param[out] enabled set if the auditor is currently in use + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_auditor_status (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_AuditorPublicKeyP * + auditor_pub, + char **auditor_url, + bool *enabled); + +#endif diff --git a/src/include/exchange-database/lookup_auditor_timestamp.h b/src/include/exchange-database/lookup_auditor_timestamp.h @@ -0,0 +1,45 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_auditor_timestamp.h + * @brief implementation of the lookup_auditor_timestamp function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_AUDITOR_TIMESTAMP_H +#define EXCHANGE_DATABASE_LOOKUP_AUDITOR_TIMESTAMP_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Check the last date an auditor was modified. + * + * @param pg the database context + * @param auditor_pub key to look up information for + * @param[out] last_date last modification date to auditor status + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_auditor_timestamp (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_AuditorPublicKeyP * + auditor_pub, + struct GNUNET_TIME_Timestamp * + last_date); + +#endif diff --git a/src/include/taler/exchange-database/lookup_completed_legitimization.h b/src/include/exchange-database/lookup_completed_legitimization.h diff --git a/src/include/exchange-database/lookup_denomination_key.h b/src/include/exchange-database/lookup_denomination_key.h @@ -0,0 +1,45 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_denomination_key.h + * @brief implementation of the lookup_denomination_key function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_DENOMINATION_KEY_H +#define EXCHANGE_DATABASE_LOOKUP_DENOMINATION_KEY_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Lookup information about current denomination key. + * + * @param pg the database context + * @param h_denom_pub hash of the denomination public key + * @param[out] meta set to various meta data about the key + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_denomination_key (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_DenominationHashP * + h_denom_pub, + struct + TALER_EXCHANGEDB_DenominationKeyMetaData + * + meta); + +#endif diff --git a/src/include/exchange-database/lookup_global_fee_by_time.h b/src/include/exchange-database/lookup_global_fee_by_time.h @@ -0,0 +1,59 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_global_fee_by_time.h + * @brief implementation of the lookup_global_fee_by_time function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_GLOBAL_FEE_BY_TIME_H +#define EXCHANGE_DATABASE_LOOKUP_GLOBAL_FEE_BY_TIME_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup information about known global fees. + * + * @param pg the database context + * @param start_time starting time of fee + * @param end_time end time of fee + * @param[out] fees set to wire fees for that time period; if + * different global fee exists within this time + * period, an 'invalid' amount is returned. + * @param[out] purse_timeout set to when unmerged purses expire + * @param[out] history_expiration set to when we expire reserve histories + * @param[out] purse_account_limit set to number of free purses + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_global_fee_by_time (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + struct GNUNET_TIME_Timestamp + start_time, + struct GNUNET_TIME_Timestamp + end_time, + struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative * + purse_timeout + , + struct GNUNET_TIME_Relative * + history_expiration, + uint32_t *purse_account_limit); + +#endif diff --git a/src/include/exchange-database/lookup_h_payto_by_access_token.h b/src/include/exchange-database/lookup_h_payto_by_access_token.h @@ -0,0 +1,53 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_h_payto_by_access_token.h + * @brief implementation of the lookup_h_payto_by_access_token function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_H_PAYTO_BY_ACCESS_TOKEN_H +#define EXCHANGE_DATABASE_LOOKUP_H_PAYTO_BY_ACCESS_TOKEN_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup @a h_payto based on an @a access_token. + * + * @param pg the database context + * @param access_token + * set to token for access control + * @param[out] h_payto set to the the hash of the + * payto URI of the account (if found) + * @param[out] is_wallet set to true if @a h_payto + * is for a wallet + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_h_payto_by_access_token (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + const struct + TALER_AccountAccessTokenP * + access_token, + struct + TALER_NormalizedPaytoHashP * + h_payto, + bool *is_wallet); + +#endif diff --git a/src/include/exchange-database/lookup_kyc_history.h b/src/include/exchange-database/lookup_kyc_history.h @@ -0,0 +1,115 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_kyc_history.h + * @brief implementation of the lookup_kyc_history function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_HISTORY_H +#define EXCHANGE_DATABASE_LOOKUP_KYC_HISTORY_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with historic KYC events of an + * account. + * + * @param cls closure + * @param provider_name name of the KYC provider + * @param finished did the KYC process finish + * @param error_code error code from the KYC process + * @param error_message error message from the KYC process, + * or NULL for none + * @param provider_user_id user ID at the provider + * or NULL for none + * @param provider_legitimization_id legitimization process ID at the provider + * or NULL for none + * @param collection_time when was the data collected + * @param expiration_time when does the collected data expire + * @param encrypted_attributes_len number of bytes in @a encrypted_attributes + * @param encrypted_attributes encrypted KYC attributes + */ +typedef void +(*TALER_EXCHANGEDB_KycHistoryCallback) ( + void *cls, + const char *provider_name, + bool finished, + enum TALER_ErrorCode error_code, + const char *error_message, + const char *provider_user_id, + const char *provider_legitimization_id, + struct GNUNET_TIME_Timestamp collection_time, + struct GNUNET_TIME_Absolute expiration_time, + size_t encrypted_attributes_len, + const void *encrypted_attributes); + + +/* Callback typedefs */ +/** + * Function called with historic KYC events of an + * account. + * + * @param cls closure + * @param provider_name name of the KYC provider + * @param finished did the KYC process finish + * @param error_code error code from the KYC process + * @param error_message error message from the KYC process, + * or NULL for none + * @param provider_user_id user ID at the provider + * or NULL for none + * @param provider_legitimization_id legitimization process ID at the provider + * or NULL for none + * @param collection_time when was the data collected + * @param expiration_time when does the collected data expire + * @param encrypted_attributes_len number of bytes in @a encrypted_attributes + * @param encrypted_attributes encrypted KYC attributes + */ +typedef void +(*TALER_EXCHANGEDB_KycHistoryCallback) ( + void *cls, + const char *provider_name, + bool finished, + enum TALER_ErrorCode error_code, + const char *error_message, + const char *provider_user_id, + const char *provider_legitimization_id, + struct GNUNET_TIME_Timestamp collection_time, + struct GNUNET_TIME_Absolute expiration_time, + size_t encrypted_attributes_len, + const void *encrypted_attributes); + +/** + * Lookup KYC history for an account identified via + * @a h_payto. + * + * @param pg the database context + * @param h_payto hash of account to lookup history for + * @param cb function to call on results + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_kyc_history (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct TALER_NormalizedPaytoHashP * + h_payto, + TALER_EXCHANGEDB_KycHistoryCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/lookup_kyc_process_by_account.h b/src/include/exchange-database/lookup_kyc_process_by_account.h @@ -0,0 +1,59 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_kyc_process_by_account.h + * @brief implementation of the lookup_kyc_process_by_account function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_PROCESS_BY_ACCOUNT_H +#define EXCHANGE_DATABASE_LOOKUP_KYC_PROCESS_BY_ACCOUNT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup KYC provider meta data. + * + * @param pg the database context + * @param provider_name provider that must be checked + * @param h_payto account that must be KYC'ed + * @param[out] process_row row with the legitimization data + * @param[out] expiration how long is this KYC check set to be valid (in the past if invalid) + * @param[out] provider_account_id provider account ID + * @param[out] provider_legitimization_id provider legitimization ID + * @param[out] is_wallet set to true if @a h_payto is for a wallet + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_kyc_process_by_account (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + const char *provider_name, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + uint64_t *process_row, + struct GNUNET_TIME_Absolute * + expiration, + char **provider_account_id, + char ** + provider_legitimization_id, + bool *is_wallet); + +#endif diff --git a/src/include/exchange-database/lookup_kyc_requirement_by_row.h b/src/include/exchange-database/lookup_kyc_requirement_by_row.h @@ -0,0 +1,72 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_kyc_requirement_by_row.h + * @brief implementation of the lookup_kyc_requirement_by_row function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_REQUIREMENT_BY_ROW_H +#define EXCHANGE_DATABASE_LOOKUP_KYC_REQUIREMENT_BY_ROW_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup KYC requirement. + * + * @param pg the database context + * @param h_payto identifies account to look up requirement for + * @param account_pub set to public key of the account + * needed to authorize access + * @param[out] is_wallet set to #GNUNET_YES if the account is + * that of a wallet (#GNUNET_SYSERR is used if unknown) + * @param[out] access_token set to the access token to begin + * work on KYC processes for this account + * @param[out] rule_gen row ID of the last decision this + * response is based on (for long-polling by clients) + * @param[out] jrules set to active ``LegitimizationRuleSet`` + * of the account impacted by the requirement + * @param[out] aml_review set to true if the account is under + * active review by AML staff + * @param[out] kyc_required set to true if the user must pass + * some KYC check before some previous operation may continue + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_kyc_requirement_by_row (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + const struct + TALER_NormalizedPaytoHashP * + h_payto, + const union + TALER_AccountPublicKeyP * + account_pub, + enum GNUNET_GenericReturnValue * + is_wallet, + struct TALER_AccountAccessTokenP + * + access_token, + uint64_t *rule_gen, + json_t **jrules, + bool *aml_review, + bool *kyc_required); + + +#endif diff --git a/src/include/exchange-database/lookup_kyc_status_by_token.h b/src/include/exchange-database/lookup_kyc_status_by_token.h @@ -0,0 +1,47 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_kyc_status_by_token.h + * @brief implementation of the lookup_kyc_status_by_token function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_STATUS_BY_TOKEN_H +#define EXCHANGE_DATABASE_LOOKUP_KYC_STATUS_BY_TOKEN_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup KYC status by account access token. + * + * @param pg the database context + * @param access_token key to look under + * @param[out] row set to requirement row that matches + * @param[out] jmeasures set to the LegitimizationMeasures for the @a access_token; must be freed by caller! + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_kyc_status_by_token (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_AccountAccessTokenP * + access_token, + uint64_t *row, + json_t **jmeasures); + + +#endif diff --git a/src/include/exchange-database/lookup_pending_legitimization.h b/src/include/exchange-database/lookup_pending_legitimization.h @@ -0,0 +1,62 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_pending_legitimization.h + * @brief implementation of the lookup_pending_legitimization function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_PENDING_LEGITIMIZATION_H +#define EXCHANGE_DATABASE_LOOKUP_PENDING_LEGITIMIZATION_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup measure data for a legitimization process. + * + * @param pg the database context + * @param legitimization_measure_serial_id + * row in legitimization_measures table to access + * @param[out] access_token + * set to token for access control that must match + * @param[out] h_payto set to the the hash of the + * payto URI of the account undergoing legitimization + * @param[out] jmeasures set to the legitimization + * measures that were put on the account + * @param[out] is_finished set to true if the legitimization was + * already finished + * @param[out] is_wallet set to true if @a h_payto is for a wallet + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_pending_legitimization (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + uint64_t + legitimization_measure_serial_id, + struct TALER_AccountAccessTokenP + * + access_token, + struct + TALER_NormalizedPaytoHashP * + h_payto, + json_t **jmeasures, + bool *is_finished, + bool *is_wallet); + +#endif diff --git a/src/include/taler/exchange-database/lookup_records_by_table.h b/src/include/exchange-database/lookup_records_by_table.h diff --git a/src/include/exchange-database/lookup_rules_by_access_token.h b/src/include/exchange-database/lookup_rules_by_access_token.h @@ -0,0 +1,47 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_rules_by_access_token.h + * @brief implementation of the lookup_rules_by_access_token function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_RULES_BY_ACCESS_TOKEN_H +#define EXCHANGE_DATABASE_LOOKUP_RULES_BY_ACCESS_TOKEN_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup KYC rules by account access token. + * + * @param pg the database context + * @param h_payto account hash to look under + * @param[out] jnew_rules set to active LegitimizationRuleSet + * @param[out] rowid set to outcome_serial_id of the row + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_rules_by_access_token (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + json_t **jnew_rules, + uint64_t *rowid); + +#endif diff --git a/src/include/exchange-database/lookup_serial_by_table.h b/src/include/exchange-database/lookup_serial_by_table.h @@ -0,0 +1,44 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file lookup_serial_by_table.h + * @brief implementation of the lookup_serial_by_table function + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_SERIAL_BY_TABLE_H +#define EXCHANGE_DATABASE_LOOKUP_SERIAL_BY_TABLE_H + +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/lookup_records_by_table.h" + +/** + * Lookup the latest serial number of @a table. Used in + * exchange-auditor database replication. + * + * @param pg the database context + * @param table table for which we should return the serial + * @param[out] serial latest serial number in use + * @return transaction status code, GNUNET_DB_STATUS_HARD_ERROR if + * @a table does not have a serial number + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_serial_by_table ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + enum TALER_EXCHANGEDB_ReplicatedTable table, + uint64_t *serial); + + +#endif diff --git a/src/include/exchange-database/lookup_signing_key.h b/src/include/exchange-database/lookup_signing_key.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_signing_key.h + * @brief implementation of the lookup_signing_key function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_SIGNING_KEY_H +#define EXCHANGE_DATABASE_LOOKUP_SIGNING_KEY_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup signing key meta data. + * + * @param pg the database context + * @param exchange_pub the exchange online signing public key + * @param[out] meta meta data about @a exchange_pub + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_signing_key (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct TALER_ExchangePublicKeyP * + exchange_pub, + struct TALER_EXCHANGEDB_SignkeyMetaData * + meta); + +#endif diff --git a/src/include/exchange-database/lookup_signkey_revocation.h b/src/include/exchange-database/lookup_signkey_revocation.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_signkey_revocation.h + * @brief implementation of the lookup_signkey_revocation function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_SIGNKEY_REVOCATION_H +#define EXCHANGE_DATABASE_LOOKUP_SIGNKEY_REVOCATION_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Obtain information about a revoked online signing key. + * + * @param pg the database context + * @param exchange_pub exchange online signing key + * @param[out] master_sig set to signature affirming the revocation (if revoked) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_signkey_revocation (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + const struct + TALER_ExchangePublicKeyP * + exchange_pub, + struct TALER_MasterSignatureP * + master_sig) +; + +#endif diff --git a/src/include/exchange-database/lookup_transfer_by_deposit.h b/src/include/exchange-database/lookup_transfer_by_deposit.h @@ -0,0 +1,79 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_transfer_by_deposit.h + * @brief implementation of the lookup_transfer_by_deposit function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_TRANSFER_BY_DEPOSIT_H +#define EXCHANGE_DATABASE_LOOKUP_TRANSFER_BY_DEPOSIT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Try to find the wire transfer details for a deposit operation. + * If we did not execute the deposit yet, return when it is supposed + * to be executed. + * + * @param pg the database context + * @param h_contract_terms hash of the proposal data + * @param h_wire hash of merchant wire details + * @param coin_pub public key of deposited coin + * @param merchant_pub merchant public key + * @param[out] pending set to true if the transaction is still pending + * @param[out] wtid wire transfer identifier, only set if @a pending is false + * @param[out] exec_time when was the transaction done, or + * when we expect it to be done (if @a pending is false) + * @param[out] amount_with_fee set to the total deposited amount + * @param[out] deposit_fee set to how much the exchange did charge for the deposit + * @param[out] kyc set to the kyc status of the receiver (if @a pending) + * @param[out] account_pub set to public key that is authorized to start the KYC process; unchanged if no such key is known + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_transfer_by_deposit (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_PrivateContractHashP * + h_contract_terms, + const struct + TALER_MerchantWireHashP * + h_wire, + const struct + TALER_CoinSpendPublicKeyP * + coin_pub, + const struct + TALER_MerchantPublicKeyP * + merchant_pub, + bool *pending, + struct + TALER_WireTransferIdentifierRawP * + wtid, + struct GNUNET_TIME_Timestamp * + exec_time, + struct TALER_Amount * + amount_with_fee, + struct TALER_Amount *deposit_fee, + struct TALER_EXCHANGEDB_KycStatus * + kyc, + union TALER_AccountPublicKeyP * + account_pub); + +#endif diff --git a/src/include/exchange-database/lookup_wire_fee_by_time.h b/src/include/exchange-database/lookup_wire_fee_by_time.h @@ -0,0 +1,53 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_wire_fee_by_time.h + * @brief implementation of the lookup_wire_fee_by_time function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_FEE_BY_TIME_H +#define EXCHANGE_DATABASE_LOOKUP_WIRE_FEE_BY_TIME_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Lookup information about known wire fees. Finds all applicable + * fees in the given range. If they are identical, returns the + * respective @a fees. If any of the fees + * differ between @a start_time and @a end_time, the transaction + * succeeds BUT returns an invalid amount for both fees. + * + * @param pg the database context + * @param wire_method the wire method to lookup fees for + * @param start_time starting time of fee + * @param end_time end time of fee + * @param[out] fees wire fees for that time period; if + * different fees exists within this time + * period, an 'invalid' amount is returned. + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_wire_fee_by_time (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *wire_method, + struct GNUNET_TIME_Timestamp + start_time, + struct GNUNET_TIME_Timestamp end_time, + struct TALER_WireFeeSet *fees); + +#endif diff --git a/src/include/exchange-database/lookup_wire_timestamp.h b/src/include/exchange-database/lookup_wire_timestamp.h @@ -0,0 +1,44 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_wire_timestamp.h + * @brief implementation of the lookup_wire_timestamp function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_TIMESTAMP_H +#define EXCHANGE_DATABASE_LOOKUP_WIRE_TIMESTAMP_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Check the last date an exchange wire account was modified. + * + * @param pg the database context + * @param payto_uri key to look up information for + * @param[out] last_date last modification date to auditor status + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_wire_timestamp (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_FullPayto payto_uri, + struct GNUNET_TIME_Timestamp *last_date) +; + +#endif diff --git a/src/include/exchange-database/lookup_wire_transfer.h b/src/include/exchange-database/lookup_wire_transfer.h @@ -0,0 +1,111 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/lookup_wire_transfer.h + * @brief implementation of the lookup_wire_transfer function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_TRANSFER_H +#define EXCHANGE_DATABASE_LOOKUP_WIRE_TRANSFER_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with the results of the lookup of the + * transaction data associated with a wire transfer identifier. + * + * @param cls closure + * @param rowid which row in the table is the information from (for diagnostics) + * @param merchant_pub public key of the merchant (should be same for all callbacks with the same @e cls) + * @param account_payto_uri which account did the transfer go to? + * @param h_payto hash over @a account_payto_uri as it is in the DB + * @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls) + * @param h_contract_terms which proposal was this payment about + * @param denom_pub denomination of @a coin_pub + * @param coin_pub which public key was this payment about + * @param coin_value amount contributed by this coin in total (with fee) + * @param coin_fee applicable fee for this coin + */ +typedef void +(*TALER_EXCHANGEDB_AggregationDataCallback)( + void *cls, + uint64_t rowid, + const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_FullPayto account_payto_uri, + const struct TALER_FullPaytoHashP *h_payto, + struct GNUNET_TIME_Timestamp exec_time, + const struct TALER_PrivateContractHashP *h_contract_terms, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_Amount *coin_value, + const struct TALER_Amount *coin_fee); + + +/* Callback typedefs */ +/** + * Function called with the results of the lookup of the + * transaction data associated with a wire transfer identifier. + * + * @param cls closure + * @param rowid which row in the table is the information from (for diagnostics) + * @param merchant_pub public key of the merchant (should be same for all callbacks with the same @e cls) + * @param account_payto_uri which account did the transfer go to? + * @param h_payto hash over @a account_payto_uri as it is in the DB + * @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls) + * @param h_contract_terms which proposal was this payment about + * @param denom_pub denomination of @a coin_pub + * @param coin_pub which public key was this payment about + * @param coin_value amount contributed by this coin in total (with fee) + * @param coin_fee applicable fee for this coin + */ +typedef void +(*TALER_EXCHANGEDB_AggregationDataCallback)( + void *cls, + uint64_t rowid, + const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_FullPayto account_payto_uri, + const struct TALER_FullPaytoHashP *h_payto, + struct GNUNET_TIME_Timestamp exec_time, + const struct TALER_PrivateContractHashP *h_contract_terms, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_Amount *coin_value, + const struct TALER_Amount *coin_fee); + +/** + * Lookup the list of Taler transactions that were aggregated + * into a wire transfer by the respective @a wtid. + * + * @param pg the database context + * @param wtid the raw wire transfer identifier we used + * @param cb function to call on each transaction found + * @param cb_cls closure for @a cb + * @return query status of the transaction + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_lookup_wire_transfer (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_WireTransferIdentifierRawP * + wtid, + TALER_EXCHANGEDB_AggregationDataCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/mark_refresh_reveal_success.h b/src/include/exchange-database/mark_refresh_reveal_success.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/mark_refresh_reveal_success.h + * @brief Mark the successful reveal of a refresh in the database + * @author Özgür Kesim + */ +#ifndef EXCHANGE_DATABASE_MARK_REFRESH_REVEAL_SUCCESS_H +#define EXCHANGE_DATABASE_MARK_REFRESH_REVEAL_SUCCESS_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Mark a refresh, given by the commitment, as successfully revealed. + * + * @param pg the database context + * @param rc commitment for the refresh + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_mark_refresh_reveal_success (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const struct + TALER_RefreshCommitmentP * + rc); + +#endif diff --git a/src/include/exchange-database/persist_aml_program_result.h b/src/include/exchange-database/persist_aml_program_result.h @@ -0,0 +1,53 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file persist_aml_program_result.h + * @brief implementation of the persist_aml_program_result function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_PERSIST_AML_PROGRAM_RESULT_H +#define EXCHANGE_DATABASE_PERSIST_AML_PROGRAM_RESULT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/set_aml_lock.h" +#include "exchange-database/clear_aml_lock.h" + + +/** + * Persist the given @a apr for the given process and account + * into the database via @a pg. Called within an open + * database transaction. + * + * @param pg database API handle + * @param process_row row identifying the legitimization process that was run, + * 0 if there was no legi process (for example, due to rule + * expiration triggering something) and we should simply + * create a new row + * @param account_id hash of account the result is about + * @param ret_pprs + * @param apr AML program result to persist + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_persist_aml_program_result ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + uint64_t process_row, + const struct TALER_NormalizedPaytoHashP *account_id, + const struct TALER_KYCLOGIC_AmlProgramResult *apr, + enum TALER_EXCHANGEDB_PersistProgramResultStatus *ret_pprs); + +#endif diff --git a/src/include/exchange-database/persist_kyc_attributes.h b/src/include/exchange-database/persist_kyc_attributes.h @@ -0,0 +1,63 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/persist_kyc_attributes.h + * @brief implementation of the persist_kyc_attributes function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_PERSIST_KYC_ATTRIBUTES_H +#define EXCHANGE_DATABASE_PERSIST_KYC_ATTRIBUTES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Store KYC attribute data. + * + * @param pg the database context + * @param process_row KYC process row to update + * @param h_payto account for which the attribute data is stored + * @param provider_name name of the provider that provided the attributes + * @param provider_account_id provider account ID + * @param provider_legitimization_id provider legitimization ID + * @param birthday birthdate of user, in days after 1990, or 0 if unknown or definitively adult + * @param expiration_time when does the data expire + * @param form_name name of the form from which the @a enc_attributes originate, can be NULL + * @param enc_attributes_size number of bytes in @a enc_attributes + * @param enc_attributes encrypted attribute data + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_persist_kyc_attributes (struct + TALER_EXCHANGEDB_PostgresContext *pg, + uint64_t process_row, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + const char *provider_name, + const char *provider_account_id, + const char *provider_legitimization_id, + uint32_t birthday, + struct GNUNET_TIME_Absolute + expiration_time, + const char *form_name, + size_t enc_attributes_size, + const void *enc_attributes); + + +#endif diff --git a/src/include/exchange-database/persist_policy_details.h b/src/include/exchange-database/persist_policy_details.h @@ -0,0 +1,52 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/persist_policy_details.h + * @brief implementation of the persist_policy_details function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_PERSIST_POLICY_DETAILS_H +#define EXCHANGE_DATABASE_PERSIST_POLICY_DETAILS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" +#include "taler/taler_extensions_policy.h" + + +/** + * Persist the details to a policy in the policy_details table. If there + * already exists a policy, update the fields accordingly. + * + * @param pg database connection + * @param details The policy details that should be persisted. If an entry for + * the given details->hash_code exists, the values will be updated. + * @param[out] policy_details_serial_id The row ID of the policy details + * @param[out] accumulated_total The total amount accumulated in that policy + * @param[out] fulfillment_state The state of policy. If the state was Insufficient prior to the call and the provided deposit raises the accumulated_total above the commitment, it will be set to Ready. + * @return query execution status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_persist_policy_details (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PolicyDetails * + details, + uint64_t *policy_details_serial_id, + struct TALER_Amount *accumulated_total, + enum TALER_PolicyFulfillmentState * + fulfillment_state); + +#endif diff --git a/src/include/taler/exchange-database/preflight.h b/src/include/exchange-database/preflight.h diff --git a/src/include/exchange-database/profit_drains_get_pending.h b/src/include/exchange-database/profit_drains_get_pending.h @@ -0,0 +1,59 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/profit_drains_get_pending.h + * @brief implementation of the profit_drains_get_pending function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_PROFIT_DRAINS_GET_PENDING_H +#define EXCHANGE_DATABASE_PROFIT_DRAINS_GET_PENDING_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Get profit drain operation ready to execute. + * + * @param pg the database context + * @param[out] serial set to serial ID of the entry + * @param[out] wtid set set to wire transfer ID to use + * @param[out] account_section set to account to drain + * @param[out] payto_uri set to account to wire funds to + * @param[out] request_timestamp set to time of the signature + * @param[out] amount set to amount to wire + * @param[out] master_sig set to signature affirming the operation + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_profit_drains_get_pending (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + uint64_t *serial, + struct + TALER_WireTransferIdentifierRawP * + wtid, + char **account_section, + struct TALER_FullPayto *payto_uri, + struct GNUNET_TIME_Timestamp * + request_timestamp, + struct TALER_Amount *amount, + struct TALER_MasterSignatureP * + master_sig) +; + +#endif diff --git a/src/include/exchange-database/profit_drains_set_finished.h b/src/include/exchange-database/profit_drains_set_finished.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/profit_drains_set_finished.h + * @brief implementation of the profit_drains_set_finished function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_PROFIT_DRAINS_SET_FINISHED_H +#define EXCHANGE_DATABASE_PROFIT_DRAINS_SET_FINISHED_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Set profit drain operation to finished. + * + * @param pg the database context + * @param serial serial ID of the entry to mark finished + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_profit_drains_set_finished (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + uint64_t serial); + +#endif diff --git a/src/include/exchange-database/release_revolving_shard.h b/src/include/exchange-database/release_revolving_shard.h @@ -0,0 +1,44 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/release_revolving_shard.h + * @brief implementation of the release_revolving_shard function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_RELEASE_REVOLVING_SHARD_H +#define EXCHANGE_DATABASE_RELEASE_REVOLVING_SHARD_H + +#include "taler/taler_exchangedb_lib.h" + +/** + * Function called to release a revolving shard + * back into the work pool. Clears the + * "completed" flag. + * + * @param pg the database context + * @param job_name name of the operation to grab a word shard for + * @param start_row inclusive start row of the shard + * @param end_row exclusive end row of the shard + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_release_revolving_shard (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *job_name, + uint32_t start_row, + uint32_t end_row); + +#endif diff --git a/src/include/exchange-database/reserves_get.h b/src/include/exchange-database/reserves_get.h @@ -0,0 +1,40 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/reserves_get.h + * @brief implementation of the reserves_get function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_RESERVES_GET_H +#define EXCHANGE_DATABASE_RESERVES_GET_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Get the summary of a reserve. + * + * @param pg the database context + * @param[in,out] reserve the reserve data. The public key of the reserve should be + * set in this structure; it is used to query the database. The balance + * and expiration are then filled accordingly. + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_reserves_get (struct TALER_EXCHANGEDB_PostgresContext *pg, + struct TALER_EXCHANGEDB_Reserve *reserve); + +#endif diff --git a/src/include/exchange-database/reserves_get_origin.h b/src/include/exchange-database/reserves_get_origin.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/reserves_get_origin.h + * @brief implementation of the reserves_get_origin function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_RESERVES_GET_ORIGIN_H +#define EXCHANGE_DATABASE_RESERVES_GET_ORIGIN_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Get the origin of funds of a reserve. + * + * @param pg the database context + * @param reserve_pub public key of the reserve + * @param[out] h_payto set to hash of the wire source payto://-URI + * @param[out] payto_uri set to the wire source payto://-URI + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_reserves_get_origin (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + const struct + TALER_ReservePublicKeyP * + reserve_pub, + struct TALER_FullPaytoHashP *h_payto + , + struct TALER_FullPayto *payto_uri); + +#endif diff --git a/src/include/exchange-database/reserves_in_insert.h b/src/include/exchange-database/reserves_in_insert.h @@ -0,0 +1,58 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/reserves_in_insert.h + * @brief implementation of the reserves_in_insert function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_RESERVES_IN_INSERT_H +#define EXCHANGE_DATABASE_RESERVES_IN_INSERT_H + +#include "taler/taler_exchangedb_lib.h" + + +struct TALER_EXCHANGEDB_ReserveInInfo +{ + const struct TALER_ReservePublicKeyP *reserve_pub; + const struct TALER_Amount *balance; + struct GNUNET_TIME_Timestamp execution_time; + struct TALER_FullPayto sender_account_details; + const char *exchange_account_name; + uint64_t wire_reference; +}; + + +/** + * Insert an incoming transaction into reserves. New reserves are also + * created through this function. Runs its own transaction(s). + * + * @param pg the database context + * @param reserves array of reserves to insert + * @param reserves_length length of the @a reserves array + * @param[out] results set to query status per reserve, must be of length @a reserves_length + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_reserves_in_insert (struct TALER_EXCHANGEDB_PostgresContext *pg + , + const struct + TALER_EXCHANGEDB_ReserveInInfo * + reserves, + unsigned int reserves_length, + enum GNUNET_DB_QueryStatus *results); + + +#endif diff --git a/src/include/exchange-database/reserves_update.h b/src/include/exchange-database/reserves_update.h @@ -0,0 +1,41 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/reserves_update.h + * @brief implementation of the reserves_update function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_RESERVES_UPDATE_H +#define EXCHANGE_DATABASE_RESERVES_UPDATE_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Updates a reserve with the data from the given reserve structure. + * + * @param pg the database context + * @param reserve the reserve structure whose data will be used to update the + * corresponding record in the database. + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_reserves_update (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_Reserve *reserve + ); + +#endif diff --git a/src/include/exchange-database/rollback.h b/src/include/exchange-database/rollback.h @@ -0,0 +1,36 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/rollback.h + * @brief implementation of the rollback function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_ROLLBACK_H +#define EXCHANGE_DATABASE_ROLLBACK_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Roll back the current transaction of a database connection. + * + * @param pg the database context + */ +void +TALER_EXCHANGEDB_rollback (struct TALER_EXCHANGEDB_PostgresContext *pg); + +#endif diff --git a/src/include/taler/exchange-database/select_account_merges_above_serial_id.h b/src/include/exchange-database/select_account_merges_above_serial_id.h diff --git a/src/include/exchange-database/select_aggregation_amounts_for_kyc_check.h b/src/include/exchange-database/select_aggregation_amounts_for_kyc_check.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aggregation_amounts_for_kyc_check.h + * @brief implementation of the select_aggregation_amounts_for_kyc_check function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AGGREGATION_AMOUNTS_FOR_KYC_CHECK_H +#define EXCHANGE_DATABASE_SELECT_AGGREGATION_AMOUNTS_FOR_KYC_CHECK_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Call @a kac on deposited amounts after @a time_limit which are relevant for a + * KYC trigger for a the (credited) account identified by @a h_payto. + * + * @param pg the database context + * @param h_payto account identifier + * @param time_limit oldest transaction that could be relevant + * @param kac function to call for each applicable amount, in reverse chronological order (or until @a kac aborts by returning anything except #GNUNET_OK). + * @param kac_cls closure for @a kac + * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aggregation_amounts_for_kyc_check ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Absolute time_limit, + TALER_KYCLOGIC_KycAmountCallback kac, + void *kac_cls); + +#endif diff --git a/src/include/exchange-database/select_aggregation_transient.h b/src/include/exchange-database/select_aggregation_transient.h @@ -0,0 +1,58 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aggregation_transient.h + * @brief implementation of the select_aggregation_transient function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AGGREGATION_TRANSIENT_H +#define EXCHANGE_DATABASE_SELECT_AGGREGATION_TRANSIENT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Find existing entry in the transient aggregation table. + * + * @param pg the database context + * @param h_payto destination of the wire transfer + * @param merchant_pub public key of the merchant receiving the transfer + * @param exchange_account_section exchange account to use + * @param[out] wtid set to the raw wire transfer identifier to be used + * @param[out] total existing amount to be wired in the future + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aggregation_transient (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_FullPaytoHashP * + h_payto, + const struct + TALER_MerchantPublicKeyP * + merchant_pub, + const char * + exchange_account_section, + struct + TALER_WireTransferIdentifierRawP + *wtid, + struct TALER_Amount *total); + + +#endif diff --git a/src/include/exchange-database/select_aggregations_above_serial.h b/src/include/exchange-database/select_aggregations_above_serial.h @@ -0,0 +1,85 @@ +/* + This file is part of TALER + Copyright (C) 2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aggregations_above_serial.h + * @brief implementation of the select_aggregations_above_serial function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AGGREGATIONS_ABOVE_SERIAL_H +#define EXCHANGE_DATABASE_SELECT_AGGREGATIONS_ABOVE_SERIAL_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called on aggregations that were done for + * a (batch) deposit. + * + * @param cls closure + * @param amount affected amount + * @param tracking_serial_id where in the table are we + * @param batch_deposit_serial_id which batch deposit was aggregated + */ +typedef void +(*TALER_EXCHANGEDB_AggregationCallback)( + void *cls, + const struct TALER_Amount *amount, + uint64_t tracking_serial_id, + uint64_t batch_deposit_serial_id); + + +/* Callback typedefs */ +/** + * Function called on aggregations that were done for + * a (batch) deposit. + * + * @param cls closure + * @param amount affected amount + * @param tracking_serial_id where in the table are we + * @param batch_deposit_serial_id which batch deposit was aggregated + */ +typedef void +(*TALER_EXCHANGEDB_AggregationCallback)( + void *cls, + const struct TALER_Amount *amount, + uint64_t tracking_serial_id, + uint64_t batch_deposit_serial_id); + +/** + * Select all aggregation tracking IDs in the database + * above a given @a min_tracking_serial_id. + * + * @param pg the database context + * @param min_tracking_serial_id only return entries strictly above this row (and in order) + * @param cb function to call on all such aggregations + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aggregations_above_serial (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t + min_tracking_serial_id, + TALER_EXCHANGEDB_AggregationCallback + cb, + void *cb_cls); + + +#endif diff --git a/src/include/exchange-database/select_all_kyc_attributes.h b/src/include/exchange-database/select_all_kyc_attributes.h @@ -0,0 +1,101 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_all_kyc_attributes.h + * @brief implementation of the select_all_kyc_attributes function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_ALL_KYC_ATTRIBUTES_H +#define EXCHANGE_DATABASE_SELECT_ALL_KYC_ATTRIBUTES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Return KYC attribute information. + * + * @param cls closure + * @param row_id current row in kyc_attributes table + * @param h_payto account the attributes are about + * @param provider_name name of the provider that collected the attributes + * @param collection_time when were the attributes collected + * @param expiration_time when does the data expire + * @param properties properties that were set for @a h_payto + * @param enc_attributes_size size of @a enc_attributes + * @param enc_attributes the encrypted collected attributes + * @return true to continue to iterate + */ +typedef bool +(*TALER_EXCHANGEDB_AllAttributesCallback)( + void *cls, + uint64_t row_id, + const struct TALER_NormalizedPaytoHashP *h_payto, + const char *provider_name, + struct GNUNET_TIME_Timestamp collection_time, + struct GNUNET_TIME_Timestamp expiration_time, + const json_t *properties, + size_t enc_attributes_size, + const void *enc_attributes); + + +/* Callback typedefs */ +/** + * Return KYC attribute information. + * + * @param cls closure + * @param row_id current row in kyc_attributes table + * @param h_payto account the attributes are about + * @param provider_name name of the provider that collected the attributes + * @param collection_time when were the attributes collected + * @param expiration_time when does the data expire + * @param properties properties that were set for @a h_payto + * @param enc_attributes_size size of @a enc_attributes + * @param enc_attributes the encrypted collected attributes + * @return true to continue to iterate + */ +typedef bool +(*TALER_EXCHANGEDB_AllAttributesCallback)( + void *cls, + uint64_t row_id, + const struct TALER_NormalizedPaytoHashP *h_payto, + const char *provider_name, + struct GNUNET_TIME_Timestamp collection_time, + struct GNUNET_TIME_Timestamp expiration_time, + const json_t *properties, + size_t enc_attributes_size, + const void *enc_attributes); + +/** + * Lookup all KYC attributes above @a min_row_id. + * + * @param pg the database context + * @param min_row_id minimum row ID to return (exclusive) + * @param cb callback to invoke on each match + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_all_kyc_attributes (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + uint64_t min_row_id, + TALER_EXCHANGEDB_AllAttributesCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/taler/exchange-database/select_all_purse_decisions_above_serial_id.h b/src/include/exchange-database/select_all_purse_decisions_above_serial_id.h diff --git a/src/include/exchange-database/select_all_purse_deletions_above_serial_id.h b/src/include/exchange-database/select_all_purse_deletions_above_serial_id.h @@ -0,0 +1,84 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_all_purse_deletions_above_serial_id.h + * @brief implementation of the select_all_purse_deletions_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_ALL_PURSE_DELETIONS_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_ALL_PURSE_DELETIONS_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with details about purse deletions that have been made, with + * the goal of auditing the purse's execution. + * + * @param cls closure + * @param rowid unique serial ID for the deposit in our DB + * @param purse_pub public key of the purse + * @param purse_sig signature affirming deletion of the purse + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_AllPurseDeletionsCallback)( + void *cls, + uint64_t rowid, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_PurseContractSignatureP *purse_sig); + + +/* Callback typedefs */ +/** + * Function called with details about purse deletions that have been made, with + * the goal of auditing the purse's execution. + * + * @param cls closure + * @param rowid unique serial ID for the deposit in our DB + * @param purse_pub public key of the purse + * @param purse_sig signature affirming deletion of the purse + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_AllPurseDeletionsCallback)( + void *cls, + uint64_t rowid, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_PurseContractSignatureP *purse_sig); + +/** + * Select all purse deletions above @a serial_id in monotonically increasing + * order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_all_purse_deletions_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + uint64_t serial_id, + TALER_EXCHANGEDB_AllPurseDeletionsCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_aml_attributes.h b/src/include/exchange-database/select_aml_attributes.h @@ -0,0 +1,98 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aml_attributes.h + * @brief implementation of the select_aml_attributes function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AML_ATTRIBUTES_H +#define EXCHANGE_DATABASE_SELECT_AML_ATTRIBUTES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Return AML attribute information. + * + * @param cls closure + * @param row_id current row in kyc_attributes table + * @param collection_time when were the attributes collected + * @param by_aml_officer true if the data was filed by an AML officer + * @param officer_name name of the officer, NULL if not @a by_aml_officer + * @param enc_attributes_size size of @a enc_attributes + * @param enc_attributes the encrypted collected attributes + */ +typedef void +(*TALER_EXCHANGEDB_AmlAttributeCallback)( + void *cls, + uint64_t row_id, + struct GNUNET_TIME_Timestamp collection_time, + bool by_aml_officer, + const char *officer_name, + size_t enc_attributes_size, + const void *enc_attributes); + + +/* Callback typedefs */ +/** + * Return AML attribute information. + * + * @param cls closure + * @param row_id current row in kyc_attributes table + * @param collection_time when were the attributes collected + * @param by_aml_officer true if the data was filed by an AML officer + * @param officer_name name of the officer, NULL if not @a by_aml_officer + * @param enc_attributes_size size of @a enc_attributes + * @param enc_attributes the encrypted collected attributes + */ +typedef void +(*TALER_EXCHANGEDB_AmlAttributeCallback)( + void *cls, + uint64_t row_id, + struct GNUNET_TIME_Timestamp collection_time, + bool by_aml_officer, + const char *officer_name, + size_t enc_attributes_size, + const void *enc_attributes); + +/** + * Lookup AML attributes of a particular account. + * + * @param pg the database context + * @param h_payto which account should we return attributes for + * @param offset row to start from + * @param limit how many records to return (negative + * to go back in time, positive to go forward) + * @param cb callback to invoke on each match + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aml_attributes (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + uint64_t offset, + int64_t limit, + TALER_EXCHANGEDB_AmlAttributeCallback cb + , + void *cb_cls); + + +#endif diff --git a/src/include/exchange-database/select_aml_decisions.h b/src/include/exchange-database/select_aml_decisions.h @@ -0,0 +1,123 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aml_decisions.h + * @brief implementation of the select_aml_decisions function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AML_DECISIONS_H +#define EXCHANGE_DATABASE_SELECT_AML_DECISIONS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Return AML decision information. + * + * @param cls closure + * @param row_id current row in legitimization outcomes table + * @param justification human-readable reason for the decision, NULL if none is available + * @param h_payto account for which the attribute data is stored + * @param decision_time when was the decision taken + * @param expiration_time when will the rules expire + * @param jproperties properties set for the account, + * NULL if no properties were set + * @param to_investigate true if AML staff should look at the account + * @param is_active true if this is the currently active decision about the account + * @param is_wallet true if the @a h_payto is for a Taler wallet + * @param payto payto URI of the account the decision is about + * @param account_rules current active rules for the account + */ +typedef void +(*TALER_EXCHANGEDB_AmlDecisionCallback)( + void *cls, + uint64_t row_id, + const char *justification, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Timestamp decision_time, + struct GNUNET_TIME_Absolute expiration_time, + const json_t *jproperties, + bool to_investigate, + bool is_active, + bool is_wallet, + struct TALER_FullPayto payto, + const json_t *account_rules); + + +/* Callback typedefs */ +/** + * Return AML decision information. + * + * @param cls closure + * @param row_id current row in legitimization outcomes table + * @param justification human-readable reason for the decision, NULL if none is available + * @param h_payto account for which the attribute data is stored + * @param decision_time when was the decision taken + * @param expiration_time when will the rules expire + * @param jproperties properties set for the account, + * NULL if no properties were set + * @param to_investigate true if AML staff should look at the account + * @param is_active true if this is the currently active decision about the account + * @param is_wallet true if the @a h_payto is for a Taler wallet + * @param payto payto URI of the account the decision is about + * @param account_rules current active rules for the account + */ +typedef void +(*TALER_EXCHANGEDB_AmlDecisionCallback)( + void *cls, + uint64_t row_id, + const char *justification, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Timestamp decision_time, + struct GNUNET_TIME_Absolute expiration_time, + const json_t *jproperties, + bool to_investigate, + bool is_active, + bool is_wallet, + struct TALER_FullPayto payto, + const json_t *account_rules); + +/** + * Lookup AML decisions that have a particular state. + * + * @param pg the database context + * @param h_payto which account should we return the AML decision history for, NULL to return all accounts + * @param investigation_only filter by investigation state + * @param active_only filter for only active states + * @param offset row to start from + * @param limit how many records to return (negative + * to go back in time, positive to go forward) + * @param cb callback to invoke on each match + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aml_decisions (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_NormalizedPaytoHashP * + h_payto, + enum TALER_EXCHANGE_YesNoAll + investigation_only + , + enum TALER_EXCHANGE_YesNoAll active_only, + uint64_t offset, + int64_t limit, + TALER_EXCHANGEDB_AmlDecisionCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_aml_measures.h b/src/include/exchange-database/select_aml_measures.h @@ -0,0 +1,96 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aml_measures.h + * @brief implementation of the select_aml_measures function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AML_MEASURES_H +#define EXCHANGE_DATABASE_SELECT_AML_MEASURES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with legitimization measures. + * + * @param cls closure + * @param h_payto hash of account the measure applies to + * @param start_time when was the process started + * @param jmeasures object of type ``LegitimizationMeasures`` + * @param is_finished true if the measure was finished + * @param measure_serial_id row ID of the measure in the exchange table + */ +typedef void +(*TALER_EXCHANGEDB_LegitimizationMeasureCallback) ( + void *cls, + struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Absolute start_time, + const json_t *jmeasures, + bool is_finished, + uint64_t measure_serial_id); + + +/* Callback typedefs */ +/** + * Function called with legitimization measures. + * + * @param cls closure + * @param h_payto hash of account the measure applies to + * @param start_time when was the process started + * @param jmeasures object of type ``LegitimizationMeasures`` + * @param is_finished true if the measure was finished + * @param measure_serial_id row ID of the measure in the exchange table + */ +typedef void +(*TALER_EXCHANGEDB_LegitimizationMeasureCallback) ( + void *cls, + struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Absolute start_time, + const json_t *jmeasures, + bool is_finished, + uint64_t measure_serial_id); + +/** + * Lookup legitimization measures. + * + * @param pg the database context + * @param h_payto account for which the attribute data is stored, + * NULL to select for all accounts + * @param active_only select only measures that are active + * @param offset row offset to select from + * @param limit number of results to return, negative to + * return in descending order from @a offset + * @param cb callback to invoke on each match + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aml_measures (struct TALER_EXCHANGEDB_PostgresContext * + pg, + const struct TALER_NormalizedPaytoHashP * + h_payto + , + enum TALER_EXCHANGE_YesNoAll active_only, + uint64_t offset, + int64_t limit, + TALER_EXCHANGEDB_LegitimizationMeasureCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_aml_statistics.h b/src/include/exchange-database/select_aml_statistics.h @@ -0,0 +1,81 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_aml_statistics.h + * @brief implementation of the select_aml_statistics function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AML_STATISTICS_H +#define EXCHANGE_DATABASE_SELECT_AML_STATISTICS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with AML statistics (counters). + * + * @param cls closure + * @param name name of the counter + * @param cnt number of events for @a name in the query range + */ +typedef void +(*TALER_EXCHANGEDB_AmlStatisticsCallback)( + void *cls, + const char *name, + uint64_t cnt); + + +/* Callback typedefs */ +/** + * Function called with AML statistics (counters). + * + * @param cls closure + * @param name name of the counter + * @param cnt number of events for @a name in the query range + */ +typedef void +(*TALER_EXCHANGEDB_AmlStatisticsCallback)( + void *cls, + const char *name, + uint64_t cnt); + +/** + * Obtain the AML statistics for a given set of @a names and + * timeframe. + * + * @param pg the database context + * @param num_names length of the @e names array + * @param names array of names of the statistics to fetch + * @param start_date start of time range + * @param end_date end of time range + * @param cb function to call on each statistic + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_aml_statistics (struct + TALER_EXCHANGEDB_PostgresContext *pg, + size_t num_names, + const char *names[static num_names], + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + TALER_EXCHANGEDB_AmlStatisticsCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_auditor_denom_sig.h b/src/include/exchange-database/select_auditor_denom_sig.h @@ -0,0 +1,49 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_auditor_denom_sig.h + * @brief implementation of the select_auditor_denom_sig function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_AUDITOR_DENOM_SIG_H +#define EXCHANGE_DATABASE_SELECT_AUDITOR_DENOM_SIG_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Select information about an auditor auditing a denomination key. + * + * @param pg the database context + * @param h_denom_pub the audited denomination + * @param auditor_pub the auditor's key + * @param[out] auditor_sig set to signature affirming the auditor's audit activity + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_auditor_denom_sig (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_DenominationHashP * + h_denom_pub, + const struct + TALER_AuditorPublicKeyP * + auditor_pub, + struct TALER_AuditorSignatureP * + auditor_sig + ); + +#endif diff --git a/src/include/exchange-database/select_batch_deposits_missing_wire.h b/src/include/exchange-database/select_batch_deposits_missing_wire.h @@ -0,0 +1,87 @@ +/* + This file is part of TALER + Copyright (C) 2022-2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_batch_deposits_missing_wire.h + * @brief implementation of the select_batch_deposits_missing_wire function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H +#define EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called on (batch) deposits will need a wire + * transfer. + * + * @param cls closure + * @param batch_deposit_serial_id where in the table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param deadline what was the earliest requested wire transfer deadline + */ +typedef void +(*TALER_EXCHANGEDB_WireMissingCallback)( + void *cls, + uint64_t batch_deposit_serial_id, + const struct TALER_Amount *total_amount, + const struct TALER_FullPaytoHashP *wire_target_h_payto, + struct GNUNET_TIME_Timestamp deadline); + + +/* Callback typedefs */ +/** + * Function called on (batch) deposits will need a wire + * transfer. + * + * @param cls closure + * @param batch_deposit_serial_id where in the table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param deadline what was the earliest requested wire transfer deadline + */ +typedef void +(*TALER_EXCHANGEDB_WireMissingCallback)( + void *cls, + uint64_t batch_deposit_serial_id, + const struct TALER_Amount *total_amount, + const struct TALER_FullPaytoHashP *wire_target_h_payto, + struct GNUNET_TIME_Timestamp deadline); + +/** + * Select all of those batch deposits in the database + * above the given serial ID. + * + * @param pg the database context + * @param min_batch_deposit_serial_id select all batch deposits above this ID + * @param cb function to call on all such deposits + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_batch_deposits_missing_wire (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + uint64_t + min_batch_deposit_serial_id, + TALER_EXCHANGEDB_WireMissingCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_coin_deposits_above_serial_id.h b/src/include/exchange-database/select_coin_deposits_above_serial_id.h @@ -0,0 +1,93 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_coin_deposits_above_serial_id.h + * @brief implementation of the select_coin_deposits_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_COIN_DEPOSITS_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_COIN_DEPOSITS_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with details about deposits that have been made, + * with the goal of auditing the deposit's execution. + * + * @param cls closure + * @param rowid unique serial ID for the deposit in our DB + * @param exchange_timestamp when did the deposit happen + * @param deposit deposit details + * @param denom_pub denomination public key of @a coin_pub + * @param done flag set if the deposit was already executed (or not) + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_DepositCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp exchange_timestamp, + const struct TALER_EXCHANGEDB_Deposit *deposit, + const struct TALER_DenominationPublicKey *denom_pub, + bool done); + + +/* Callback typedefs */ +/** + * Function called with details about deposits that have been made, + * with the goal of auditing the deposit's execution. + * + * @param cls closure + * @param rowid unique serial ID for the deposit in our DB + * @param exchange_timestamp when did the deposit happen + * @param deposit deposit details + * @param denom_pub denomination public key of @a coin_pub + * @param done flag set if the deposit was already executed (or not) + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_DepositCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp exchange_timestamp, + const struct TALER_EXCHANGEDB_Deposit *deposit, + const struct TALER_DenominationPublicKey *denom_pub, + bool done); + +/** + * Select deposits above @a serial_id in monotonically increasing + * order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_coin_deposits_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + uint64_t serial_id, + TALER_EXCHANGEDB_DepositCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_contract.h b/src/include/exchange-database/select_contract.h @@ -0,0 +1,50 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_contract.h + * @brief implementation of the select_contract function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_CONTRACT_H +#define EXCHANGE_DATABASE_SELECT_CONTRACT_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to retrieve an encrypted contract. + * + * @param pg the database context + * @param purse_pub key to lookup the contract by + * @param[out] pub_ckey set to the ephemeral DH used to encrypt the contract + * @param[out] econtract_sig set to the signature over the encrypted contract + * @param[out] econtract_size set to the number of bytes in @a econtract + * @param[out] econtract set to the encrypted contract on success, to be freed by the caller + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_contract (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_ContractDiffiePublicP * + pub_ckey, + struct TALER_PurseContractPublicKeyP * + purse_pub, + struct TALER_PurseContractSignatureP * + econtract_sig, + size_t *econtract_size, + void **econtract); + +#endif diff --git a/src/include/exchange-database/select_contract_by_purse.h b/src/include/exchange-database/select_contract_by_purse.h @@ -0,0 +1,46 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_contract_by_purse.h + * @brief implementation of the select_contract_by_purse function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_CONTRACT_BY_PURSE_H +#define EXCHANGE_DATABASE_SELECT_CONTRACT_BY_PURSE_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to retrieve an encrypted contract. + * + * @param pg the database context + * @param purse_pub key to lookup the contract by + * @param[out] econtract set to the encrypted contract on success, to be freed by the caller + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_contract_by_purse (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_PurseContractPublicKeyP * + purse_pub, + struct TALER_EncryptedContract + *econtract); + +#endif diff --git a/src/include/exchange-database/select_deposit_amounts_for_kyc_check.h b/src/include/exchange-database/select_deposit_amounts_for_kyc_check.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_deposit_amounts_for_kyc_check.h + * @brief implementation of the select_deposit_amounts_for_kyc_check function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_DEPOSIT_AMOUNTS_FOR_KYC_CHECK_H +#define EXCHANGE_DATABASE_SELECT_DEPOSIT_AMOUNTS_FOR_KYC_CHECK_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Call @a kac on deposited amounts after @a time_limit which are relevant for a + * KYC trigger for a merchant identified by @a h_payto. + * + * @param pg the database context + * @param h_payto account identifier + * @param time_limit oldest transaction that could be relevant + * @param kac function to call for each applicable amount, + * in reverse chronological order (or until @a kac aborts + * by returning anything except #GNUNET_OK). + * @param kac_cls closure for @a kac + * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_deposit_amounts_for_kyc_check ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Absolute time_limit, + TALER_KYCLOGIC_KycAmountCallback kac, + void *kac_cls); + + +#endif diff --git a/src/include/exchange-database/select_exchange_credit_transfers.h b/src/include/exchange-database/select_exchange_credit_transfers.h @@ -0,0 +1,51 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_exchange_credit_transfers.h + * @brief implementation of the select_exchange_credit_transfers function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_EXCHANGE_CREDIT_TRANSFERS_H +#define EXCHANGE_DATABASE_SELECT_EXCHANGE_CREDIT_TRANSFERS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Return AML-relevant wire transfer credit data. + * + * @param pg the database context + * @param threshold minimum wire amount to return data for + * @param offset offset in table to filter by + * @param limit maximum number of entries to return, negative for descending + * @param h_payto account to filter transfer data by + * @param cb function to call on each result + * @param cb_cls closure to pass to @a cb + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_exchange_credit_transfers ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_Amount *threshold, + uint64_t offset, + int64_t limit, + const struct TALER_NormalizedPaytoHashP *h_payto, + TALER_EXCHANGEDB_AmlTransferCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_exchange_debit_transfers.h b/src/include/exchange-database/select_exchange_debit_transfers.h @@ -0,0 +1,77 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_exchange_debit_transfers.h + * @brief implementation of the select_exchange_debit_transfers function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_EXCHANGE_DEBIT_TRANSFERS_H +#define EXCHANGE_DATABASE_SELECT_EXCHANGE_DEBIT_TRANSFERS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/* Callback typedefs */ +/** + * Callback that is given AML-relevant transfer data. + * + * @param cls closure + * @param row_id current row in AML status table + * @param payto_uri account involved with the wire transfer + * @param execution_time when was the transfer made + * @param amount wire amount of the transfer + */ +typedef void +(*TALER_EXCHANGEDB_AmlTransferCallback)( + void *cls, + uint64_t row_id, + const char *payto_uri, + struct GNUNET_TIME_Absolute execution_time, + const struct TALER_Amount *amount); + +/** + * Return AML-relevant wire transfer debit data. + * + * @param pg the database context + * @param threshold minimum wire amount to return data for + * @param offset offset in table to filter by + * @param limit maximum number of entries to return, negative for descending + * @param h_payto account to filter transfer data by + * @param cb function to call on each result + * @param cb_cls closure to pass to @a cb + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_exchange_debit_transfers (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + const struct TALER_Amount * + threshold + , + uint64_t offset, + int64_t limit, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + TALER_EXCHANGEDB_AmlTransferCallback + cb, + void *cb_cls); + + +#endif diff --git a/src/include/exchange-database/select_exchange_kycauth_transfers.h b/src/include/exchange-database/select_exchange_kycauth_transfers.h @@ -0,0 +1,74 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_exchange_kycauth_transfers.h + * @brief implementation of the select_exchange_kycauth_transfers function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_EXCHANGE_KYCAUTH_TRANSFERS_H +#define EXCHANGE_DATABASE_SELECT_EXCHANGE_KYCAUTH_TRANSFERS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/* Callback typedefs */ +/** + * Callback that is given AML-relevant transfer data. + * + * @param cls closure + * @param row_id current row in AML status table + * @param payto_uri account involved with the wire transfer + * @param execution_time when was the transfer made + * @param amount wire amount of the transfer + */ +typedef void +(*TALER_EXCHANGEDB_AmlTransferCallback)( + void *cls, + uint64_t row_id, + const char *payto_uri, + struct GNUNET_TIME_Absolute execution_time, + const struct TALER_Amount *amount); + +/** + * Return wire transfer kycauth data. + * + * @param pg the database context + * @param threshold minimum wire amount to return data for + * @param offset offset in table to filter by + * @param limit maximum number of entries to return, negative for descending + * @param h_payto account to filter transfer data by + * @param cb function to call on each result + * @param cb_cls closure to pass to @a cb + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_exchange_kycauth_transfers (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct TALER_Amount * + threshold, + uint64_t offset, + int64_t limit, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + TALER_EXCHANGEDB_AmlTransferCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_kyc_accounts.h b/src/include/exchange-database/select_kyc_accounts.h @@ -0,0 +1,114 @@ +/* + This file is part of TALER + Copyright (C) 2025 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_kyc_accounts.h + * @brief implementation of the select_kyc_accounts function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_KYC_ACCOUNTS_H +#define EXCHANGE_DATABASE_SELECT_KYC_ACCOUNTS_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Return account summary information. + * + * @param cls closure + * @param row_id current row in AML status table + * @param h_payto account for which the attribute data is stored + * @param open_time when was the account opened formally, + * GNUNET_TIME_UNIT_FOREVER_TS if it was never opened + * @param close_time when was the account formally closed, + * GNUNET_TIME_UNIT_ZERO_TS if it was never closed + * @param comments comments on the account + * @param high_risk is this a high-risk business relationship + * @param to_investigate TRUE if this account should be investigated + * @param payto the payto URI of the account + */ +typedef void +(*TALER_EXCHANGEDB_AmlAccountListCallback)( + void *cls, + uint64_t row_id, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Timestamp open_time, + struct GNUNET_TIME_Timestamp close_time, + const char *comments, + bool high_risk, + bool to_investigate, + struct TALER_FullPayto payto); + + +/* Callback typedefs */ +/** + * Return account summary information. + * + * @param cls closure + * @param row_id current row in AML status table + * @param h_payto account for which the attribute data is stored + * @param open_time when was the account opened formally, + * GNUNET_TIME_UNIT_FOREVER_TS if it was never opened + * @param close_time when was the account formally closed, + * GNUNET_TIME_UNIT_ZERO_TS if it was never closed + * @param comments comments on the account + * @param high_risk is this a high-risk business relationship + * @param to_investigate TRUE if this account should be investigated + * @param payto the payto URI of the account + */ +typedef void +(*TALER_EXCHANGEDB_AmlAccountListCallback)( + void *cls, + uint64_t row_id, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Timestamp open_time, + struct GNUNET_TIME_Timestamp close_time, + const char *comments, + bool high_risk, + bool to_investigate, + struct TALER_FullPayto payto); + +/** + * List accounts managed by the exchange (for AML/KYC). + * + * @param pg the database context + * @param investigation_only filter by investigation state + * @param open_only filter for only open accounts + * @param high_risk_only filter for only high-risk accounts + * @param offset row to start from + * @param limit how many records to return (negative + * to go back in time, positive to go forward) + * @param cb callback to invoke on each match + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_kyc_accounts (struct TALER_EXCHANGEDB_PostgresContext * + pg, + enum TALER_EXCHANGE_YesNoAll + investigation_only, + enum TALER_EXCHANGE_YesNoAll open_only, + enum TALER_EXCHANGE_YesNoAll + high_risk_only, + uint64_t offset, + int64_t limit, + TALER_EXCHANGEDB_AmlAccountListCallback cb + , + void *cb_cls); + + +#endif diff --git a/src/include/exchange-database/select_kyc_attributes.h b/src/include/exchange-database/select_kyc_attributes.h @@ -0,0 +1,91 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_kyc_attributes.h + * @brief implementation of the select_kyc_attributes function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_KYC_ATTRIBUTES_H +#define EXCHANGE_DATABASE_SELECT_KYC_ATTRIBUTES_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Callback with KYC attributes about a particular user. + * + * @param cls closure + * @param h_payto account for which the attribute data is stored + * @param provider_name provider that must be checked + * @param collection_time when was the data collected + * @param expiration_time when does the data expire + * @param enc_attributes_size number of bytes in @a enc_attributes + * @param enc_attributes encrypted attribute data + */ +typedef void +(*TALER_EXCHANGEDB_AttributeCallback)( + void *cls, + const struct TALER_NormalizedPaytoHashP *h_payto, + const char *provider_name, + struct GNUNET_TIME_Timestamp collection_time, + struct GNUNET_TIME_Timestamp expiration_time, + size_t enc_attributes_size, + const void *enc_attributes); + + +/* Callback typedefs */ +/** + * Callback with KYC attributes about a particular user. + * + * @param cls closure + * @param h_payto account for which the attribute data is stored + * @param provider_name provider that must be checked + * @param collection_time when was the data collected + * @param expiration_time when does the data expire + * @param enc_attributes_size number of bytes in @a enc_attributes + * @param enc_attributes encrypted attribute data + */ +typedef void +(*TALER_EXCHANGEDB_AttributeCallback)( + void *cls, + const struct TALER_NormalizedPaytoHashP *h_payto, + const char *provider_name, + struct GNUNET_TIME_Timestamp collection_time, + struct GNUNET_TIME_Timestamp expiration_time, + size_t enc_attributes_size, + const void *enc_attributes); + +/** + * Lookup KYC attribute data for a specific account. + * + * @param pg the database context + * @param h_payto account for which the attribute data is stored + * @param cb callback to invoke on each match + * @param cb_cls closure for @a cb + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_kyc_attributes (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + TALER_EXCHANGEDB_AttributeCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_merge_amounts_for_kyc_check.h b/src/include/exchange-database/select_merge_amounts_for_kyc_check.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_merge_amounts_for_kyc_check.h + * @brief implementation of the select_merge_amounts_for_kyc_check function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_MERGE_AMOUNTS_FOR_KYC_CHECK_H +#define EXCHANGE_DATABASE_SELECT_MERGE_AMOUNTS_FOR_KYC_CHECK_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Call @a kac on merged reserve amounts after @a time_limit which are relevant for a + * KYC trigger for a the wallet identified by @a h_payto. + * + * @param pg the database context + * @param h_payto account identifier + * @param time_limit oldest transaction that could be relevant + * @param kac function to call for each applicable amount, in reverse chronological order (or until @a kac aborts by returning anything except #GNUNET_OK). + * @param kac_cls closure for @a kac + * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_merge_amounts_for_kyc_check ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Absolute time_limit, + TALER_KYCLOGIC_KycAmountCallback kac, + void *kac_cls); + +#endif diff --git a/src/include/taler/exchange-database/select_purse.h b/src/include/exchange-database/select_purse.h diff --git a/src/include/exchange-database/select_purse_by_merge_pub.h b/src/include/exchange-database/select_purse_by_merge_pub.h @@ -0,0 +1,69 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_purse_by_merge_pub.h + * @brief implementation of the select_purse_by_merge_pub function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_PURSE_BY_MERGE_PUB_H +#define EXCHANGE_DATABASE_SELECT_PURSE_BY_MERGE_PUB_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to return meta data about a purse by the + * merge capability key. + * + * @param pg the database context + * @param merge_pub public key representing the merge capability + * @param[out] purse_pub public key of the purse + * @param[out] purse_expiration when would an unmerged purse expire + * @param[out] h_contract_terms contract associated with the purse + * @param[out] age_limit the age limit for deposits into the purse + * @param[out] target_amount amount to be put into the purse + * @param[out] balance amount put so far into the purse + * @param[out] purse_sig signature of the purse over the initialization data + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_purse_by_merge_pub (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_PurseMergePublicKeyP * + merge_pub, + struct + TALER_PurseContractPublicKeyP + * + purse_pub, + struct GNUNET_TIME_Timestamp * + purse_expiration, + struct + TALER_PrivateContractHashP * + h_contract_terms, + uint32_t *age_limit, + struct TALER_Amount * + target_amount, + struct TALER_Amount *balance, + struct + TALER_PurseContractSignatureP + * + purse_sig); + +#endif diff --git a/src/include/exchange-database/select_purse_decisions_above_serial_id.h b/src/include/exchange-database/select_purse_decisions_above_serial_id.h @@ -0,0 +1,92 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_purse_decisions_above_serial_id.h + * @brief implementation of the select_purse_decisions_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_PURSE_DECISIONS_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_PURSE_DECISIONS_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with details about purse decisions that have been made, with + * the goal of auditing the purse's execution. + * + * @param cls closure + * @param rowid unique serial ID for the deposit in our DB + * @param purse_pub public key of the purse + * @param reserve_pub public key of the target reserve, NULL if not known / refunded + * @param purse_value what is the (target) value of the purse + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_PurseDecisionCallback)( + void *cls, + uint64_t rowid, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_Amount *purse_value); + + +/* Callback typedefs */ +/** + * Function called with details about purse decisions that have been made, with + * the goal of auditing the purse's execution. + * + * @param cls closure + * @param rowid unique serial ID for the deposit in our DB + * @param purse_pub public key of the purse + * @param reserve_pub public key of the target reserve, NULL if not known / refunded + * @param purse_value what is the (target) value of the purse + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_PurseDecisionCallback)( + void *cls, + uint64_t rowid, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_Amount *purse_value); + +/** + * Select purse decisions above @a serial_id in monotonically increasing + * order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param refunded which refund status to select for + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_purse_decisions_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t + serial_id, + bool refunded, + TALER_EXCHANGEDB_PurseDecisionCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/taler/exchange-database/select_purse_deposits_above_serial_id.h b/src/include/exchange-database/select_purse_deposits_above_serial_id.h diff --git a/src/include/exchange-database/select_purse_deposits_by_purse.h b/src/include/exchange-database/select_purse_deposits_by_purse.h @@ -0,0 +1,91 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_purse_deposits_by_purse.h + * @brief implementation of the select_purse_deposits_by_purse function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_PURSE_DEPOSITS_BY_PURSE_H +#define EXCHANGE_DATABASE_SELECT_PURSE_DEPOSITS_BY_PURSE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with details about purse refunds that have been made, with + * the goal of auditing the purse refund's execution. + * + * @param cls closure + * @param rowid row of the refund event + * @param amount_with_fee amount of the deposit into the purse + * @param coin_pub coin that is to be refunded the @a given amount_with_fee + * @param denom_pub denomination of @a coin_pub + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_PurseRefundCoinCallback)( + void *cls, + uint64_t rowid, + const struct TALER_Amount *amount_with_fee, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_DenominationPublicKey *denom_pub); + + +/* Callback typedefs */ +/** + * Function called with details about purse refunds that have been made, with + * the goal of auditing the purse refund's execution. + * + * @param cls closure + * @param rowid row of the refund event + * @param amount_with_fee amount of the deposit into the purse + * @param coin_pub coin that is to be refunded the @a given amount_with_fee + * @param denom_pub denomination of @a coin_pub + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_PurseRefundCoinCallback)( + void *cls, + uint64_t rowid, + const struct TALER_Amount *amount_with_fee, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_DenominationPublicKey *denom_pub); + +/** + * Select coin affected by purse refund. + * + * @param pg the database context + * @param purse_pub purse that was refunded + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_purse_deposits_by_purse (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + const struct + TALER_PurseContractPublicKeyP + * + purse_pub, + TALER_EXCHANGEDB_PurseRefundCoinCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_purse_merge.h b/src/include/exchange-database/select_purse_merge.h @@ -0,0 +1,56 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_purse_merge.h + * @brief implementation of the select_purse_merge function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_PURSE_MERGE_H +#define EXCHANGE_DATABASE_SELECT_PURSE_MERGE_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to approve merging of a purse with + * an account, made by the receiving account. + * + * @param pg the database context + * @param purse_pub public key of the purse + * @param[out] merge_sig set to the signature confirming the merge + * @param[out] merge_timestamp set to the time of the merge + * @param[out] partner_url set to the URL of the target exchange, or NULL if the target exchange is us. To be freed by the caller. + * @param[out] reserve_pub set to the public key of the reserve/account being credited + * @param[out] refunded set to true if purse was refunded + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_purse_merge (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_PurseContractPublicKeyP * + purse_pub, + struct TALER_PurseMergeSignatureP * + merge_sig, + struct GNUNET_TIME_Timestamp * + merge_timestamp, + char **partner_url, + struct TALER_ReservePublicKeyP * + reserve_pub, + bool *refunded); + +#endif diff --git a/src/include/taler/exchange-database/select_purse_merges_above_serial_id.h b/src/include/exchange-database/select_purse_merges_above_serial_id.h diff --git a/src/include/taler/exchange-database/select_purse_requests_above_serial_id.h b/src/include/exchange-database/select_purse_requests_above_serial_id.h diff --git a/src/include/exchange-database/select_recoup_above_serial_id.h b/src/include/exchange-database/select_recoup_above_serial_id.h @@ -0,0 +1,103 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_recoup_above_serial_id.h + * @brief implementation of the select_recoup_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_RECOUP_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_RECOUP_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called about recoups the exchange has to perform. + * + * @param cls closure + * @param rowid row identifier used to uniquely identify the recoup operation + * @param timestamp when did we receive the recoup request + * @param amount how much should be added back to the reserve + * @param reserve_pub public key of the reserve + * @param coin public information about the coin + * @param denom_pub denomination key of @a coin + * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP + * @param coin_blind blinding factor used to blind the coin + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RecoupCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp timestamp, + const struct TALER_Amount *amount, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_CoinPublicInfo *coin, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendSignatureP *coin_sig, + const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); + + +/* Callback typedefs */ +/** + * Function called about recoups the exchange has to perform. + * + * @param cls closure + * @param rowid row identifier used to uniquely identify the recoup operation + * @param timestamp when did we receive the recoup request + * @param amount how much should be added back to the reserve + * @param reserve_pub public key of the reserve + * @param coin public information about the coin + * @param denom_pub denomination key of @a coin + * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP + * @param coin_blind blinding factor used to blind the coin + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RecoupCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp timestamp, + const struct TALER_Amount *amount, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_CoinPublicInfo *coin, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendSignatureP *coin_sig, + const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); + +/** + * Function called to select recoup requests the exchange + * received, ordered by serial ID (monotonically increasing). + * + * @param pg the database context + * @param serial_id lowest serial ID to include (select larger or equal) + * @param cb function to call for ONE unfinished item + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_recoup_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + uint64_t serial_id, + TALER_EXCHANGEDB_RecoupCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_recoup_refresh_above_serial_id.h b/src/include/exchange-database/select_recoup_refresh_above_serial_id.h @@ -0,0 +1,109 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_recoup_refresh_above_serial_id.h + * @brief implementation of the select_recoup_refresh_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_RECOUP_REFRESH_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_RECOUP_REFRESH_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called about recoups on refreshed coins the exchange has to + * perform. + * + * @param cls closure + * @param rowid row identifier used to uniquely identify the recoup operation + * @param timestamp when did we receive the recoup request + * @param amount how much should be added back to the old coin + * @param old_coin_pub original coin that was refreshed to create @a coin + * @param old_denom_pub_hash hash of public key of @a old_coin_pub + * @param coin public information about the fresh coin + * @param denom_pub denomination key of @a coin + * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP + * @param coin_blind blinding factor used to blind the coin + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RecoupRefreshCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp timestamp, + const struct TALER_Amount *amount, + const struct TALER_CoinSpendPublicKeyP *old_coin_pub, + const struct TALER_DenominationHashP *old_denom_pub_hash, + const struct TALER_CoinPublicInfo *coin, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendSignatureP *coin_sig, + const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); + + +/* Callback typedefs */ +/** + * Function called about recoups on refreshed coins the exchange has to + * perform. + * + * @param cls closure + * @param rowid row identifier used to uniquely identify the recoup operation + * @param timestamp when did we receive the recoup request + * @param amount how much should be added back to the old coin + * @param old_coin_pub original coin that was refreshed to create @a coin + * @param old_denom_pub_hash hash of public key of @a old_coin_pub + * @param coin public information about the fresh coin + * @param denom_pub denomination key of @a coin + * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP + * @param coin_blind blinding factor used to blind the coin + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RecoupRefreshCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp timestamp, + const struct TALER_Amount *amount, + const struct TALER_CoinSpendPublicKeyP *old_coin_pub, + const struct TALER_DenominationHashP *old_denom_pub_hash, + const struct TALER_CoinPublicInfo *coin, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendSignatureP *coin_sig, + const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); + +/** + * Function called to select recoup requests the exchange received for + * refreshed coins, ordered by serial ID (monotonically increasing). + * + * @param pg the database context + * @param serial_id lowest serial ID to include (select larger or equal) + * @param cb function to call for ONE unfinished item + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_recoup_refresh_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t serial_id, + TALER_EXCHANGEDB_RecoupRefreshCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_refreshes_above_serial_id.h b/src/include/exchange-database/select_refreshes_above_serial_id.h @@ -0,0 +1,109 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_refreshes_above_serial_id.h + * @brief implementation of the select_refreshes_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_REFRESHES_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_REFRESHES_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with details about coins that were melted, + * with the goal of auditing the refresh's execution. + * + * @param cls closure + * @param rowid unique serial ID for the refresh session in our DB + * @param old_denom_pub denomination public key of @a coin_pub + * @param coin_pub public key of the coin + * @param coin_sig signature from the coin + * @param h_age_commitment hash of the age commitment for the coin + * @param amount_with_fee amount that was deposited including fee + * @param num_nds length of the @a new_denom_serials array + * @param new_denom_serials array of denomination serials of fresh coins + * @param rc what the refresh commitment + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RefreshesCallback)( + void *cls, + uint64_t rowid, + const struct TALER_DenominationPublicKey *old_denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_CoinSpendSignatureP *coin_sig, + const struct TALER_AgeCommitmentHashP *h_age_commitment, + const struct TALER_Amount *amount_with_fee, + size_t num_nds, + uint64_t new_denom_serials[static num_nds], + const struct TALER_RefreshCommitmentP *rc); + + +/* Callback typedefs */ +/** + * Function called with details about coins that were melted, + * with the goal of auditing the refresh's execution. + * + * @param cls closure + * @param rowid unique serial ID for the refresh session in our DB + * @param old_denom_pub denomination public key of @a coin_pub + * @param coin_pub public key of the coin + * @param coin_sig signature from the coin + * @param h_age_commitment hash of the age commitment for the coin + * @param amount_with_fee amount that was deposited including fee + * @param num_nds length of the @a new_denom_serials array + * @param new_denom_serials array of denomination serials of fresh coins + * @param rc what the refresh commitment + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RefreshesCallback)( + void *cls, + uint64_t rowid, + const struct TALER_DenominationPublicKey *old_denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_CoinSpendSignatureP *coin_sig, + const struct TALER_AgeCommitmentHashP *h_age_commitment, + const struct TALER_Amount *amount_with_fee, + size_t num_nds, + uint64_t new_denom_serials[static num_nds], + const struct TALER_RefreshCommitmentP *rc); + +/** + * Select refresh sessions above @a serial_id in monotonically increasing + * order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_refreshes_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t serial_id, + TALER_EXCHANGEDB_RefreshesCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_refunds_above_serial_id.h b/src/include/exchange-database/select_refunds_above_serial_id.h @@ -0,0 +1,109 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_refunds_above_serial_id.h + * @brief implementation of the select_refunds_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_REFUNDS_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_REFUNDS_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" +#include "exchange-database/do_refund.h" + + +/** + * Function called with details about coins that were refunding, + * with the goal of auditing the refund's execution. + * + * @param cls closure + * @param rowid unique serial ID for the refund in our DB + * @param denom_pub denomination public key of @a coin_pub + * @param coin_pub public key of the coin + * @param merchant_pub public key of the merchant + * @param merchant_sig signature of the merchant + * @param h_contract_terms hash of the proposal data known to merchant and customer + * @param rtransaction_id refund transaction ID chosen by the merchant + * @param full_refund true if the refunds total up to the entire value of the deposit + * @param amount_with_fee amount that was deposited including fee + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RefundCallback)( + void *cls, + uint64_t rowid, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_MerchantSignatureP *merchant_sig, + const struct TALER_PrivateContractHashP *h_contract_terms, + uint64_t rtransaction_id, + bool full_refund, + const struct TALER_Amount *amount_with_fee); + + +/* Callback typedefs */ +/** + * Function called with details about coins that were refunding, + * with the goal of auditing the refund's execution. + * + * @param cls closure + * @param rowid unique serial ID for the refund in our DB + * @param denom_pub denomination public key of @a coin_pub + * @param coin_pub public key of the coin + * @param merchant_pub public key of the merchant + * @param merchant_sig signature of the merchant + * @param h_contract_terms hash of the proposal data known to merchant and customer + * @param rtransaction_id refund transaction ID chosen by the merchant + * @param full_refund true if the refunds total up to the entire value of the deposit + * @param amount_with_fee amount that was deposited including fee + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RefundCallback)( + void *cls, + uint64_t rowid, + const struct TALER_DenominationPublicKey *denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_MerchantSignatureP *merchant_sig, + const struct TALER_PrivateContractHashP *h_contract_terms, + uint64_t rtransaction_id, + bool full_refund, + const struct TALER_Amount *amount_with_fee); + +/** + * Select refunds above @a serial_id in monotonically increasing + * order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_refunds_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t serial_id, + TALER_EXCHANGEDB_RefundCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_refunds_by_coin.h b/src/include/exchange-database/select_refunds_by_coin.h @@ -0,0 +1,82 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_refunds_by_coin.h + * @brief implementation of the select_refunds_by_coin function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_REFUNDS_BY_COIN_H +#define EXCHANGE_DATABASE_SELECT_REFUNDS_BY_COIN_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Callback invoked with information about refunds applicable + * to a particular coin and contract. + * + * @param cls closure + * @param amount_with_fee amount being refunded + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RefundCoinCallback)( + void *cls, + const struct TALER_Amount *amount_with_fee); + + +/* Callback typedefs */ +/** + * Callback invoked with information about refunds applicable + * to a particular coin and contract. + * + * @param cls closure + * @param amount_with_fee amount being refunded + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_RefundCoinCallback)( + void *cls, + const struct TALER_Amount *amount_with_fee); + +/** + * Select refunds by @a coin_pub, @a merchant_pub and @a h_contract. + * + * @param pg the database context + * @param coin_pub coin to get refunds for + * @param merchant_pub merchant to get refunds for + * @param h_contract contract (hash) to get refunds for + * @param cb function to call for each refund found + * @param cb_cls closure for @a cb + * @return query result status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_refunds_by_coin (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const struct + TALER_CoinSpendPublicKeyP * + coin_pub, + const struct TALER_MerchantPublicKeyP * + merchant_pub, + const struct + TALER_PrivateContractHashP * + h_contract, + TALER_EXCHANGEDB_RefundCoinCallback cb, + void *cb_cls); + +#endif diff --git a/src/include/taler/exchange-database/select_reserve_close_info.h b/src/include/exchange-database/select_reserve_close_info.h diff --git a/src/include/taler/exchange-database/select_reserve_close_request_info.h b/src/include/exchange-database/select_reserve_close_request_info.h diff --git a/src/include/taler/exchange-database/select_reserve_closed_above_serial_id.h b/src/include/exchange-database/select_reserve_closed_above_serial_id.h diff --git a/src/include/taler/exchange-database/select_reserve_open_above_serial_id.h b/src/include/exchange-database/select_reserve_open_above_serial_id.h diff --git a/src/include/exchange-database/select_reserves_in_above_serial_id.h b/src/include/exchange-database/select_reserves_in_above_serial_id.h @@ -0,0 +1,71 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_reserves_in_above_serial_id.h + * @brief implementation of the select_reserves_in_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/* Callback typedefs */ +/** + * Function called with details about incoming wire transfers. + * + * @param cls closure + * @param rowid unique serial ID for the refresh session in our DB + * @param reserve_pub public key of the reserve (also the wire subject) + * @param credit amount that was received + * @param sender_account_details information about the sender's bank account, in payto://-format + * @param wire_reference unique identifier for the wire transfer + * @param execution_date when did we receive the funds + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_ReserveInCallback)( + void *cls, + uint64_t rowid, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_Amount *credit, + const struct TALER_FullPayto sender_account_details, + uint64_t wire_reference, + struct GNUNET_TIME_Timestamp execution_date); + +/** + * Select inbound wire transfers into reserves_in above @a serial_id + * in monotonically increasing order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_reserves_in_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + uint64_t serial_id, + TALER_EXCHANGEDB_ReserveInCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_reserves_in_above_serial_id_by_account.h b/src/include/exchange-database/select_reserves_in_above_serial_id_by_account.h @@ -0,0 +1,77 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_reserves_in_above_serial_id_by_account.h + * @brief implementation of the select_reserves_in_above_serial_id_by_account function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H +#define EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/* Callback typedefs */ +/** + * Function called with details about incoming wire transfers. + * + * @param cls closure + * @param rowid unique serial ID for the refresh session in our DB + * @param reserve_pub public key of the reserve (also the wire subject) + * @param credit amount that was received + * @param sender_account_details information about the sender's bank account, in payto://-format + * @param wire_reference unique identifier for the wire transfer + * @param execution_date when did we receive the funds + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_ReserveInCallback)( + void *cls, + uint64_t rowid, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_Amount *credit, + const struct TALER_FullPayto sender_account_details, + uint64_t wire_reference, + struct GNUNET_TIME_Timestamp execution_date); + +/** + * Select inbound wire transfers into reserves_in above @a serial_id + * in monotonically increasing order by account. + * + * @param pg the database context + * @param account_name name of the account to select by + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_reserves_in_above_serial_id_by_account (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const char + * + account_name, + uint64_t + serial_id, + TALER_EXCHANGEDB_ReserveInCallback + cb, + void * + cb_cls); + +#endif diff --git a/src/include/exchange-database/select_wire_out_above_serial_id.h b/src/include/exchange-database/select_wire_out_above_serial_id.h @@ -0,0 +1,71 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_wire_out_above_serial_id.h + * @brief implementation of the select_wire_out_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/* Callback typedefs */ +/** + * Function called with the results of the lookup of the + * wire transfer data of the exchange. + * + * @param cls closure + * @param rowid identifier of the respective row in the database + * @param date timestamp of the wire transfer (roughly) + * @param wtid wire transfer subject + * @param payto_uri details of the receiver, URI in payto://-format + * @param amount amount that was wired + * @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_WireTransferOutCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp date, + const struct TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_FullPayto payto_uri, + const struct TALER_Amount *amount); + +/** + * Function called to select all wire transfers the exchange + * executed. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call for ONE unfinished item + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_wire_out_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t serial_id, + TALER_EXCHANGEDB_WireTransferOutCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/select_wire_out_above_serial_id_by_account.h b/src/include/exchange-database/select_wire_out_above_serial_id_by_account.h @@ -0,0 +1,75 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_wire_out_above_serial_id_by_account.h + * @brief implementation of the select_wire_out_above_serial_id_by_account function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_BY_ACCOUNT_H +#define EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_BY_ACCOUNT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/* Callback typedefs */ +/** + * Function called with the results of the lookup of the + * wire transfer data of the exchange. + * + * @param cls closure + * @param rowid identifier of the respective row in the database + * @param date timestamp of the wire transfer (roughly) + * @param wtid wire transfer subject + * @param payto_uri details of the receiver, URI in payto://-format + * @param amount amount that was wired + * @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_WireTransferOutCallback)( + void *cls, + uint64_t rowid, + struct GNUNET_TIME_Timestamp date, + const struct TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_FullPayto payto_uri, + const struct TALER_Amount *amount); + +/** + * Function called to select all wire transfers the exchange + * executed by account. + * + * @param pg the database context + * @param account_name account to select + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call for ONE unfinished item + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_TALER_EXCHANGEDB_select_wire_out_above_serial_id_by_account (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const char * + account_name, + uint64_t + serial_id, + TALER_EXCHANGEDB_WireTransferOutCallback + cb, + void *cb_cls) +; + +#endif diff --git a/src/include/exchange-database/select_withdraw_amounts_for_kyc_check.h b/src/include/exchange-database/select_withdraw_amounts_for_kyc_check.h @@ -0,0 +1,56 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_withdraw_amounts_for_kyc_check.h + * @brief implementation of the select_withdraw_amounts_for_kyc_check function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_WITHDRAW_AMOUNTS_FOR_KYC_CHECK_H +#define EXCHANGE_DATABASE_SELECT_WITHDRAW_AMOUNTS_FOR_KYC_CHECK_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Call @a kac on withdrawn amounts after @a time_limit which are relevant + * for a KYC trigger for a the (debited) account identified by @a h_payto. + * + * @param pg the database context + * @param h_payto account identifier + * @param time_limit oldest transaction that could be relevant + * @param kac function to call for each applicable amount, in reverse chronological order (or until @a kac aborts by returning anything except #GNUNET_OK). + * @param kac_cls closure for @a kac + * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_withdraw_amounts_for_kyc_check (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + const struct + TALER_NormalizedPaytoHashP + * + h_payto, + struct + GNUNET_TIME_Absolute + time_limit, + TALER_KYCLOGIC_KycAmountCallback + kac, + void *kac_cls); + +#endif diff --git a/src/include/exchange-database/select_withdrawals_above_serial_id.h b/src/include/exchange-database/select_withdrawals_above_serial_id.h @@ -0,0 +1,122 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/select_withdrawals_above_serial_id.h + * @brief implementation of the select_withdrawals_above_serial_id function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SELECT_WITHDRAWALS_ABOVE_SERIAL_ID_H +#define EXCHANGE_DATABASE_SELECT_WITHDRAWALS_ABOVE_SERIAL_ID_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called with details about withdraw operations. + * + * @param cls closure + * @param rowid unique serial ID for the refresh session in our DB + * @param num_denom_serials number of elements in @e denom_serials array + * @param denom_serials array with length @e num_denom_serials of serial ID's of denominations in our DB + * @param selected_h hash over the gamma-selected planchets + * @param h_planchets running hash over all hashes of blinded planchets in the original withdraw request + * @param blinding_seed the blinding seed for CS denominations that was provided during withdraw; might be NULL + * @param age_proof_required true if the withdraw request required an age proof. + * @param max_age if @e age_proof_required is true, the maximum age that was set on the coins. + * @param noreveal_index if @e age_proof_required is true, the index that was returned by the exchange for the reveal phase. + * @param reserve_pub public key of the reserve + * @param reserve_sig signature over the withdraw operation + * @param execution_date when did the wallet withdraw the coin + * @param amount_with_fee amount that was withdrawn + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_WithdrawCallback)( + void *cls, + uint64_t rowid, + size_t num_denom_serials, + const uint64_t *denom_serials, + const struct TALER_HashBlindedPlanchetsP *selected_h, + const struct TALER_HashBlindedPlanchetsP *h_planchets, + const struct TALER_BlindingMasterSeedP *blinding_seed, + bool age_proof_required, + uint8_t max_age, + uint8_t noreveal_index, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_ReserveSignatureP *reserve_sig, + struct GNUNET_TIME_Timestamp execution_date, + const struct TALER_Amount *amount_with_fee); + + +/* Callback typedefs */ +/** + * Function called with details about withdraw operations. + * + * @param cls closure + * @param rowid unique serial ID for the refresh session in our DB + * @param num_denom_serials number of elements in @e denom_serials array + * @param denom_serials array with length @e num_denom_serials of serial ID's of denominations in our DB + * @param selected_h hash over the gamma-selected planchets + * @param h_planchets running hash over all hashes of blinded planchets in the original withdraw request + * @param blinding_seed the blinding seed for CS denominations that was provided during withdraw; might be NULL + * @param age_proof_required true if the withdraw request required an age proof. + * @param max_age if @e age_proof_required is true, the maximum age that was set on the coins. + * @param noreveal_index if @e age_proof_required is true, the index that was returned by the exchange for the reveal phase. + * @param reserve_pub public key of the reserve + * @param reserve_sig signature over the withdraw operation + * @param execution_date when did the wallet withdraw the coin + * @param amount_with_fee amount that was withdrawn + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop + */ +typedef enum GNUNET_GenericReturnValue +(*TALER_EXCHANGEDB_WithdrawCallback)( + void *cls, + uint64_t rowid, + size_t num_denom_serials, + const uint64_t *denom_serials, + const struct TALER_HashBlindedPlanchetsP *selected_h, + const struct TALER_HashBlindedPlanchetsP *h_planchets, + const struct TALER_BlindingMasterSeedP *blinding_seed, + bool age_proof_required, + uint8_t max_age, + uint8_t noreveal_index, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_ReserveSignatureP *reserve_sig, + struct GNUNET_TIME_Timestamp execution_date, + const struct TALER_Amount *amount_with_fee); + +/** + * Select withdraw operations from reserves_out above @a serial_id + * in monotonically increasing order. + * + * @param pg the database context + * @param serial_id highest serial ID to exclude (select strictly larger) + * @param cb function to call on each result + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_select_withdrawals_above_serial_id (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + uint64_t serial_id, + TALER_EXCHANGEDB_WithdrawCallback + cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/set_aml_lock.h b/src/include/exchange-database/set_aml_lock.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/set_aml_lock.h + * @brief implementation of the set_aml_lock function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SET_AML_LOCK_H +#define EXCHANGE_DATABASE_SET_AML_LOCK_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Set a lock for @a lock_duration on running AML programs for the @a h_payto + * account. If a lock already exists, returns the timeout of the + * @a existing_lock. Returns 0 if @a h_payto is not known. + * + * @param pg the database context + * @param h_payto account to lock + * @param lock_duration how long to lock the account + * @param[out] existing_lock set to timeout of existing lock, or + * to zero if there is no existing lock + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_set_aml_lock (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_NormalizedPaytoHashP *h_payto, + struct GNUNET_TIME_Relative lock_duration, + struct GNUNET_TIME_Absolute *existing_lock); + + +#endif diff --git a/src/include/exchange-database/set_extension_manifest.h b/src/include/exchange-database/set_extension_manifest.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/set_extension_manifest.h + * @brief implementation of the set_extension_manifest function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SET_EXTENSION_MANIFEST_H +#define EXCHANGE_DATABASE_SET_EXTENSION_MANIFEST_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to save the manifest of an extension + * (age-restriction, policy_extension_...) After successful storage of the + * configuration it triggers the corresponding event. + * + * @param pg the database context + * @param extension_name the name of the extension + * @param manifest JSON object of the configuration as string + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_set_extension_manifest (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *extension_name, + const char *manifest); + +#endif diff --git a/src/include/exchange-database/set_purse_balance.h b/src/include/exchange-database/set_purse_balance.h @@ -0,0 +1,44 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/set_purse_balance.h + * @brief implementation of the set_purse_balance function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_SET_PURSE_BALANCE_H +#define EXCHANGE_DATABASE_SET_PURSE_BALANCE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Set the current @a balance in the purse + * identified by @a purse_pub. Used by the auditor + * to update the balance as calculated by the auditor. + * + * @param pg the database context + * @param purse_pub public key of a purse + * @param balance new balance to store under the purse + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_set_purse_balance (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_PurseContractPublicKeyP * + purse_pub, + const struct TALER_Amount *balance); + +#endif diff --git a/src/include/taler/exchange-database/start.h b/src/include/exchange-database/start.h diff --git a/src/include/exchange-database/start_deferred_wire_out.h b/src/include/exchange-database/start_deferred_wire_out.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/start_deferred_wire_out.h + * @brief implementation of the start_deferred_wire_out function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_START_DEFERRED_WIRE_OUT_H +#define EXCHANGE_DATABASE_START_DEFERRED_WIRE_OUT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Starts a READ COMMITTED transaction where we transiently violate the foreign + * constraints on the "wire_out" table as we insert aggregations + * and only add the wire transfer out at the end. + * + * @param pg the database context + * @return #GNUNET_OK on success + */ +enum GNUNET_GenericReturnValue +TALER_TALER_EXCHANGEDB_start_deferred_wire_out (struct + TALER_EXCHANGEDB_PostgresContext + *pg); + +#endif diff --git a/src/include/exchange-database/start_read_committed.h b/src/include/exchange-database/start_read_committed.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/start_read_committed.h + * @brief implementation of the start_read_committed function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_START_READ_COMMITTED_H +#define EXCHANGE_DATABASE_START_READ_COMMITTED_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Start a READ COMMITTED transaction. + * + * @param pg the database context + * @param name unique name identifying the transaction (for debugging) + * must point to a constant + * @return #GNUNET_OK on success + */ +enum GNUNET_GenericReturnValue +TALER_TALER_EXCHANGEDB_start_read_committed (struct + TALER_EXCHANGEDB_PostgresContext * + pg, + const char *name); + +#endif diff --git a/src/include/exchange-database/start_read_only.h b/src/include/exchange-database/start_read_only.h @@ -0,0 +1,42 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/start_read_only.h + * @brief implementation of the start_read_only function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_START_READ_ONLY_H +#define EXCHANGE_DATABASE_START_READ_ONLY_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Start a READ ONLY serializable transaction. + * + * @param pg the database context + * @param name unique name identifying the transaction (for debugging) + * must point to a constant + * @return #GNUNET_OK on success + */ +enum GNUNET_GenericReturnValue +TALER_TALER_EXCHANGEDB_start_read_only (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *name); + +#endif diff --git a/src/include/exchange-database/store_wire_transfer_out.h b/src/include/exchange-database/store_wire_transfer_out.h @@ -0,0 +1,55 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/store_wire_transfer_out.h + * @brief implementation of the store_wire_transfer_out function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_STORE_WIRE_TRANSFER_OUT_H +#define EXCHANGE_DATABASE_STORE_WIRE_TRANSFER_OUT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Store information about an outgoing wire transfer that was executed. + * + * @param pg the database context + * @param date time of the wire transfer + * @param wtid subject of the wire transfer + * @param h_payto identifies the receiver account of the wire transfer + * @param exchange_account_section configuration section of the exchange specifying the + * exchange's bank account being used + * @param amount amount that was transmitted + * @param extra_wire_subject_metadata additional meta data for the wire transfer subject, can be NULL + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_store_wire_transfer_out (struct + TALER_EXCHANGEDB_PostgresContext *pg, + struct GNUNET_TIME_Timestamp date, + const struct + TALER_WireTransferIdentifierRawP *wtid + , + const struct TALER_FullPaytoHashP * + h_payto, + const char *exchange_account_section, + const struct TALER_Amount *amount, + const char * + extra_wire_subject_metadata); + +#endif diff --git a/src/include/exchange-database/test_aml_officer.h b/src/include/exchange-database/test_aml_officer.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/test_aml_officer.h + * @brief implementation of the test_aml_officer function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_TEST_AML_OFFICER_H +#define EXCHANGE_DATABASE_TEST_AML_OFFICER_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Test if the given AML staff member is active + * (at least read-only). + * + * @param pg the database context + * @param decider_pub public key of the staff member + * @param[out] read_only set to true if the member is read-only + * @return database transaction status, if member is unknown or not active, 1 if member is active + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_test_aml_officer (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_AmlOfficerPublicKeyP * + decider_pub, + bool *read_only); + + +#endif diff --git a/src/include/exchange-database/trigger_kyc_rule_for_account.h b/src/include/exchange-database/trigger_kyc_rule_for_account.h @@ -0,0 +1,69 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/trigger_kyc_rule_for_account.h + * @brief implementation of the trigger_kyc_rule_for_account function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_TRIGGER_KYC_RULE_FOR_ACCOUNT_H +#define EXCHANGE_DATABASE_TRIGGER_KYC_RULE_FOR_ACCOUNT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert KYC requirement for @a h_payto account into table. + * + * @param pg the database context + * @param payto_uri account that must be KYC'ed, + * can be NULL if @a h_payto is already + * guaranteed to be in wire_targets + * @param h_payto hash of @a payto_uri + * @param set_account_pub public key to enable for the + * KYC authorization, NULL if not known + * @param check_merchant_pub public key that must already + * be enabled for a KYC authorzation for it to be + * valid, NULL if not known + * @param jmeasures serialized MeasureSet to put in place + * @param display_priority priority of the rule + * @param[out] requirement_row set to legitimization requirement row for this check + * @param[out] bad_kyc_auth set if @a check_account_pub + * did not match the existing KYC auth + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_trigger_kyc_rule_for_account (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct TALER_FullPayto + payto_uri, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + const union + TALER_AccountPublicKeyP * + set_account_pub, + const struct + TALER_MerchantPublicKeyP * + check_merchant_pub, + const json_t *jmeasures, + uint32_t display_priority, + uint64_t *requirement_row, + bool *bad_kyc_auth); + +#endif diff --git a/src/include/exchange-database/update_aggregation_transient.h b/src/include/exchange-database/update_aggregation_transient.h @@ -0,0 +1,54 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/update_aggregation_transient.h + * @brief implementation of the update_aggregation_transient function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_UPDATE_AGGREGATION_TRANSIENT_H +#define EXCHANGE_DATABASE_UPDATE_AGGREGATION_TRANSIENT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Update existing entry in the transient aggregation table. + * @a h_payto is only needed for query performance. + * + * @param pg the database context + * @param h_payto destination of the wire transfer + * @param wtid the raw wire transfer identifier to update + * @param kyc_requirement_row row in legitimization_requirements that need to be satisfied to continue, or 0 for none + * @param total new total amount to be wired in the future + * @return transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_update_aggregation_transient (struct + TALER_EXCHANGEDB_PostgresContext + *pg, + const struct + TALER_FullPaytoHashP * + h_payto, + const struct + TALER_WireTransferIdentifierRawP + *wtid, + uint64_t kyc_requirement_row, + const struct TALER_Amount *total) +; + +#endif diff --git a/src/include/exchange-database/update_auditor.h b/src/include/exchange-database/update_auditor.h @@ -0,0 +1,48 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/update_auditor.h + * @brief implementation of the update_auditor function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_UPDATE_AUDITOR_H +#define EXCHANGE_DATABASE_UPDATE_AUDITOR_H + +#include "taler/taler_util.h" +#include "taler/taler_exchangedb_lib.h" + +/** + * Update information about an auditor that will audit this exchange. + * + * @param pg the database context + * @param auditor_pub key of the auditor (primary key for the existing record) + * @param auditor_url base URL of the auditor's REST service, to be updated + * @param auditor_name name of the auditor (for humans) + * @param change_date date when the auditor status was last changed + * (only to be used for replay detection) + * @param enabled true to enable, false to disable + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_update_auditor (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_AuditorPublicKeyP * + auditor_pub, + const char *auditor_url, + const char *auditor_name, + struct GNUNET_TIME_Timestamp change_date, + bool enabled); + +#endif diff --git a/src/include/exchange-database/update_kyc_process_by_row.h b/src/include/exchange-database/update_kyc_process_by_row.h @@ -0,0 +1,65 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/update_kyc_process_by_row.h + * @brief implementation of the update_kyc_process_by_row function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_UPDATE_KYC_PROCESS_BY_ROW_H +#define EXCHANGE_DATABASE_UPDATE_KYC_PROCESS_BY_ROW_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Update KYC requirement check with provider-linkage and/or + * expiration data. + * + * @param pg the database context + * @param process_row row to select by + * @param provider_name provider that must be checked (technically redundant) + * @param h_payto account that must be KYC'ed (helps access by shard, otherwise also redundant) + * @param provider_account_id provider account ID + * @param provider_legitimization_id provider legitimization ID + * @param redirect_url where the user should be redirected to start the KYC process + * @param expiration how long is this KYC check set to be valid (in the past if invalid) + * @param ec error code, #TALER_EC_NONE on success + * @param error_message_hint human-readable error message details (in addition to @a ec, NULL on success) + * @param finished true to mark the process as done + * @return database transaction status + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_update_kyc_process_by_row (struct + TALER_EXCHANGEDB_PostgresContext *pg + , + uint64_t process_row, + const char *provider_name, + const struct + TALER_NormalizedPaytoHashP * + h_payto, + const char *provider_account_id, + const char * + provider_legitimization_id, + const char *redirect_url, + struct GNUNET_TIME_Absolute + expiration, + enum TALER_ErrorCode ec, + const char *error_message_hint, + bool finished); + +#endif diff --git a/src/include/taler/exchange-database/update_rules.h b/src/include/exchange-database/update_rules.h diff --git a/src/include/exchange-database/update_wire.h b/src/include/exchange-database/update_wire.h @@ -0,0 +1,61 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/update_wire.h + * @brief implementation of the update_wire function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_UPDATE_WIRE_H +#define EXCHANGE_DATABASE_UPDATE_WIRE_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Update information about a wire account of the exchange. + * + * @param pg the database context + * @param payto_uri account the update is about + * @param conversion_url URL of a conversion service, NULL if there is no conversion + * @param open_banking_gateway open banking gateway service, NULL if unavailable + * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable + * @param debit_restrictions JSON array with debit restrictions on the account; NULL allowed if not @a enabled + * @param credit_restrictions JSON array with credit restrictions on the account; NULL allowed if not @a enabled + * @param change_date date when the account status was last changed + * (only to be used for replay detection) + * @param master_sig master signature to store, can be NULL (if @a enabled is false) + * @param bank_label label to show this entry under in the UI, can be NULL + * @param priority determines order in which entries are shown in the UI + * @param enabled true to enable, false to disable (the actual change) + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_update_wire (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_FullPayto payto_uri, + const char *conversion_url, + const char *open_banking_gateway, + const char *wire_transfer_gateway, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + struct GNUNET_TIME_Timestamp change_date, + const struct TALER_MasterSignatureP *master_sig, + const char *bank_label, + int64_t priority, + bool enabled); + +#endif diff --git a/src/include/exchange-database/wad_in_insert.h b/src/include/exchange-database/wad_in_insert.h @@ -0,0 +1,52 @@ +/* + This file is part of TALER + Copyright (C) 2024 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/wad_in_insert.h + * @brief implementation of the wad_in_insert function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_WAD_IN_INSERT_H +#define EXCHANGE_DATABASE_WAD_IN_INSERT_H + +#include "taler/taler_util.h" +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Insert an incoming WAD wire transfer into the database. + * + * @param pg the database context + * @param wad_id WAD identifier + * @param origin_exchange_url exchange base URL originating the transfer + * @param amount the amount that was transferred + * @param execution_date when was the transfer made + * @param debit_account_uri URI of the debit account + * @param section_name section of the exchange bank account that received the transfer + * @param serial_id bank-specific row identifying the transfer + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_wad_in_insert (struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_WadIdentifierP *wad_id, + const char *origin_exchange_url, + const struct TALER_Amount *amount, + struct GNUNET_TIME_Timestamp execution_date, + const struct TALER_FullPayto debit_account_uri, + const char *section_name, + uint64_t serial_id); + + +#endif diff --git a/src/include/exchange-database/wire_prepare_data_get.h b/src/include/exchange-database/wire_prepare_data_get.h @@ -0,0 +1,63 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/wire_prepare_data_get.h + * @brief implementation of the wire_prepare_data_get function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_GET_H +#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_GET_H + +#include "taler/taler_json_lib.h" +#include "taler/taler_exchangedb_lib.h" + + +/** + * Callback with data about a prepared wire transfer. + * + * @param cls closure + * @param rowid row identifier used to mark prepared transaction as done + * @param wire_method which wire method is this preparation data for + * @param buf transaction data that was persisted, NULL on error + * @param buf_size number of bytes in @a buf, 0 on error + */ +typedef void +(*TALER_EXCHANGEDB_WirePreparationIterator) (void *cls, + uint64_t rowid, + const char *wire_method, + const char *buf, + size_t buf_size); + +/** + * Function called to get an unfinished wire transfer + * preparation data. Fetches at most one item. + * + * @param pg the database context + * @param start_row offset to query table at + * @param limit maximum number of results to return + * @param cb function to call for ONE unfinished item + * @param cb_cls closure for @a cb + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_wire_prepare_data_get ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + uint64_t start_row, + uint64_t limit, + TALER_EXCHANGEDB_WirePreparationIterator cb, + void *cb_cls); + +#endif diff --git a/src/include/exchange-database/wire_prepare_data_insert.h b/src/include/exchange-database/wire_prepare_data_insert.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/wire_prepare_data_insert.h + * @brief implementation of the wire_prepare_data_insert function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_INSERT_H +#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_INSERT_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to insert wire transfer commit data into the DB. + * + * @param pg the database context + * @param type type of the wire transfer (i.e. "iban") + * @param buf buffer with wire transfer preparation data + * @param buf_size number of bytes in @a buf + * @return query status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_wire_prepare_data_insert (struct + TALER_EXCHANGEDB_PostgresContext *pg, + const char *type, + const char *buf, + size_t buf_size); + +#endif diff --git a/src/include/exchange-database/wire_prepare_data_mark_failed.h b/src/include/exchange-database/wire_prepare_data_mark_failed.h @@ -0,0 +1,41 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/wire_prepare_data_mark_failed.h + * @brief implementation of the wire_prepare_data_mark_failed function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FAILED_H +#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FAILED_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to mark wire transfer commit data as failed. + * + * @param pg the database context + * @param rowid which entry to mark as failed + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_wire_prepare_data_mark_failed (struct + TALER_EXCHANGEDB_PostgresContext + *pg + , + uint64_t rowid); + +#endif diff --git a/src/include/exchange-database/wire_prepare_data_mark_finished.h b/src/include/exchange-database/wire_prepare_data_mark_finished.h @@ -0,0 +1,41 @@ +/* + This file is part of TALER + Copyright (C) 2022 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +/** + * @file src/include/exchange-database/wire_prepare_data_mark_finished.h + * @brief implementation of the wire_prepare_data_mark_finished function for Postgres + * @author Christian Grothoff + */ +#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FINISHED_H +#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FINISHED_H + +#include "taler/taler_exchangedb_lib.h" + + +/** + * Function called to mark wire transfer commit data as finished. + * + * @param pg the database context + * @param rowid which entry to mark as finished + * @return transaction status code + */ +enum GNUNET_DB_QueryStatus +TALER_EXCHANGEDB_wire_prepare_data_mark_finished (struct + TALER_EXCHANGEDB_PostgresContext + * + pg, + uint64_t rowid); + +#endif diff --git a/src/include/taler/auditor-database/del_denomination_balance.h b/src/include/taler/auditor-database/del_denomination_balance.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/del_denomination_balance.h - * @brief implementation of the del_denomination_balance function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_DEL_DENOMINATION_BALANCE_H -#define AUDITOR_DATABASE_DEL_DENOMINATION_BALANCE_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Delete information about a denomination key's balances. - * - * @param pg the database context - * @param denom_pub_hash hash of the denomination public key - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_del_denomination_balance (struct AUDITORDB_PostgresContext *pg, - const struct TALER_DenominationHashP * - denom_pub_hash); - -#endif diff --git a/src/include/taler/auditor-database/delete_auditor_closure_lag.h b/src/include/taler/auditor-database/delete_auditor_closure_lag.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/delete_auditor_closure_lag.h - * @brief implementation of the delete_auditor_closure_lag function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_DELETE_AUDITOR_CLOSURE_LAG_H -#define AUDITOR_DATABASE_DELETE_AUDITOR_CLOSURE_LAG_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * A previously missing wire transfer may have been found. Remove an alert - * (if we raised one). - * - * @param pg the database context - * @param amount wire transfer amount - * @param wtid wire transfer subject - * @param credit_account_uri destination account - * @return #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no matching alert was - * found - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_delete_auditor_closure_lag (struct AUDITORDB_PostgresContext *pg, - const struct TALER_Amount *amount, - const struct - TALER_WireTransferIdentifierRawP *wtid, - struct TALER_FullPayto credit_account_uri) -; - -#endif diff --git a/src/include/taler/auditor-database/delete_early_aggregation.h b/src/include/taler/auditor-database/delete_early_aggregation.h @@ -1,41 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/delete_early_aggregation.h - * @brief implementation of the delete_early_aggregation function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_DELETE_EARLY_AGGREGATION_H -#define AUDITOR_DATABASE_DELETE_EARLY_AGGREGATION_H - -#include "taler/taler_auditordb_lib.h" - - -/** - * Delete a row from the early aggregation table. - * Usually done when the expected aggregation - * was finally detected. - * - * @param pg the database context - * @param batch_deposit_serial_id which entry to delete - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_delete_early_aggregation (struct AUDITORDB_PostgresContext *pg, - uint64_t batch_deposit_serial_id); - - -#endif diff --git a/src/include/taler/auditor-database/delete_pending_deposit.h b/src/include/taler/auditor-database/delete_pending_deposit.h @@ -1,41 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/delete_pending_deposit.h - * @brief implementation of the delete_pending_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_DELETE_PENDING_DEPOSIT_H -#define AUDITOR_DATABASE_DELETE_PENDING_DEPOSIT_H - -#include "taler/taler_auditordb_lib.h" - - -/** - * Delete a row from the pending deposit table. - * Usually done when the respective wire transfer - * was finally detected. - * - * @param pg the database context - * @param batch_deposit_serial_id which entry to delete - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_delete_pending_deposit (struct AUDITORDB_PostgresContext *pg, - uint64_t batch_deposit_serial_id); - - -#endif diff --git a/src/include/taler/auditor-database/delete_purse_info.h b/src/include/taler/auditor-database/delete_purse_info.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/delete_purse_info.h - * @brief implementation of the delete_purse_info function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_DELETE_PURSE_INFO_H -#define AUDITOR_DATABASE_DELETE_PURSE_INFO_H - -#include "taler/taler_auditordb_lib.h" - - -/** - * Delete information about a purse. - * - * @param pg the database context - * @param purse_pub public key of the reserve - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_delete_purse_info (struct AUDITORDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub); - - -#endif diff --git a/src/include/taler/auditor-database/delete_reserve_in_inconsistency.h b/src/include/taler/auditor-database/delete_reserve_in_inconsistency.h @@ -1,38 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/delete_reserve_in_inconsistency.h - * @brief implementation of the delete_reserve_in_inconsistency function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_DELETE_RESERVE_IN_INCONSISTENCY_H -#define AUDITOR_DATABASE_DELETE_RESERVE_IN_INCONSISTENCY_H - -#include "taler/taler_auditordb_lib.h" - - -/** - * Delete information about an reserve-in-inconsistency from the database. - * - * @param pg the database context - * @param row_id row of the inconsistency in our table - * @return query result status - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_delete_reserve_in_inconsistency (struct AUDITORDB_PostgresContext *pg, - uint64_t row_id); - -#endif diff --git a/src/include/taler/auditor-database/get_balance.h b/src/include/taler/auditor-database/get_balance.h @@ -1,44 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/get_balance.h - * @brief implementation of the get_balance function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_GET_BALANCE_H -#define AUDITOR_DATABASE_GET_BALANCE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Get summary information about balance tracked by the auditor. - * - * @param pg the database context - * @param balance_key key of the balance to store - * @param[out] balance_value set to amount stored under @a balance_key - * @param ... NULL terminated list of additional key-value pairs to fetch - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_get_balance (struct AUDITORDB_PostgresContext *pg, - const char *balance_key, - struct TALER_Amount *balance_value, - ...); - -#endif diff --git a/src/include/taler/auditor-database/get_progress_points.h b/src/include/taler/auditor-database/get_progress_points.h @@ -1,66 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/get_progress_points.h - * @brief implementation of the get_progress_points function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_GET_PROGRESS_POINTS_H -#define AUDITOR_DATABASE_GET_PROGRESS_POINTS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Information about progress of the audit. - */ -struct TALER_AUDITORDB_Progress -{ - char *progress_key; - uint64_t progress_offset; -}; - -typedef enum GNUNET_GenericReturnValue -(*TALER_AUDITORDB_ProgressPointsCallback)( - void *cls, - const struct TALER_AUDITORDB_Progress *pp); - - -/* Callback typedefs */ -typedef enum GNUNET_GenericReturnValue -(*TALER_AUDITORDB_ProgressPointsCallback)( - void *cls, - const struct TALER_AUDITORDB_Progress *pp); - -/** - * Get information about progress from the database. - * - * @param pg the database context - * @param progress_key only return this particular progress point - * @param cb function to call with results - * @param cb_cls closure for @a cb - * @return query result status - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_get_progress_points (struct AUDITORDB_PostgresContext *pg, - const char *progress_key, - TALER_AUDITORDB_ProgressPointsCallback cb, - void *cb_cls); - - -#endif diff --git a/src/include/taler/auditor-database/get_purse_info.h b/src/include/taler/auditor-database/get_purse_info.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/get_purse_info.h - * @brief implementation of the get_purse_info function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_GET_PURSE_INFO_H -#define AUDITOR_DATABASE_GET_PURSE_INFO_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Get information about a purse. - * - * @param pg the database context - * @param purse_pub public key of the purse - * @param[out] rowid which row did we get the information from - * @param[out] balance set to balance of the purse - * @param[out] expiration_date expiration date of the purse - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_get_purse_info (struct AUDITORDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP *purse_pub, - uint64_t *rowid, - struct TALER_Amount *balance, - struct GNUNET_TIME_Timestamp *expiration_date); - -#endif diff --git a/src/include/taler/auditor-database/insert_early_aggregation.h b/src/include/taler/auditor-database/insert_early_aggregation.h @@ -1,47 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/insert_early_aggregation.h - * @brief implementation of the insert_early_aggregation function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_INSERT_EARLY_AGGREGATION_H -#define AUDITOR_DATABASE_INSERT_EARLY_AGGREGATION_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Insert new row into the early aggregation table. This can happen simply - * because of when the taler-helper-auditor-transfer looks at which of the - * two tables. If it is cleared in the next iteration, this is perfectly - * expected. - * - * @param pg the database context - * @param batch_deposit_serial_id where in the batch deposit table are we - * @param tracking_serial_id where in the tracking table are we - * @param total_amount value of all missing deposits, including fees - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_insert_early_aggregation (struct AUDITORDB_PostgresContext *pg, - uint64_t batch_deposit_serial_id, - uint64_t tracking_serial_id, - const struct TALER_Amount *total_amount); - -#endif diff --git a/src/include/taler/auditor-database/insert_pending_deposit.h b/src/include/taler/auditor-database/insert_pending_deposit.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/insert_pending_deposit.h - * @brief implementation of the insert_pending_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_INSERT_PENDING_DEPOSIT_H -#define AUDITOR_DATABASE_INSERT_PENDING_DEPOSIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Insert new row into the pending deposits table. - * - * @param pg the database context - * @param batch_deposit_serial_id where in the table are we - * @param total_amount value of all missing deposits, including fees - * @param wire_target_h_payto hash of the recipient account's payto URI - * @param deadline what was the requested wire transfer deadline - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_insert_pending_deposit (struct AUDITORDB_PostgresContext *pg, - uint64_t batch_deposit_serial_id, - const struct TALER_FullPaytoHashP * - wire_target_h_payto, - const struct TALER_Amount *total_amount, - struct GNUNET_TIME_Timestamp deadline); - - -#endif diff --git a/src/include/taler/auditor-database/insert_purse_info.h b/src/include/taler/auditor-database/insert_purse_info.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/insert_purse_info.h - * @brief implementation of the insert_purse_info function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_INSERT_PURSE_INFO_H -#define AUDITOR_DATABASE_INSERT_PURSE_INFO_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Insert information about a purse. There must not be an - * existing record for the purse. - * - * @param pg the database context - * @param purse_pub public key of the purse - * @param balance balance of the purse - * @param expiration_date expiration date of the purse - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_insert_purse_info (struct AUDITORDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_Amount *balance, - struct GNUNET_TIME_Timestamp expiration_date); - -#endif diff --git a/src/include/taler/auditor-database/select_early_aggregations.h b/src/include/taler/auditor-database/select_early_aggregations.h @@ -1,96 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/select_early_aggregations.h - * @brief implementation of the select_early_aggregations function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_SELECT_EARLY_AGGREGATIONS_H -#define AUDITOR_DATABASE_SELECT_EARLY_AGGREGATIONS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Information about an early aggregation event. - */ -struct TALER_AUDITORDB_EarlyAggregation -{ - /** - * Row of the event in the auditor database. - */ - uint64_t row_id; - - /** - * Row of the batch deposit in the exchange database. - */ - uint64_t batch_deposit_serial_id; - - /** - * FIXME - */ - uint64_t tracking_serial_id; - - /** - * Total amount involved. - */ - struct TALER_Amount total; - - /** - * True if this report was previously suppressed. - */ - bool suppressed; -}; - - -/** - * Function to call with information about early aggregations. - * - * @param cls closure - * @param ea event data - * @return #GNUNET_OK to continue to iterate - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_AUDITORDB_EarlyAggregationsCallback)( - void *cls, - const struct TALER_AUDITORDB_EarlyAggregation *ea); - - -/** - * Returns all aggregations that were found that were done - * too early. - * - * @param pg the database context - * @param limit number of rows to return, negative to iterate backwards - * @param offset starting offset, exclusive - * @param return_suppressed true to also return suppressed events - * @param cb function to call with results - * @param cb_cls closure for @a cb - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_select_early_aggregations ( - struct AUDITORDB_PostgresContext *pg, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_EarlyAggregationsCallback cb, - void *cb_cls); - - -#endif diff --git a/src/include/taler/auditor-database/select_pending_deposits.h b/src/include/taler/auditor-database/select_pending_deposits.h @@ -1,97 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/select_pending_deposits.h - * @brief implementation of the select_pending_deposits function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H -#define AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Function called on deposits that are past their due date - * and have not yet seen a wire transfer. - * - * @param cls closure - * @param row_id row ID of the alert in the auditor database - * @param batch_deposit_serial_id where in the exchange table are we - * @param total_amount value of all missing deposits, including fees - * @param wire_target_h_payto hash of the recipient account's payto URI - * @param deadline what was the earliest requested wire transfer deadline - * @param suppressed true if this report was suppressed - */ -typedef void -(*TALER_AUDITORDB_WireMissingCallback) ( - void *cls, - uint64_t row_id, - uint64_t batch_deposit_serial_id, - const struct TALER_Amount *total_amount, - const struct TALER_FullPaytoHashP *wire_target_h_payto, - struct GNUNET_TIME_Timestamp deadline, - bool suppressed); - - -/* Callback typedefs */ -/** - * Function called on deposits that are past their due date - * and have not yet seen a wire transfer. - * - * @param cls closure - * @param row_id row ID of the alert in the auditor database - * @param batch_deposit_serial_id where in the exchange table are we - * @param total_amount value of all missing deposits, including fees - * @param wire_target_h_payto hash of the recipient account's payto URI - * @param deadline what was the earliest requested wire transfer deadline - * @param suppressed true if this report was suppressed - */ -typedef void -(*TALER_AUDITORDB_WireMissingCallback) ( - void *cls, - uint64_t row_id, - uint64_t batch_deposit_serial_id, - const struct TALER_Amount *total_amount, - const struct TALER_FullPaytoHashP *wire_target_h_payto, - struct GNUNET_TIME_Timestamp deadline, - bool suppressed); - -/** - * Return (batch) deposits for which we have not yet - * seen the required wire transfer. - * - * @param pg the database context - * @param deadline only return up to this deadline - * @param limit number of rows to return, negative to iterate backwards - * @param offset starting offset, exclusive - * @param return_suppressed true to also return suppressed events - * @param cb function to call on each entry - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_select_pending_deposits (struct AUDITORDB_PostgresContext *pg, - struct GNUNET_TIME_Absolute deadline, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_WireMissingCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/auditor-database/select_purse_expired.h b/src/include/taler/auditor-database/select_purse_expired.h @@ -1,76 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/select_purse_expired.h - * @brief implementation of the select_purse_expired function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_SELECT_PURSE_EXPIRED_H -#define AUDITOR_DATABASE_SELECT_PURSE_EXPIRED_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Function called on expired purses. - * - * @param cls closure - * @param purse_pub public key of the purse - * @param balance amount of money in the purse - * @param expiration_date when did the purse expire? - * @return #GNUNET_OK to continue to iterate - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_AUDITORDB_ExpiredPurseCallback)( - void *cls, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_Amount *balance, - struct GNUNET_TIME_Timestamp expiration_date); - - -/* Callback typedefs */ -/** - * Function called on expired purses. - * - * @param cls closure - * @param purse_pub public key of the purse - * @param balance amount of money in the purse - * @param expiration_date when did the purse expire? - * @return #GNUNET_OK to continue to iterate - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_AUDITORDB_ExpiredPurseCallback)( - void *cls, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_Amount *balance, - struct GNUNET_TIME_Timestamp expiration_date); - -/** - * Get information about expired purses. - * - * @param pg the database context - * @param cb function to call on expired purses - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_select_purse_expired (struct AUDITORDB_PostgresContext *pg, - TALER_AUDITORDB_ExpiredPurseCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/auditor-database/select_reserve_in_inconsistency.h b/src/include/taler/auditor-database/select_reserve_in_inconsistency.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/select_reserve_in_inconsistency.h - * @brief implementation of the select_reserve_in_inconsistency function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_SELECT_RESERVE_IN_INCONSISTENCY_H -#define AUDITOR_DATABASE_SELECT_RESERVE_IN_INCONSISTENCY_H - -#include "taler/taler_auditordb_lib.h" - - -/** - * Return any reserve incoming inconsistency associated with the - * given @a bank_row_id. - * - * @param pg the database context - * @param bank_row_id row to select by - * @param[out] dc details to return - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_select_reserve_in_inconsistency (struct AUDITORDB_PostgresContext *pg, - uint64_t bank_row_id, - struct - TALER_AUDITORDB_ReserveInInconsistency - *dc); - - -#endif diff --git a/src/include/taler/auditor-database/template.h b/src/include/taler/auditor-database/template.h @@ -1,27 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/template.h - * @brief implementation of the template function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_TEMPLATE_H -#define AUDITOR_DATABASE_TEMPLATE_H - -#include "taler/taler_auditordb_lib.h" - - -#endif diff --git a/src/include/taler/auditor-database/update_balance.h b/src/include/taler/auditor-database/update_balance.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/update_balance.h - * @brief implementation of the update_balance function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_UPDATE_BALANCE_H -#define AUDITOR_DATABASE_UPDATE_BALANCE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Insert information about a balance tracked by the auditor. Destructively updates an - * existing record, which must already exist. - * - * @param pg the database context - * @param balance_key key of the balance to store - * @param balance_amount value to store - * @param ... NULL terminated list of additional key-value pairs to update - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_update_balance (struct AUDITORDB_PostgresContext *pg, - const char *balance_key, - const struct TALER_Amount *balance_amount, - ...); - - -#endif diff --git a/src/include/taler/auditor-database/update_purse_info.h b/src/include/taler/auditor-database/update_purse_info.h @@ -1,45 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/auditor-database/update_purse_info.h - * @brief implementation of the update_purse_info function for Postgres - * @author Christian Grothoff - */ -#ifndef AUDITOR_DATABASE_UPDATE_PURSE_INFO_H -#define AUDITOR_DATABASE_UPDATE_PURSE_INFO_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_auditordb_lib.h" - - -/** - * Update information about a purse. Destructively updates an - * existing record, which must already exist. - * - * @param pg the database context - * @param purse_pub public key of the purse - * @param balance new balance for the purse - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -AUDITORDB_update_purse_info (struct AUDITORDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_Amount *balance); - - -#endif diff --git a/src/include/taler/exchange-database/abort_shard.h b/src/include/taler/exchange-database/abort_shard.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/abort_shard.h - * @brief implementation of the abort_shard function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ABORT_SHARD_H -#define EXCHANGE_DATABASE_ABORT_SHARD_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to abort work on a shard. - * - * @param pg the database context - * @param job_name name of the operation to abort a word shard for - * @param start_row inclusive start row of the shard - * @param end_row exclusive end row of the shard - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_abort_shard (struct TALER_EXCHANGEDB_PostgresContext *pg, - const char *job_name, - uint64_t start_row, - uint64_t end_row); - -#endif diff --git a/src/include/taler/exchange-database/activate_signing_key.h b/src/include/taler/exchange-database/activate_signing_key.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/activate_signing_key.h - * @brief implementation of the activate_signing_key function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ACTIVATE_SIGNING_KEY_H -#define EXCHANGE_DATABASE_ACTIVATE_SIGNING_KEY_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Add signing key. - * - * @param pg the database context - * @param exchange_pub the exchange online signing public key - * @param meta meta data about @a exchange_pub - * @param master_sig master signature to add - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_activate_signing_key (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_ExchangePublicKeyP * - exchange_pub, - const struct - TALER_EXCHANGEDB_SignkeyMetaData * - meta, - const struct TALER_MasterSignatureP * - master_sig - ); - -#endif diff --git a/src/include/taler/exchange-database/add_denomination_key.h b/src/include/taler/exchange-database/add_denomination_key.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/add_denomination_key.h - * @brief implementation of the add_denomination_key function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ADD_DENOMINATION_KEY_H -#define EXCHANGE_DATABASE_ADD_DENOMINATION_KEY_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Activate denomination key, turning it into a "current" or "valid" - * denomination key by adding the master signature. - * - * @param pg the database context - * @param h_denom_pub hash of the denomination public key - * @param denom_pub the actual denomination key - * @param meta meta data about the denomination - * @param master_sig master signature to add - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_add_denomination_key (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_DenominationHashP * - h_denom_pub, - const struct - TALER_DenominationPublicKey * - denom_pub, - const struct - TALER_EXCHANGEDB_DenominationKeyMetaData - *meta, - const struct TALER_MasterSignatureP * - master_sig - ); - -#endif diff --git a/src/include/taler/exchange-database/add_policy_fulfillment_proof.h b/src/include/taler/exchange-database/add_policy_fulfillment_proof.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/add_policy_fulfillment_proof.h - * @brief implementation of the add_policy_fulfillment_proof function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ADD_POLICY_FULFILLMENT_PROOF_H -#define EXCHANGE_DATABASE_ADD_POLICY_FULFILLMENT_PROOF_H - -#include "taler/taler_exchangedb_lib.h" -#include "taler/taler_extensions_policy.h" - - -/** - * Add a proof of fulfillment into the policy_fulfillments table - * - * @param pg the database context - * @param fulfillment fullfilment transaction data to be added - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_add_policy_fulfillment_proof ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - struct TALER_PolicyFulfillmentTransactionData *fulfillment); - -#endif diff --git a/src/include/taler/exchange-database/aggregate.h b/src/include/taler/exchange-database/aggregate.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/aggregate.h - * @brief implementation of the aggregate function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_AGGREGATE_H -#define EXCHANGE_DATABASE_AGGREGATE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Aggregate all matching deposits for @a h_payto and - * @a merchant_pub, returning the total amounts. - * - * @param pg the database context - * @param h_payto destination of the wire transfer - * @param merchant_pub public key of the merchant - * @param wtid wire transfer ID to set for the aggregate - * @param[out] total set to the sum of the total deposits minus applicable deposit fees and refunds - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_aggregate (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_FullPaytoHashP *h_payto, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct TALER_Amount *total); - -#endif diff --git a/src/include/taler/exchange-database/batch_ensure_coin_known.h b/src/include/taler/exchange-database/batch_ensure_coin_known.h @@ -1,115 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022, 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/batch_ensure_coin_known.h - * @brief implementation of the batch_ensure_coin_known function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_BATCH_ENSURE_COIN_KNOWN_H -#define EXCHANGE_DATABASE_BATCH_ENSURE_COIN_KNOWN_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * The conflict that can occur for the age restriction - */ -enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict -{ - /** - * Value OK, no conflict - */ - TALER_AgeCommitmentHashP_NoConflict = 0, - - /** - * Given hash had a value, but NULL (or zero) was expected - */ - TALER_AgeCommitmentHashP_NullExpected = 1, - - /** - * Given hash was NULL, but value was expected - */ - TALER_AgeCommitmentHashP_ValueExpected = 2, - - /** - * Given hash differs from value in the known coin - */ - TALER_AgeCommitmentHashP_ValueDiffers = 3, -}; - -/** - * Per-coin information returned when doing a batch insert. - */ -struct TALER_EXCHANGEDB_CoinInfo -{ - /** - * Row of the coin in the known_coins table. - */ - uint64_t known_coin_id; - - /** - * Hash of the denomination, relevant on @e denom_conflict. - */ - struct TALER_DenominationHashP denom_hash; - - /** - * Hash of the age commitment, relevant on @e age_conflict. - */ - struct TALER_AgeCommitmentHashP h_age_commitment; - - /** - * True if the coin was known previously. - */ - bool existed; - - /** - * True if the known coin has a different denomination; - * application will find denomination of the already - * known coin in @e denom_hash. - */ - bool denom_conflict; - - /** - * Indicates if and what kind of conflict with the age - * restriction of the known coin was present; - * application will find age commitment of the already - * known coin in @e h_age_commitment. - */ - enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict age_conflict; -}; - - -/** - * Make sure the array of given @a coin is known to the database. - * - * @param pg the database context - * @param coin array of coins that must be made known - * @param[out] result array where to store information about each coin - * @param coin_length length of the @a coin and @a result arraysf - * @param batch_size desired (maximum) batch size - * @return database transaction status, non-negative on success - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_batch_ensure_coin_known (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_CoinPublicInfo * - coin, - struct TALER_EXCHANGEDB_CoinInfo * - result, - unsigned int coin_length, - unsigned int batch_size); - -#endif diff --git a/src/include/taler/exchange-database/begin_revolving_shard.h b/src/include/taler/exchange-database/begin_revolving_shard.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/begin_revolving_shard.h - * @brief implementation of the begin_revolving_shard function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_BEGIN_REVOLVING_SHARD_H -#define EXCHANGE_DATABASE_BEGIN_REVOLVING_SHARD_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to grab a revolving work shard on an operation @a op. Runs - * in its own transaction. Returns the oldest inactive shard. - * - * @param pg the database context - * @param job_name name of the operation to grab a revolving shard for - * @param shard_size desired shard size - * @param shard_limit exclusive end of the shard range - * @param[out] start_row inclusive start row of the shard (returned) - * @param[out] end_row inclusive end row of the shard (returned) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_begin_revolving_shard (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *job_name, - uint32_t shard_size, - uint32_t shard_limit, - uint32_t *start_row, - uint32_t *end_row); - -#endif diff --git a/src/include/taler/exchange-database/begin_shard.h b/src/include/taler/exchange-database/begin_shard.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/begin_shard.h - * @brief implementation of the begin_shard function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_BEGIN_SHARD_H -#define EXCHANGE_DATABASE_BEGIN_SHARD_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Function called to grab a work shard on an operation @a op. Runs in its - * own transaction. - * - * @param pg the database context - * @param job_name name of the operation to grab a word shard for - * @param delay minimum age of a shard to grab - * @param shard_size desired shard size - * @param[out] start_row inclusive start row of the shard (returned) - * @param[out] end_row exclusive end row of the shard (returned) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_begin_shard (struct TALER_EXCHANGEDB_PostgresContext *pg, - const char *job_name, - struct GNUNET_TIME_Relative delay, - uint64_t shard_size, - uint64_t *start_row, - uint64_t *end_row); - -#endif diff --git a/src/include/taler/exchange-database/clear_aml_lock.h b/src/include/taler/exchange-database/clear_aml_lock.h @@ -1,45 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/clear_aml_lock.h - * @brief implementation of the clear_aml_lock function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_CLEAR_AML_LOCK_H -#define EXCHANGE_DATABASE_CLEAR_AML_LOCK_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Clear a lock on running AML programs for the @a h_payto - * account. Returns 0 if @a h_payto is not known; does not - * actually care if there was a lock. Also does not by - * itself notify clients waiting for the lock, that - * notification the caller must do separately after finishing - * the database update. - * - * @param pg the database context - * @param h_payto account to clear the lock for - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_clear_aml_lock (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_NormalizedPaytoHashP * - h_payto); - -#endif diff --git a/src/include/taler/exchange-database/commit.h b/src/include/taler/exchange-database/commit.h @@ -1,36 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/commit.h - * @brief implementation of the commit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_COMMIT_H -#define EXCHANGE_DATABASE_COMMIT_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Commit the current transaction of a database connection. - * - * @param pg the database context - * @return final transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_commit (struct TALER_EXCHANGEDB_PostgresContext *pg); - -#endif diff --git a/src/include/taler/exchange-database/complete_shard.h b/src/include/taler/exchange-database/complete_shard.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/complete_shard.h - * @brief implementation of the complete_shard function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_COMPLETE_SHARD_H -#define EXCHANGE_DATABASE_COMPLETE_SHARD_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to persist that work on a shard was completed. - * - * @param pg the database context - * @param job_name name of the operation to grab a word shard for - * @param start_row inclusive start row of the shard - * @param end_row exclusive end row of the shard - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_complete_shard (struct TALER_EXCHANGEDB_PostgresContext *pg, - const char *job_name, - uint64_t start_row, - uint64_t end_row); - -#endif diff --git a/src/include/taler/exchange-database/compute_shard.h b/src/include/taler/exchange-database/compute_shard.h @@ -1,38 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/compute_shard.h - * @brief implementation of the compute_shard function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_COMPUTE_SHARD_H -#define EXCHANGE_DATABASE_COMPUTE_SHARD_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Compute the shard number of a given @a merchant_pub. - * - * @param merchant_pub merchant public key to compute shard for - * @return shard number - */ -uint64_t -TALER_EXCHANGEDB_compute_shard (const struct TALER_MerchantPublicKeyP * - merchant_pub); - - -#endif diff --git a/src/include/taler/exchange-database/count_known_coins.h b/src/include/taler/exchange-database/count_known_coins.h @@ -1,39 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/count_known_coins.h - * @brief implementation of the count_known_coins function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_COUNT_KNOWN_COINS_H -#define EXCHANGE_DATABASE_COUNT_KNOWN_COINS_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Count the number of known coins by denomination. - * - * @param pg the database context - * @param denom_pub_hash denomination to count by - * @return number of coins if non-negative, otherwise an `enum GNUNET_DB_QueryStatus` - */ -long long -TALER_EXCHANGEDB_count_known_coins (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_DenominationHashP *denom_pub_hash); - -#endif diff --git a/src/include/taler/exchange-database/create_aggregation_transient.h b/src/include/taler/exchange-database/create_aggregation_transient.h @@ -1,59 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/create_aggregation_transient.h - * @brief implementation of the create_aggregation_transient function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_CREATE_AGGREGATION_TRANSIENT_H -#define EXCHANGE_DATABASE_CREATE_AGGREGATION_TRANSIENT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Create a new entry in the transient aggregation table. - * - * @param pg the database context - * @param h_payto destination of the wire transfer - * @param exchange_account_section exchange account to use - * @param merchant_pub public key of the merchant receiving the transfer - * @param wtid the raw wire transfer identifier to be used - * @param kyc_requirement_row row in legitimization_requirements that need to be satisfied to continue, or 0 for none - * @param total amount to be wired in the future - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_create_aggregation_transient (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_FullPaytoHashP * - h_payto, - const char * - exchange_account_section, - const struct - TALER_MerchantPublicKeyP * - merchant_pub, - const struct - TALER_WireTransferIdentifierRawP - *wtid, - uint64_t kyc_requirement_row, - const struct TALER_Amount *total) -; - -#endif diff --git a/src/include/taler/exchange-database/delete_aggregation_transient.h b/src/include/taler/exchange-database/delete_aggregation_transient.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/delete_aggregation_transient.h - * @brief implementation of the delete_aggregation_transient function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DELETE_AGGREGATION_TRANSIENT_H -#define EXCHANGE_DATABASE_DELETE_AGGREGATION_TRANSIENT_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Delete existing entry in the transient aggregation table. - * @a h_payto is only needed for query performance. - * - * @param pg the database context - * @param h_payto destination of the wire transfer - * @param wtid the raw wire transfer identifier to update - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_delete_aggregation_transient (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_FullPaytoHashP * - h_payto, - const struct - TALER_WireTransferIdentifierRawP - *wtid) -; - -#endif diff --git a/src/include/taler/exchange-database/delete_shard_locks.h b/src/include/taler/exchange-database/delete_shard_locks.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/delete_shard_locks.h - * @brief implementation of the delete_shard_locks function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DELETE_SHARD_LOCKS_H -#define EXCHANGE_DATABASE_DELETE_SHARD_LOCKS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Function called to delete all revolving shards. - * To be used after a crash or when the shard size is - * changed. - * - * @param pg the database context - * @return transaction status code - */ -enum GNUNET_GenericReturnValue -TALER_EXCHANGEDB_delete_shard_locks (struct TALER_EXCHANGEDB_PostgresContext *pg - ); - -#endif diff --git a/src/include/taler/exchange-database/disable_rules.h b/src/include/taler/exchange-database/disable_rules.h @@ -1,38 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/disable_rules.h - * @brief implementation of the disable_rules function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DISABLE_RULES_H -#define EXCHANGE_DATABASE_DISABLE_RULES_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Disable (delete/drop) customization rule schema from a deployment. - * - * @param pg the database context - * @param schema name of the schema with customization rules to remove - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_disable_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, - const char *schema); - -#endif diff --git a/src/include/taler/exchange-database/do_check_deposit_idempotent.h b/src/include/taler/exchange-database/do_check_deposit_idempotent.h @@ -1,47 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_check_deposit_idempotent.h - * @brief implementation of the do_check_deposit_idempotent function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_CHECK_DEPOSIT_IDEMPOTENT_H -#define EXCHANGE_DATABASE_DO_CHECK_DEPOSIT_IDEMPOTENT_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Check ifdeposit operation is idempotent to existing one. - * - * @param pg the database context - * @param bd batch deposit operation details - * @param[in,out] exchange_timestamp time to use for the deposit (possibly updated) - * @param[out] is_idempotent set to true if the request is idempotent - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_check_deposit_idempotent (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_EXCHANGEDB_BatchDeposit *bd, - struct GNUNET_TIME_Timestamp * - exchange_timestamp, - bool *is_idempotent); - -#endif diff --git a/src/include/taler/exchange-database/do_deposit.h b/src/include/taler/exchange-database/do_deposit.h @@ -1,56 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022, 2026 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_deposit.h - * @brief implementation of the do_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_DEPOSIT_H -#define EXCHANGE_DATABASE_DO_DEPOSIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Perform deposit operation, checking for sufficient balance - * of the coins and possibly persisting the deposit details. - * - * @param pg the database context - * @param bd batch deposit operation details - * @param deposit_fees array of "bd->num_cids" deposit fees - * of the respective coins - * @param[in,out] exchange_timestamp time to use for the deposit (possibly updated) - * @param[out] accumulated_total_without_fee set to the sum of all deposits - * made for this merchant and contract (minus deposit fees) - * @param[out] balance_ok set to true if the balance was sufficient - * @param[out] bad_balance_index set to the first index of a coin for which the balance was insufficient, - * only used if @a balance_ok is set to false. - * @param[out] in_conflict set to true if the deposit conflicted - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_EXCHANGEDB_BatchDeposit *bd, - const struct TALER_Amount deposit_fees[], - struct GNUNET_TIME_Timestamp *exchange_timestamp, - struct TALER_Amount *accumulated_total_without_fee, - bool *balance_ok, - uint32_t *bad_balance_index, - bool *in_conflict); - -#endif diff --git a/src/include/taler/exchange-database/do_purse_delete.h b/src/include/taler/exchange-database/do_purse_delete.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_purse_delete.h - * @brief implementation of the do_purse_delete function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_PURSE_DELETE_H -#define EXCHANGE_DATABASE_DO_PURSE_DELETE_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to explicitly delete a purse. - * - * @param pg the database context - * @param purse_pub purse to delete - * @param purse_sig signature affirming the deletion - * @param[out] decided set to true if the purse was - * already decided and thus could not be deleted - * @param[out] found set to true if the purse was found - * (if false, purse could not be deleted) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_purse_delete (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_PurseContractSignatureP * - purse_sig, - bool *decided, - bool *found); - -#endif diff --git a/src/include/taler/exchange-database/do_purse_deposit.h b/src/include/taler/exchange-database/do_purse_deposit.h @@ -1,66 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_purse_deposit.h - * @brief implementation of the do_purse_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_PURSE_DEPOSIT_H -#define EXCHANGE_DATABASE_DO_PURSE_DEPOSIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to execute a transaction crediting - * a purse with @a amount from @a coin_pub. Reduces the - * value of @a coin_pub and increase the balance of - * the @a purse_pub purse. If the balance reaches the - * target amount and the purse has been merged, triggers - * the updates of the reserve/account balance. - * - * @param pg the database context - * @param purse_pub purse to credit - * @param coin_pub coin to deposit (debit) - * @param amount fraction of the coin's value to deposit - * @param coin_sig signature affirming the operation - * @param amount_minus_fee amount to add to the purse - * @param[out] balance_ok set to false if the coin's - * remaining balance is below @a amount; - * in this case, the return value will be - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure - * @param[out] too_late set to true if it is too late to deposit into the purse - * @param[out] conflict set to true if the deposit failed due to a conflict (coin already spent, - * or deposited into this purse with a different amount) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_purse_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_CoinSpendPublicKeyP * - coin_pub, - const struct TALER_Amount *amount, - const struct TALER_CoinSpendSignatureP * - coin_sig, - const struct TALER_Amount *amount_minus_fee, - bool *balance_ok, - bool *too_late, - bool *conflict); - -#endif diff --git a/src/include/taler/exchange-database/do_purse_merge.h b/src/include/taler/exchange-database/do_purse_merge.h @@ -1,62 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_purse_merge.h - * @brief implementation of the do_purse_merge function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_PURSE_MERGE_H -#define EXCHANGE_DATABASE_DO_PURSE_MERGE_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to approve merging a purse into a - * reserve by the respective purse merge key. - * - * @param pg the database context - * @param purse_pub purse to merge - * @param merge_sig signature affirming the merge - * @param merge_timestamp time of the merge - * @param reserve_sig signature of the reserve affirming the merge - * @param partner_url URL of the partner exchange, can be NULL if the reserves lives with us - * @param reserve_pub public key of the reserve to credit - * @param[out] no_partner set to true if @a partner_url is unknown - * @param[out] no_balance set to true if the @a purse_pub is not paid up yet - * @param[out] in_conflict set to true if @a purse_pub was merged into a different reserve already - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_purse_merge (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub - , - const struct TALER_PurseMergeSignatureP * - merge_sig, - const struct GNUNET_TIME_Timestamp - merge_timestamp, - const struct TALER_ReserveSignatureP * - reserve_sig, - const char *partner_url, - const struct TALER_ReservePublicKeyP * - reserve_pub, - bool *no_partner, - bool *no_balance, - bool *in_conflict); - -#endif diff --git a/src/include/taler/exchange-database/do_recoup.h b/src/include/taler/exchange-database/do_recoup.h @@ -1,55 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_recoup.h - * @brief implementation of the do_recoup function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_RECOUP_H -#define EXCHANGE_DATABASE_DO_RECOUP_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Perform recoup operation, checking for sufficient deposits - * of the coin and possibly persisting the recoup details. - * - * @param pg the database context - * @param reserve_pub public key of the reserve to credit - * @param withdraw_serial_id row in the withdraw table justifying the recoup - * @param coin_bks coin blinding key secret to persist - * @param coin_pub public key of the coin being recouped - * @param known_coin_id row of the @a coin_pub in the known_coins table - * @param coin_sig signature of the coin requesting the recoup - * @param[in,out] recoup_timestamp recoup timestamp, set if recoup existed - * @param[out] recoup_ok set if the recoup succeeded (balance ok) - * @param[out] internal_failure set on internal failures - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_recoup (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_ReservePublicKeyP *reserve_pub, - uint64_t withdraw_serial_id, - const union GNUNET_CRYPTO_BlindingSecretP *coin_bks, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - uint64_t known_coin_id, - const struct TALER_CoinSpendSignatureP *coin_sig, - struct GNUNET_TIME_Timestamp *recoup_timestamp, - bool *recoup_ok, - bool *internal_failure); - -#endif diff --git a/src/include/taler/exchange-database/do_recoup_refresh.h b/src/include/taler/exchange-database/do_recoup_refresh.h @@ -1,64 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_recoup_refresh.h - * @brief implementation of the do_recoup_refresh function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_RECOUP_REFRESH_H -#define EXCHANGE_DATABASE_DO_RECOUP_REFRESH_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Perform recoup-refresh operation, checking for sufficient deposits of the - * coin and possibly persisting the recoup-refresh details. - * - * @param pg the database context - * @param old_coin_pub public key of the old coin to credit - * @param rrc_serial row in the refresh_revealed_coins table justifying the recoup-refresh - * @param coin_bks coin blinding key secret to persist - * @param coin_pub public key of the coin being recouped - * @param known_coin_id row of the @a coin_pub in the known_coins table - * @param coin_sig signature of the coin requesting the recoup - * @param[in,out] recoup_timestamp recoup timestamp, set if recoup existed - * @param[out] recoup_ok set if the recoup-refresh succeeded (balance ok) - * @param[out] internal_failure set on internal failures - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_do_recoup_refresh (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_CoinSpendPublicKeyP * - old_coin_pub, - uint64_t rrc_serial, - const union - GNUNET_CRYPTO_BlindingSecretP * - coin_bks, - const struct - TALER_CoinSpendPublicKeyP *coin_pub, - uint64_t known_coin_id, - const struct - TALER_CoinSpendSignatureP *coin_sig, - struct GNUNET_TIME_Timestamp * - recoup_timestamp, - bool *recoup_ok, - bool *internal_failure); - -#endif diff --git a/src/include/taler/exchange-database/do_refresh.h b/src/include/taler/exchange-database/do_refresh.h @@ -1,57 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_refresh.h - * @brief implementation of the do_refresh function for Postgres - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_DO_REFRESH_H -#define EXCHANGE_DATABASE_DO_REFRESH_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Perform refresh operation--introduced with v26 of the API--, - * checking for sufficient balance of the coin and possibly persisting the melt/refresh details. - * - * @param pg the database context - * @param[in,out] refresh refresh operation details; the noreveal_index - * is set in case the coin was already melted before - * @param timestamp the timestamp of this melt operation, helpful for the coin history. - * @param[in,out] zombie_required true if the melt must only succeed - * if the coin is a zombie, set to false if the requirement was satisfied - * @param[out] found set to true if there exists already an entry in the database for - * the calculated commitment hash. - * @param[out] noreveal_index if @e idempotent ist true, the existing value of the noreveal_index. - * @param[out] nonce_reuse set to true if the blinding seed for CS was re-used. - * @param[out] balance_ok set to true if the balance was sufficient - * @param[out] coin_balance if balance_ok is false, set to the remaining value of the coin - * @return query execution status, NO_RESULTS in case of an unknown coin. - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_refresh (struct TALER_EXCHANGEDB_PostgresContext *pg, - struct TALER_EXCHANGEDB_Refresh_vDOLDPLUS *refresh, - const struct GNUNET_TIME_Timestamp *timestamp, - bool *found, - uint32_t *noreveal_index, - bool *zombie_required, - bool *nonce_reuse, - bool *balance_ok, - struct TALER_Amount *coin_balance); - -#endif diff --git a/src/include/taler/exchange-database/do_refund.h b/src/include/taler/exchange-database/do_refund.h @@ -1,77 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_refund.h - * @brief implementation of the do_refund function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_REFUND_H -#define EXCHANGE_DATABASE_DO_REFUND_H - -#include "taler/taler_util.h" -#include "taler/exchange-database/free_coin_transaction_list.h" - -/** - * @brief Specification for a refund operation. The combination of - * the coin's public key, the merchant's public key and the - * transaction ID must be unique. While a coin can (theoretically) be - * deposited at the same merchant twice (with partial spending), the - * merchant must either use a different public key or a different - * transaction ID for the two transactions. The same goes for - * refunds, hence we also have a "rtransaction" ID which is disjoint - * from the transaction ID. The same coin must not be used twice at - * the same merchant for the same transaction or rtransaction ID. - */ -struct TALER_EXCHANGEDB_Refund -{ - /** - * Information about the coin that is being refunded. - */ - struct TALER_CoinPublicInfo coin; - - /** - * Details about the refund. - */ - struct TALER_EXCHANGEDB_RefundListEntry details; - -}; - - -/** - * Perform refund operation, checking for sufficient deposits - * of the coin and possibly persisting the refund details. - * - * @param pg the database context - * @param refund refund operation details - * @param deposit_fee deposit fee applicable for the coin, possibly refunded - * @param known_coin_id row of the coin in the known_coins table - * @param[out] not_found set if the deposit was not found - * @param[out] refund_ok set if the refund succeeded (below deposit amount) - * @param[out] gone if the merchant was already paid - * @param[out] conflict set if the refund ID was reused - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_refund (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_EXCHANGEDB_Refund *refund, - const struct TALER_Amount *deposit_fee, - uint64_t known_coin_id, - bool *not_found, - bool *refund_ok, - bool *gone, - bool *conflict); - -#endif diff --git a/src/include/taler/exchange-database/do_reserve_purse.h b/src/include/taler/exchange-database/do_reserve_purse.h @@ -1,62 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_reserve_purse.h - * @brief implementation of the do_reserve_purse function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DO_RESERVE_PURSE_H -#define EXCHANGE_DATABASE_DO_RESERVE_PURSE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Function called insert request to merge a purse into a reserve by the - * respective purse merge key. The purse must not have been merged into a - * different reserve. - * - * @param pg the database context - * @param purse_pub purse to merge - * @param merge_sig signature affirming the merge - * @param merge_timestamp time of the merge - * @param reserve_sig signature of the reserve affirming the merge - * @param purse_fee amount to charge the reserve for the purse creation, NULL to use the quota - * @param reserve_pub public key of the reserve to credit - * @param[out] in_conflict set to true if @a purse_pub was merged into a different reserve already - * @param[out] no_reserve set to true if @a reserve_pub is not a known reserve - * @param[out] insufficient_funds set to true if @a reserve_pub has insufficient capacity to create another purse - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_reserve_purse (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_PurseMergeSignatureP * - merge_sig, - const struct GNUNET_TIME_Timestamp - merge_timestamp, - const struct TALER_ReserveSignatureP * - reserve_sig, - const struct TALER_Amount *purse_fee, - const struct TALER_ReservePublicKeyP * - reserve_pub, - bool *in_conflict, - bool *no_reserve, - bool *insufficient_funds); - -#endif diff --git a/src/include/taler/exchange-database/do_withdraw.h b/src/include/taler/exchange-database/do_withdraw.h @@ -1,59 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/do_withdraw.h - * @brief implementation of the do_withdraw function for Postgres - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_DO_WITHDRAW_H -#define EXCHANGE_DATABASE_DO_WITHDRAW_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/free_reserve_history.h" - -/** - * Perform reserve update as part of an age-withdraw operation, checking for - * sufficient balance and fulfillment of age requirements. Finally persisting - * the withdrawal details. - * - * @param pg the database context - * @param withdraw the withdraw data - * @param now the timestamp of the withdraw - * @param[out] balance_ok set to true if the balance was sufficient - * @param[out] reserve_balance set to original balance of the reserve - * @param[out] age_ok set to true if age requirements were met - * @param[out] allowed_maximum_age if @e age_ok is FALSE, this is set to the allowed maximum age - * @param[out] reserve_birthday if @e age_ok is FALSE, this is set to the reserve's birthday - * @param[out] idempotent set to true if an entry already exists for the given h_planchets and reserve_pub - * @param[out] noreveal_index if @e idempotent is true, set to the noreveal_index in the existing record - * @param[out] nonce_reuse set to true if the blinding_seed has been found in the table for a different withdraw - * @return 0 if no reserve was found, 1 if a reserve was found, else the query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_do_withdraw (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_EXCHANGEDB_Withdraw *withdraw, - const struct GNUNET_TIME_Timestamp *now, - bool *balance_ok, - struct TALER_Amount *reserve_balance, - bool *age_ok, - uint16_t *allowed_maximum_age, - uint32_t *reserve_birthday, - bool *idempotent, - uint16_t *noreveal_index, - bool *nonce_reuse); - -#endif diff --git a/src/include/taler/exchange-database/drain_kyc_alert.h b/src/include/taler/exchange-database/drain_kyc_alert.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/drain_kyc_alert.h - * @brief implementation of the drain_kyc_alert function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_DRAIN_KYC_ALERT_H -#define EXCHANGE_DATABASE_DRAIN_KYC_ALERT_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Extract next KYC alert. Deletes the alert. - * - * @param pg the database context - * @param trigger_type which type of alert to drain - * @param[out] h_payto set to hash of payto-URI where KYC status changed - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_drain_kyc_alert (struct TALER_EXCHANGEDB_PostgresContext *pg, - uint32_t trigger_type, - struct TALER_NormalizedPaytoHashP *h_payto); - -#endif diff --git a/src/include/taler/exchange-database/enable_rules.h b/src/include/taler/exchange-database/enable_rules.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/enable_rules.h - * @brief implementation of the enable_rules function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ENABLE_RULES_H -#define EXCHANGE_DATABASE_ENABLE_RULES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Enable (create/insert) customization rule schema from a deployment. - * - * @param pg the database context - * @param schema name of the schema with customization rules to remove - * @return transaction status - */ -enum GNUNET_GenericReturnValue -TALER_EXCHANGEDB_enable_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, - const char *schema); - -#endif diff --git a/src/include/taler/exchange-database/ensure_coin_known.h b/src/include/taler/exchange-database/ensure_coin_known.h @@ -1,94 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/ensure_coin_known.h - * @brief implementation of the ensure_coin_known function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ENSURE_COIN_KNOWN_H -#define EXCHANGE_DATABASE_ENSURE_COIN_KNOWN_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Possible status codes from making sure a coin is known. - */ -enum TALER_EXCHANGEDB_CoinKnownStatus -{ - /** - * The coin was successfully added. - */ - TALER_EXCHANGEDB_CKS_ADDED = 1, - - /** - * The coin was already present. - */ - TALER_EXCHANGEDB_CKS_PRESENT = 0, - - /** - * Serialization failure. - */ - TALER_EXCHANGEDB_CKS_SOFT_FAIL = -1, - - /** - * Hard database failure. - */ - TALER_EXCHANGEDB_CKS_HARD_FAIL = -2, - - /** - * Conflicting coin (different denomination key) already in database. - */ - TALER_EXCHANGEDB_CKS_DENOM_CONFLICT = -3, - - /** - * Conflicting coin (expected NULL age hash) already in database. - */ - TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL = -4, - - /** - * Conflicting coin (unexpected NULL age hash) already in database. - */ - TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL = -5, - - /** - * Conflicting coin (different age hash) already in database. - */ - TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS = -6, - -}; - - -/** - * Make sure the given @a coin is known to the database. - * - * @param pg the database context - * @param coin the coin that must be made known - * @param[out] known_coin_id set to the unique row of the coin - * @param[out] denom_hash set to the denomination hash of the existing - * coin (for conflict error reporting) - * @param[out] h_age_commitment set to the conflicting age commitment hash on conflict - * @return database transaction status, non-negative on success - */ -enum TALER_EXCHANGEDB_CoinKnownStatus -TALER_EXCHANGEDB_ensure_coin_known (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_CoinPublicInfo *coin, - uint64_t *known_coin_id, - struct TALER_DenominationHashP *denom_hash, - struct TALER_AgeCommitmentHashP * - h_age_commitment) -; - -#endif diff --git a/src/include/taler/exchange-database/event_listen_cancel.h b/src/include/taler/exchange-database/event_listen_cancel.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/event_listen_cancel.h - * @brief implementation of the event_listen_cancel function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_EVENT_LISTEN_CANCEL_H -#define EXCHANGE_DATABASE_EVENT_LISTEN_CANCEL_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Stop notifications. - * - * @param pg the database context - * @param eh handle to unregister. - */ -void -TALER_TALER_EXCHANGEDB_event_listen_cancel (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - struct GNUNET_DB_EventHandler *eh); - -#endif diff --git a/src/include/taler/exchange-database/expire_purse.h b/src/include/taler/exchange-database/expire_purse.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/expire_purse.h - * @brief implementation of the expire_purse function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_EXPIRE_PURSE_H -#define EXCHANGE_DATABASE_EXPIRE_PURSE_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Function called to clean up one expired purse. - * - * @param pg the database context - * @param start_time select purse expired after this time - * @param end_time select purse expired before this time - * @return transaction status code (#GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no purse expired in the given time interval). - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_expire_purse (struct TALER_EXCHANGEDB_PostgresContext *pg, - struct GNUNET_TIME_Absolute start_time, - struct GNUNET_TIME_Absolute end_time); - -#endif diff --git a/src/include/taler/exchange-database/find_aggregation_transient.h b/src/include/taler/exchange-database/find_aggregation_transient.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022, 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/find_aggregation_transient.h - * @brief implementation of the find_aggregation_transient function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_FIND_AGGREGATION_TRANSIENT_H -#define EXCHANGE_DATABASE_FIND_AGGREGATION_TRANSIENT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Find existing entry in the transient aggregation table. - * - * @param pg the database context - * @param h_payto destination of the wire transfer - * @param[out] payto_uri corresponding payto URI, to be freed by caller - * @param[out] wtid wire transfer identifier of transient aggregation - * @param[out] merchant_pub public key of the merchant - * @param[out] total amount aggregated so far - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_find_aggregation_transient (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - struct TALER_FullPayto *payto_uri, - struct - TALER_WireTransferIdentifierRawP * - wtid, - struct TALER_MerchantPublicKeyP * - merchant_pub, - struct TALER_Amount *total); - -#endif diff --git a/src/include/taler/exchange-database/get_coin_denomination.h b/src/include/taler/exchange-database/get_coin_denomination.h @@ -1,45 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_coin_denomination.h - * @brief implementation of the get_coin_denomination function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_COIN_DENOMINATION_H -#define EXCHANGE_DATABASE_GET_COIN_DENOMINATION_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Retrieve the denomination of a known coin. - * - * @param pg the database context - * @param coin_pub the public key of the coin to search for - * @param[out] known_coin_id set to the ID of the coin in the known_coins table - * @param[out] denom_hash where to store the hash of the coins denomination - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_coin_denomination (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_CoinSpendPublicKeyP * - coin_pub, - uint64_t *known_coin_id, - struct TALER_DenominationHashP * - denom_hash); - -#endif diff --git a/src/include/taler/exchange-database/get_coin_transactions.h b/src/include/taler/exchange-database/get_coin_transactions.h @@ -1,64 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022, 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file get_coin_transactions.h - * @brief implementation of the get_coin_transactions function - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_COIN_TRANSACTIONS_H -#define EXCHANGE_DATABASE_GET_COIN_TRANSACTIONS_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/free_coin_transaction_list.h" - - -/** - * Compile a list of (historic) transactions performed with the given coin - * (melt, refund, recoup and deposit operations). Should return 0 if the @a - * coin_pub is unknown, otherwise determine @a etag_out and if it is past @a - * etag_in return the history after @a start_off. @a etag_out should be set - * to the last row ID of the given @a coin_pub in the coin history table. - * - * @param pg the database context - * @param begin_transaction true to run this in its own transaction(s) - * @param coin_pub coin to investigate - * @param start_off starting offset from which on to return entries - * @param etag_in up to this offset the client already has a response, do not - * return anything unless @a etag_out will be larger - * @param[out] etag_out set to the latest history offset known for this @a coin_pub - * @param[out] balance set to current balance of the coin - * @param[out] h_denom_pub set to denomination public key of the coin - * @param[out] tlp set to list of transactions, set to NULL if coin has no - * transaction history past @a start_off or if @a etag_in is equal - * to the value written to @a etag_out. - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_coin_transactions ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - bool begin_transaction, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - uint64_t start_off, - uint64_t etag_in, - uint64_t *etag_out, - struct TALER_Amount *balance, - struct TALER_DenominationHashP *h_denom_pub, - struct TALER_EXCHANGEDB_TransactionList **tlp) -; - - -#endif diff --git a/src/include/taler/exchange-database/get_denomination_by_serial.h b/src/include/taler/exchange-database/get_denomination_by_serial.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_denomination_by_serial.h - * @brief implementation of the get_denomination_by_serial function for Postgres - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_GET_DENOMINATION_BY_SERIAL_H -#define EXCHANGE_DATABASE_GET_DENOMINATION_BY_SERIAL_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Fetch information about a denomination for a given serial. - * - * @param pg the database context - * @param denom_serial row in the denomination table - * @param[out] issue set to issue information with value, fees and other info about the coin - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_denomination_by_serial (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - uint64_t denom_serial, - struct - TALER_EXCHANGEDB_DenominationKeyInformation - *issue); - -#endif diff --git a/src/include/taler/exchange-database/get_denomination_info.h b/src/include/taler/exchange-database/get_denomination_info.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022,2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_denomination_info.h - * @brief implementation of the get_denomination_info function for Postgres - * @author Christian Grothoff - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_GET_DENOMINATION_INFO_H -#define EXCHANGE_DATABASE_GET_DENOMINATION_INFO_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Fetch information about a denomination key. - * - * @param pg the database context - * @param denom_pub_hash hash of the public key used for signing coins of this denomination - * @param[out] denom_serial row in the denomination table, might be NULL - * @param[out] issue set to issue information with value, fees and other info about the coin - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_denomination_info (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_DenominationHashP * - denom_pub_hash, - uint64_t *denom_serial, - struct - TALER_EXCHANGEDB_DenominationKeyInformation - * - issue); - -#endif diff --git a/src/include/taler/exchange-database/get_denomination_revocation.h b/src/include/taler/exchange-database/get_denomination_revocation.h @@ -1,49 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_denomination_revocation.h - * @brief implementation of the get_denomination_revocation function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_DENOMINATION_REVOCATION_H -#define EXCHANGE_DATABASE_GET_DENOMINATION_REVOCATION_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Obtain information about a denomination key's revocation from - * the database. - * - * @param pg the database context - * @param denom_pub_hash hash of the revoked denomination key - * @param[out] master_sig signature affirming the revocation - * @param[out] rowid row where the information is stored - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_denomination_revocation (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_DenominationHashP * - denom_pub_hash, - struct TALER_MasterSignatureP * - master_sig, - uint64_t *rowid); - -#endif diff --git a/src/include/taler/exchange-database/get_drain_profit.h b/src/include/taler/exchange-database/get_drain_profit.h @@ -1,55 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_drain_profit.h - * @brief implementation of the get_drain_profit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_DRAIN_PROFIT_H -#define EXCHANGE_DATABASE_GET_DRAIN_PROFIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to get information about a profit drain event. - * - * @param pg the database context - * @param wtid wire transfer ID to look up drain event for - * @param[out] serial set to serial ID of the entry - * @param[out] account_section set to account to drain - * @param[out] payto_uri set to account to wire funds to - * @param[out] request_timestamp set to time of the signature - * @param[out] amount set to amount to wire - * @param[out] master_sig set to signature affirming the operation - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_drain_profit (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_WireTransferIdentifierRawP *wtid - , - uint64_t *serial, - char **account_section, - struct TALER_FullPayto *payto_uri, - struct GNUNET_TIME_Timestamp * - request_timestamp, - struct TALER_Amount *amount, - struct TALER_MasterSignatureP *master_sig); - -#endif diff --git a/src/include/taler/exchange-database/get_extension_manifest.h b/src/include/taler/exchange-database/get_extension_manifest.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_extension_manifest.h - * @brief implementation of the get_extension_manifest function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_EXTENSION_MANIFEST_H -#define EXCHANGE_DATABASE_GET_EXTENSION_MANIFEST_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to get the manifest of an extension - * (age-restriction, policy_extension_...) - * - * @param pg the database context - * @param extension_name the name of the extension - * @param[out] manifest JSON object of the manifest as string - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_extension_manifest (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *extension_name, - char **manifest); - -#endif diff --git a/src/include/taler/exchange-database/get_global_fee.h b/src/include/taler/exchange-database/get_global_fee.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_global_fee.h - * @brief implementation of the get_global_fee function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_GLOBAL_FEE_H -#define EXCHANGE_DATABASE_GET_GLOBAL_FEE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Obtain global fees from database. - * - * @param pg the database context - * @param date for which date do we want the fee? - * @param[out] start_date when does the fee go into effect - * @param[out] end_date when does the fee end being valid - * @param[out] fees how high are the wire fees - * @param[out] purse_timeout set to how long we keep unmerged purses - * @param[out] history_expiration set to how long we keep account histories - * @param[out] purse_account_limit set to the number of free purses per account - * @param[out] master_sig signature over the above by the exchange master key - * @return status of the transaction - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_global_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, - struct GNUNET_TIME_Timestamp date, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative *purse_timeout, - struct GNUNET_TIME_Relative *history_expiration - , - uint32_t *purse_account_limit, - struct TALER_MasterSignatureP *master_sig); - -#endif diff --git a/src/include/taler/exchange-database/get_global_fees.h b/src/include/taler/exchange-database/get_global_fees.h @@ -1,93 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_global_fees.h - * @brief implementation of the get_global_fees function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_GLOBAL_FEES_H -#define EXCHANGE_DATABASE_GET_GLOBAL_FEES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Provide information about global fees. - * - * @param cls closure - * @param fees the global fees we charge - * @param purse_timeout when do purses time out - * @param history_expiration how long are account histories preserved - * @param purse_account_limit how many purses are free per account - * @param start_date from when are these fees valid (start date) - * @param end_date until when are these fees valid (end date, exclusive) - * @param master_sig master key signature affirming that this is the correct - * fee (of purpose #TALER_SIGNATURE_MASTER_GLOBAL_FEES) - */ -typedef void -(*TALER_EXCHANGEDB_GlobalFeeCallback)( - void *cls, - const struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative purse_timeout, - struct GNUNET_TIME_Relative history_expiration, - uint32_t purse_account_limit, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_MasterSignatureP *master_sig); - - -/* Callback typedefs */ -/** - * Provide information about global fees. - * - * @param cls closure - * @param fees the global fees we charge - * @param purse_timeout when do purses time out - * @param history_expiration how long are account histories preserved - * @param purse_account_limit how many purses are free per account - * @param start_date from when are these fees valid (start date) - * @param end_date until when are these fees valid (end date, exclusive) - * @param master_sig master key signature affirming that this is the correct - * fee (of purpose #TALER_SIGNATURE_MASTER_GLOBAL_FEES) - */ -typedef void -(*TALER_EXCHANGEDB_GlobalFeeCallback)( - void *cls, - const struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative purse_timeout, - struct GNUNET_TIME_Relative history_expiration, - uint32_t purse_account_limit, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_MasterSignatureP *master_sig); - -/** - * Obtain global fees from database. - * - * @param pg the database context - * @param cb function to call on each fee entry - * @param cb_cls closure for @a cb - * @return status of the transaction - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_get_global_fees (struct - TALER_EXCHANGEDB_PostgresContext *pg, - TALER_EXCHANGEDB_GlobalFeeCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/get_known_coin.h b/src/include/taler/exchange-database/get_known_coin.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_known_coin.h - * @brief implementation of the get_known_coin function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_KNOWN_COIN_H -#define EXCHANGE_DATABASE_GET_KNOWN_COIN_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Retrieve the record for a known coin. - * - * @param pg the database context - * @param coin_pub the public key of the coin to search for - * @param coin_info place holder for the returned coin information object - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_known_coin (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_CoinSpendPublicKeyP * - coin_pub, - struct TALER_CoinPublicInfo *coin_info); - -#endif diff --git a/src/include/taler/exchange-database/get_kyc_rules.h b/src/include/taler/exchange-database/get_kyc_rules.h @@ -1,76 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022-2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_kyc_rules.h - * @brief implementation of the get_kyc_rules function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_KYC_RULES_H -#define EXCHANGE_DATABASE_GET_KYC_RULES_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Return KYC rules that apply to the given account. - * - * @param pg the database context - * @param h_payto account identifier - * @param merchant_pub merchant public key used by the client, or NULL - * if not available; if multiple @a reserve_pub values could be returned, - * we should use this one - * @param[out] no_account_pub set to true if no @a account_pub is available - * @param[out] account_pub set to account public key the rules - * apply to (because this key was used in KYC auth) - * @param[out] no_reserve_pub set to true if no @a reserve_pub is available - * @param[out] reserve_pub set to last incoming reserve public key - * of a wire transfer to the exchange from the given @a h_payto - * apply to (because this key was used in KYC auth) - * @param[out] jrules set to the active KYC rules for the - * given account, set to NULL if no custom rules are active - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_kyc_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_NormalizedPaytoHashP *h_payto - , - const struct TALER_MerchantPublicKeyP * - merchant_pub, - bool *no_account_pub, - union TALER_AccountPublicKeyP *account_pub, - bool *no_reserve_pub, - struct TALER_ReservePublicKeyP *reserve_pub, - json_t **jrules); - - -/** - * Return only the KYC rules that apply to the given account. - * - * @param pg the database context - * @param h_payto account identifier - * @param[out] jrules set to the active KYC rules for the - * given account, set to NULL if no custom rules are active - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_get_kyc_rules2 (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_NormalizedPaytoHashP * - h_payto, - json_t **jrules); - -#endif diff --git a/src/include/taler/exchange-database/get_old_coin_by_h_blind.h b/src/include/taler/exchange-database/get_old_coin_by_h_blind.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_old_coin_by_h_blind.h - * @brief implementation of the get_old_coin_by_h_blind function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_OLD_COIN_BY_H_BLIND_H -#define EXCHANGE_DATABASE_GET_OLD_COIN_BY_H_BLIND_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Obtain information about which old coin a coin was refreshed - * given the hash of the blinded (fresh) coin. - * - * @param pg the database context - * @param h_blind_ev hash of the blinded coin - * @param[out] old_coin_pub set to information about the old coin (on success only) - * @param[out] rrc_serial set to serial number of the entry in the database - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_old_coin_by_h_blind (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_BlindedCoinHashP * - h_blind_ev, - struct TALER_CoinSpendPublicKeyP * - old_coin_pub, - uint64_t *rrc_serial); - -#endif diff --git a/src/include/taler/exchange-database/get_pending_kyc_requirement_process.h b/src/include/taler/exchange-database/get_pending_kyc_requirement_process.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_pending_kyc_requirement_process.h - * @brief implementation of the get_pending_kyc_requirement_process function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_PENDING_KYC_REQUIREMENT_PROCESS_H -#define EXCHANGE_DATABASE_GET_PENDING_KYC_REQUIREMENT_PROCESS_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Fetch information about pending KYC requirement process. - * - * @param pg the database context - * @param h_payto account that must be KYC'ed - * @param provider_name provider that must be checked - * @param[out] redirect_url set to redirect URL for the process - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_pending_kyc_requirement_process (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_NormalizedPaytoHashP - * - h_payto, - const char *provider_name, - char **redirect_url); - -#endif diff --git a/src/include/taler/exchange-database/get_policy_details.h b/src/include/taler/exchange-database/get_policy_details.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_policy_details.h - * @brief implementation of the get_policy_details function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_POLICY_DETAILS_H -#define EXCHANGE_DATABASE_GET_POLICY_DETAILS_H - -#include "taler/taler_exchangedb_lib.h" -#include "taler/taler_extensions_policy.h" - - -/** - * Get the details of a policy, referenced by its hash code - * - * @param pg the database context - * @param hc The hash code under which the details to a particular policy should be found - * @param[out] details The found details - * @return query execution status - * */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_policy_details (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct GNUNET_HashCode *hc, - struct TALER_PolicyDetails *details); - -#endif diff --git a/src/include/taler/exchange-database/get_purse_deposit.h b/src/include/taler/exchange-database/get_purse_deposit.h @@ -1,55 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_purse_deposit.h - * @brief implementation of the get_purse_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_PURSE_DEPOSIT_H -#define EXCHANGE_DATABASE_GET_PURSE_DEPOSIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to obtain a coin deposit data from - * depositing the coin into a purse. - * - * @param pg the database context - * @param purse_pub purse to credit - * @param coin_pub coin to deposit (debit) - * @param[out] amount set fraction of the coin's value that was deposited (with fee) - * @param[out] h_denom_pub set to hash of denomination of the coin - * @param[out] phac set to hash of age restriction on the coin - * @param[out] coin_sig set to signature affirming the operation - * @param[out] partner_url set to the URL of the partner exchange, or NULL for ourselves, must be freed by caller - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_purse_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_CoinSpendPublicKeyP * - coin_pub, - struct TALER_Amount *amount, - struct TALER_DenominationHashP *h_denom_pub, - struct TALER_AgeCommitmentHashP *phac, - struct TALER_CoinSpendSignatureP *coin_sig, - char **partner_url); - -#endif diff --git a/src/include/taler/exchange-database/get_purse_request.h b/src/include/taler/exchange-database/get_purse_request.h @@ -1,62 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - -/** - * @file src/include/taler/exchange-database/get_purse_request.h - * @brief implementation of the get_purse_request function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_PURSE_REQUEST_H -#define EXCHANGE_DATABASE_GET_PURSE_REQUEST_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to return meta data about a purse by the - * purse public key. - * - * @param pg the database context - * @param purse_pub public key of the purse - * @param[out] merge_pub public key representing the merge capability - * @param[out] purse_expiration when would an unmerged purse expire - * @param[out] h_contract_terms contract associated with the purse - * @param[out] age_limit the age limit for deposits into the purse - * @param[out] target_amount amount to be put into the purse - * @param[out] balance amount put so far into the purse - * @param[out] purse_sig signature of the purse over the initialization data - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_purse_request (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - struct TALER_PurseMergePublicKeyP *merge_pub - , - struct GNUNET_TIME_Timestamp * - purse_expiration, - struct TALER_PrivateContractHashP * - h_contract_terms, - uint32_t *age_limit, - struct TALER_Amount *target_amount, - struct TALER_Amount *balance, - struct TALER_PurseContractSignatureP * - purse_sig); - -#endif diff --git a/src/include/taler/exchange-database/get_ready_deposit.h b/src/include/taler/exchange-database/get_ready_deposit.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_ready_deposit.h - * @brief implementation of the get_ready_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_READY_DEPOSIT_H -#define EXCHANGE_DATABASE_GET_READY_DEPOSIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Obtain information about deposits that are ready to be executed. Such - * deposits must not be marked as "done", the execution time must be - * in the past, and the KYC status must be 'ok'. - * - * @param pg the database context - * @param start_shard_row minimum shard row to select - * @param end_shard_row maximum shard row to select (inclusive) - * @param[out] merchant_pub set to the public key of a merchant with a ready deposit - * @param[out] payto_uri set to the account of the merchant, to be freed by caller - * @param[out] extra_wire_subject_metadata set to additional metadata to include in the wire subject, or NULL for none - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_ready_deposit (struct TALER_EXCHANGEDB_PostgresContext *pg, - uint64_t start_shard_row, - uint64_t end_shard_row, - struct TALER_MerchantPublicKeyP * - merchant_pub, - struct TALER_FullPayto *payto_uri, - char **extra_wire_subject_metadata); - -#endif diff --git a/src/include/taler/exchange-database/get_refresh.h b/src/include/taler/exchange-database/get_refresh.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_refresh.h - * @brief implementation of the get_refresh function for Postgres - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_GET_REFRESH_H -#define EXCHANGE_DATABASE_GET_REFRESH_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Lookup refresh refresh commitment data under the given @a rc. - * - * @param pg the database context - * @param rc commitment hash to use to locate the operation - * @param[out] refresh where to store the result; note that - * refresh->session.coin.denom_sig will be set to NULL - * and is not fetched by this routine (as it is not needed by the client) - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_refresh (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_RefreshCommitmentP *rc, - struct TALER_EXCHANGEDB_Refresh_vDOLDPLUS *refresh - ); - -#endif diff --git a/src/include/taler/exchange-database/get_reserve_balance.h b/src/include/taler/exchange-database/get_reserve_balance.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_reserve_balance.h - * @brief implementation of the get_reserve_balance function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_RESERVE_BALANCE_H -#define EXCHANGE_DATABASE_GET_RESERVE_BALANCE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Get the balance of the specified reserve. - * - * @param pg the database context - * @param reserve_pub public key of the reserve - * @param[out] balance set to the reserve balance - * @param[out] origin_account set to URI of the origin account, NULL - * if we have no origin account (reserve created by P2P merge) -* @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_reserve_balance (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_ReservePublicKeyP * - reserve_pub, - struct TALER_Amount *balance, - struct TALER_FullPayto *origin_account); - -#endif diff --git a/src/include/taler/exchange-database/get_reserve_by_h_planchets.h b/src/include/taler/exchange-database/get_reserve_by_h_planchets.h @@ -1,49 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_reserve_by_h_planchets.h - * @brief implementation of the get_reserve_by_h_planchets function for Postgres - * @author Christian Grothoff - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_GET_RESERVE_BY_H_PLANCHETS_H -#define EXCHANGE_DATABASE_GET_RESERVE_BY_H_PLANCHETS_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Obtain information about which reserve a coin was generated - * from given the hash of the blinded coin. - * - * @param pg the database context - * @param h_planchets hash that uniquely identifies the withdraw request - * @param[out] reserve_pub set to information about the reserve (on success only) - * @param[out] withdraw_serial_id set to row of the @a h_commitment in withdraw - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_reserve_by_h_planchets (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_HashBlindedPlanchetsP * - h_planchets, - struct TALER_ReservePublicKeyP * - reserve_pub, - uint64_t *withdraw_serial_id); - -#endif diff --git a/src/include/taler/exchange-database/get_reserve_history.h b/src/include/taler/exchange-database/get_reserve_history.h @@ -1,59 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file get_reserve_history.h - * @brief implementation of the get_reserve_history function - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_RESERVE_HISTORY_H -#define EXCHANGE_DATABASE_GET_RESERVE_HISTORY_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/free_reserve_history.h" - - -/** - * Compile a list of (historic) transactions performed with the given reserve - * (withdraw, incoming wire, open, close operations). Should return 0 if the @a - * reserve_pub is unknown, otherwise determine @a etag_out and if it is past @a - * etag_in return the history after @a start_off. @a etag_out should be set - * to the last row ID of the given @a reserve_pub in the reserve history table. - * - * @param pg the database context - * @param reserve_pub public key of the reserve - * @param start_off maximum starting offset in history to exclude from returning - * @param etag_in up to this offset the client already has a response, do not - * return anything unless @a etag_out will be larger - * @param[out] etag_out set to the latest history offset known for this @a coin_pub - * @param[out] balance set to the reserve balance - * @param[out] rhp set to known transaction history (NULL if reserve is unknown) - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_reserve_history (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_ReservePublicKeyP * - reserve_pub, - uint64_t start_off, - uint64_t etag_in, - uint64_t *etag_out, - struct TALER_Amount *balance, - struct TALER_EXCHANGEDB_ReserveHistory ** - rhp); - - -#endif diff --git a/src/include/taler/exchange-database/get_signature_for_known_coin.h b/src/include/taler/exchange-database/get_signature_for_known_coin.h @@ -1,50 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_signature_for_known_coin.h - * @brief implementation of the get_signature_for_known_coin function for Postgres - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_GET_SIGNATURE_FOR_KNOWN_COIN_H -#define EXCHANGE_DATABASE_GET_SIGNATURE_FOR_KNOWN_COIN_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Retrieve the denomination and the corresponding signature for a known coin. - * - * @param pg the database context - * @param coin_pub the public key of the coin to search for - * @param[out] denom_pub the denomination of the public key, if coin was present - * @param[out] denom_sig the signature with the denomination key of the coin, if coin was present - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_signature_for_known_coin (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_CoinSpendPublicKeyP * - coin_pub, - struct - TALER_DenominationPublicKey * - denom_pub, - struct - TALER_DenominationSignature * - denom_sig); - -#endif diff --git a/src/include/taler/exchange-database/get_wire_accounts.h b/src/include/taler/exchange-database/get_wire_accounts.h @@ -1,100 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_wire_accounts.h - * @brief implementation of the get_wire_accounts function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_WIRE_ACCOUNTS_H -#define EXCHANGE_DATABASE_GET_WIRE_ACCOUNTS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Provide information about a wire account. - * - * @param cls closure - * @param payto_uri the exchange bank account URI - * @param conversion_url URL of a conversion service, NULL if there is no conversion - * @param open_banking_gateway open banking gateway service, NULL if unavailable - * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable - * @param debit_restrictions JSON array with debit restrictions on the account - * @param credit_restrictions JSON array with credit restrictions on the account - * @param master_sig master key signature affirming that this is a bank - * account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS) - * @param bank_label label the wallet should use to display the account, can be NULL - * @param priority priority for ordering bank account labels - */ -typedef void -(*TALER_EXCHANGEDB_WireAccountCallback)( - void *cls, - const struct TALER_FullPayto payto_uri, - const char *conversion_url, - const char *open_banking_gateway, - const char *wire_transfer_gateway, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - const struct TALER_MasterSignatureP *master_sig, - const char *bank_label, - int64_t priority); - - -/* Callback typedefs */ -/** - * Provide information about a wire account. - * - * @param cls closure - * @param payto_uri the exchange bank account URI - * @param conversion_url URL of a conversion service, NULL if there is no conversion - * @param open_banking_gateway open banking gateway service, NULL if unavailable - * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable - * @param debit_restrictions JSON array with debit restrictions on the account - * @param credit_restrictions JSON array with credit restrictions on the account - * @param master_sig master key signature affirming that this is a bank - * account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS) - * @param bank_label label the wallet should use to display the account, can be NULL - * @param priority priority for ordering bank account labels - */ -typedef void -(*TALER_EXCHANGEDB_WireAccountCallback)( - void *cls, - const struct TALER_FullPayto payto_uri, - const char *conversion_url, - const char *open_banking_gateway, - const char *wire_transfer_gateway, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - const struct TALER_MasterSignatureP *master_sig, - const char *bank_label, - int64_t priority); - -/** - * Obtain information about the enabled wire accounts of the exchange. - * - * @param pg the database context - * @param cb function to call on each account - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_wire_accounts (struct TALER_EXCHANGEDB_PostgresContext *pg, - TALER_EXCHANGEDB_WireAccountCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/get_wire_fee.h b/src/include/taler/exchange-database/get_wire_fee.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_wire_fee.h - * @brief implementation of the get_wire_fee function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_WIRE_FEE_H -#define EXCHANGE_DATABASE_GET_WIRE_FEE_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Obtain wire fee from database. - * - * @param pg the database context - * @param type type of wire transfer the fee applies for - * @param date for which date do we want the fee? - * @param[out] rowid set to row in the database with the wire fee - * @param[out] start_date when does the fee go into effect - * @param[out] end_date when does the fee end being valid - * @param[out] fees how high are the wire fees - * @param[out] master_sig signature over the above by the exchange master key - * @return status of the transaction - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_wire_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, - const char *type, - struct GNUNET_TIME_Timestamp date, - uint64_t *rowid, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_WireFeeSet *fees, - struct TALER_MasterSignatureP *master_sig); - -#endif diff --git a/src/include/taler/exchange-database/get_wire_fees.h b/src/include/taler/exchange-database/get_wire_fees.h @@ -1,84 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_wire_fees.h - * @brief implementation of the get_wire_fees function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_GET_WIRE_FEES_H -#define EXCHANGE_DATABASE_GET_WIRE_FEES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Provide information about wire fees. - * - * @param cls closure - * @param fees the wire fees we charge - * @param start_date from when are these fees valid (start date) - * @param end_date until when are these fees valid (end date, exclusive) - * @param master_sig master key signature affirming that this is the correct - * fee (of purpose #TALER_SIGNATURE_MASTER_WIRE_FEES) - */ -typedef void -(*TALER_EXCHANGEDB_WireFeeCallback)( - void *cls, - const struct TALER_WireFeeSet *fees, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_MasterSignatureP *master_sig); - - -/* Callback typedefs */ -/** - * Provide information about wire fees. - * - * @param cls closure - * @param fees the wire fees we charge - * @param start_date from when are these fees valid (start date) - * @param end_date until when are these fees valid (end date, exclusive) - * @param master_sig master key signature affirming that this is the correct - * fee (of purpose #TALER_SIGNATURE_MASTER_WIRE_FEES) - */ -typedef void -(*TALER_EXCHANGEDB_WireFeeCallback)( - void *cls, - const struct TALER_WireFeeSet *fees, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_MasterSignatureP *master_sig); - -/** - * Obtain information about the fee structure of the exchange for - * a given @a wire_method - * - * @param pg the database context - * @param wire_method which wire method to obtain fees for - * @param cb function to call on each account - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_get_wire_fees (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const char *wire_method, - TALER_EXCHANGEDB_WireFeeCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/get_wire_hash_for_contract.h b/src/include/taler/exchange-database/get_wire_hash_for_contract.h @@ -1,52 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_wire_hash_for_contract.h - * @brief implementation of the get_wire_hash_for_contract function for Postgres - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_GET_WIRE_HASH_FOR_CONTRACT_H -#define EXCHANGE_DATABASE_GET_WIRE_HASH_FOR_CONTRACT_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Try to get the salted hash of a merchant's bank account to a deposit - * contract. This is necessary in the event of a conflict with a given - * (merchant_pub, h_contract_terms) during deposit. - * - * @param pg the database context - * @param merchant_pub merchant public key - * @param h_contract_terms hash of the proposal data - * @param[out] h_wire salted hash of a merchant's bank account - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_wire_hash_for_contract (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_MerchantPublicKeyP * - merchant_pub, - const struct - TALER_PrivateContractHashP * - h_contract_terms, - struct TALER_MerchantWireHashP * - h_wire); - -#endif diff --git a/src/include/taler/exchange-database/get_withdraw.h b/src/include/taler/exchange-database/get_withdraw.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/get_withdraw.h - * @brief implementation of the get_withdraw function for Postgres - * @author Özgür KESIM - */ -#ifndef EXCHANGE_DATABASE_GET_WITHDRAW_H -#define EXCHANGE_DATABASE_GET_WITHDRAW_H - -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/free_reserve_history.h" - - -/** - * Locate the response for a withdraw request under a hash that uniquely - * identifies the withdraw operation. Used to ensure idempotency of the - * request. - * - * @param pg the database context - * @param wch hash over all hashes of blinded planchets that uniquely identifies the withdraw operation - * @param[out] wd corresponding details of the previous withdraw request if an entry was found - * @return statement execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_get_withdraw (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_HashBlindedPlanchetsP *wch, - struct TALER_EXCHANGEDB_Withdraw *wd); - -#endif diff --git a/src/include/taler/exchange-database/have_deposit2.h b/src/include/taler/exchange-database/have_deposit2.h @@ -1,57 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/have_deposit2.h - * @brief implementation of the have_deposit2 function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_HAVE_DEPOSIT2_H -#define EXCHANGE_DATABASE_HAVE_DEPOSIT2_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Check if we have the specified deposit already in the database. - * - * @param pg the database context - * @param h_contract_terms contract to check for - * @param h_wire wire hash to check for - * @param coin_pub public key of the coin to check for - * @param merchant merchant public key to check for - * @param refund_deadline expected refund deadline - * @param[out] deposit_fee set to the deposit fee the exchange charged - * @param[out] exchange_timestamp set to the time when the exchange received the deposit - * @return 1 if we know this operation, - * 0 if this exact deposit is unknown to us, - * otherwise transaction error status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_have_deposit2 (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PrivateContractHashP * - h_contract_terms, - const struct TALER_MerchantWireHashP *h_wire, - const struct TALER_CoinSpendPublicKeyP *coin_pub - , - const struct TALER_MerchantPublicKeyP *merchant, - struct GNUNET_TIME_Timestamp refund_deadline, - struct TALER_Amount *deposit_fee, - struct GNUNET_TIME_Timestamp *exchange_timestamp - ); - -#endif diff --git a/src/include/taler/exchange-database/inject_auditor_triggers.h b/src/include/taler/exchange-database/inject_auditor_triggers.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/inject_auditor_triggers.h - * @brief implementation of the inject_auditor_triggers function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INJECT_AUDITOR_TRIGGERS_H -#define EXCHANGE_DATABASE_INJECT_AUDITOR_TRIGGERS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to inject auditor triggers into the - * database, triggering the real-time auditor upon - * relevant INSERTs. - * - * @param pg the database context - * @return #GNUNET_OK on success, - * #GNUNET_SYSERR on DB errors - */ -enum GNUNET_GenericReturnValue -TALER_EXCHANGEDB_inject_auditor_triggers (struct - TALER_EXCHANGEDB_PostgresContext *pg); - - -#endif diff --git a/src/include/taler/exchange-database/insert_active_legitimization_measure.h b/src/include/taler/exchange-database/insert_active_legitimization_measure.h @@ -1,53 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_active_legitimization_measure.h - * @brief implementation of the insert_active_legitimization_measure function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_ACTIVE_LEGITIMIZATION_MEASURE_H -#define EXCHANGE_DATABASE_INSERT_ACTIVE_LEGITIMIZATION_MEASURE_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Create new active legitimization measure. - * - * - * @param pg the database context - * @param access_token access token that identifies the - * account the legitimization measures apply to - * @param jmeasures new legitimization measures - * @param[out] legitimization_measure_serial_id - * set to new row in legitimization_measures table - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_active_legitimization_measure (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - const struct - TALER_AccountAccessTokenP - * - access_token, - const json_t *jmeasures, - uint64_t * - legitimization_measure_serial_id); - - -#endif diff --git a/src/include/taler/exchange-database/insert_aml_decision.h b/src/include/taler/exchange-database/insert_aml_decision.h @@ -1,101 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022, 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_aml_decision.h - * @brief implementation of the insert_aml_decision function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_AML_DECISION_H -#define EXCHANGE_DATABASE_INSERT_AML_DECISION_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert an AML decision. Inserts into AML history and insert or updates AML - * status. - * - * @param pg the database context - * @param payto_uri full URI of the account, optional, - * can be NULL if the backend already knows the account - * @param h_payto account for which the attribute data is stored - * @param decision_time when was the decision made - * @param expiration_time when does the decision expire - * @param properties JSON object with properties to set for the account - * @param new_rules JSON array with new AML/KYC rules - * @param to_investigate true if AML staff should look more into this account - * @param new_measure_name name of the @a jmeasures measure that was triggered, or NULL for none - * @param jmeasures a JSON with LegitimizationMeasures to apply to the - * account, or NULL to not apply any measure right now - * @param justification human-readable text justifying the decision - * @param decider_pub public key of the staff member - * @param decider_sig signature of the staff member - * @param num_events length of the @a events array - * @param events array of events to trigger - * @param enc_attributes_size number of bytes in @a enc_attributes - * @param enc_attributes encrypted attribute data - * @param form_name name of the form from which @a enc_attributes originate, can be NULL - * @param attributes_hash hash of the unencrypted attribute data - * @param attributes_expiration_time when does the attribute data expire - * @param[out] invalid_officer set to TRUE if @a decider_pub is not allowed to make decisions right now - * @param[out] unknown_account set to TRUE if @a h_payto does not refer to a known account and @a jmeasures was given - * @param[out] last_date set to the previous decision time; - * the INSERT is not performed if @a last_date is not before @a decision_time - * @param[out] legitimization_measure_serial_id serial ID of the legitimization measures - * of the decision - * @param[out] is_wallet set to true if @a h_payto is for a wallet - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_aml_decision (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_FullPayto payto_uri, - const struct TALER_NormalizedPaytoHashP * - h_payto - , - struct GNUNET_TIME_Timestamp decision_time - , - struct GNUNET_TIME_Timestamp - expiration_time, - const json_t *properties, - const json_t *new_rules, - bool to_investigate, - const char *new_measure_name, - const json_t *jmeasures, - const char *justification, - const struct TALER_AmlOfficerPublicKeyP * - decider_pub, - const struct TALER_AmlOfficerSignatureP * - decider_sig, - size_t num_events, - const char *events[static num_events], - const char *form_name, - size_t enc_attributes_size, - const void *enc_attributes, - struct GNUNET_HashCode *attributes_hash, - struct GNUNET_TIME_Timestamp - attributes_expiration_time, - bool *invalid_officer, - bool *unknown_account, - struct GNUNET_TIME_Timestamp *last_date, - uint64_t *legitimization_measure_serial_id - , - bool *is_wallet); - - -#endif diff --git a/src/include/taler/exchange-database/insert_aml_officer.h b/src/include/taler/exchange-database/insert_aml_officer.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_aml_officer.h - * @brief implementation of the insert_aml_officer function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_AML_OFFICER_H -#define EXCHANGE_DATABASE_INSERT_AML_OFFICER_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert AML staff record. If the time given in - * @a last_change is before the previous change in the - * database, only @e previous_change is returned and - * no actual change is committed to the database. - * - * @param pg the database context - * @param decider_pub public key of the staff member - * @param master_sig offline signature affirming the AML officer - * @param decider_name full name of the staff member - * @param is_active true to enable, false to set as inactive - * @param read_only true to set read-only access - * @param last_change when was the change made effective - * @param[out] previous_change set to the time of the previous change - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_aml_officer (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct TALER_AmlOfficerPublicKeyP * - decider_pub, - const struct TALER_MasterSignatureP * - master_sig, - const char *decider_name, - bool is_active, - bool read_only, - struct GNUNET_TIME_Timestamp last_change, - struct GNUNET_TIME_Timestamp * - previous_change); - -#endif diff --git a/src/include/taler/exchange-database/insert_aml_program_failure.h b/src/include/taler/exchange-database/insert_aml_program_failure.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_aml_program_failure.h - * @brief implementation of the insert_aml_program_failure function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_AML_PROGRAM_FAILURE_H -#define EXCHANGE_DATABASE_INSERT_AML_PROGRAM_FAILURE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Update AML program status to finished (and failed). - * - * @param pg the database context - * @param process_row KYC process row to update - * @param h_payto account for which the attribute data is stored - * @param error_message details about what went wrong - * @param ec error code about the failure - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_aml_program_failure (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - uint64_t process_row, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - const char *error_message, - enum TALER_ErrorCode ec); - - -#endif diff --git a/src/include/taler/exchange-database/insert_auditor.h b/src/include/taler/exchange-database/insert_auditor.h @@ -1,47 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_auditor.h - * @brief implementation of the insert_auditor function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_AUDITOR_H -#define EXCHANGE_DATABASE_INSERT_AUDITOR_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert information about an auditor that will audit this exchange. - * - * @param pg the database context - * @param auditor_pub key of the auditor - * @param auditor_url base URL of the auditor's REST service - * @param auditor_name name of the auditor (for humans) - * @param start_date date when the auditor was added by the offline system - * (only to be used for replay detection) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_auditor (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_AuditorPublicKeyP * - auditor_pub, - const char *auditor_url, - const char *auditor_name, - struct GNUNET_TIME_Timestamp start_date); - -#endif diff --git a/src/include/taler/exchange-database/insert_auditor_denom_sig.h b/src/include/taler/exchange-database/insert_auditor_denom_sig.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_auditor_denom_sig.h - * @brief implementation of the insert_auditor_denom_sig function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_AUDITOR_DENOM_SIG_H -#define EXCHANGE_DATABASE_INSERT_AUDITOR_DENOM_SIG_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert information about an auditor auditing a denomination key. - * - * @param pg the database context - * @param h_denom_pub the audited denomination - * @param auditor_pub the auditor's key - * @param auditor_sig signature affirming the auditor's audit activity - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_insert_auditor_denom_sig (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_DenominationHashP * - h_denom_pub, - const struct - TALER_AuditorPublicKeyP * - auditor_pub, - const struct - TALER_AuditorSignatureP * - auditor_sig); - -#endif diff --git a/src/include/taler/exchange-database/insert_contract.h b/src/include/taler/exchange-database/insert_contract.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_contract.h - * @brief implementation of the insert_contract function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_CONTRACT_H -#define EXCHANGE_DATABASE_INSERT_CONTRACT_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to persist an encrypted contract associated with a reserve. - * - * @param pg the database context - * @param purse_pub the purse the contract is associated with (must exist) - * @param econtract the encrypted contract - * @param[out] in_conflict set to true if @a econtract - * conflicts with an existing contract; - * in this case, the return value will be - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_contract (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_EncryptedContract * - econtract, - bool *in_conflict); - -#endif diff --git a/src/include/taler/exchange-database/insert_denomination_info.h b/src/include/taler/exchange-database/insert_denomination_info.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_denomination_info.h - * @brief implementation of the insert_denomination_info function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_DENOMINATION_INFO_H -#define EXCHANGE_DATABASE_INSERT_DENOMINATION_INFO_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Insert a denomination key's public information into the database for - * reference by auditors and other consistency checks. - * - * @param pg the database context - * @param denom_pub the public key used for signing coins of this denomination - * @param issue issuing information with value, fees and other info about the coin - * @return status of the query - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_denomination_info (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_DenominationPublicKey * - denom_pub, - const struct - TALER_EXCHANGEDB_DenominationKeyInformation - *issue); - -#endif diff --git a/src/include/taler/exchange-database/insert_denomination_revocation.h b/src/include/taler/exchange-database/insert_denomination_revocation.h @@ -1,49 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_denomination_revocation.h - * @brief implementation of the insert_denomination_revocation function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_DENOMINATION_REVOCATION_H -#define EXCHANGE_DATABASE_INSERT_DENOMINATION_REVOCATION_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Store information that a denomination key was revoked - * in the database. - * - * @param pg the database context - * @param denom_pub_hash hash of the revoked denomination key - * @param master_sig signature affirming the revocation - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_denomination_revocation (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - const struct - TALER_DenominationHashP * - denom_pub_hash, - const struct - TALER_MasterSignatureP * - master_sig); - -#endif diff --git a/src/include/taler/exchange-database/insert_drain_profit.h b/src/include/taler/exchange-database/insert_drain_profit.h @@ -1,56 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_drain_profit.h - * @brief implementation of the insert_drain_profit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_DRAIN_PROFIT_H -#define EXCHANGE_DATABASE_INSERT_DRAIN_PROFIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to persist a request to drain profits. - * - * @param pg the database context - * @param wtid wire transfer ID to use - * @param account_section account to drain - * @param payto_uri account to wire funds to - * @param request_timestamp when was the request made - * @param amount amount to wire - * @param master_sig signature affirming the operation - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_drain_profit (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_WireTransferIdentifierRawP * - wtid, - const char *account_section, - const struct TALER_FullPayto payto_uri, - struct GNUNET_TIME_Timestamp - request_timestamp, - const struct TALER_Amount *amount, - const struct TALER_MasterSignatureP * - master_sig) -; - -#endif diff --git a/src/include/taler/exchange-database/insert_global_fee.h b/src/include/taler/exchange-database/insert_global_fee.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_global_fee.h - * @brief implementation of the insert_global_fee function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_GLOBAL_FEE_H -#define EXCHANGE_DATABASE_INSERT_GLOBAL_FEE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert global fee data into database. - * - * @param pg the database context - * @param start_date when does the fees go into effect - * @param end_date when does the fees end being valid - * @param fees how high is are the global fees - * @param purse_timeout when do purses time out - * @param history_expiration how long are account histories preserved - * @param purse_account_limit how many purses are free per account - * @param master_sig signature over the above by the exchange master key - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_global_fee (struct TALER_EXCHANGEDB_PostgresContext *pg, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative purse_timeout, - struct GNUNET_TIME_Relative - history_expiration, - uint32_t purse_account_limit, - const struct TALER_MasterSignatureP * - master_sig); - -#endif diff --git a/src/include/taler/exchange-database/insert_kyc_failure.h b/src/include/taler/exchange-database/insert_kyc_failure.h @@ -1,55 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_kyc_failure.h - * @brief implementation of the insert_kyc_failure function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_KYC_FAILURE_H -#define EXCHANGE_DATABASE_INSERT_KYC_FAILURE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Update KYC process status to finished (and failed). - * - * @param pg the database context - * @param process_row KYC process row to update - * @param h_payto account for which the attribute data is stored - * @param provider_name provider that must be checked - * @param provider_account_id provider account ID - * @param provider_legitimization_id provider legitimization ID - * @param error_message details about what went wrong - * @param ec error code about the failure - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_kyc_failure (struct TALER_EXCHANGEDB_PostgresContext *pg - , - uint64_t process_row, - const struct TALER_NormalizedPaytoHashP * - h_payto, - const char *provider_name, - const char *provider_account_id, - const char *provider_legitimization_id, - const char *error_message, - enum TALER_ErrorCode ec); - - -#endif diff --git a/src/include/taler/exchange-database/insert_kyc_requirement_process.h b/src/include/taler/exchange-database/insert_kyc_requirement_process.h @@ -1,62 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_kyc_requirement_process.h - * @brief implementation of the insert_kyc_requirement_process function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_KYC_REQUIREMENT_PROCESS_H -#define EXCHANGE_DATABASE_INSERT_KYC_REQUIREMENT_PROCESS_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Begin KYC requirement process. - * - * @param pg the database context - * @param h_payto account that must be KYC'ed - * @param measure_index which of the measures in - * jmeasures does this KYC process relate to - * @param legitimization_measure_serial_id which - * legitimization measure set does this KYC process - * relate to (uniquely identifies jmeasures) - * @param provider_name provider that must be checked - * @param provider_account_id provider account ID - * @param provider_legitimization_id provider legitimization ID - * @param[out] process_row row the process is stored under - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_kyc_requirement_process (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - uint32_t measure_index, - uint64_t - legitimization_measure_serial_id, - const char *provider_name, - const char *provider_account_id - , - const char * - provider_legitimization_id, - uint64_t *process_row); - -#endif diff --git a/src/include/taler/exchange-database/insert_partner.h b/src/include/taler/exchange-database/insert_partner.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_partner.h - * @brief implementation of the insert_partner function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_PARTNER_H -#define EXCHANGE_DATABASE_INSERT_PARTNER_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Function called to store configuration data about a partner - * exchange that we are federated with. - * - * @param pg the database context - * @param master_pub public offline signing key of the partner exchange - * @param start_date when does the following data start to be valid - * @param end_date when does the validity end (exclusive) - * @param wad_frequency how often do we do exchange-to-exchange settlements? - * @param wad_fee how much do we charge for transfers to the partner - * @param partner_base_url base URL of the partner exchange - * @param master_sig signature with our offline signing key affirming the above - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_partner (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_MasterPublicKeyP *master_pub - , - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - struct GNUNET_TIME_Relative wad_frequency, - const struct TALER_Amount *wad_fee, - const char *partner_base_url, - const struct TALER_MasterSignatureP *master_sig - ); - -#endif diff --git a/src/include/taler/exchange-database/insert_purse_request.h b/src/include/taler/exchange-database/insert_purse_request.h @@ -1,69 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_purse_request.h - * @brief implementation of the insert_purse_request function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_PURSE_REQUEST_H -#define EXCHANGE_DATABASE_INSERT_PURSE_REQUEST_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to create a new purse with certain meta data. - * - * @param pg the database context - * @param purse_pub public key of the new purse - * @param merge_pub public key providing the merge capability - * @param purse_expiration time when the purse will expire - * @param h_contract_terms hash of the contract for the purse - * @param age_limit age limit to enforce for payments into the purse - * @param flags flags for the operation - * @param purse_fee fee we are allowed to charge to the reserve (depending on @a flags) - * @param amount target amount (with fees) to be put into the purse - * @param purse_sig signature with @a purse_pub's private key affirming the above - * @param[out] in_conflict set to true if the meta data - * conflicts with an existing purse; - * in this case, the return value will be - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_purse_request (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_PurseMergePublicKeyP * - merge_pub, - struct GNUNET_TIME_Timestamp - purse_expiration, - const struct TALER_PrivateContractHashP * - h_contract_terms, - uint32_t age_limit, - enum TALER_WalletAccountMergeFlags flags, - const struct TALER_Amount *purse_fee, - const struct TALER_Amount *amount, - const struct - TALER_PurseContractSignatureP * - purse_sig, - bool *in_conflict); - -#endif diff --git a/src/include/taler/exchange-database/insert_records_by_table.h b/src/include/taler/exchange-database/insert_records_by_table.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file insert_records_by_table.h - * @brief implementation of the insert_records_by_table function - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_RECORDS_BY_TABLE_H -#define EXCHANGE_DATABASE_INSERT_RECORDS_BY_TABLE_H - -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/lookup_records_by_table.h" - - -/** - * Insert record set into @a table. Used in exchange-auditor database - * replication. - * - * @param pg the database context - * @param td table data to insert - * @return transaction status code, #GNUNET_DB_STATUS_HARD_ERROR if - * @e table in @a tr is not supported - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_records_by_table ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_EXCHANGEDB_TableData *td); - - -#endif diff --git a/src/include/taler/exchange-database/insert_refund.h b/src/include/taler/exchange-database/insert_refund.h @@ -1,38 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_refund.h - * @brief implementation of the insert_refund function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_REFUND_H -#define EXCHANGE_DATABASE_INSERT_REFUND_H - -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/do_refund.h" - -/** - * Insert information about refunded coin into the database. - * - * @param pg the database context - * @param refund refund information to store - * @return query result status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_refund (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_EXCHANGEDB_Refund *refund); - -#endif diff --git a/src/include/taler/exchange-database/insert_reserve_closed.h b/src/include/taler/exchange-database/insert_reserve_closed.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_reserve_closed.h - * @brief implementation of the insert_reserve_closed function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_RESERVE_CLOSED_H -#define EXCHANGE_DATABASE_INSERT_RESERVE_CLOSED_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert reserve close operation into database. - * - * @param pg the database context - * @param reserve_pub which reserve is this about? - * @param execution_date when did we perform the transfer? - * @param receiver_account to which account do we transfer? - * @param wtid wire transfer details - * @param amount_with_fee amount we charged to the reserve - * @param closing_fee how high is the closing fee - * @param close_request_row identifies explicit close request, 0 for none - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_reserve_closed (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_ReservePublicKeyP * - reserve_pub, - struct GNUNET_TIME_Timestamp - execution_date, - const struct TALER_FullPayto - receiver_account, - const struct - TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_Amount * - amount_with_fee, - const struct TALER_Amount *closing_fee, - uint64_t close_request_row); - -#endif diff --git a/src/include/taler/exchange-database/insert_sanction_list_hit.h b/src/include/taler/exchange-database/insert_sanction_list_hit.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_sanction_list_hit.h - * @brief implementation of the insert_sanction_list_hit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_SANCTION_LIST_HIT_H -#define EXCHANGE_DATABASE_INSERT_SANCTION_LIST_HIT_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Update sanction list hit status of the given account. - * - * @param pg the database context - * @param h_payto account for which the hit is to be stored - * @param to_investigate true to flag account for investigation, - * false to **preserve** existing status - * @param new_rules new KYC rules to apply to the account, NULL to preserve - * existing rules - * @param account_properties new account properties - * @param num_events length of the @a events array - * @param events array of KYC events to trigger - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_sanction_list_hit (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - bool to_investigate, - const json_t *new_rules, - const json_t *account_properties, - unsigned int num_events, - const char **events); - -#endif diff --git a/src/include/taler/exchange-database/insert_signkey_revocation.h b/src/include/taler/exchange-database/insert_signkey_revocation.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_signkey_revocation.h - * @brief implementation of the insert_signkey_revocation function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_SIGNKEY_REVOCATION_H -#define EXCHANGE_DATABASE_INSERT_SIGNKEY_REVOCATION_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Store information about a revoked online signing key. - * - * @param pg the database context - * @param exchange_pub exchange online signing key that was revoked - * @param master_sig signature affirming the revocation - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_signkey_revocation (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - const struct - TALER_ExchangePublicKeyP * - exchange_pub, - const struct - TALER_MasterSignatureP * - master_sig); - -#endif diff --git a/src/include/taler/exchange-database/insert_successor_measure.h b/src/include/taler/exchange-database/insert_successor_measure.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022, 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_successor_measure.h - * @brief implementation of the insert_successor_measure function for Postgres - * @author Florian Dold - */ -#ifndef EXCHANGE_DATABASE_INSERT_SUCCESSOR_MEASURE_H -#define EXCHANGE_DATABASE_INSERT_SUCCESSOR_MEASURE_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_successor_measure (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - struct GNUNET_TIME_Timestamp - decision_time, - const char *new_measure_name, - const json_t *jmeasures, - bool *unknown_account, - struct GNUNET_TIME_Timestamp * - last_date); - - -#endif diff --git a/src/include/taler/exchange-database/insert_wire.h b/src/include/taler/exchange-database/insert_wire.h @@ -1,61 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_wire.h - * @brief implementation of the insert_wire function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_WIRE_H -#define EXCHANGE_DATABASE_INSERT_WIRE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert information about an wire account used by this exchange. - * - * @param pg the database context - * @param payto_uri wire account of the exchange - * @param conversion_url URL of a conversion service, NULL if there is no conversion - * @param open_banking_gateway open banking gateway service, NULL if unavailable - * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable - * @param debit_restrictions JSON array with debit restrictions on the account - * @param credit_restrictions JSON array with credit restrictions on the account - * @param start_date date when the account was added by the offline system - * (only to be used for replay detection) - * @param master_sig public signature affirming the existence of the account, - * must be of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS - * @param bank_label label to show this entry under in the UI, can be NULL - * @param priority determines order in which entries are shown in the UI - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_wire (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_FullPayto payto_uri, - const char *conversion_url, - const char *open_banking_gateway, - const char *wire_transfer_gateway, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - struct GNUNET_TIME_Timestamp start_date, - const struct TALER_MasterSignatureP *master_sig, - const char *bank_label, - int64_t priority); - - -#endif diff --git a/src/include/taler/exchange-database/insert_wire_fee.h b/src/include/taler/exchange-database/insert_wire_fee.h @@ -1,49 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/insert_wire_fee.h - * @brief implementation of the insert_wire_fee function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_INSERT_WIRE_FEE_H -#define EXCHANGE_DATABASE_INSERT_WIRE_FEE_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert wire transfer fee into database. - * - * @param pg the database context - * @param type type of wire transfer this fee applies for - * @param start_date when does the fee go into effect - * @param end_date when does the fee end being valid - * @param fees how high are the wire fees - * @param master_sig signature over the above by the exchange master key - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_insert_wire_fee (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *type, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_WireFeeSet *fees, - const struct TALER_MasterSignatureP * - master_sig); - -#endif diff --git a/src/include/taler/exchange-database/iterate_active_auditors.h b/src/include/taler/exchange-database/iterate_active_auditors.h @@ -1,75 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/iterate_active_auditors.h - * @brief implementation of the iterate_active_auditors function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ITERATE_ACTIVE_AUDITORS_H -#define EXCHANGE_DATABASE_ITERATE_ACTIVE_AUDITORS_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with information about the exchange's auditors. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param auditor_pub the public key of the auditor - * @param auditor_url URL of the REST API of the auditor - * @param auditor_name human readable official name of the auditor - */ -typedef void -(*TALER_EXCHANGEDB_AuditorsCallback)( - void *cls, - const struct TALER_AuditorPublicKeyP *auditor_pub, - const char *auditor_url, - const char *auditor_name); - - -/* Callback typedefs */ -/** - * Function called with information about the exchange's auditors. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param auditor_pub the public key of the auditor - * @param auditor_url URL of the REST API of the auditor - * @param auditor_name human readable official name of the auditor - */ -typedef void -(*TALER_EXCHANGEDB_AuditorsCallback)( - void *cls, - const struct TALER_AuditorPublicKeyP *auditor_pub, - const char *auditor_url, - const char *auditor_name); - -/** - * Function called to invoke @a cb on every active auditor. Disabled - * auditors are skipped. Runs in its own read-only transaction. - * - * @param pg the database context - * @param cb function to call on each active auditor - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_iterate_active_auditors (struct - TALER_EXCHANGEDB_PostgresContext *pg, - TALER_EXCHANGEDB_AuditorsCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/iterate_active_signkeys.h b/src/include/taler/exchange-database/iterate_active_signkeys.h @@ -1,79 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/iterate_active_signkeys.h - * @brief implementation of the iterate_active_signkeys function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ITERATE_ACTIVE_SIGNKEYS_H -#define EXCHANGE_DATABASE_ITERATE_ACTIVE_SIGNKEYS_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Signature of a function called with information about the exchange's - * online signing keys. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param exchange_pub public key of the exchange - * @param meta meta data information about the signing type (expirations) - * @param master_sig master signature affirming the validity of this denomination - */ -typedef void -(*TALER_EXCHANGEDB_ActiveSignkeysCallback)( - void *cls, - const struct TALER_ExchangePublicKeyP *exchange_pub, - const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, - const struct TALER_MasterSignatureP *master_sig); - - -/* Callback typedefs */ -/** - * Signature of a function called with information about the exchange's - * online signing keys. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param exchange_pub public key of the exchange - * @param meta meta data information about the signing type (expirations) - * @param master_sig master signature affirming the validity of this denomination - */ -typedef void -(*TALER_EXCHANGEDB_ActiveSignkeysCallback)( - void *cls, - const struct TALER_ExchangePublicKeyP *exchange_pub, - const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, - const struct TALER_MasterSignatureP *master_sig); - -/** - * Function called to invoke @a cb on every non-revoked exchange signing key - * that has been signed by the master key. Revoked and (for signing!) - * expired keys are skipped. Runs in its own read-only transaction. - * - * @param pg the database context - * @param cb function to call on each signing key - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_iterate_active_signkeys (struct - TALER_EXCHANGEDB_PostgresContext *pg, - TALER_EXCHANGEDB_ActiveSignkeysCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/iterate_auditor_denominations.h b/src/include/taler/exchange-database/iterate_auditor_denominations.h @@ -1,81 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/iterate_auditor_denominations.h - * @brief implementation of the iterate_auditor_denominations function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H -#define EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with information about the denominations - * audited by the exchange's auditors. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param auditor_pub the public key of an auditor - * @param h_denom_pub hash of a denomination key audited by this auditor - * @param auditor_sig signature from the auditor affirming this - */ -typedef void -(*TALER_EXCHANGEDB_AuditorDenominationsCallback)( - void *cls, - const struct TALER_AuditorPublicKeyP *auditor_pub, - const struct TALER_DenominationHashP *h_denom_pub, - const struct TALER_AuditorSignatureP *auditor_sig); - - -/* Callback typedefs */ -/** - * Function called with information about the denominations - * audited by the exchange's auditors. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param auditor_pub the public key of an auditor - * @param h_denom_pub hash of a denomination key audited by this auditor - * @param auditor_sig signature from the auditor affirming this - */ -typedef void -(*TALER_EXCHANGEDB_AuditorDenominationsCallback)( - void *cls, - const struct TALER_AuditorPublicKeyP *auditor_pub, - const struct TALER_DenominationHashP *h_denom_pub, - const struct TALER_AuditorSignatureP *auditor_sig); - -/** - * Function called to invoke @a cb on every denomination with an active - * auditor. Disabled auditors and denominations without auditor are - * skipped. Runs in its own read-only transaction. - * - * @param pg the database context - * @param cb function to call on each active auditor - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_iterate_auditor_denominations (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - TALER_EXCHANGEDB_AuditorDenominationsCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/iterate_denomination_info.h b/src/include/taler/exchange-database/iterate_denomination_info.h @@ -1,80 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/iterate_denomination_info.h - * @brief implementation of the iterate_denomination_info function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ITERATE_DENOMINATION_INFO_H -#define EXCHANGE_DATABASE_ITERATE_DENOMINATION_INFO_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with information about the exchange's denomination keys. - * Note that the 'master' field in @a issue will not yet be initialized when - * this function is called! - * - * @param cls closure - * @param denom_serial table row of the denomination - * @param denom_pub public key of the denomination - * @param issue detailed information about the denomination (value, expiration times, fees); - */ -typedef void -(*TALER_EXCHANGEDB_DenominationCallback)( - void *cls, - uint64_t denom_serial, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); - - -/* Callback typedefs */ -/** - * Function called with information about the exchange's denomination keys. - * Note that the 'master' field in @a issue will not yet be initialized when - * this function is called! - * - * @param cls closure - * @param denom_serial table row of the denomination - * @param denom_pub public key of the denomination - * @param issue detailed information about the denomination (value, expiration times, fees); - */ -typedef void -(*TALER_EXCHANGEDB_DenominationCallback)( - void *cls, - uint64_t denom_serial, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); - -/** - * Fetch information about all known denomination keys. - * - * @param pg the database context - * @param cb function to call on each denomination key - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_iterate_denomination_info (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - TALER_EXCHANGEDB_DenominationCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/iterate_denominations.h b/src/include/taler/exchange-database/iterate_denominations.h @@ -1,68 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/iterate_denominations.h - * @brief implementation of the iterate_denominations function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ITERATE_DENOMINATIONS_H -#define EXCHANGE_DATABASE_ITERATE_DENOMINATIONS_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Signature of a function called with information about the exchange's - * denomination keys. - * - * @param cls closure with a `struct TEH_KeyStateHandle *` - * @param denom_pub public key of the denomination - * @param h_denom_pub hash of @a denom_pub - * @param meta meta data information about the denomination type (value, expirations, fees) - * @param master_sig master signature affirming the validity of this denomination - * @param recoup_possible true if the key was revoked and clients can currently recoup - * coins of this denomination - */ -typedef void -(*TALER_EXCHANGEDB_DenominationsCallback)( - void *cls, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_DenominationHashP *h_denom_pub, - const struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta, - const struct TALER_MasterSignatureP *master_sig, - bool recoup_possible); - - -/** - * Function called to invoke @a cb on every known denomination key (revoked - * and non-revoked) that has been signed by the master key. Runs in its own - * read-only transaction. - * - * - * @param pg the database context - * @param cb function to call on each denomination key - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_iterate_denominations (struct - TALER_EXCHANGEDB_PostgresContext *pg, - TALER_EXCHANGEDB_DenominationsCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/kyc_provider_account_lookup.h b/src/include/taler/exchange-database/kyc_provider_account_lookup.h @@ -1,53 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/kyc_provider_account_lookup.h - * @brief implementation of the kyc_provider_account_lookup function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_KYC_PROVIDER_ACCOUNT_LOOKUP_H -#define EXCHANGE_DATABASE_KYC_PROVIDER_ACCOUNT_LOOKUP_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup an - * @a h_payto by @a provider_legitimization_id. - * - * @param pg the database context - * @param provider_name - * @param provider_legitimization_id legi to look up - * @param[out] h_payto where to write the result - * @param[out] is_wallet set to true if @a h_payto is for a wallet - * @param[out] process_row where to write the row of the entry - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_kyc_provider_account_lookup (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const char *provider_name, - const char * - provider_legitimization_id, - struct TALER_NormalizedPaytoHashP - * - h_payto, - bool *is_wallet, - uint64_t *process_row); - -#endif diff --git a/src/include/taler/exchange-database/kycauth_in_insert.h b/src/include/taler/exchange-database/kycauth_in_insert.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/kycauth_in_insert.h - * @brief implementation of the kycauth_in_insert function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_KYCAUTH_IN_INSERT_H -#define EXCHANGE_DATABASE_KYCAUTH_IN_INSERT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert an incoming KCYAUTH wire transfer into - * the database and update the authentication key - * for the origin account. - * - * @param pg the database context - * @param account_pub public key of the account - * @param credit_amount amount we were credited - * @param execution_date when was the transfer made - * @param debit_account_uri URI of the debit account - * @param section_name section of the exchange bank account that received the transfer - * @param serial_id bank-specific row identifying the transfer - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_kycauth_in_insert (struct TALER_EXCHANGEDB_PostgresContext *pg, - const union TALER_AccountPublicKeyP * - account_pub, - const struct TALER_Amount *credit_amount, - struct GNUNET_TIME_Timestamp execution_date, - const struct TALER_FullPayto - debit_account_uri, - const char *section_name, - uint64_t serial_id); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_active_legitimization.h b/src/include/taler/exchange-database/lookup_active_legitimization.h @@ -1,49 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_active_legitimization.h - * @brief implementation of the lookup_active_legitimization function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_ACTIVE_LEGITIMIZATION_H -#define EXCHANGE_DATABASE_LOOKUP_ACTIVE_LEGITIMIZATION_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup measure data for an active legitimization process. - * - * @param pg the database context - * @param legitimization_process_serial_id - * row in legitimization_processes table to access - * @param[out] measure_index set to the measure the - * process is trying to satisfy - * @param[out] jmeasures set to the legitimization - * measures that were put on the account - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_active_legitimization (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - uint64_t - legitimization_process_serial_id, - uint32_t *measure_index, - json_t **jmeasures); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_aml_file_number.h b/src/include/taler/exchange-database/lookup_aml_file_number.h @@ -1,47 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_aml_file_number.h - * @brief implementation of the lookup_aml_file_number function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_AML_FILE_NUMBER_H -#define EXCHANGE_DATABASE_LOOKUP_AML_FILE_NUMBER_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup AML file number by the payto address. - * - * @param pg the database context - * @param h_payto account for which to find the row ID - * @param[out] kyc_target_row set to row in the kyc_targets table for @a h_payto - * @param[out] is_wallet set to true if this account is for a wallet - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_aml_file_number (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - uint64_t *kyc_target_row, - bool *is_wallet); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_aml_history.h b/src/include/taler/exchange-database/lookup_aml_history.h @@ -1,108 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_aml_history.h - * @brief implementation of the lookup_aml_history function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_AML_HISTORY_H -#define EXCHANGE_DATABASE_LOOKUP_AML_HISTORY_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with historic AML events of an - * account. - * - * @param cls closure - * @param outcome_serial_id row ID of the decision - * @param decision_time when was the decision taken - * @param justification what was the given justification - * @param decider_pub which key signed the decision - * @param jproperties what are the new account properties - * @param jnew_rules what are the new account rules - * @param to_investigate should AML staff investigate - * after the decision - * @param is_active is this the active decision - */ -typedef void -(*TALER_EXCHANGEDB_AmlHistoryCallback) ( - void *cls, - uint64_t outcome_serial_id, - struct GNUNET_TIME_Timestamp decision_time, - const char *justification, - const struct TALER_AmlOfficerPublicKeyP *decider_pub, - const json_t *jproperties, - const json_t *jnew_rules, - bool to_investigate, - bool is_active); - - -/* Callback typedefs */ -/** - * Function called with historic AML events of an - * account. - * - * @param cls closure - * @param outcome_serial_id row ID of the decision - * @param decision_time when was the decision taken - * @param justification what was the given justification - * @param decider_pub which key signed the decision - * @param jproperties what are the new account properties - * @param jnew_rules what are the new account rules - * @param to_investigate should AML staff investigate - * after the decision - * @param is_active is this the active decision - */ -typedef void -(*TALER_EXCHANGEDB_AmlHistoryCallback) ( - void *cls, - uint64_t outcome_serial_id, - struct GNUNET_TIME_Timestamp decision_time, - const char *justification, - const struct TALER_AmlOfficerPublicKeyP *decider_pub, - const json_t *jproperties, - const json_t *jnew_rules, - bool to_investigate, - bool is_active); - -/** - * Lookup AML history for an account identified via - * @a h_payto. - * - * @param pg the database context - * @param h_payto hash of account to lookup history for - * @param offset row ID to start returning results from - * @param limit how many results to return, negative for descending order - * @param cb function to call on results - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_aml_history (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct TALER_NormalizedPaytoHashP * - h_payto, - uint64_t offset, - int64_t limit, - TALER_EXCHANGEDB_AmlHistoryCallback cb, - void *cb_cls); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_aml_officer.h b/src/include/taler/exchange-database/lookup_aml_officer.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_aml_officer.h - * @brief implementation of the lookup_aml_officer function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_AML_OFFICER_H -#define EXCHANGE_DATABASE_LOOKUP_AML_OFFICER_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Fetch AML staff record. - * - * @param pg the database context - * @param decider_pub public key of the staff member - * @param[out] master_sig offline signature affirming the AML officer - * @param[out] decider_name full name of the staff member - * @param[out] is_active true to enable, false to set as inactive - * @param[out] read_only true to set read-only access - * @param[out] last_change when was the change made effective - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_aml_officer (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct TALER_AmlOfficerPublicKeyP * - decider_pub, - struct TALER_MasterSignatureP *master_sig, - char **decider_name, - bool *is_active, - bool *read_only, - struct GNUNET_TIME_Absolute *last_change); - -#endif diff --git a/src/include/taler/exchange-database/lookup_auditor_status.h b/src/include/taler/exchange-database/lookup_auditor_status.h @@ -1,44 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_auditor_status.h - * @brief implementation of the lookup_auditor_status function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_AUDITOR_STATUS_H -#define EXCHANGE_DATABASE_LOOKUP_AUDITOR_STATUS_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Lookup current state of an auditor. - * - * @param pg the database context - * @param auditor_pub key to look up information for - * @param[out] auditor_url set to the base URL of the auditor's REST API; memory to be - * released by the caller! - * @param[out] enabled set if the auditor is currently in use - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_auditor_status (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_AuditorPublicKeyP * - auditor_pub, - char **auditor_url, - bool *enabled); - -#endif diff --git a/src/include/taler/exchange-database/lookup_auditor_timestamp.h b/src/include/taler/exchange-database/lookup_auditor_timestamp.h @@ -1,45 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_auditor_timestamp.h - * @brief implementation of the lookup_auditor_timestamp function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_AUDITOR_TIMESTAMP_H -#define EXCHANGE_DATABASE_LOOKUP_AUDITOR_TIMESTAMP_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Check the last date an auditor was modified. - * - * @param pg the database context - * @param auditor_pub key to look up information for - * @param[out] last_date last modification date to auditor status - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_auditor_timestamp (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_AuditorPublicKeyP * - auditor_pub, - struct GNUNET_TIME_Timestamp * - last_date); - -#endif diff --git a/src/include/taler/exchange-database/lookup_denomination_key.h b/src/include/taler/exchange-database/lookup_denomination_key.h @@ -1,45 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_denomination_key.h - * @brief implementation of the lookup_denomination_key function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_DENOMINATION_KEY_H -#define EXCHANGE_DATABASE_LOOKUP_DENOMINATION_KEY_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Lookup information about current denomination key. - * - * @param pg the database context - * @param h_denom_pub hash of the denomination public key - * @param[out] meta set to various meta data about the key - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_denomination_key (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_DenominationHashP * - h_denom_pub, - struct - TALER_EXCHANGEDB_DenominationKeyMetaData - * - meta); - -#endif diff --git a/src/include/taler/exchange-database/lookup_global_fee_by_time.h b/src/include/taler/exchange-database/lookup_global_fee_by_time.h @@ -1,59 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_global_fee_by_time.h - * @brief implementation of the lookup_global_fee_by_time function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_GLOBAL_FEE_BY_TIME_H -#define EXCHANGE_DATABASE_LOOKUP_GLOBAL_FEE_BY_TIME_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup information about known global fees. - * - * @param pg the database context - * @param start_time starting time of fee - * @param end_time end time of fee - * @param[out] fees set to wire fees for that time period; if - * different global fee exists within this time - * period, an 'invalid' amount is returned. - * @param[out] purse_timeout set to when unmerged purses expire - * @param[out] history_expiration set to when we expire reserve histories - * @param[out] purse_account_limit set to number of free purses - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_global_fee_by_time (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - struct GNUNET_TIME_Timestamp - start_time, - struct GNUNET_TIME_Timestamp - end_time, - struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative * - purse_timeout - , - struct GNUNET_TIME_Relative * - history_expiration, - uint32_t *purse_account_limit); - -#endif diff --git a/src/include/taler/exchange-database/lookup_h_payto_by_access_token.h b/src/include/taler/exchange-database/lookup_h_payto_by_access_token.h @@ -1,53 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_h_payto_by_access_token.h - * @brief implementation of the lookup_h_payto_by_access_token function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_H_PAYTO_BY_ACCESS_TOKEN_H -#define EXCHANGE_DATABASE_LOOKUP_H_PAYTO_BY_ACCESS_TOKEN_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup @a h_payto based on an @a access_token. - * - * @param pg the database context - * @param access_token - * set to token for access control - * @param[out] h_payto set to the the hash of the - * payto URI of the account (if found) - * @param[out] is_wallet set to true if @a h_payto - * is for a wallet - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_h_payto_by_access_token (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - const struct - TALER_AccountAccessTokenP * - access_token, - struct - TALER_NormalizedPaytoHashP * - h_payto, - bool *is_wallet); - -#endif diff --git a/src/include/taler/exchange-database/lookup_kyc_history.h b/src/include/taler/exchange-database/lookup_kyc_history.h @@ -1,115 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_kyc_history.h - * @brief implementation of the lookup_kyc_history function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_HISTORY_H -#define EXCHANGE_DATABASE_LOOKUP_KYC_HISTORY_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with historic KYC events of an - * account. - * - * @param cls closure - * @param provider_name name of the KYC provider - * @param finished did the KYC process finish - * @param error_code error code from the KYC process - * @param error_message error message from the KYC process, - * or NULL for none - * @param provider_user_id user ID at the provider - * or NULL for none - * @param provider_legitimization_id legitimization process ID at the provider - * or NULL for none - * @param collection_time when was the data collected - * @param expiration_time when does the collected data expire - * @param encrypted_attributes_len number of bytes in @a encrypted_attributes - * @param encrypted_attributes encrypted KYC attributes - */ -typedef void -(*TALER_EXCHANGEDB_KycHistoryCallback) ( - void *cls, - const char *provider_name, - bool finished, - enum TALER_ErrorCode error_code, - const char *error_message, - const char *provider_user_id, - const char *provider_legitimization_id, - struct GNUNET_TIME_Timestamp collection_time, - struct GNUNET_TIME_Absolute expiration_time, - size_t encrypted_attributes_len, - const void *encrypted_attributes); - - -/* Callback typedefs */ -/** - * Function called with historic KYC events of an - * account. - * - * @param cls closure - * @param provider_name name of the KYC provider - * @param finished did the KYC process finish - * @param error_code error code from the KYC process - * @param error_message error message from the KYC process, - * or NULL for none - * @param provider_user_id user ID at the provider - * or NULL for none - * @param provider_legitimization_id legitimization process ID at the provider - * or NULL for none - * @param collection_time when was the data collected - * @param expiration_time when does the collected data expire - * @param encrypted_attributes_len number of bytes in @a encrypted_attributes - * @param encrypted_attributes encrypted KYC attributes - */ -typedef void -(*TALER_EXCHANGEDB_KycHistoryCallback) ( - void *cls, - const char *provider_name, - bool finished, - enum TALER_ErrorCode error_code, - const char *error_message, - const char *provider_user_id, - const char *provider_legitimization_id, - struct GNUNET_TIME_Timestamp collection_time, - struct GNUNET_TIME_Absolute expiration_time, - size_t encrypted_attributes_len, - const void *encrypted_attributes); - -/** - * Lookup KYC history for an account identified via - * @a h_payto. - * - * @param pg the database context - * @param h_payto hash of account to lookup history for - * @param cb function to call on results - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_kyc_history (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct TALER_NormalizedPaytoHashP * - h_payto, - TALER_EXCHANGEDB_KycHistoryCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/lookup_kyc_process_by_account.h b/src/include/taler/exchange-database/lookup_kyc_process_by_account.h @@ -1,59 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_kyc_process_by_account.h - * @brief implementation of the lookup_kyc_process_by_account function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_PROCESS_BY_ACCOUNT_H -#define EXCHANGE_DATABASE_LOOKUP_KYC_PROCESS_BY_ACCOUNT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup KYC provider meta data. - * - * @param pg the database context - * @param provider_name provider that must be checked - * @param h_payto account that must be KYC'ed - * @param[out] process_row row with the legitimization data - * @param[out] expiration how long is this KYC check set to be valid (in the past if invalid) - * @param[out] provider_account_id provider account ID - * @param[out] provider_legitimization_id provider legitimization ID - * @param[out] is_wallet set to true if @a h_payto is for a wallet - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_kyc_process_by_account (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - const char *provider_name, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - uint64_t *process_row, - struct GNUNET_TIME_Absolute * - expiration, - char **provider_account_id, - char ** - provider_legitimization_id, - bool *is_wallet); - -#endif diff --git a/src/include/taler/exchange-database/lookup_kyc_requirement_by_row.h b/src/include/taler/exchange-database/lookup_kyc_requirement_by_row.h @@ -1,72 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_kyc_requirement_by_row.h - * @brief implementation of the lookup_kyc_requirement_by_row function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_REQUIREMENT_BY_ROW_H -#define EXCHANGE_DATABASE_LOOKUP_KYC_REQUIREMENT_BY_ROW_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup KYC requirement. - * - * @param pg the database context - * @param h_payto identifies account to look up requirement for - * @param account_pub set to public key of the account - * needed to authorize access - * @param[out] is_wallet set to #GNUNET_YES if the account is - * that of a wallet (#GNUNET_SYSERR is used if unknown) - * @param[out] access_token set to the access token to begin - * work on KYC processes for this account - * @param[out] rule_gen row ID of the last decision this - * response is based on (for long-polling by clients) - * @param[out] jrules set to active ``LegitimizationRuleSet`` - * of the account impacted by the requirement - * @param[out] aml_review set to true if the account is under - * active review by AML staff - * @param[out] kyc_required set to true if the user must pass - * some KYC check before some previous operation may continue - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_kyc_requirement_by_row (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - const struct - TALER_NormalizedPaytoHashP * - h_payto, - const union - TALER_AccountPublicKeyP * - account_pub, - enum GNUNET_GenericReturnValue * - is_wallet, - struct TALER_AccountAccessTokenP - * - access_token, - uint64_t *rule_gen, - json_t **jrules, - bool *aml_review, - bool *kyc_required); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_kyc_status_by_token.h b/src/include/taler/exchange-database/lookup_kyc_status_by_token.h @@ -1,47 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_kyc_status_by_token.h - * @brief implementation of the lookup_kyc_status_by_token function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_KYC_STATUS_BY_TOKEN_H -#define EXCHANGE_DATABASE_LOOKUP_KYC_STATUS_BY_TOKEN_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup KYC status by account access token. - * - * @param pg the database context - * @param access_token key to look under - * @param[out] row set to requirement row that matches - * @param[out] jmeasures set to the LegitimizationMeasures for the @a access_token; must be freed by caller! - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_kyc_status_by_token (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_AccountAccessTokenP * - access_token, - uint64_t *row, - json_t **jmeasures); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_pending_legitimization.h b/src/include/taler/exchange-database/lookup_pending_legitimization.h @@ -1,62 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_pending_legitimization.h - * @brief implementation of the lookup_pending_legitimization function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_PENDING_LEGITIMIZATION_H -#define EXCHANGE_DATABASE_LOOKUP_PENDING_LEGITIMIZATION_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup measure data for a legitimization process. - * - * @param pg the database context - * @param legitimization_measure_serial_id - * row in legitimization_measures table to access - * @param[out] access_token - * set to token for access control that must match - * @param[out] h_payto set to the the hash of the - * payto URI of the account undergoing legitimization - * @param[out] jmeasures set to the legitimization - * measures that were put on the account - * @param[out] is_finished set to true if the legitimization was - * already finished - * @param[out] is_wallet set to true if @a h_payto is for a wallet - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_pending_legitimization (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - uint64_t - legitimization_measure_serial_id, - struct TALER_AccountAccessTokenP - * - access_token, - struct - TALER_NormalizedPaytoHashP * - h_payto, - json_t **jmeasures, - bool *is_finished, - bool *is_wallet); - -#endif diff --git a/src/include/taler/exchange-database/lookup_rules_by_access_token.h b/src/include/taler/exchange-database/lookup_rules_by_access_token.h @@ -1,47 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_rules_by_access_token.h - * @brief implementation of the lookup_rules_by_access_token function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_RULES_BY_ACCESS_TOKEN_H -#define EXCHANGE_DATABASE_LOOKUP_RULES_BY_ACCESS_TOKEN_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup KYC rules by account access token. - * - * @param pg the database context - * @param h_payto account hash to look under - * @param[out] jnew_rules set to active LegitimizationRuleSet - * @param[out] rowid set to outcome_serial_id of the row - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_rules_by_access_token (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - json_t **jnew_rules, - uint64_t *rowid); - -#endif diff --git a/src/include/taler/exchange-database/lookup_serial_by_table.h b/src/include/taler/exchange-database/lookup_serial_by_table.h @@ -1,44 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file lookup_serial_by_table.h - * @brief implementation of the lookup_serial_by_table function - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_SERIAL_BY_TABLE_H -#define EXCHANGE_DATABASE_LOOKUP_SERIAL_BY_TABLE_H - -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/lookup_records_by_table.h" - -/** - * Lookup the latest serial number of @a table. Used in - * exchange-auditor database replication. - * - * @param pg the database context - * @param table table for which we should return the serial - * @param[out] serial latest serial number in use - * @return transaction status code, GNUNET_DB_STATUS_HARD_ERROR if - * @a table does not have a serial number - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_serial_by_table ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - enum TALER_EXCHANGEDB_ReplicatedTable table, - uint64_t *serial); - - -#endif diff --git a/src/include/taler/exchange-database/lookup_signing_key.h b/src/include/taler/exchange-database/lookup_signing_key.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_signing_key.h - * @brief implementation of the lookup_signing_key function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_SIGNING_KEY_H -#define EXCHANGE_DATABASE_LOOKUP_SIGNING_KEY_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup signing key meta data. - * - * @param pg the database context - * @param exchange_pub the exchange online signing public key - * @param[out] meta meta data about @a exchange_pub - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_signing_key (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct TALER_ExchangePublicKeyP * - exchange_pub, - struct TALER_EXCHANGEDB_SignkeyMetaData * - meta); - -#endif diff --git a/src/include/taler/exchange-database/lookup_signkey_revocation.h b/src/include/taler/exchange-database/lookup_signkey_revocation.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_signkey_revocation.h - * @brief implementation of the lookup_signkey_revocation function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_SIGNKEY_REVOCATION_H -#define EXCHANGE_DATABASE_LOOKUP_SIGNKEY_REVOCATION_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Obtain information about a revoked online signing key. - * - * @param pg the database context - * @param exchange_pub exchange online signing key - * @param[out] master_sig set to signature affirming the revocation (if revoked) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_signkey_revocation (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - const struct - TALER_ExchangePublicKeyP * - exchange_pub, - struct TALER_MasterSignatureP * - master_sig) -; - -#endif diff --git a/src/include/taler/exchange-database/lookup_transfer_by_deposit.h b/src/include/taler/exchange-database/lookup_transfer_by_deposit.h @@ -1,79 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_transfer_by_deposit.h - * @brief implementation of the lookup_transfer_by_deposit function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_TRANSFER_BY_DEPOSIT_H -#define EXCHANGE_DATABASE_LOOKUP_TRANSFER_BY_DEPOSIT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Try to find the wire transfer details for a deposit operation. - * If we did not execute the deposit yet, return when it is supposed - * to be executed. - * - * @param pg the database context - * @param h_contract_terms hash of the proposal data - * @param h_wire hash of merchant wire details - * @param coin_pub public key of deposited coin - * @param merchant_pub merchant public key - * @param[out] pending set to true if the transaction is still pending - * @param[out] wtid wire transfer identifier, only set if @a pending is false - * @param[out] exec_time when was the transaction done, or - * when we expect it to be done (if @a pending is false) - * @param[out] amount_with_fee set to the total deposited amount - * @param[out] deposit_fee set to how much the exchange did charge for the deposit - * @param[out] kyc set to the kyc status of the receiver (if @a pending) - * @param[out] account_pub set to public key that is authorized to start the KYC process; unchanged if no such key is known - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_transfer_by_deposit (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_PrivateContractHashP * - h_contract_terms, - const struct - TALER_MerchantWireHashP * - h_wire, - const struct - TALER_CoinSpendPublicKeyP * - coin_pub, - const struct - TALER_MerchantPublicKeyP * - merchant_pub, - bool *pending, - struct - TALER_WireTransferIdentifierRawP * - wtid, - struct GNUNET_TIME_Timestamp * - exec_time, - struct TALER_Amount * - amount_with_fee, - struct TALER_Amount *deposit_fee, - struct TALER_EXCHANGEDB_KycStatus * - kyc, - union TALER_AccountPublicKeyP * - account_pub); - -#endif diff --git a/src/include/taler/exchange-database/lookup_wire_fee_by_time.h b/src/include/taler/exchange-database/lookup_wire_fee_by_time.h @@ -1,53 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_wire_fee_by_time.h - * @brief implementation of the lookup_wire_fee_by_time function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_FEE_BY_TIME_H -#define EXCHANGE_DATABASE_LOOKUP_WIRE_FEE_BY_TIME_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Lookup information about known wire fees. Finds all applicable - * fees in the given range. If they are identical, returns the - * respective @a fees. If any of the fees - * differ between @a start_time and @a end_time, the transaction - * succeeds BUT returns an invalid amount for both fees. - * - * @param pg the database context - * @param wire_method the wire method to lookup fees for - * @param start_time starting time of fee - * @param end_time end time of fee - * @param[out] fees wire fees for that time period; if - * different fees exists within this time - * period, an 'invalid' amount is returned. - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_wire_fee_by_time (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *wire_method, - struct GNUNET_TIME_Timestamp - start_time, - struct GNUNET_TIME_Timestamp end_time, - struct TALER_WireFeeSet *fees); - -#endif diff --git a/src/include/taler/exchange-database/lookup_wire_timestamp.h b/src/include/taler/exchange-database/lookup_wire_timestamp.h @@ -1,44 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_wire_timestamp.h - * @brief implementation of the lookup_wire_timestamp function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_TIMESTAMP_H -#define EXCHANGE_DATABASE_LOOKUP_WIRE_TIMESTAMP_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Check the last date an exchange wire account was modified. - * - * @param pg the database context - * @param payto_uri key to look up information for - * @param[out] last_date last modification date to auditor status - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_wire_timestamp (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_FullPayto payto_uri, - struct GNUNET_TIME_Timestamp *last_date) -; - -#endif diff --git a/src/include/taler/exchange-database/lookup_wire_transfer.h b/src/include/taler/exchange-database/lookup_wire_transfer.h @@ -1,111 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/lookup_wire_transfer.h - * @brief implementation of the lookup_wire_transfer function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_TRANSFER_H -#define EXCHANGE_DATABASE_LOOKUP_WIRE_TRANSFER_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with the results of the lookup of the - * transaction data associated with a wire transfer identifier. - * - * @param cls closure - * @param rowid which row in the table is the information from (for diagnostics) - * @param merchant_pub public key of the merchant (should be same for all callbacks with the same @e cls) - * @param account_payto_uri which account did the transfer go to? - * @param h_payto hash over @a account_payto_uri as it is in the DB - * @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls) - * @param h_contract_terms which proposal was this payment about - * @param denom_pub denomination of @a coin_pub - * @param coin_pub which public key was this payment about - * @param coin_value amount contributed by this coin in total (with fee) - * @param coin_fee applicable fee for this coin - */ -typedef void -(*TALER_EXCHANGEDB_AggregationDataCallback)( - void *cls, - uint64_t rowid, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_FullPayto account_payto_uri, - const struct TALER_FullPaytoHashP *h_payto, - struct GNUNET_TIME_Timestamp exec_time, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_Amount *coin_value, - const struct TALER_Amount *coin_fee); - - -/* Callback typedefs */ -/** - * Function called with the results of the lookup of the - * transaction data associated with a wire transfer identifier. - * - * @param cls closure - * @param rowid which row in the table is the information from (for diagnostics) - * @param merchant_pub public key of the merchant (should be same for all callbacks with the same @e cls) - * @param account_payto_uri which account did the transfer go to? - * @param h_payto hash over @a account_payto_uri as it is in the DB - * @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls) - * @param h_contract_terms which proposal was this payment about - * @param denom_pub denomination of @a coin_pub - * @param coin_pub which public key was this payment about - * @param coin_value amount contributed by this coin in total (with fee) - * @param coin_fee applicable fee for this coin - */ -typedef void -(*TALER_EXCHANGEDB_AggregationDataCallback)( - void *cls, - uint64_t rowid, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_FullPayto account_payto_uri, - const struct TALER_FullPaytoHashP *h_payto, - struct GNUNET_TIME_Timestamp exec_time, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_Amount *coin_value, - const struct TALER_Amount *coin_fee); - -/** - * Lookup the list of Taler transactions that were aggregated - * into a wire transfer by the respective @a wtid. - * - * @param pg the database context - * @param wtid the raw wire transfer identifier we used - * @param cb function to call on each transaction found - * @param cb_cls closure for @a cb - * @return query status of the transaction - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_lookup_wire_transfer (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_WireTransferIdentifierRawP * - wtid, - TALER_EXCHANGEDB_AggregationDataCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/mark_refresh_reveal_success.h b/src/include/taler/exchange-database/mark_refresh_reveal_success.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/mark_refresh_reveal_success.h - * @brief Mark the successful reveal of a refresh in the database - * @author Özgür Kesim - */ -#ifndef EXCHANGE_DATABASE_MARK_REFRESH_REVEAL_SUCCESS_H -#define EXCHANGE_DATABASE_MARK_REFRESH_REVEAL_SUCCESS_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Mark a refresh, given by the commitment, as successfully revealed. - * - * @param pg the database context - * @param rc commitment for the refresh - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_mark_refresh_reveal_success (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const struct - TALER_RefreshCommitmentP * - rc); - -#endif diff --git a/src/include/taler/exchange-database/persist_aml_program_result.h b/src/include/taler/exchange-database/persist_aml_program_result.h @@ -1,53 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file persist_aml_program_result.h - * @brief implementation of the persist_aml_program_result function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_PERSIST_AML_PROGRAM_RESULT_H -#define EXCHANGE_DATABASE_PERSIST_AML_PROGRAM_RESULT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/set_aml_lock.h" -#include "taler/exchange-database/clear_aml_lock.h" - - -/** - * Persist the given @a apr for the given process and account - * into the database via @a pg. Called within an open - * database transaction. - * - * @param pg database API handle - * @param process_row row identifying the legitimization process that was run, - * 0 if there was no legi process (for example, due to rule - * expiration triggering something) and we should simply - * create a new row - * @param account_id hash of account the result is about - * @param ret_pprs - * @param apr AML program result to persist - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_persist_aml_program_result ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - uint64_t process_row, - const struct TALER_NormalizedPaytoHashP *account_id, - const struct TALER_KYCLOGIC_AmlProgramResult *apr, - enum TALER_EXCHANGEDB_PersistProgramResultStatus *ret_pprs); - -#endif diff --git a/src/include/taler/exchange-database/persist_kyc_attributes.h b/src/include/taler/exchange-database/persist_kyc_attributes.h @@ -1,63 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/persist_kyc_attributes.h - * @brief implementation of the persist_kyc_attributes function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_PERSIST_KYC_ATTRIBUTES_H -#define EXCHANGE_DATABASE_PERSIST_KYC_ATTRIBUTES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Store KYC attribute data. - * - * @param pg the database context - * @param process_row KYC process row to update - * @param h_payto account for which the attribute data is stored - * @param provider_name name of the provider that provided the attributes - * @param provider_account_id provider account ID - * @param provider_legitimization_id provider legitimization ID - * @param birthday birthdate of user, in days after 1990, or 0 if unknown or definitively adult - * @param expiration_time when does the data expire - * @param form_name name of the form from which the @a enc_attributes originate, can be NULL - * @param enc_attributes_size number of bytes in @a enc_attributes - * @param enc_attributes encrypted attribute data - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_persist_kyc_attributes (struct - TALER_EXCHANGEDB_PostgresContext *pg, - uint64_t process_row, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - const char *provider_name, - const char *provider_account_id, - const char *provider_legitimization_id, - uint32_t birthday, - struct GNUNET_TIME_Absolute - expiration_time, - const char *form_name, - size_t enc_attributes_size, - const void *enc_attributes); - - -#endif diff --git a/src/include/taler/exchange-database/persist_policy_details.h b/src/include/taler/exchange-database/persist_policy_details.h @@ -1,52 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/persist_policy_details.h - * @brief implementation of the persist_policy_details function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_PERSIST_POLICY_DETAILS_H -#define EXCHANGE_DATABASE_PERSIST_POLICY_DETAILS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" -#include "taler/taler_extensions_policy.h" - - -/** - * Persist the details to a policy in the policy_details table. If there - * already exists a policy, update the fields accordingly. - * - * @param pg database connection - * @param details The policy details that should be persisted. If an entry for - * the given details->hash_code exists, the values will be updated. - * @param[out] policy_details_serial_id The row ID of the policy details - * @param[out] accumulated_total The total amount accumulated in that policy - * @param[out] fulfillment_state The state of policy. If the state was Insufficient prior to the call and the provided deposit raises the accumulated_total above the commitment, it will be set to Ready. - * @return query execution status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_persist_policy_details (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PolicyDetails * - details, - uint64_t *policy_details_serial_id, - struct TALER_Amount *accumulated_total, - enum TALER_PolicyFulfillmentState * - fulfillment_state); - -#endif diff --git a/src/include/taler/exchange-database/profit_drains_get_pending.h b/src/include/taler/exchange-database/profit_drains_get_pending.h @@ -1,59 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/profit_drains_get_pending.h - * @brief implementation of the profit_drains_get_pending function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_PROFIT_DRAINS_GET_PENDING_H -#define EXCHANGE_DATABASE_PROFIT_DRAINS_GET_PENDING_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Get profit drain operation ready to execute. - * - * @param pg the database context - * @param[out] serial set to serial ID of the entry - * @param[out] wtid set set to wire transfer ID to use - * @param[out] account_section set to account to drain - * @param[out] payto_uri set to account to wire funds to - * @param[out] request_timestamp set to time of the signature - * @param[out] amount set to amount to wire - * @param[out] master_sig set to signature affirming the operation - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_profit_drains_get_pending (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - uint64_t *serial, - struct - TALER_WireTransferIdentifierRawP * - wtid, - char **account_section, - struct TALER_FullPayto *payto_uri, - struct GNUNET_TIME_Timestamp * - request_timestamp, - struct TALER_Amount *amount, - struct TALER_MasterSignatureP * - master_sig) -; - -#endif diff --git a/src/include/taler/exchange-database/profit_drains_set_finished.h b/src/include/taler/exchange-database/profit_drains_set_finished.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/profit_drains_set_finished.h - * @brief implementation of the profit_drains_set_finished function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_PROFIT_DRAINS_SET_FINISHED_H -#define EXCHANGE_DATABASE_PROFIT_DRAINS_SET_FINISHED_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Set profit drain operation to finished. - * - * @param pg the database context - * @param serial serial ID of the entry to mark finished - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_profit_drains_set_finished (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - uint64_t serial); - -#endif diff --git a/src/include/taler/exchange-database/release_revolving_shard.h b/src/include/taler/exchange-database/release_revolving_shard.h @@ -1,44 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/release_revolving_shard.h - * @brief implementation of the release_revolving_shard function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_RELEASE_REVOLVING_SHARD_H -#define EXCHANGE_DATABASE_RELEASE_REVOLVING_SHARD_H - -#include "taler/taler_exchangedb_lib.h" - -/** - * Function called to release a revolving shard - * back into the work pool. Clears the - * "completed" flag. - * - * @param pg the database context - * @param job_name name of the operation to grab a word shard for - * @param start_row inclusive start row of the shard - * @param end_row exclusive end row of the shard - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_release_revolving_shard (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *job_name, - uint32_t start_row, - uint32_t end_row); - -#endif diff --git a/src/include/taler/exchange-database/reserves_get.h b/src/include/taler/exchange-database/reserves_get.h @@ -1,40 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/reserves_get.h - * @brief implementation of the reserves_get function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_RESERVES_GET_H -#define EXCHANGE_DATABASE_RESERVES_GET_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Get the summary of a reserve. - * - * @param pg the database context - * @param[in,out] reserve the reserve data. The public key of the reserve should be - * set in this structure; it is used to query the database. The balance - * and expiration are then filled accordingly. - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_reserves_get (struct TALER_EXCHANGEDB_PostgresContext *pg, - struct TALER_EXCHANGEDB_Reserve *reserve); - -#endif diff --git a/src/include/taler/exchange-database/reserves_get_origin.h b/src/include/taler/exchange-database/reserves_get_origin.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/reserves_get_origin.h - * @brief implementation of the reserves_get_origin function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_RESERVES_GET_ORIGIN_H -#define EXCHANGE_DATABASE_RESERVES_GET_ORIGIN_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Get the origin of funds of a reserve. - * - * @param pg the database context - * @param reserve_pub public key of the reserve - * @param[out] h_payto set to hash of the wire source payto://-URI - * @param[out] payto_uri set to the wire source payto://-URI - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_reserves_get_origin (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - const struct - TALER_ReservePublicKeyP * - reserve_pub, - struct TALER_FullPaytoHashP *h_payto - , - struct TALER_FullPayto *payto_uri); - -#endif diff --git a/src/include/taler/exchange-database/reserves_in_insert.h b/src/include/taler/exchange-database/reserves_in_insert.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/reserves_in_insert.h - * @brief implementation of the reserves_in_insert function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_RESERVES_IN_INSERT_H -#define EXCHANGE_DATABASE_RESERVES_IN_INSERT_H - -#include "taler/taler_exchangedb_lib.h" - - -struct TALER_EXCHANGEDB_ReserveInInfo -{ - const struct TALER_ReservePublicKeyP *reserve_pub; - const struct TALER_Amount *balance; - struct GNUNET_TIME_Timestamp execution_time; - struct TALER_FullPayto sender_account_details; - const char *exchange_account_name; - uint64_t wire_reference; -}; - - -/** - * Insert an incoming transaction into reserves. New reserves are also - * created through this function. Runs its own transaction(s). - * - * @param pg the database context - * @param reserves array of reserves to insert - * @param reserves_length length of the @a reserves array - * @param[out] results set to query status per reserve, must be of length @a reserves_length - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_reserves_in_insert (struct TALER_EXCHANGEDB_PostgresContext *pg - , - const struct - TALER_EXCHANGEDB_ReserveInInfo * - reserves, - unsigned int reserves_length, - enum GNUNET_DB_QueryStatus *results); - - -#endif diff --git a/src/include/taler/exchange-database/reserves_update.h b/src/include/taler/exchange-database/reserves_update.h @@ -1,41 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/reserves_update.h - * @brief implementation of the reserves_update function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_RESERVES_UPDATE_H -#define EXCHANGE_DATABASE_RESERVES_UPDATE_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Updates a reserve with the data from the given reserve structure. - * - * @param pg the database context - * @param reserve the reserve structure whose data will be used to update the - * corresponding record in the database. - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_reserves_update (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_EXCHANGEDB_Reserve *reserve - ); - -#endif diff --git a/src/include/taler/exchange-database/rollback.h b/src/include/taler/exchange-database/rollback.h @@ -1,36 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/rollback.h - * @brief implementation of the rollback function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_ROLLBACK_H -#define EXCHANGE_DATABASE_ROLLBACK_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Roll back the current transaction of a database connection. - * - * @param pg the database context - */ -void -TALER_EXCHANGEDB_rollback (struct TALER_EXCHANGEDB_PostgresContext *pg); - -#endif diff --git a/src/include/taler/exchange-database/select_aggregation_amounts_for_kyc_check.h b/src/include/taler/exchange-database/select_aggregation_amounts_for_kyc_check.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aggregation_amounts_for_kyc_check.h - * @brief implementation of the select_aggregation_amounts_for_kyc_check function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AGGREGATION_AMOUNTS_FOR_KYC_CHECK_H -#define EXCHANGE_DATABASE_SELECT_AGGREGATION_AMOUNTS_FOR_KYC_CHECK_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Call @a kac on deposited amounts after @a time_limit which are relevant for a - * KYC trigger for a the (credited) account identified by @a h_payto. - * - * @param pg the database context - * @param h_payto account identifier - * @param time_limit oldest transaction that could be relevant - * @param kac function to call for each applicable amount, in reverse chronological order (or until @a kac aborts by returning anything except #GNUNET_OK). - * @param kac_cls closure for @a kac - * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aggregation_amounts_for_kyc_check ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Absolute time_limit, - TALER_KYCLOGIC_KycAmountCallback kac, - void *kac_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_aggregation_transient.h b/src/include/taler/exchange-database/select_aggregation_transient.h @@ -1,58 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aggregation_transient.h - * @brief implementation of the select_aggregation_transient function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AGGREGATION_TRANSIENT_H -#define EXCHANGE_DATABASE_SELECT_AGGREGATION_TRANSIENT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Find existing entry in the transient aggregation table. - * - * @param pg the database context - * @param h_payto destination of the wire transfer - * @param merchant_pub public key of the merchant receiving the transfer - * @param exchange_account_section exchange account to use - * @param[out] wtid set to the raw wire transfer identifier to be used - * @param[out] total existing amount to be wired in the future - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aggregation_transient (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_FullPaytoHashP * - h_payto, - const struct - TALER_MerchantPublicKeyP * - merchant_pub, - const char * - exchange_account_section, - struct - TALER_WireTransferIdentifierRawP - *wtid, - struct TALER_Amount *total); - - -#endif diff --git a/src/include/taler/exchange-database/select_aggregations_above_serial.h b/src/include/taler/exchange-database/select_aggregations_above_serial.h @@ -1,85 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aggregations_above_serial.h - * @brief implementation of the select_aggregations_above_serial function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AGGREGATIONS_ABOVE_SERIAL_H -#define EXCHANGE_DATABASE_SELECT_AGGREGATIONS_ABOVE_SERIAL_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called on aggregations that were done for - * a (batch) deposit. - * - * @param cls closure - * @param amount affected amount - * @param tracking_serial_id where in the table are we - * @param batch_deposit_serial_id which batch deposit was aggregated - */ -typedef void -(*TALER_EXCHANGEDB_AggregationCallback)( - void *cls, - const struct TALER_Amount *amount, - uint64_t tracking_serial_id, - uint64_t batch_deposit_serial_id); - - -/* Callback typedefs */ -/** - * Function called on aggregations that were done for - * a (batch) deposit. - * - * @param cls closure - * @param amount affected amount - * @param tracking_serial_id where in the table are we - * @param batch_deposit_serial_id which batch deposit was aggregated - */ -typedef void -(*TALER_EXCHANGEDB_AggregationCallback)( - void *cls, - const struct TALER_Amount *amount, - uint64_t tracking_serial_id, - uint64_t batch_deposit_serial_id); - -/** - * Select all aggregation tracking IDs in the database - * above a given @a min_tracking_serial_id. - * - * @param pg the database context - * @param min_tracking_serial_id only return entries strictly above this row (and in order) - * @param cb function to call on all such aggregations - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aggregations_above_serial (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t - min_tracking_serial_id, - TALER_EXCHANGEDB_AggregationCallback - cb, - void *cb_cls); - - -#endif diff --git a/src/include/taler/exchange-database/select_all_kyc_attributes.h b/src/include/taler/exchange-database/select_all_kyc_attributes.h @@ -1,101 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_all_kyc_attributes.h - * @brief implementation of the select_all_kyc_attributes function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_ALL_KYC_ATTRIBUTES_H -#define EXCHANGE_DATABASE_SELECT_ALL_KYC_ATTRIBUTES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Return KYC attribute information. - * - * @param cls closure - * @param row_id current row in kyc_attributes table - * @param h_payto account the attributes are about - * @param provider_name name of the provider that collected the attributes - * @param collection_time when were the attributes collected - * @param expiration_time when does the data expire - * @param properties properties that were set for @a h_payto - * @param enc_attributes_size size of @a enc_attributes - * @param enc_attributes the encrypted collected attributes - * @return true to continue to iterate - */ -typedef bool -(*TALER_EXCHANGEDB_AllAttributesCallback)( - void *cls, - uint64_t row_id, - const struct TALER_NormalizedPaytoHashP *h_payto, - const char *provider_name, - struct GNUNET_TIME_Timestamp collection_time, - struct GNUNET_TIME_Timestamp expiration_time, - const json_t *properties, - size_t enc_attributes_size, - const void *enc_attributes); - - -/* Callback typedefs */ -/** - * Return KYC attribute information. - * - * @param cls closure - * @param row_id current row in kyc_attributes table - * @param h_payto account the attributes are about - * @param provider_name name of the provider that collected the attributes - * @param collection_time when were the attributes collected - * @param expiration_time when does the data expire - * @param properties properties that were set for @a h_payto - * @param enc_attributes_size size of @a enc_attributes - * @param enc_attributes the encrypted collected attributes - * @return true to continue to iterate - */ -typedef bool -(*TALER_EXCHANGEDB_AllAttributesCallback)( - void *cls, - uint64_t row_id, - const struct TALER_NormalizedPaytoHashP *h_payto, - const char *provider_name, - struct GNUNET_TIME_Timestamp collection_time, - struct GNUNET_TIME_Timestamp expiration_time, - const json_t *properties, - size_t enc_attributes_size, - const void *enc_attributes); - -/** - * Lookup all KYC attributes above @a min_row_id. - * - * @param pg the database context - * @param min_row_id minimum row ID to return (exclusive) - * @param cb callback to invoke on each match - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_all_kyc_attributes (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - uint64_t min_row_id, - TALER_EXCHANGEDB_AllAttributesCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_all_purse_deletions_above_serial_id.h b/src/include/taler/exchange-database/select_all_purse_deletions_above_serial_id.h @@ -1,84 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_all_purse_deletions_above_serial_id.h - * @brief implementation of the select_all_purse_deletions_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_ALL_PURSE_DELETIONS_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_ALL_PURSE_DELETIONS_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with details about purse deletions that have been made, with - * the goal of auditing the purse's execution. - * - * @param cls closure - * @param rowid unique serial ID for the deposit in our DB - * @param purse_pub public key of the purse - * @param purse_sig signature affirming deletion of the purse - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_AllPurseDeletionsCallback)( - void *cls, - uint64_t rowid, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_PurseContractSignatureP *purse_sig); - - -/* Callback typedefs */ -/** - * Function called with details about purse deletions that have been made, with - * the goal of auditing the purse's execution. - * - * @param cls closure - * @param rowid unique serial ID for the deposit in our DB - * @param purse_pub public key of the purse - * @param purse_sig signature affirming deletion of the purse - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_AllPurseDeletionsCallback)( - void *cls, - uint64_t rowid, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_PurseContractSignatureP *purse_sig); - -/** - * Select all purse deletions above @a serial_id in monotonically increasing - * order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_all_purse_deletions_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - uint64_t serial_id, - TALER_EXCHANGEDB_AllPurseDeletionsCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_aml_attributes.h b/src/include/taler/exchange-database/select_aml_attributes.h @@ -1,98 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aml_attributes.h - * @brief implementation of the select_aml_attributes function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AML_ATTRIBUTES_H -#define EXCHANGE_DATABASE_SELECT_AML_ATTRIBUTES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Return AML attribute information. - * - * @param cls closure - * @param row_id current row in kyc_attributes table - * @param collection_time when were the attributes collected - * @param by_aml_officer true if the data was filed by an AML officer - * @param officer_name name of the officer, NULL if not @a by_aml_officer - * @param enc_attributes_size size of @a enc_attributes - * @param enc_attributes the encrypted collected attributes - */ -typedef void -(*TALER_EXCHANGEDB_AmlAttributeCallback)( - void *cls, - uint64_t row_id, - struct GNUNET_TIME_Timestamp collection_time, - bool by_aml_officer, - const char *officer_name, - size_t enc_attributes_size, - const void *enc_attributes); - - -/* Callback typedefs */ -/** - * Return AML attribute information. - * - * @param cls closure - * @param row_id current row in kyc_attributes table - * @param collection_time when were the attributes collected - * @param by_aml_officer true if the data was filed by an AML officer - * @param officer_name name of the officer, NULL if not @a by_aml_officer - * @param enc_attributes_size size of @a enc_attributes - * @param enc_attributes the encrypted collected attributes - */ -typedef void -(*TALER_EXCHANGEDB_AmlAttributeCallback)( - void *cls, - uint64_t row_id, - struct GNUNET_TIME_Timestamp collection_time, - bool by_aml_officer, - const char *officer_name, - size_t enc_attributes_size, - const void *enc_attributes); - -/** - * Lookup AML attributes of a particular account. - * - * @param pg the database context - * @param h_payto which account should we return attributes for - * @param offset row to start from - * @param limit how many records to return (negative - * to go back in time, positive to go forward) - * @param cb callback to invoke on each match - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aml_attributes (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - uint64_t offset, - int64_t limit, - TALER_EXCHANGEDB_AmlAttributeCallback cb - , - void *cb_cls); - - -#endif diff --git a/src/include/taler/exchange-database/select_aml_decisions.h b/src/include/taler/exchange-database/select_aml_decisions.h @@ -1,123 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aml_decisions.h - * @brief implementation of the select_aml_decisions function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AML_DECISIONS_H -#define EXCHANGE_DATABASE_SELECT_AML_DECISIONS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Return AML decision information. - * - * @param cls closure - * @param row_id current row in legitimization outcomes table - * @param justification human-readable reason for the decision, NULL if none is available - * @param h_payto account for which the attribute data is stored - * @param decision_time when was the decision taken - * @param expiration_time when will the rules expire - * @param jproperties properties set for the account, - * NULL if no properties were set - * @param to_investigate true if AML staff should look at the account - * @param is_active true if this is the currently active decision about the account - * @param is_wallet true if the @a h_payto is for a Taler wallet - * @param payto payto URI of the account the decision is about - * @param account_rules current active rules for the account - */ -typedef void -(*TALER_EXCHANGEDB_AmlDecisionCallback)( - void *cls, - uint64_t row_id, - const char *justification, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Timestamp decision_time, - struct GNUNET_TIME_Absolute expiration_time, - const json_t *jproperties, - bool to_investigate, - bool is_active, - bool is_wallet, - struct TALER_FullPayto payto, - const json_t *account_rules); - - -/* Callback typedefs */ -/** - * Return AML decision information. - * - * @param cls closure - * @param row_id current row in legitimization outcomes table - * @param justification human-readable reason for the decision, NULL if none is available - * @param h_payto account for which the attribute data is stored - * @param decision_time when was the decision taken - * @param expiration_time when will the rules expire - * @param jproperties properties set for the account, - * NULL if no properties were set - * @param to_investigate true if AML staff should look at the account - * @param is_active true if this is the currently active decision about the account - * @param is_wallet true if the @a h_payto is for a Taler wallet - * @param payto payto URI of the account the decision is about - * @param account_rules current active rules for the account - */ -typedef void -(*TALER_EXCHANGEDB_AmlDecisionCallback)( - void *cls, - uint64_t row_id, - const char *justification, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Timestamp decision_time, - struct GNUNET_TIME_Absolute expiration_time, - const json_t *jproperties, - bool to_investigate, - bool is_active, - bool is_wallet, - struct TALER_FullPayto payto, - const json_t *account_rules); - -/** - * Lookup AML decisions that have a particular state. - * - * @param pg the database context - * @param h_payto which account should we return the AML decision history for, NULL to return all accounts - * @param investigation_only filter by investigation state - * @param active_only filter for only active states - * @param offset row to start from - * @param limit how many records to return (negative - * to go back in time, positive to go forward) - * @param cb callback to invoke on each match - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aml_decisions (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_NormalizedPaytoHashP * - h_payto, - enum TALER_EXCHANGE_YesNoAll - investigation_only - , - enum TALER_EXCHANGE_YesNoAll active_only, - uint64_t offset, - int64_t limit, - TALER_EXCHANGEDB_AmlDecisionCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_aml_measures.h b/src/include/taler/exchange-database/select_aml_measures.h @@ -1,96 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aml_measures.h - * @brief implementation of the select_aml_measures function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AML_MEASURES_H -#define EXCHANGE_DATABASE_SELECT_AML_MEASURES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with legitimization measures. - * - * @param cls closure - * @param h_payto hash of account the measure applies to - * @param start_time when was the process started - * @param jmeasures object of type ``LegitimizationMeasures`` - * @param is_finished true if the measure was finished - * @param measure_serial_id row ID of the measure in the exchange table - */ -typedef void -(*TALER_EXCHANGEDB_LegitimizationMeasureCallback) ( - void *cls, - struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Absolute start_time, - const json_t *jmeasures, - bool is_finished, - uint64_t measure_serial_id); - - -/* Callback typedefs */ -/** - * Function called with legitimization measures. - * - * @param cls closure - * @param h_payto hash of account the measure applies to - * @param start_time when was the process started - * @param jmeasures object of type ``LegitimizationMeasures`` - * @param is_finished true if the measure was finished - * @param measure_serial_id row ID of the measure in the exchange table - */ -typedef void -(*TALER_EXCHANGEDB_LegitimizationMeasureCallback) ( - void *cls, - struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Absolute start_time, - const json_t *jmeasures, - bool is_finished, - uint64_t measure_serial_id); - -/** - * Lookup legitimization measures. - * - * @param pg the database context - * @param h_payto account for which the attribute data is stored, - * NULL to select for all accounts - * @param active_only select only measures that are active - * @param offset row offset to select from - * @param limit number of results to return, negative to - * return in descending order from @a offset - * @param cb callback to invoke on each match - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aml_measures (struct TALER_EXCHANGEDB_PostgresContext * - pg, - const struct TALER_NormalizedPaytoHashP * - h_payto - , - enum TALER_EXCHANGE_YesNoAll active_only, - uint64_t offset, - int64_t limit, - TALER_EXCHANGEDB_LegitimizationMeasureCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_aml_statistics.h b/src/include/taler/exchange-database/select_aml_statistics.h @@ -1,81 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_aml_statistics.h - * @brief implementation of the select_aml_statistics function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AML_STATISTICS_H -#define EXCHANGE_DATABASE_SELECT_AML_STATISTICS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with AML statistics (counters). - * - * @param cls closure - * @param name name of the counter - * @param cnt number of events for @a name in the query range - */ -typedef void -(*TALER_EXCHANGEDB_AmlStatisticsCallback)( - void *cls, - const char *name, - uint64_t cnt); - - -/* Callback typedefs */ -/** - * Function called with AML statistics (counters). - * - * @param cls closure - * @param name name of the counter - * @param cnt number of events for @a name in the query range - */ -typedef void -(*TALER_EXCHANGEDB_AmlStatisticsCallback)( - void *cls, - const char *name, - uint64_t cnt); - -/** - * Obtain the AML statistics for a given set of @a names and - * timeframe. - * - * @param pg the database context - * @param num_names length of the @e names array - * @param names array of names of the statistics to fetch - * @param start_date start of time range - * @param end_date end of time range - * @param cb function to call on each statistic - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_aml_statistics (struct - TALER_EXCHANGEDB_PostgresContext *pg, - size_t num_names, - const char *names[static num_names], - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - TALER_EXCHANGEDB_AmlStatisticsCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_auditor_denom_sig.h b/src/include/taler/exchange-database/select_auditor_denom_sig.h @@ -1,49 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_auditor_denom_sig.h - * @brief implementation of the select_auditor_denom_sig function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_AUDITOR_DENOM_SIG_H -#define EXCHANGE_DATABASE_SELECT_AUDITOR_DENOM_SIG_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Select information about an auditor auditing a denomination key. - * - * @param pg the database context - * @param h_denom_pub the audited denomination - * @param auditor_pub the auditor's key - * @param[out] auditor_sig set to signature affirming the auditor's audit activity - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_auditor_denom_sig (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_DenominationHashP * - h_denom_pub, - const struct - TALER_AuditorPublicKeyP * - auditor_pub, - struct TALER_AuditorSignatureP * - auditor_sig - ); - -#endif diff --git a/src/include/taler/exchange-database/select_batch_deposits_missing_wire.h b/src/include/taler/exchange-database/select_batch_deposits_missing_wire.h @@ -1,87 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022-2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_batch_deposits_missing_wire.h - * @brief implementation of the select_batch_deposits_missing_wire function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H -#define EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called on (batch) deposits will need a wire - * transfer. - * - * @param cls closure - * @param batch_deposit_serial_id where in the table are we - * @param total_amount value of all missing deposits, including fees - * @param wire_target_h_payto hash of the recipient account's payto URI - * @param deadline what was the earliest requested wire transfer deadline - */ -typedef void -(*TALER_EXCHANGEDB_WireMissingCallback)( - void *cls, - uint64_t batch_deposit_serial_id, - const struct TALER_Amount *total_amount, - const struct TALER_FullPaytoHashP *wire_target_h_payto, - struct GNUNET_TIME_Timestamp deadline); - - -/* Callback typedefs */ -/** - * Function called on (batch) deposits will need a wire - * transfer. - * - * @param cls closure - * @param batch_deposit_serial_id where in the table are we - * @param total_amount value of all missing deposits, including fees - * @param wire_target_h_payto hash of the recipient account's payto URI - * @param deadline what was the earliest requested wire transfer deadline - */ -typedef void -(*TALER_EXCHANGEDB_WireMissingCallback)( - void *cls, - uint64_t batch_deposit_serial_id, - const struct TALER_Amount *total_amount, - const struct TALER_FullPaytoHashP *wire_target_h_payto, - struct GNUNET_TIME_Timestamp deadline); - -/** - * Select all of those batch deposits in the database - * above the given serial ID. - * - * @param pg the database context - * @param min_batch_deposit_serial_id select all batch deposits above this ID - * @param cb function to call on all such deposits - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_batch_deposits_missing_wire (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - uint64_t - min_batch_deposit_serial_id, - TALER_EXCHANGEDB_WireMissingCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_coin_deposits_above_serial_id.h b/src/include/taler/exchange-database/select_coin_deposits_above_serial_id.h @@ -1,93 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_coin_deposits_above_serial_id.h - * @brief implementation of the select_coin_deposits_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_COIN_DEPOSITS_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_COIN_DEPOSITS_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with details about deposits that have been made, - * with the goal of auditing the deposit's execution. - * - * @param cls closure - * @param rowid unique serial ID for the deposit in our DB - * @param exchange_timestamp when did the deposit happen - * @param deposit deposit details - * @param denom_pub denomination public key of @a coin_pub - * @param done flag set if the deposit was already executed (or not) - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_DepositCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp exchange_timestamp, - const struct TALER_EXCHANGEDB_Deposit *deposit, - const struct TALER_DenominationPublicKey *denom_pub, - bool done); - - -/* Callback typedefs */ -/** - * Function called with details about deposits that have been made, - * with the goal of auditing the deposit's execution. - * - * @param cls closure - * @param rowid unique serial ID for the deposit in our DB - * @param exchange_timestamp when did the deposit happen - * @param deposit deposit details - * @param denom_pub denomination public key of @a coin_pub - * @param done flag set if the deposit was already executed (or not) - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_DepositCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp exchange_timestamp, - const struct TALER_EXCHANGEDB_Deposit *deposit, - const struct TALER_DenominationPublicKey *denom_pub, - bool done); - -/** - * Select deposits above @a serial_id in monotonically increasing - * order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_coin_deposits_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - uint64_t serial_id, - TALER_EXCHANGEDB_DepositCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_contract.h b/src/include/taler/exchange-database/select_contract.h @@ -1,50 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_contract.h - * @brief implementation of the select_contract function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_CONTRACT_H -#define EXCHANGE_DATABASE_SELECT_CONTRACT_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to retrieve an encrypted contract. - * - * @param pg the database context - * @param purse_pub key to lookup the contract by - * @param[out] pub_ckey set to the ephemeral DH used to encrypt the contract - * @param[out] econtract_sig set to the signature over the encrypted contract - * @param[out] econtract_size set to the number of bytes in @a econtract - * @param[out] econtract set to the encrypted contract on success, to be freed by the caller - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_contract (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_ContractDiffiePublicP * - pub_ckey, - struct TALER_PurseContractPublicKeyP * - purse_pub, - struct TALER_PurseContractSignatureP * - econtract_sig, - size_t *econtract_size, - void **econtract); - -#endif diff --git a/src/include/taler/exchange-database/select_contract_by_purse.h b/src/include/taler/exchange-database/select_contract_by_purse.h @@ -1,46 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_contract_by_purse.h - * @brief implementation of the select_contract_by_purse function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_CONTRACT_BY_PURSE_H -#define EXCHANGE_DATABASE_SELECT_CONTRACT_BY_PURSE_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to retrieve an encrypted contract. - * - * @param pg the database context - * @param purse_pub key to lookup the contract by - * @param[out] econtract set to the encrypted contract on success, to be freed by the caller - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_contract_by_purse (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_PurseContractPublicKeyP * - purse_pub, - struct TALER_EncryptedContract - *econtract); - -#endif diff --git a/src/include/taler/exchange-database/select_deposit_amounts_for_kyc_check.h b/src/include/taler/exchange-database/select_deposit_amounts_for_kyc_check.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_deposit_amounts_for_kyc_check.h - * @brief implementation of the select_deposit_amounts_for_kyc_check function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_DEPOSIT_AMOUNTS_FOR_KYC_CHECK_H -#define EXCHANGE_DATABASE_SELECT_DEPOSIT_AMOUNTS_FOR_KYC_CHECK_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Call @a kac on deposited amounts after @a time_limit which are relevant for a - * KYC trigger for a merchant identified by @a h_payto. - * - * @param pg the database context - * @param h_payto account identifier - * @param time_limit oldest transaction that could be relevant - * @param kac function to call for each applicable amount, - * in reverse chronological order (or until @a kac aborts - * by returning anything except #GNUNET_OK). - * @param kac_cls closure for @a kac - * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_deposit_amounts_for_kyc_check ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Absolute time_limit, - TALER_KYCLOGIC_KycAmountCallback kac, - void *kac_cls); - - -#endif diff --git a/src/include/taler/exchange-database/select_exchange_credit_transfers.h b/src/include/taler/exchange-database/select_exchange_credit_transfers.h @@ -1,51 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_exchange_credit_transfers.h - * @brief implementation of the select_exchange_credit_transfers function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_EXCHANGE_CREDIT_TRANSFERS_H -#define EXCHANGE_DATABASE_SELECT_EXCHANGE_CREDIT_TRANSFERS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Return AML-relevant wire transfer credit data. - * - * @param pg the database context - * @param threshold minimum wire amount to return data for - * @param offset offset in table to filter by - * @param limit maximum number of entries to return, negative for descending - * @param h_payto account to filter transfer data by - * @param cb function to call on each result - * @param cb_cls closure to pass to @a cb - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_exchange_credit_transfers ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_Amount *threshold, - uint64_t offset, - int64_t limit, - const struct TALER_NormalizedPaytoHashP *h_payto, - TALER_EXCHANGEDB_AmlTransferCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_exchange_debit_transfers.h b/src/include/taler/exchange-database/select_exchange_debit_transfers.h @@ -1,77 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_exchange_debit_transfers.h - * @brief implementation of the select_exchange_debit_transfers function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_EXCHANGE_DEBIT_TRANSFERS_H -#define EXCHANGE_DATABASE_SELECT_EXCHANGE_DEBIT_TRANSFERS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/* Callback typedefs */ -/** - * Callback that is given AML-relevant transfer data. - * - * @param cls closure - * @param row_id current row in AML status table - * @param payto_uri account involved with the wire transfer - * @param execution_time when was the transfer made - * @param amount wire amount of the transfer - */ -typedef void -(*TALER_EXCHANGEDB_AmlTransferCallback)( - void *cls, - uint64_t row_id, - const char *payto_uri, - struct GNUNET_TIME_Absolute execution_time, - const struct TALER_Amount *amount); - -/** - * Return AML-relevant wire transfer debit data. - * - * @param pg the database context - * @param threshold minimum wire amount to return data for - * @param offset offset in table to filter by - * @param limit maximum number of entries to return, negative for descending - * @param h_payto account to filter transfer data by - * @param cb function to call on each result - * @param cb_cls closure to pass to @a cb - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_exchange_debit_transfers (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - const struct TALER_Amount * - threshold - , - uint64_t offset, - int64_t limit, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - TALER_EXCHANGEDB_AmlTransferCallback - cb, - void *cb_cls); - - -#endif diff --git a/src/include/taler/exchange-database/select_exchange_kycauth_transfers.h b/src/include/taler/exchange-database/select_exchange_kycauth_transfers.h @@ -1,74 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_exchange_kycauth_transfers.h - * @brief implementation of the select_exchange_kycauth_transfers function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_EXCHANGE_KYCAUTH_TRANSFERS_H -#define EXCHANGE_DATABASE_SELECT_EXCHANGE_KYCAUTH_TRANSFERS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/* Callback typedefs */ -/** - * Callback that is given AML-relevant transfer data. - * - * @param cls closure - * @param row_id current row in AML status table - * @param payto_uri account involved with the wire transfer - * @param execution_time when was the transfer made - * @param amount wire amount of the transfer - */ -typedef void -(*TALER_EXCHANGEDB_AmlTransferCallback)( - void *cls, - uint64_t row_id, - const char *payto_uri, - struct GNUNET_TIME_Absolute execution_time, - const struct TALER_Amount *amount); - -/** - * Return wire transfer kycauth data. - * - * @param pg the database context - * @param threshold minimum wire amount to return data for - * @param offset offset in table to filter by - * @param limit maximum number of entries to return, negative for descending - * @param h_payto account to filter transfer data by - * @param cb function to call on each result - * @param cb_cls closure to pass to @a cb - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_exchange_kycauth_transfers (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct TALER_Amount * - threshold, - uint64_t offset, - int64_t limit, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - TALER_EXCHANGEDB_AmlTransferCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_kyc_accounts.h b/src/include/taler/exchange-database/select_kyc_accounts.h @@ -1,114 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_kyc_accounts.h - * @brief implementation of the select_kyc_accounts function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_KYC_ACCOUNTS_H -#define EXCHANGE_DATABASE_SELECT_KYC_ACCOUNTS_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Return account summary information. - * - * @param cls closure - * @param row_id current row in AML status table - * @param h_payto account for which the attribute data is stored - * @param open_time when was the account opened formally, - * GNUNET_TIME_UNIT_FOREVER_TS if it was never opened - * @param close_time when was the account formally closed, - * GNUNET_TIME_UNIT_ZERO_TS if it was never closed - * @param comments comments on the account - * @param high_risk is this a high-risk business relationship - * @param to_investigate TRUE if this account should be investigated - * @param payto the payto URI of the account - */ -typedef void -(*TALER_EXCHANGEDB_AmlAccountListCallback)( - void *cls, - uint64_t row_id, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Timestamp open_time, - struct GNUNET_TIME_Timestamp close_time, - const char *comments, - bool high_risk, - bool to_investigate, - struct TALER_FullPayto payto); - - -/* Callback typedefs */ -/** - * Return account summary information. - * - * @param cls closure - * @param row_id current row in AML status table - * @param h_payto account for which the attribute data is stored - * @param open_time when was the account opened formally, - * GNUNET_TIME_UNIT_FOREVER_TS if it was never opened - * @param close_time when was the account formally closed, - * GNUNET_TIME_UNIT_ZERO_TS if it was never closed - * @param comments comments on the account - * @param high_risk is this a high-risk business relationship - * @param to_investigate TRUE if this account should be investigated - * @param payto the payto URI of the account - */ -typedef void -(*TALER_EXCHANGEDB_AmlAccountListCallback)( - void *cls, - uint64_t row_id, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Timestamp open_time, - struct GNUNET_TIME_Timestamp close_time, - const char *comments, - bool high_risk, - bool to_investigate, - struct TALER_FullPayto payto); - -/** - * List accounts managed by the exchange (for AML/KYC). - * - * @param pg the database context - * @param investigation_only filter by investigation state - * @param open_only filter for only open accounts - * @param high_risk_only filter for only high-risk accounts - * @param offset row to start from - * @param limit how many records to return (negative - * to go back in time, positive to go forward) - * @param cb callback to invoke on each match - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_kyc_accounts (struct TALER_EXCHANGEDB_PostgresContext * - pg, - enum TALER_EXCHANGE_YesNoAll - investigation_only, - enum TALER_EXCHANGE_YesNoAll open_only, - enum TALER_EXCHANGE_YesNoAll - high_risk_only, - uint64_t offset, - int64_t limit, - TALER_EXCHANGEDB_AmlAccountListCallback cb - , - void *cb_cls); - - -#endif diff --git a/src/include/taler/exchange-database/select_kyc_attributes.h b/src/include/taler/exchange-database/select_kyc_attributes.h @@ -1,91 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_kyc_attributes.h - * @brief implementation of the select_kyc_attributes function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_KYC_ATTRIBUTES_H -#define EXCHANGE_DATABASE_SELECT_KYC_ATTRIBUTES_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Callback with KYC attributes about a particular user. - * - * @param cls closure - * @param h_payto account for which the attribute data is stored - * @param provider_name provider that must be checked - * @param collection_time when was the data collected - * @param expiration_time when does the data expire - * @param enc_attributes_size number of bytes in @a enc_attributes - * @param enc_attributes encrypted attribute data - */ -typedef void -(*TALER_EXCHANGEDB_AttributeCallback)( - void *cls, - const struct TALER_NormalizedPaytoHashP *h_payto, - const char *provider_name, - struct GNUNET_TIME_Timestamp collection_time, - struct GNUNET_TIME_Timestamp expiration_time, - size_t enc_attributes_size, - const void *enc_attributes); - - -/* Callback typedefs */ -/** - * Callback with KYC attributes about a particular user. - * - * @param cls closure - * @param h_payto account for which the attribute data is stored - * @param provider_name provider that must be checked - * @param collection_time when was the data collected - * @param expiration_time when does the data expire - * @param enc_attributes_size number of bytes in @a enc_attributes - * @param enc_attributes encrypted attribute data - */ -typedef void -(*TALER_EXCHANGEDB_AttributeCallback)( - void *cls, - const struct TALER_NormalizedPaytoHashP *h_payto, - const char *provider_name, - struct GNUNET_TIME_Timestamp collection_time, - struct GNUNET_TIME_Timestamp expiration_time, - size_t enc_attributes_size, - const void *enc_attributes); - -/** - * Lookup KYC attribute data for a specific account. - * - * @param pg the database context - * @param h_payto account for which the attribute data is stored - * @param cb callback to invoke on each match - * @param cb_cls closure for @a cb - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_kyc_attributes (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - TALER_EXCHANGEDB_AttributeCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_merge_amounts_for_kyc_check.h b/src/include/taler/exchange-database/select_merge_amounts_for_kyc_check.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_merge_amounts_for_kyc_check.h - * @brief implementation of the select_merge_amounts_for_kyc_check function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_MERGE_AMOUNTS_FOR_KYC_CHECK_H -#define EXCHANGE_DATABASE_SELECT_MERGE_AMOUNTS_FOR_KYC_CHECK_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Call @a kac on merged reserve amounts after @a time_limit which are relevant for a - * KYC trigger for a the wallet identified by @a h_payto. - * - * @param pg the database context - * @param h_payto account identifier - * @param time_limit oldest transaction that could be relevant - * @param kac function to call for each applicable amount, in reverse chronological order (or until @a kac aborts by returning anything except #GNUNET_OK). - * @param kac_cls closure for @a kac - * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_merge_amounts_for_kyc_check ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Absolute time_limit, - TALER_KYCLOGIC_KycAmountCallback kac, - void *kac_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_purse_by_merge_pub.h b/src/include/taler/exchange-database/select_purse_by_merge_pub.h @@ -1,69 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_purse_by_merge_pub.h - * @brief implementation of the select_purse_by_merge_pub function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_PURSE_BY_MERGE_PUB_H -#define EXCHANGE_DATABASE_SELECT_PURSE_BY_MERGE_PUB_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to return meta data about a purse by the - * merge capability key. - * - * @param pg the database context - * @param merge_pub public key representing the merge capability - * @param[out] purse_pub public key of the purse - * @param[out] purse_expiration when would an unmerged purse expire - * @param[out] h_contract_terms contract associated with the purse - * @param[out] age_limit the age limit for deposits into the purse - * @param[out] target_amount amount to be put into the purse - * @param[out] balance amount put so far into the purse - * @param[out] purse_sig signature of the purse over the initialization data - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_purse_by_merge_pub (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_PurseMergePublicKeyP * - merge_pub, - struct - TALER_PurseContractPublicKeyP - * - purse_pub, - struct GNUNET_TIME_Timestamp * - purse_expiration, - struct - TALER_PrivateContractHashP * - h_contract_terms, - uint32_t *age_limit, - struct TALER_Amount * - target_amount, - struct TALER_Amount *balance, - struct - TALER_PurseContractSignatureP - * - purse_sig); - -#endif diff --git a/src/include/taler/exchange-database/select_purse_decisions_above_serial_id.h b/src/include/taler/exchange-database/select_purse_decisions_above_serial_id.h @@ -1,92 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_purse_decisions_above_serial_id.h - * @brief implementation of the select_purse_decisions_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_PURSE_DECISIONS_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_PURSE_DECISIONS_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with details about purse decisions that have been made, with - * the goal of auditing the purse's execution. - * - * @param cls closure - * @param rowid unique serial ID for the deposit in our DB - * @param purse_pub public key of the purse - * @param reserve_pub public key of the target reserve, NULL if not known / refunded - * @param purse_value what is the (target) value of the purse - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_PurseDecisionCallback)( - void *cls, - uint64_t rowid, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_Amount *purse_value); - - -/* Callback typedefs */ -/** - * Function called with details about purse decisions that have been made, with - * the goal of auditing the purse's execution. - * - * @param cls closure - * @param rowid unique serial ID for the deposit in our DB - * @param purse_pub public key of the purse - * @param reserve_pub public key of the target reserve, NULL if not known / refunded - * @param purse_value what is the (target) value of the purse - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_PurseDecisionCallback)( - void *cls, - uint64_t rowid, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_Amount *purse_value); - -/** - * Select purse decisions above @a serial_id in monotonically increasing - * order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param refunded which refund status to select for - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_purse_decisions_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t - serial_id, - bool refunded, - TALER_EXCHANGEDB_PurseDecisionCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_purse_deposits_by_purse.h b/src/include/taler/exchange-database/select_purse_deposits_by_purse.h @@ -1,91 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_purse_deposits_by_purse.h - * @brief implementation of the select_purse_deposits_by_purse function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_PURSE_DEPOSITS_BY_PURSE_H -#define EXCHANGE_DATABASE_SELECT_PURSE_DEPOSITS_BY_PURSE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with details about purse refunds that have been made, with - * the goal of auditing the purse refund's execution. - * - * @param cls closure - * @param rowid row of the refund event - * @param amount_with_fee amount of the deposit into the purse - * @param coin_pub coin that is to be refunded the @a given amount_with_fee - * @param denom_pub denomination of @a coin_pub - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_PurseRefundCoinCallback)( - void *cls, - uint64_t rowid, - const struct TALER_Amount *amount_with_fee, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_DenominationPublicKey *denom_pub); - - -/* Callback typedefs */ -/** - * Function called with details about purse refunds that have been made, with - * the goal of auditing the purse refund's execution. - * - * @param cls closure - * @param rowid row of the refund event - * @param amount_with_fee amount of the deposit into the purse - * @param coin_pub coin that is to be refunded the @a given amount_with_fee - * @param denom_pub denomination of @a coin_pub - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_PurseRefundCoinCallback)( - void *cls, - uint64_t rowid, - const struct TALER_Amount *amount_with_fee, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_DenominationPublicKey *denom_pub); - -/** - * Select coin affected by purse refund. - * - * @param pg the database context - * @param purse_pub purse that was refunded - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_purse_deposits_by_purse (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - const struct - TALER_PurseContractPublicKeyP - * - purse_pub, - TALER_EXCHANGEDB_PurseRefundCoinCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_purse_merge.h b/src/include/taler/exchange-database/select_purse_merge.h @@ -1,56 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_purse_merge.h - * @brief implementation of the select_purse_merge function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_PURSE_MERGE_H -#define EXCHANGE_DATABASE_SELECT_PURSE_MERGE_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to approve merging of a purse with - * an account, made by the receiving account. - * - * @param pg the database context - * @param purse_pub public key of the purse - * @param[out] merge_sig set to the signature confirming the merge - * @param[out] merge_timestamp set to the time of the merge - * @param[out] partner_url set to the URL of the target exchange, or NULL if the target exchange is us. To be freed by the caller. - * @param[out] reserve_pub set to the public key of the reserve/account being credited - * @param[out] refunded set to true if purse was refunded - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_purse_merge (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_PurseContractPublicKeyP * - purse_pub, - struct TALER_PurseMergeSignatureP * - merge_sig, - struct GNUNET_TIME_Timestamp * - merge_timestamp, - char **partner_url, - struct TALER_ReservePublicKeyP * - reserve_pub, - bool *refunded); - -#endif diff --git a/src/include/taler/exchange-database/select_recoup_above_serial_id.h b/src/include/taler/exchange-database/select_recoup_above_serial_id.h @@ -1,103 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_recoup_above_serial_id.h - * @brief implementation of the select_recoup_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_RECOUP_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_RECOUP_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called about recoups the exchange has to perform. - * - * @param cls closure - * @param rowid row identifier used to uniquely identify the recoup operation - * @param timestamp when did we receive the recoup request - * @param amount how much should be added back to the reserve - * @param reserve_pub public key of the reserve - * @param coin public information about the coin - * @param denom_pub denomination key of @a coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP - * @param coin_blind blinding factor used to blind the coin - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RecoupCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp timestamp, - const struct TALER_Amount *amount, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_CoinPublicInfo *coin, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); - - -/* Callback typedefs */ -/** - * Function called about recoups the exchange has to perform. - * - * @param cls closure - * @param rowid row identifier used to uniquely identify the recoup operation - * @param timestamp when did we receive the recoup request - * @param amount how much should be added back to the reserve - * @param reserve_pub public key of the reserve - * @param coin public information about the coin - * @param denom_pub denomination key of @a coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP - * @param coin_blind blinding factor used to blind the coin - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RecoupCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp timestamp, - const struct TALER_Amount *amount, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_CoinPublicInfo *coin, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); - -/** - * Function called to select recoup requests the exchange - * received, ordered by serial ID (monotonically increasing). - * - * @param pg the database context - * @param serial_id lowest serial ID to include (select larger or equal) - * @param cb function to call for ONE unfinished item - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_recoup_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - uint64_t serial_id, - TALER_EXCHANGEDB_RecoupCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_recoup_refresh_above_serial_id.h b/src/include/taler/exchange-database/select_recoup_refresh_above_serial_id.h @@ -1,109 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_recoup_refresh_above_serial_id.h - * @brief implementation of the select_recoup_refresh_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_RECOUP_REFRESH_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_RECOUP_REFRESH_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called about recoups on refreshed coins the exchange has to - * perform. - * - * @param cls closure - * @param rowid row identifier used to uniquely identify the recoup operation - * @param timestamp when did we receive the recoup request - * @param amount how much should be added back to the old coin - * @param old_coin_pub original coin that was refreshed to create @a coin - * @param old_denom_pub_hash hash of public key of @a old_coin_pub - * @param coin public information about the fresh coin - * @param denom_pub denomination key of @a coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP - * @param coin_blind blinding factor used to blind the coin - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RecoupRefreshCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp timestamp, - const struct TALER_Amount *amount, - const struct TALER_CoinSpendPublicKeyP *old_coin_pub, - const struct TALER_DenominationHashP *old_denom_pub_hash, - const struct TALER_CoinPublicInfo *coin, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); - - -/* Callback typedefs */ -/** - * Function called about recoups on refreshed coins the exchange has to - * perform. - * - * @param cls closure - * @param rowid row identifier used to uniquely identify the recoup operation - * @param timestamp when did we receive the recoup request - * @param amount how much should be added back to the old coin - * @param old_coin_pub original coin that was refreshed to create @a coin - * @param old_denom_pub_hash hash of public key of @a old_coin_pub - * @param coin public information about the fresh coin - * @param denom_pub denomination key of @a coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP - * @param coin_blind blinding factor used to blind the coin - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RecoupRefreshCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp timestamp, - const struct TALER_Amount *amount, - const struct TALER_CoinSpendPublicKeyP *old_coin_pub, - const struct TALER_DenominationHashP *old_denom_pub_hash, - const struct TALER_CoinPublicInfo *coin, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const union GNUNET_CRYPTO_BlindingSecretP *coin_blind); - -/** - * Function called to select recoup requests the exchange received for - * refreshed coins, ordered by serial ID (monotonically increasing). - * - * @param pg the database context - * @param serial_id lowest serial ID to include (select larger or equal) - * @param cb function to call for ONE unfinished item - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_recoup_refresh_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t serial_id, - TALER_EXCHANGEDB_RecoupRefreshCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_refreshes_above_serial_id.h b/src/include/taler/exchange-database/select_refreshes_above_serial_id.h @@ -1,109 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_refreshes_above_serial_id.h - * @brief implementation of the select_refreshes_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_REFRESHES_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_REFRESHES_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with details about coins that were melted, - * with the goal of auditing the refresh's execution. - * - * @param cls closure - * @param rowid unique serial ID for the refresh session in our DB - * @param old_denom_pub denomination public key of @a coin_pub - * @param coin_pub public key of the coin - * @param coin_sig signature from the coin - * @param h_age_commitment hash of the age commitment for the coin - * @param amount_with_fee amount that was deposited including fee - * @param num_nds length of the @a new_denom_serials array - * @param new_denom_serials array of denomination serials of fresh coins - * @param rc what the refresh commitment - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RefreshesCallback)( - void *cls, - uint64_t rowid, - const struct TALER_DenominationPublicKey *old_denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const struct TALER_AgeCommitmentHashP *h_age_commitment, - const struct TALER_Amount *amount_with_fee, - size_t num_nds, - uint64_t new_denom_serials[static num_nds], - const struct TALER_RefreshCommitmentP *rc); - - -/* Callback typedefs */ -/** - * Function called with details about coins that were melted, - * with the goal of auditing the refresh's execution. - * - * @param cls closure - * @param rowid unique serial ID for the refresh session in our DB - * @param old_denom_pub denomination public key of @a coin_pub - * @param coin_pub public key of the coin - * @param coin_sig signature from the coin - * @param h_age_commitment hash of the age commitment for the coin - * @param amount_with_fee amount that was deposited including fee - * @param num_nds length of the @a new_denom_serials array - * @param new_denom_serials array of denomination serials of fresh coins - * @param rc what the refresh commitment - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RefreshesCallback)( - void *cls, - uint64_t rowid, - const struct TALER_DenominationPublicKey *old_denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const struct TALER_AgeCommitmentHashP *h_age_commitment, - const struct TALER_Amount *amount_with_fee, - size_t num_nds, - uint64_t new_denom_serials[static num_nds], - const struct TALER_RefreshCommitmentP *rc); - -/** - * Select refresh sessions above @a serial_id in monotonically increasing - * order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_refreshes_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t serial_id, - TALER_EXCHANGEDB_RefreshesCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_refunds_above_serial_id.h b/src/include/taler/exchange-database/select_refunds_above_serial_id.h @@ -1,109 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_refunds_above_serial_id.h - * @brief implementation of the select_refunds_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_REFUNDS_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_REFUNDS_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/do_refund.h" - - -/** - * Function called with details about coins that were refunding, - * with the goal of auditing the refund's execution. - * - * @param cls closure - * @param rowid unique serial ID for the refund in our DB - * @param denom_pub denomination public key of @a coin_pub - * @param coin_pub public key of the coin - * @param merchant_pub public key of the merchant - * @param merchant_sig signature of the merchant - * @param h_contract_terms hash of the proposal data known to merchant and customer - * @param rtransaction_id refund transaction ID chosen by the merchant - * @param full_refund true if the refunds total up to the entire value of the deposit - * @param amount_with_fee amount that was deposited including fee - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RefundCallback)( - void *cls, - uint64_t rowid, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_MerchantSignatureP *merchant_sig, - const struct TALER_PrivateContractHashP *h_contract_terms, - uint64_t rtransaction_id, - bool full_refund, - const struct TALER_Amount *amount_with_fee); - - -/* Callback typedefs */ -/** - * Function called with details about coins that were refunding, - * with the goal of auditing the refund's execution. - * - * @param cls closure - * @param rowid unique serial ID for the refund in our DB - * @param denom_pub denomination public key of @a coin_pub - * @param coin_pub public key of the coin - * @param merchant_pub public key of the merchant - * @param merchant_sig signature of the merchant - * @param h_contract_terms hash of the proposal data known to merchant and customer - * @param rtransaction_id refund transaction ID chosen by the merchant - * @param full_refund true if the refunds total up to the entire value of the deposit - * @param amount_with_fee amount that was deposited including fee - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RefundCallback)( - void *cls, - uint64_t rowid, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_MerchantSignatureP *merchant_sig, - const struct TALER_PrivateContractHashP *h_contract_terms, - uint64_t rtransaction_id, - bool full_refund, - const struct TALER_Amount *amount_with_fee); - -/** - * Select refunds above @a serial_id in monotonically increasing - * order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_refunds_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t serial_id, - TALER_EXCHANGEDB_RefundCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_refunds_by_coin.h b/src/include/taler/exchange-database/select_refunds_by_coin.h @@ -1,82 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_refunds_by_coin.h - * @brief implementation of the select_refunds_by_coin function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_REFUNDS_BY_COIN_H -#define EXCHANGE_DATABASE_SELECT_REFUNDS_BY_COIN_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Callback invoked with information about refunds applicable - * to a particular coin and contract. - * - * @param cls closure - * @param amount_with_fee amount being refunded - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RefundCoinCallback)( - void *cls, - const struct TALER_Amount *amount_with_fee); - - -/* Callback typedefs */ -/** - * Callback invoked with information about refunds applicable - * to a particular coin and contract. - * - * @param cls closure - * @param amount_with_fee amount being refunded - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_RefundCoinCallback)( - void *cls, - const struct TALER_Amount *amount_with_fee); - -/** - * Select refunds by @a coin_pub, @a merchant_pub and @a h_contract. - * - * @param pg the database context - * @param coin_pub coin to get refunds for - * @param merchant_pub merchant to get refunds for - * @param h_contract contract (hash) to get refunds for - * @param cb function to call for each refund found - * @param cb_cls closure for @a cb - * @return query result status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_refunds_by_coin (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_CoinSpendPublicKeyP * - coin_pub, - const struct TALER_MerchantPublicKeyP * - merchant_pub, - const struct - TALER_PrivateContractHashP * - h_contract, - TALER_EXCHANGEDB_RefundCoinCallback cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_reserves_in_above_serial_id.h b/src/include/taler/exchange-database/select_reserves_in_above_serial_id.h @@ -1,71 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_reserves_in_above_serial_id.h - * @brief implementation of the select_reserves_in_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/* Callback typedefs */ -/** - * Function called with details about incoming wire transfers. - * - * @param cls closure - * @param rowid unique serial ID for the refresh session in our DB - * @param reserve_pub public key of the reserve (also the wire subject) - * @param credit amount that was received - * @param sender_account_details information about the sender's bank account, in payto://-format - * @param wire_reference unique identifier for the wire transfer - * @param execution_date when did we receive the funds - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_ReserveInCallback)( - void *cls, - uint64_t rowid, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_Amount *credit, - const struct TALER_FullPayto sender_account_details, - uint64_t wire_reference, - struct GNUNET_TIME_Timestamp execution_date); - -/** - * Select inbound wire transfers into reserves_in above @a serial_id - * in monotonically increasing order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_reserves_in_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - uint64_t serial_id, - TALER_EXCHANGEDB_ReserveInCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_reserves_in_above_serial_id_by_account.h b/src/include/taler/exchange-database/select_reserves_in_above_serial_id_by_account.h @@ -1,77 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_reserves_in_above_serial_id_by_account.h - * @brief implementation of the select_reserves_in_above_serial_id_by_account function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H -#define EXCHANGE_DATABASE_SELECT_RESERVES_IN_ABOVE_SERIAL_ID_BY_ACCOUNT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/* Callback typedefs */ -/** - * Function called with details about incoming wire transfers. - * - * @param cls closure - * @param rowid unique serial ID for the refresh session in our DB - * @param reserve_pub public key of the reserve (also the wire subject) - * @param credit amount that was received - * @param sender_account_details information about the sender's bank account, in payto://-format - * @param wire_reference unique identifier for the wire transfer - * @param execution_date when did we receive the funds - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_ReserveInCallback)( - void *cls, - uint64_t rowid, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_Amount *credit, - const struct TALER_FullPayto sender_account_details, - uint64_t wire_reference, - struct GNUNET_TIME_Timestamp execution_date); - -/** - * Select inbound wire transfers into reserves_in above @a serial_id - * in monotonically increasing order by account. - * - * @param pg the database context - * @param account_name name of the account to select by - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_reserves_in_above_serial_id_by_account (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const char - * - account_name, - uint64_t - serial_id, - TALER_EXCHANGEDB_ReserveInCallback - cb, - void * - cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_wire_out_above_serial_id.h b/src/include/taler/exchange-database/select_wire_out_above_serial_id.h @@ -1,71 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_wire_out_above_serial_id.h - * @brief implementation of the select_wire_out_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/* Callback typedefs */ -/** - * Function called with the results of the lookup of the - * wire transfer data of the exchange. - * - * @param cls closure - * @param rowid identifier of the respective row in the database - * @param date timestamp of the wire transfer (roughly) - * @param wtid wire transfer subject - * @param payto_uri details of the receiver, URI in payto://-format - * @param amount amount that was wired - * @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_WireTransferOutCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp date, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_FullPayto payto_uri, - const struct TALER_Amount *amount); - -/** - * Function called to select all wire transfers the exchange - * executed. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call for ONE unfinished item - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_wire_out_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t serial_id, - TALER_EXCHANGEDB_WireTransferOutCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_wire_out_above_serial_id_by_account.h b/src/include/taler/exchange-database/select_wire_out_above_serial_id_by_account.h @@ -1,75 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_wire_out_above_serial_id_by_account.h - * @brief implementation of the select_wire_out_above_serial_id_by_account function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_BY_ACCOUNT_H -#define EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_BY_ACCOUNT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/* Callback typedefs */ -/** - * Function called with the results of the lookup of the - * wire transfer data of the exchange. - * - * @param cls closure - * @param rowid identifier of the respective row in the database - * @param date timestamp of the wire transfer (roughly) - * @param wtid wire transfer subject - * @param payto_uri details of the receiver, URI in payto://-format - * @param amount amount that was wired - * @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_WireTransferOutCallback)( - void *cls, - uint64_t rowid, - struct GNUNET_TIME_Timestamp date, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_FullPayto payto_uri, - const struct TALER_Amount *amount); - -/** - * Function called to select all wire transfers the exchange - * executed by account. - * - * @param pg the database context - * @param account_name account to select - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call for ONE unfinished item - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_select_wire_out_above_serial_id_by_account (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const char * - account_name, - uint64_t - serial_id, - TALER_EXCHANGEDB_WireTransferOutCallback - cb, - void *cb_cls) -; - -#endif diff --git a/src/include/taler/exchange-database/select_withdraw_amounts_for_kyc_check.h b/src/include/taler/exchange-database/select_withdraw_amounts_for_kyc_check.h @@ -1,56 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_withdraw_amounts_for_kyc_check.h - * @brief implementation of the select_withdraw_amounts_for_kyc_check function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_WITHDRAW_AMOUNTS_FOR_KYC_CHECK_H -#define EXCHANGE_DATABASE_SELECT_WITHDRAW_AMOUNTS_FOR_KYC_CHECK_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Call @a kac on withdrawn amounts after @a time_limit which are relevant - * for a KYC trigger for a the (debited) account identified by @a h_payto. - * - * @param pg the database context - * @param h_payto account identifier - * @param time_limit oldest transaction that could be relevant - * @param kac function to call for each applicable amount, in reverse chronological order (or until @a kac aborts by returning anything except #GNUNET_OK). - * @param kac_cls closure for @a kac - * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_withdraw_amounts_for_kyc_check (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - const struct - TALER_NormalizedPaytoHashP - * - h_payto, - struct - GNUNET_TIME_Absolute - time_limit, - TALER_KYCLOGIC_KycAmountCallback - kac, - void *kac_cls); - -#endif diff --git a/src/include/taler/exchange-database/select_withdrawals_above_serial_id.h b/src/include/taler/exchange-database/select_withdrawals_above_serial_id.h @@ -1,122 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/select_withdrawals_above_serial_id.h - * @brief implementation of the select_withdrawals_above_serial_id function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SELECT_WITHDRAWALS_ABOVE_SERIAL_ID_H -#define EXCHANGE_DATABASE_SELECT_WITHDRAWALS_ABOVE_SERIAL_ID_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called with details about withdraw operations. - * - * @param cls closure - * @param rowid unique serial ID for the refresh session in our DB - * @param num_denom_serials number of elements in @e denom_serials array - * @param denom_serials array with length @e num_denom_serials of serial ID's of denominations in our DB - * @param selected_h hash over the gamma-selected planchets - * @param h_planchets running hash over all hashes of blinded planchets in the original withdraw request - * @param blinding_seed the blinding seed for CS denominations that was provided during withdraw; might be NULL - * @param age_proof_required true if the withdraw request required an age proof. - * @param max_age if @e age_proof_required is true, the maximum age that was set on the coins. - * @param noreveal_index if @e age_proof_required is true, the index that was returned by the exchange for the reveal phase. - * @param reserve_pub public key of the reserve - * @param reserve_sig signature over the withdraw operation - * @param execution_date when did the wallet withdraw the coin - * @param amount_with_fee amount that was withdrawn - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_WithdrawCallback)( - void *cls, - uint64_t rowid, - size_t num_denom_serials, - const uint64_t *denom_serials, - const struct TALER_HashBlindedPlanchetsP *selected_h, - const struct TALER_HashBlindedPlanchetsP *h_planchets, - const struct TALER_BlindingMasterSeedP *blinding_seed, - bool age_proof_required, - uint8_t max_age, - uint8_t noreveal_index, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_ReserveSignatureP *reserve_sig, - struct GNUNET_TIME_Timestamp execution_date, - const struct TALER_Amount *amount_with_fee); - - -/* Callback typedefs */ -/** - * Function called with details about withdraw operations. - * - * @param cls closure - * @param rowid unique serial ID for the refresh session in our DB - * @param num_denom_serials number of elements in @e denom_serials array - * @param denom_serials array with length @e num_denom_serials of serial ID's of denominations in our DB - * @param selected_h hash over the gamma-selected planchets - * @param h_planchets running hash over all hashes of blinded planchets in the original withdraw request - * @param blinding_seed the blinding seed for CS denominations that was provided during withdraw; might be NULL - * @param age_proof_required true if the withdraw request required an age proof. - * @param max_age if @e age_proof_required is true, the maximum age that was set on the coins. - * @param noreveal_index if @e age_proof_required is true, the index that was returned by the exchange for the reveal phase. - * @param reserve_pub public key of the reserve - * @param reserve_sig signature over the withdraw operation - * @param execution_date when did the wallet withdraw the coin - * @param amount_with_fee amount that was withdrawn - * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_EXCHANGEDB_WithdrawCallback)( - void *cls, - uint64_t rowid, - size_t num_denom_serials, - const uint64_t *denom_serials, - const struct TALER_HashBlindedPlanchetsP *selected_h, - const struct TALER_HashBlindedPlanchetsP *h_planchets, - const struct TALER_BlindingMasterSeedP *blinding_seed, - bool age_proof_required, - uint8_t max_age, - uint8_t noreveal_index, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_ReserveSignatureP *reserve_sig, - struct GNUNET_TIME_Timestamp execution_date, - const struct TALER_Amount *amount_with_fee); - -/** - * Select withdraw operations from reserves_out above @a serial_id - * in monotonically increasing order. - * - * @param pg the database context - * @param serial_id highest serial ID to exclude (select strictly larger) - * @param cb function to call on each result - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_select_withdrawals_above_serial_id (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - uint64_t serial_id, - TALER_EXCHANGEDB_WithdrawCallback - cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/set_aml_lock.h b/src/include/taler/exchange-database/set_aml_lock.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/set_aml_lock.h - * @brief implementation of the set_aml_lock function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SET_AML_LOCK_H -#define EXCHANGE_DATABASE_SET_AML_LOCK_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Set a lock for @a lock_duration on running AML programs for the @a h_payto - * account. If a lock already exists, returns the timeout of the - * @a existing_lock. Returns 0 if @a h_payto is not known. - * - * @param pg the database context - * @param h_payto account to lock - * @param lock_duration how long to lock the account - * @param[out] existing_lock set to timeout of existing lock, or - * to zero if there is no existing lock - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_set_aml_lock (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_NormalizedPaytoHashP *h_payto, - struct GNUNET_TIME_Relative lock_duration, - struct GNUNET_TIME_Absolute *existing_lock); - - -#endif diff --git a/src/include/taler/exchange-database/set_extension_manifest.h b/src/include/taler/exchange-database/set_extension_manifest.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/set_extension_manifest.h - * @brief implementation of the set_extension_manifest function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SET_EXTENSION_MANIFEST_H -#define EXCHANGE_DATABASE_SET_EXTENSION_MANIFEST_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to save the manifest of an extension - * (age-restriction, policy_extension_...) After successful storage of the - * configuration it triggers the corresponding event. - * - * @param pg the database context - * @param extension_name the name of the extension - * @param manifest JSON object of the configuration as string - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_set_extension_manifest (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *extension_name, - const char *manifest); - -#endif diff --git a/src/include/taler/exchange-database/set_purse_balance.h b/src/include/taler/exchange-database/set_purse_balance.h @@ -1,44 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/set_purse_balance.h - * @brief implementation of the set_purse_balance function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_SET_PURSE_BALANCE_H -#define EXCHANGE_DATABASE_SET_PURSE_BALANCE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Set the current @a balance in the purse - * identified by @a purse_pub. Used by the auditor - * to update the balance as calculated by the auditor. - * - * @param pg the database context - * @param purse_pub public key of a purse - * @param balance new balance to store under the purse - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_set_purse_balance (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_PurseContractPublicKeyP * - purse_pub, - const struct TALER_Amount *balance); - -#endif diff --git a/src/include/taler/exchange-database/start_deferred_wire_out.h b/src/include/taler/exchange-database/start_deferred_wire_out.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/start_deferred_wire_out.h - * @brief implementation of the start_deferred_wire_out function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_START_DEFERRED_WIRE_OUT_H -#define EXCHANGE_DATABASE_START_DEFERRED_WIRE_OUT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Starts a READ COMMITTED transaction where we transiently violate the foreign - * constraints on the "wire_out" table as we insert aggregations - * and only add the wire transfer out at the end. - * - * @param pg the database context - * @return #GNUNET_OK on success - */ -enum GNUNET_GenericReturnValue -TALER_TALER_EXCHANGEDB_start_deferred_wire_out (struct - TALER_EXCHANGEDB_PostgresContext - *pg); - -#endif diff --git a/src/include/taler/exchange-database/start_read_committed.h b/src/include/taler/exchange-database/start_read_committed.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/start_read_committed.h - * @brief implementation of the start_read_committed function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_START_READ_COMMITTED_H -#define EXCHANGE_DATABASE_START_READ_COMMITTED_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Start a READ COMMITTED transaction. - * - * @param pg the database context - * @param name unique name identifying the transaction (for debugging) - * must point to a constant - * @return #GNUNET_OK on success - */ -enum GNUNET_GenericReturnValue -TALER_TALER_EXCHANGEDB_start_read_committed (struct - TALER_EXCHANGEDB_PostgresContext * - pg, - const char *name); - -#endif diff --git a/src/include/taler/exchange-database/start_read_only.h b/src/include/taler/exchange-database/start_read_only.h @@ -1,42 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/start_read_only.h - * @brief implementation of the start_read_only function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_START_READ_ONLY_H -#define EXCHANGE_DATABASE_START_READ_ONLY_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Start a READ ONLY serializable transaction. - * - * @param pg the database context - * @param name unique name identifying the transaction (for debugging) - * must point to a constant - * @return #GNUNET_OK on success - */ -enum GNUNET_GenericReturnValue -TALER_TALER_EXCHANGEDB_start_read_only (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *name); - -#endif diff --git a/src/include/taler/exchange-database/store_wire_transfer_out.h b/src/include/taler/exchange-database/store_wire_transfer_out.h @@ -1,55 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/store_wire_transfer_out.h - * @brief implementation of the store_wire_transfer_out function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_STORE_WIRE_TRANSFER_OUT_H -#define EXCHANGE_DATABASE_STORE_WIRE_TRANSFER_OUT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Store information about an outgoing wire transfer that was executed. - * - * @param pg the database context - * @param date time of the wire transfer - * @param wtid subject of the wire transfer - * @param h_payto identifies the receiver account of the wire transfer - * @param exchange_account_section configuration section of the exchange specifying the - * exchange's bank account being used - * @param amount amount that was transmitted - * @param extra_wire_subject_metadata additional meta data for the wire transfer subject, can be NULL - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_store_wire_transfer_out (struct - TALER_EXCHANGEDB_PostgresContext *pg, - struct GNUNET_TIME_Timestamp date, - const struct - TALER_WireTransferIdentifierRawP *wtid - , - const struct TALER_FullPaytoHashP * - h_payto, - const char *exchange_account_section, - const struct TALER_Amount *amount, - const char * - extra_wire_subject_metadata); - -#endif diff --git a/src/include/taler/exchange-database/test_aml_officer.h b/src/include/taler/exchange-database/test_aml_officer.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/test_aml_officer.h - * @brief implementation of the test_aml_officer function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_TEST_AML_OFFICER_H -#define EXCHANGE_DATABASE_TEST_AML_OFFICER_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Test if the given AML staff member is active - * (at least read-only). - * - * @param pg the database context - * @param decider_pub public key of the staff member - * @param[out] read_only set to true if the member is read-only - * @return database transaction status, if member is unknown or not active, 1 if member is active - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_test_aml_officer (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_AmlOfficerPublicKeyP * - decider_pub, - bool *read_only); - - -#endif diff --git a/src/include/taler/exchange-database/trigger_kyc_rule_for_account.h b/src/include/taler/exchange-database/trigger_kyc_rule_for_account.h @@ -1,69 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/trigger_kyc_rule_for_account.h - * @brief implementation of the trigger_kyc_rule_for_account function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_TRIGGER_KYC_RULE_FOR_ACCOUNT_H -#define EXCHANGE_DATABASE_TRIGGER_KYC_RULE_FOR_ACCOUNT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert KYC requirement for @a h_payto account into table. - * - * @param pg the database context - * @param payto_uri account that must be KYC'ed, - * can be NULL if @a h_payto is already - * guaranteed to be in wire_targets - * @param h_payto hash of @a payto_uri - * @param set_account_pub public key to enable for the - * KYC authorization, NULL if not known - * @param check_merchant_pub public key that must already - * be enabled for a KYC authorzation for it to be - * valid, NULL if not known - * @param jmeasures serialized MeasureSet to put in place - * @param display_priority priority of the rule - * @param[out] requirement_row set to legitimization requirement row for this check - * @param[out] bad_kyc_auth set if @a check_account_pub - * did not match the existing KYC auth - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_trigger_kyc_rule_for_account (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct TALER_FullPayto - payto_uri, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - const union - TALER_AccountPublicKeyP * - set_account_pub, - const struct - TALER_MerchantPublicKeyP * - check_merchant_pub, - const json_t *jmeasures, - uint32_t display_priority, - uint64_t *requirement_row, - bool *bad_kyc_auth); - -#endif diff --git a/src/include/taler/exchange-database/update_aggregation_transient.h b/src/include/taler/exchange-database/update_aggregation_transient.h @@ -1,54 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/update_aggregation_transient.h - * @brief implementation of the update_aggregation_transient function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_UPDATE_AGGREGATION_TRANSIENT_H -#define EXCHANGE_DATABASE_UPDATE_AGGREGATION_TRANSIENT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Update existing entry in the transient aggregation table. - * @a h_payto is only needed for query performance. - * - * @param pg the database context - * @param h_payto destination of the wire transfer - * @param wtid the raw wire transfer identifier to update - * @param kyc_requirement_row row in legitimization_requirements that need to be satisfied to continue, or 0 for none - * @param total new total amount to be wired in the future - * @return transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_update_aggregation_transient (struct - TALER_EXCHANGEDB_PostgresContext - *pg, - const struct - TALER_FullPaytoHashP * - h_payto, - const struct - TALER_WireTransferIdentifierRawP - *wtid, - uint64_t kyc_requirement_row, - const struct TALER_Amount *total) -; - -#endif diff --git a/src/include/taler/exchange-database/update_auditor.h b/src/include/taler/exchange-database/update_auditor.h @@ -1,48 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/update_auditor.h - * @brief implementation of the update_auditor function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_UPDATE_AUDITOR_H -#define EXCHANGE_DATABASE_UPDATE_AUDITOR_H - -#include "taler/taler_util.h" -#include "taler/taler_exchangedb_lib.h" - -/** - * Update information about an auditor that will audit this exchange. - * - * @param pg the database context - * @param auditor_pub key of the auditor (primary key for the existing record) - * @param auditor_url base URL of the auditor's REST service, to be updated - * @param auditor_name name of the auditor (for humans) - * @param change_date date when the auditor status was last changed - * (only to be used for replay detection) - * @param enabled true to enable, false to disable - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_update_auditor (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_AuditorPublicKeyP * - auditor_pub, - const char *auditor_url, - const char *auditor_name, - struct GNUNET_TIME_Timestamp change_date, - bool enabled); - -#endif diff --git a/src/include/taler/exchange-database/update_kyc_process_by_row.h b/src/include/taler/exchange-database/update_kyc_process_by_row.h @@ -1,65 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/update_kyc_process_by_row.h - * @brief implementation of the update_kyc_process_by_row function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_UPDATE_KYC_PROCESS_BY_ROW_H -#define EXCHANGE_DATABASE_UPDATE_KYC_PROCESS_BY_ROW_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Update KYC requirement check with provider-linkage and/or - * expiration data. - * - * @param pg the database context - * @param process_row row to select by - * @param provider_name provider that must be checked (technically redundant) - * @param h_payto account that must be KYC'ed (helps access by shard, otherwise also redundant) - * @param provider_account_id provider account ID - * @param provider_legitimization_id provider legitimization ID - * @param redirect_url where the user should be redirected to start the KYC process - * @param expiration how long is this KYC check set to be valid (in the past if invalid) - * @param ec error code, #TALER_EC_NONE on success - * @param error_message_hint human-readable error message details (in addition to @a ec, NULL on success) - * @param finished true to mark the process as done - * @return database transaction status - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_update_kyc_process_by_row (struct - TALER_EXCHANGEDB_PostgresContext *pg - , - uint64_t process_row, - const char *provider_name, - const struct - TALER_NormalizedPaytoHashP * - h_payto, - const char *provider_account_id, - const char * - provider_legitimization_id, - const char *redirect_url, - struct GNUNET_TIME_Absolute - expiration, - enum TALER_ErrorCode ec, - const char *error_message_hint, - bool finished); - -#endif diff --git a/src/include/taler/exchange-database/update_wire.h b/src/include/taler/exchange-database/update_wire.h @@ -1,61 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/update_wire.h - * @brief implementation of the update_wire function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_UPDATE_WIRE_H -#define EXCHANGE_DATABASE_UPDATE_WIRE_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Update information about a wire account of the exchange. - * - * @param pg the database context - * @param payto_uri account the update is about - * @param conversion_url URL of a conversion service, NULL if there is no conversion - * @param open_banking_gateway open banking gateway service, NULL if unavailable - * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable - * @param debit_restrictions JSON array with debit restrictions on the account; NULL allowed if not @a enabled - * @param credit_restrictions JSON array with credit restrictions on the account; NULL allowed if not @a enabled - * @param change_date date when the account status was last changed - * (only to be used for replay detection) - * @param master_sig master signature to store, can be NULL (if @a enabled is false) - * @param bank_label label to show this entry under in the UI, can be NULL - * @param priority determines order in which entries are shown in the UI - * @param enabled true to enable, false to disable (the actual change) - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_update_wire (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_FullPayto payto_uri, - const char *conversion_url, - const char *open_banking_gateway, - const char *wire_transfer_gateway, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - struct GNUNET_TIME_Timestamp change_date, - const struct TALER_MasterSignatureP *master_sig, - const char *bank_label, - int64_t priority, - bool enabled); - -#endif diff --git a/src/include/taler/exchange-database/wad_in_insert.h b/src/include/taler/exchange-database/wad_in_insert.h @@ -1,52 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/wad_in_insert.h - * @brief implementation of the wad_in_insert function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_WAD_IN_INSERT_H -#define EXCHANGE_DATABASE_WAD_IN_INSERT_H - -#include "taler/taler_util.h" -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Insert an incoming WAD wire transfer into the database. - * - * @param pg the database context - * @param wad_id WAD identifier - * @param origin_exchange_url exchange base URL originating the transfer - * @param amount the amount that was transferred - * @param execution_date when was the transfer made - * @param debit_account_uri URI of the debit account - * @param section_name section of the exchange bank account that received the transfer - * @param serial_id bank-specific row identifying the transfer - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_wad_in_insert (struct TALER_EXCHANGEDB_PostgresContext *pg, - const struct TALER_WadIdentifierP *wad_id, - const char *origin_exchange_url, - const struct TALER_Amount *amount, - struct GNUNET_TIME_Timestamp execution_date, - const struct TALER_FullPayto debit_account_uri, - const char *section_name, - uint64_t serial_id); - - -#endif diff --git a/src/include/taler/exchange-database/wire_prepare_data_get.h b/src/include/taler/exchange-database/wire_prepare_data_get.h @@ -1,63 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/wire_prepare_data_get.h - * @brief implementation of the wire_prepare_data_get function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_GET_H -#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_GET_H - -#include "taler/taler_json_lib.h" -#include "taler/taler_exchangedb_lib.h" - - -/** - * Callback with data about a prepared wire transfer. - * - * @param cls closure - * @param rowid row identifier used to mark prepared transaction as done - * @param wire_method which wire method is this preparation data for - * @param buf transaction data that was persisted, NULL on error - * @param buf_size number of bytes in @a buf, 0 on error - */ -typedef void -(*TALER_EXCHANGEDB_WirePreparationIterator) (void *cls, - uint64_t rowid, - const char *wire_method, - const char *buf, - size_t buf_size); - -/** - * Function called to get an unfinished wire transfer - * preparation data. Fetches at most one item. - * - * @param pg the database context - * @param start_row offset to query table at - * @param limit maximum number of results to return - * @param cb function to call for ONE unfinished item - * @param cb_cls closure for @a cb - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_wire_prepare_data_get ( - struct TALER_EXCHANGEDB_PostgresContext *pg, - uint64_t start_row, - uint64_t limit, - TALER_EXCHANGEDB_WirePreparationIterator cb, - void *cb_cls); - -#endif diff --git a/src/include/taler/exchange-database/wire_prepare_data_insert.h b/src/include/taler/exchange-database/wire_prepare_data_insert.h @@ -1,43 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/wire_prepare_data_insert.h - * @brief implementation of the wire_prepare_data_insert function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_INSERT_H -#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_INSERT_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to insert wire transfer commit data into the DB. - * - * @param pg the database context - * @param type type of the wire transfer (i.e. "iban") - * @param buf buffer with wire transfer preparation data - * @param buf_size number of bytes in @a buf - * @return query status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_wire_prepare_data_insert (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const char *type, - const char *buf, - size_t buf_size); - -#endif diff --git a/src/include/taler/exchange-database/wire_prepare_data_mark_failed.h b/src/include/taler/exchange-database/wire_prepare_data_mark_failed.h @@ -1,41 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/wire_prepare_data_mark_failed.h - * @brief implementation of the wire_prepare_data_mark_failed function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FAILED_H -#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FAILED_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to mark wire transfer commit data as failed. - * - * @param pg the database context - * @param rowid which entry to mark as failed - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_wire_prepare_data_mark_failed (struct - TALER_EXCHANGEDB_PostgresContext - *pg - , - uint64_t rowid); - -#endif diff --git a/src/include/taler/exchange-database/wire_prepare_data_mark_finished.h b/src/include/taler/exchange-database/wire_prepare_data_mark_finished.h @@ -1,41 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2022 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ -/** - * @file src/include/taler/exchange-database/wire_prepare_data_mark_finished.h - * @brief implementation of the wire_prepare_data_mark_finished function for Postgres - * @author Christian Grothoff - */ -#ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FINISHED_H -#define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_MARK_FINISHED_H - -#include "taler/taler_exchangedb_lib.h" - - -/** - * Function called to mark wire transfer commit data as finished. - * - * @param pg the database context - * @param rowid which entry to mark as finished - * @return transaction status code - */ -enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_wire_prepare_data_mark_finished (struct - TALER_EXCHANGEDB_PostgresContext - * - pg, - uint64_t rowid); - -#endif diff --git a/src/include/taler/meson.build b/src/include/taler/meson.build @@ -1,6 +1,5 @@ subdir('exchange') - talerinclude_headers = [ 'taler_auditor_service.h', 'taler_amount_lib.h', diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c @@ -30,13 +30,13 @@ #include "taler/taler_testing_lib.h" #include "taler/taler_exchangedb_lib.h" #include "taler/taler_exchangedb_lib.h" -#include "taler/exchange-database/rollback.h" -#include "taler/exchange-database/start.h" /* UNNECESSARY? */ -#include "taler/exchange-database/commit.h" -#include "taler/exchange-database/preflight.h" -#include "taler/exchange-database/do_deposit.h" -#include "taler/exchange-database/insert_denomination_info.h" -#include "taler/exchange-database/ensure_coin_known.h" +#include "exchange-database/rollback.h" +#include "exchange-database/start.h" /* UNNECESSARY? */ +#include "exchange-database/commit.h" +#include "exchange-database/preflight.h" +#include "exchange-database/do_deposit.h" +#include "exchange-database/insert_denomination_info.h" +#include "exchange-database/ensure_coin_known.h" /** * State for a "insert-deposit" CMD.