exchange

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

exchange-0002.sql.in (4195B)


      1 --
      2 -- This file is part of TALER
      3 -- Copyright (C) 2014--2023 Taler Systems SA
      4 --
      5 -- TALER is free software; you can redistribute it and/or modify it under the
      6 -- terms of the GNU General Public License as published by the Free Software
      7 -- Foundation; either version 3, or (at your option) any later version.
      8 --
      9 -- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11 -- A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 --
     13 -- You should have received a copy of the GNU General Public License along with
     14 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 --
     16 
     17 BEGIN;
     18 
     19 SELECT _v.register_patch('exchange-0002', NULL, NULL);
     20 SET search_path TO exchange;
     21 
     22 CREATE DOMAIN gnunet_hashcode
     23   AS BYTEA
     24   CHECK(LENGTH(VALUE) = 32);
     25 
     26 CREATE TYPE taler_amount
     27   AS
     28   (val INT8
     29   ,frac INT4
     30   );
     31 COMMENT ON TYPE taler_amount
     32   IS 'Stores an amount, fraction is in units of 1/100000000 of the base value';
     33 
     34 CREATE TYPE exchange_do_array_reserve_insert_return_type
     35   AS
     36   (transaction_duplicate BOOLEAN
     37   ,ruuid INT8
     38   );
     39 COMMENT ON TYPE exchange_do_array_reserve_insert_return_type
     40   IS 'Return type for exchange_do_array_reserves_insert() stored procedure';
     41 
     42 CREATE TYPE exchange_do_select_deposits_missing_wire_return_type
     43   AS
     44   (
     45     batch_deposit_serial_id INT8,
     46     total_amount taler_amount,
     47     wire_target_h_payto BYTEA,
     48     deadline INT8
     49   );
     50 COMMENT ON TYPE exchange_do_select_deposits_missing_wire_return_type
     51   IS 'Return type for exchange_do_select_deposits_missing_wire';
     52 
     53 CREATE TYPE exchange_do_select_aggregations_above_serial_return_type
     54   AS
     55   (
     56     batch_deposit_serial_id INT8,
     57     aggregation_serial_id INT8,
     58     total_amount taler_amount
     59   );
     60 COMMENT ON TYPE exchange_do_select_aggregations_above_serial_return_type
     61   IS 'Return type for exchange_do_select_aggregations_above_serial';
     62 
     63 
     64 #include "0002-denominations.sql"
     65 #include "0002-denomination_revocations.sql"
     66 #include "0002-wire_targets.sql"
     67 #include "0002-kyc_alerts.sql"
     68 #include "0002-wire_fee.sql"
     69 #include "0002-global_fee.sql"
     70 #include "0002-wire_accounts.sql"
     71 #include "0002-auditors.sql"
     72 #include "0002-auditor_denom_sigs.sql"
     73 #include "0002-exchange_sign_keys.sql"
     74 #include "0002-signkey_revocations.sql"
     75 #include "0002-extensions.sql"
     76 #include "0002-policy_fulfillments.sql"
     77 #include "0002-policy_details.sql"
     78 #include "0002-profit_drains.sql"
     79 #include "0002-legitimization_measures.sql"
     80 #include "0002-legitimization_outcomes.sql"
     81 #include "0002-legitimization_processes.sql"
     82 
     83 
     84 #include "0002-reserves.sql"
     85 #include "0002-reserve_history.sql"
     86 #include "0002-reserves_in.sql"
     87 #include "0002-reserves_close.sql"
     88 #include "0002-close_requests.sql"
     89 #include "0002-reserves_open_deposits.sql"
     90 #include "0002-reserves_open_requests.sql"
     91 #include "0002-known_coins.sql"
     92 #include "0002-coin_history.sql"
     93 #include "0002-batch_deposits.sql"
     94 #include "0002-coin_deposits.sql"
     95 #include "0002-refunds.sql"
     96 #include "0002-wire_out.sql"
     97 #include "0002-aggregation_transient.sql"
     98 #include "0002-aggregation_tracking.sql"
     99 #include "0002-unique_refresh_blinding_seed.sql"
    100 #include "0002-refresh.sql"
    101 #include "0002-unique_withdraw_blinding_seed.sql"
    102 #include "0002-withdraw.sql"
    103 #include "0002-recoup.sql"
    104 #include "0002-recoup_refresh.sql"
    105 #include "0002-prewire.sql"
    106 #include "0002-cs_nonce_locks.sql"
    107 #include "0002-purse_requests.sql"
    108 #include "0002-purse_merges.sql"
    109 #include "0002-account_merges.sql"
    110 #include "0002-purse_decision.sql"
    111 #include "0002-contracts.sql"
    112 #include "0002-history_requests.sql"
    113 #include "0002-purse_deposits.sql"
    114 #include "0002-wads_in.sql"
    115 #include "0002-wad_in_entries.sql"
    116 #include "0002-wads_out.sql"
    117 #include "0002-wad_out_entries.sql"
    118 #include "0002-work_shards.sql"
    119 #include "0002-revolving_work_shards.sql"
    120 #include "0002-partners.sql"
    121 #include "0002-partner_accounts.sql"
    122 #include "0002-purse_actions.sql"
    123 #include "0002-purse_deletion.sql"
    124 
    125 #include "0002-kyc_attributes.sql"
    126 
    127 #include "0002-kycauths_in.sql"
    128 #include "0002-kyc_events.sql"
    129 #include "0002-aml_staff.sql"
    130 #include "0002-aml_history.sql"
    131 
    132 #include "0002-statistics.sql"
    133 
    134 COMMIT;