exchange

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

0002-auditor_denomination_pending.sql (1830B)


      1 --
      2 -- This file is part of TALER
      3 -- Copyright (C) 2014--2022 Taler Systems SA
      4 --
      5 -- TALER is free software; you can redistribute it and/or modify it under the
      6 -- terms of the GNU General Public License as published by the Free Software
      7 -- Foundation; either version 3, or (at your option) any later version.
      8 --
      9 -- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11 -- A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 --
     13 -- You should have received a copy of the GNU General Public License along with
     14 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 --
     16 
     17 CREATE TABLE auditor_denomination_pending
     18   (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
     19   ,denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)
     20   ,denom_balance taler_amount NOT NULL
     21   ,denom_loss taler_amount NOT NULL
     22   ,num_issued BIGINT NOT NULL
     23   ,denom_risk taler_amount NOT NULL
     24   ,recoup_loss taler_amount NOT NULL
     25 );
     26 COMMENT ON TABLE auditor_denomination_pending
     27   IS 'outstanding denomination coins that the exchange is aware of and what the respective balances are (outstanding as well as issued overall which implies the maximum value at risk).';
     28 COMMENT ON COLUMN auditor_denomination_pending.num_issued
     29   IS 'counts the number of coins issued (withdraw, refresh) of this denomination';
     30 COMMENT ON COLUMN auditor_denomination_pending.denom_risk
     31   IS 'amount that could theoretically be lost in the future due to recoup operations';
     32 COMMENT ON COLUMN auditor_denomination_pending.denom_loss
     33   IS 'amount that was lost due to failures by the exchange';
     34 COMMENT ON COLUMN auditor_denomination_pending.recoup_loss
     35   IS 'amount actually lost due to recoup operations after a revocation';