summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/auditor/.gitignore4
-rw-r--r--src/auditor/Makefile.am2
-rw-r--r--src/auditor/auditor-basedb-libeufin.sql138
-rw-r--r--src/auditor/auditor-basedb.age2
-rw-r--r--src/auditor/auditor-basedb.conf254
-rw-r--r--src/auditor/auditor-basedb.feesbin800 -> 0 bytes
-rw-r--r--src/auditor/auditor-basedb.mpub2
-rw-r--r--src/auditor/auditor-basedb.sql11610
-rw-r--r--src/auditor/batch.conf12
-rwxr-xr-xsrc/auditor/batch.sh2
-rw-r--r--src/auditor/generate-auditor-basedb.conf4
-rwxr-xr-xsrc/auditor/generate-auditor-basedb.sh106
-rwxr-xr-xsrc/auditor/generate-revoke-basedb.sh33
-rw-r--r--src/auditor/report-lib.c11
-rw-r--r--src/auditor/report-lib.h5
-rw-r--r--src/auditor/revoke-basedb-libeufin.sql163
-rw-r--r--src/auditor/revoke-basedb.age2
-rw-r--r--src/auditor/revoke-basedb.conf8
-rw-r--r--src/auditor/revoke-basedb.feesbin800 -> 0 bytes
-rw-r--r--src/auditor/revoke-basedb.mpub2
-rw-r--r--src/auditor/revoke-basedb.sql11638
-rw-r--r--src/auditor/taler-auditor-sync.c14
-rw-r--r--src/auditor/taler-auditor.in15
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c215
-rw-r--r--src/auditor/taler-helper-auditor-coins.c526
-rw-r--r--src/auditor/taler-helper-auditor-deposits.c2
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c797
-rw-r--r--src/auditor/taler-helper-auditor-wire.c277
-rwxr-xr-xsrc/auditor/test-auditor.sh488
-rwxr-xr-xsrc/auditor/test-revocation.sh115
-rwxr-xr-xsrc/auditor/test-sync.sh4
-rw-r--r--src/auditordb/Makefile.am6
-rw-r--r--src/auditordb/auditor-0001.sql21
-rw-r--r--src/auditordb/drop.sql26
-rw-r--r--src/auditordb/drop0001.sql50
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c173
-rw-r--r--src/auditordb/restart.sql (renamed from src/auditordb/restart0001.sql)2
-rw-r--r--src/auditordb/test_auditordb.c74
-rw-r--r--src/auditordb/versioning.sql (renamed from src/auditordb/auditor-0000.sql)0
-rw-r--r--src/bank-lib/bank_api_credit.c3
-rw-r--r--src/bank-lib/fakebank.c417
-rwxr-xr-xsrc/bank-lib/test_bank.sh7
-rw-r--r--src/benchmark/Makefile.am4
-rw-r--r--src/benchmark/taler-aggregator-benchmark.c3
-rw-r--r--src/benchmark/taler-bank-benchmark.c129
-rw-r--r--src/exchange-tools/Makefile.am1
-rw-r--r--src/exchange-tools/taler-crypto-worker.c49
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c95
-rw-r--r--src/exchange-tools/taler-exchange-offline.c285
-rw-r--r--src/exchange/Makefile.am20
-rw-r--r--src/exchange/taler-exchange-aggregator.c783
-rw-r--r--src/exchange/taler-exchange-drain.c431
-rw-r--r--src/exchange/taler-exchange-httpd.c69
-rw-r--r--src/exchange/taler-exchange-httpd.h7
-rw-r--r--src/exchange/taler-exchange-httpd_batch-deposit.c700
-rw-r--r--src/exchange/taler-exchange-httpd_batch-deposit.h49
-rw-r--r--src/exchange/taler-exchange-httpd_batch-withdraw.c167
-rw-r--r--src/exchange/taler-exchange-httpd_common_deposit.c310
-rw-r--r--src/exchange/taler-exchange-httpd_common_deposit.h130
-rw-r--r--src/exchange/taler-exchange-httpd_csr.c2
-rw-r--r--src/exchange/taler-exchange-httpd_db.c6
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c46
-rw-r--r--src/exchange/taler-exchange-httpd_deposits_get.c14
-rw-r--r--src/exchange/taler-exchange-httpd_extensions.c13
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c473
-rw-r--r--src/exchange/taler-exchange-httpd_keys.h18
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.c352
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.h2
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-proof.c671
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-proof.h2
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-wallet.c121
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-webhook.c347
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-webhook.h64
-rw-r--r--src/exchange/taler-exchange-httpd_management.h13
-rw-r--r--src/exchange/taler-exchange-httpd_management_drain.c195
-rw-r--r--src/exchange/taler-exchange-httpd_management_extensions.c12
-rw-r--r--src/exchange/taler-exchange-httpd_management_post_keys.c20
-rw-r--r--src/exchange/taler-exchange-httpd_melt.c2
-rw-r--r--src/exchange/taler-exchange-httpd_metrics.c35
-rw-r--r--src/exchange/taler-exchange-httpd_metrics.h31
-rw-r--r--src/exchange/taler-exchange-httpd_purses_create.c597
-rw-r--r--src/exchange/taler-exchange-httpd_purses_deposit.c299
-rw-r--r--src/exchange/taler-exchange-httpd_purses_get.c8
-rw-r--r--src/exchange/taler-exchange-httpd_purses_merge.c208
-rw-r--r--src/exchange/taler-exchange-httpd_recoup-refresh.c2
-rw-r--r--src/exchange/taler-exchange-httpd_recoup.c2
-rw-r--r--src/exchange/taler-exchange-httpd_refreshes_reveal.c57
-rw-r--r--src/exchange/taler-exchange-httpd_refund.c14
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_get.c2
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_history.c60
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_purse.c331
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_purse.h2
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_status.c35
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c244
-rw-r--r--src/exchange/taler-exchange-httpd_responses.h61
-rw-r--r--src/exchange/taler-exchange-httpd_wire.c1
-rw-r--r--src/exchange/taler-exchange-httpd_withdraw.c180
-rw-r--r--src/exchange/taler-exchange-router.c4
-rw-r--r--src/exchange/taler-exchange-transfer.c4
-rw-r--r--src/exchange/taler-exchange-wirewatch.c541
-rw-r--r--src/exchangedb/Makefile.am49
-rw-r--r--src/exchangedb/common-0001.sql162
-rw-r--r--src/exchangedb/drop-common.sql95
-rw-r--r--src/exchangedb/drop.sql (renamed from src/exchangedb/drop0001-shard-part.sql)10
-rw-r--r--src/exchangedb/drop0001-exchange-part.sql107
-rw-r--r--src/exchangedb/exchange-0000.sql293
-rw-r--r--src/exchangedb/exchange-0001-part.sql2206
-rw-r--r--src/exchangedb/exchange-0001.sql.in33
-rw-r--r--src/exchangedb/exchangedb_transactions.c12
-rw-r--r--src/exchangedb/irbt_callbacks.c379
-rw-r--r--src/exchangedb/lrbt_callbacks.c726
-rw-r--r--src/exchangedb/plugin_exchangedb_common.c25
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c4266
-rw-r--r--src/exchangedb/procedures.sql2130
-rw-r--r--src/exchangedb/shard-0001-part.sql169
-rw-r--r--src/exchangedb/shard-0001.sql.in33
-rw-r--r--src/exchangedb/test_exchangedb.c52
-rw-r--r--src/exchangedb/versioning.sql (renamed from src/exchangedb/benchmark-0000.sql)0
-rw-r--r--src/extensions/Makefile.am3
-rw-r--r--src/extensions/extension_age_restriction.c92
-rw-r--r--src/extensions/extensions.c6
-rw-r--r--src/include/.gitignore1
-rw-r--r--src/include/Makefile.am2
-rw-r--r--src/include/taler_auditordb_plugin.h79
-rw-r--r--src/include/taler_crypto_lib.h455
-rw-r--r--src/include/taler_exchange_service.h835
-rw-r--r--src/include/taler_exchangedb_lib.h2
-rw-r--r--src/include/taler_exchangedb_plugin.h1226
-rw-r--r--src/include/taler_extensions.h93
-rw-r--r--src/include/taler_json_lib.h127
-rw-r--r--src/include/taler_kyclogic_lib.h254
-rw-r--r--src/include/taler_kyclogic_plugin.h367
-rw-r--r--src/include/taler_signatures.h393
-rw-r--r--src/include/taler_testing_lib.h94
-rw-r--r--src/include/taler_util.h36
-rw-r--r--src/json/json_helper.c386
-rw-r--r--src/json/json_pack.c75
-rw-r--r--src/kyclogic/Makefile.am76
-rw-r--r--src/kyclogic/kyclogic-oauth2.conf27
-rw-r--r--src/kyclogic/kyclogic.conf15
-rw-r--r--src/kyclogic/kyclogic_api.c1132
-rw-r--r--src/kyclogic/plugin_kyclogic_oauth2.c1265
-rw-r--r--src/kyclogic/plugin_kyclogic_template.c443
-rw-r--r--src/kyclogic/sample.conf33
-rw-r--r--src/kyclogic/taler-exchange-kyc-tester.c1493
-rw-r--r--src/lib/Makefile.am6
-rw-r--r--src/lib/auditor_api_deposit_confirmation.c1
-rw-r--r--src/lib/exchange_api_auditor_add_denomination.c13
-rw-r--r--src/lib/exchange_api_batch_deposit.c657
-rw-r--r--src/lib/exchange_api_batch_withdraw.c437
-rw-r--r--src/lib/exchange_api_batch_withdraw2.c561
-rw-r--r--src/lib/exchange_api_common.c2381
-rw-r--r--src/lib/exchange_api_common.h221
-rw-r--r--src/lib/exchange_api_deposit.c468
-rw-r--r--src/lib/exchange_api_deposits_get.c100
-rw-r--r--src/lib/exchange_api_handle.c338
-rw-r--r--src/lib/exchange_api_handle.h5
-rw-r--r--src/lib/exchange_api_kyc_check.c6
-rw-r--r--src/lib/exchange_api_kyc_proof.c18
-rw-r--r--src/lib/exchange_api_kyc_wallet.c7
-rw-r--r--src/lib/exchange_api_management_auditor_disable.c13
-rw-r--r--src/lib/exchange_api_management_auditor_enable.c13
-rw-r--r--src/lib/exchange_api_management_drain_profits.c213
-rw-r--r--src/lib/exchange_api_management_post_extensions.c25
-rw-r--r--src/lib/exchange_api_management_post_keys.c13
-rw-r--r--src/lib/exchange_api_management_revoke_denomination_key.c12
-rw-r--r--src/lib/exchange_api_management_revoke_signing_key.c13
-rw-r--r--src/lib/exchange_api_management_set_global_fee.c13
-rw-r--r--src/lib/exchange_api_management_set_wire_fee.c13
-rw-r--r--src/lib/exchange_api_management_wire_disable.c13
-rw-r--r--src/lib/exchange_api_management_wire_enable.c13
-rw-r--r--src/lib/exchange_api_melt.c188
-rw-r--r--src/lib/exchange_api_purse_create_with_deposit.c413
-rw-r--r--src/lib/exchange_api_purse_create_with_merge.c189
-rw-r--r--src/lib/exchange_api_purse_deposit.c247
-rw-r--r--src/lib/exchange_api_purse_merge.c160
-rw-r--r--src/lib/exchange_api_recoup.c107
-rw-r--r--src/lib/exchange_api_recoup_refresh.c118
-rw-r--r--src/lib/exchange_api_refund.c60
-rw-r--r--src/lib/exchange_api_reserves_get.c2
-rw-r--r--src/lib/exchange_api_reserves_history.c72
-rw-r--r--src/lib/exchange_api_reserves_status.c4
-rw-r--r--src/lib/exchange_api_wire.c1
-rw-r--r--src/lib/exchange_api_withdraw.c31
-rw-r--r--src/lib/exchange_api_withdraw2.c44
-rw-r--r--src/testing/Makefile.am46
-rw-r--r--src/testing/test-taler-exchange-aggregator-postgres.conf2
-rw-r--r--src/testing/test-taler-exchange-wirewatch-postgres.conf2
-rw-r--r--src/testing/test_auditor_api-cs.conf4
-rw-r--r--src/testing/test_auditor_api-rsa.conf4
-rw-r--r--src/testing/test_auditor_api.c2
-rw-r--r--src/testing/test_bank_api.c20
-rw-r--r--src/testing/test_bank_api_fakebank.conf2
-rw-r--r--src/testing/test_bank_api_fakebank_twisted.conf4
-rw-r--r--src/testing/test_bank_api_nexus.conf10
-rw-r--r--src/testing/test_bank_api_pybank.conf21
-rw-r--r--src/testing/test_bank_api_pybank_twisted.conf43
-rw-r--r--src/testing/test_exchange_api-cs.conf4
-rw-r--r--src/testing/test_exchange_api-rsa.conf4
-rw-r--r--src/testing/test_exchange_api.c90
-rw-r--r--src/testing/test_exchange_api_keys_cherry_picking-cs.conf4
-rw-r--r--src/testing/test_exchange_api_keys_cherry_picking-rsa.conf4
-rw-r--r--src/testing/test_exchange_api_keys_cherry_picking.c2
-rw-r--r--src/testing/test_exchange_api_overlapping_keys_bug.c2
-rw-r--r--src/testing/test_exchange_api_revocation.c2
-rw-r--r--src/testing/test_exchange_api_twisted-cs.conf4
-rw-r--r--src/testing/test_exchange_api_twisted-rsa.conf4
-rw-r--r--src/testing/test_exchange_api_twisted.c2
-rw-r--r--src/testing/test_exchange_management_api.c14
-rw-r--r--src/testing/test_exchange_p2p.c35
-rw-r--r--src/testing/test_kyc_api.c261
-rw-r--r--src/testing/test_kyc_api.conf48
-rw-r--r--src/testing/test_taler_exchange_aggregator.c6
-rw-r--r--src/testing/test_taler_exchange_wirewatch.c2
-rw-r--r--src/testing/testing_api_cmd_auditor_exec_auditor.c1
-rw-r--r--src/testing/testing_api_cmd_bank_admin_add_incoming.c29
-rw-r--r--src/testing/testing_api_cmd_bank_admin_check.c1
-rw-r--r--src/testing/testing_api_cmd_bank_check.c2
-rw-r--r--src/testing/testing_api_cmd_bank_history_credit.c54
-rw-r--r--src/testing/testing_api_cmd_bank_history_debit.c18
-rw-r--r--src/testing/testing_api_cmd_batch_deposit.c624
-rw-r--r--src/testing/testing_api_cmd_batch_withdraw.c537
-rw-r--r--src/testing/testing_api_cmd_common.c111
-rw-r--r--src/testing/testing_api_cmd_deposit.c71
-rw-r--r--src/testing/testing_api_cmd_deposits_get.c4
-rw-r--r--src/testing/testing_api_cmd_exec_closer.c3
-rw-r--r--src/testing/testing_api_cmd_insert_deposit.c21
-rw-r--r--src/testing/testing_api_cmd_kyc_check_get.c2
-rw-r--r--src/testing/testing_api_cmd_kyc_proof.c28
-rw-r--r--src/testing/testing_api_cmd_kyc_wallet_get.c16
-rw-r--r--src/testing/testing_api_cmd_purse_create_deposit.c13
-rw-r--r--src/testing/testing_api_cmd_purse_deposit.c132
-rw-r--r--src/testing/testing_api_cmd_purse_merge.c146
-rw-r--r--src/testing/testing_api_cmd_recoup.c3
-rw-r--r--src/testing/testing_api_cmd_refresh.c67
-rw-r--r--src/testing/testing_api_cmd_reserve_history.c229
-rw-r--r--src/testing/testing_api_cmd_reserve_purse.c61
-rw-r--r--src/testing/testing_api_cmd_reserve_status.c150
-rw-r--r--src/testing/testing_api_cmd_withdraw.c95
-rw-r--r--src/testing/testing_api_helpers_bank.c38
-rw-r--r--src/testing/testing_api_helpers_exchange.c1
-rw-r--r--src/testing/testing_api_loop.c10
-rw-r--r--src/util/age_restriction.c1
-rw-r--r--src/util/crypto.c2
-rw-r--r--src/util/crypto_helper_rsa.c24
-rw-r--r--src/util/exchange_signatures.c13
-rw-r--r--src/util/merchant_signatures.c12
-rw-r--r--src/util/offline_signatures.c84
-rw-r--r--src/util/payto.c92
-rw-r--r--src/util/taler-exchange-secmod-cs.c8
-rw-r--r--src/util/taler-exchange-secmod-eddsa.c4
-rw-r--r--src/util/taler-exchange-secmod-rsa.c615
-rw-r--r--src/util/taler-exchange-secmod-rsa.h27
-rw-r--r--src/util/test_helper_rsa.c64
-rw-r--r--src/util/tv_age_restriction.c14
-rw-r--r--src/util/wallet_signatures.c73
257 files changed, 44126 insertions, 22542 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5d46850c..05c0b742 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,6 +25,7 @@ SUBDIRS = \
mhd \
bank-lib \
exchangedb \
+ kyclogic \
exchange \
auditordb \
auditor \
diff --git a/src/auditor/.gitignore b/src/auditor/.gitignore
index 6d25d8ba..59088a1b 100644
--- a/src/auditor/.gitignore
+++ b/src/auditor/.gitignore
@@ -19,3 +19,7 @@ generate-auditor-basedb-revocation.conf
revocation-tmp-*
auditor-basedb.wdb
taler-auditor-sync
+auditor-basedb.sqlite3
+taler-auditor-test.sqlite3
+libeufin-nexus.pid
+libeufin-sandbox.pid
diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am
index 6d49da6d..a74e0ad2 100644
--- a/src/auditor/Makefile.am
+++ b/src/auditor/Makefile.am
@@ -210,8 +210,10 @@ EXTRA_DIST = \
auditor-basedb.age \
auditor-basedb.conf \
auditor-basedb.sql \
+ auditor-basedb-libeufin.sql \
auditor-basedb.mpub \
revoke-basedb.age \
revoke-basedb.conf \
revoke-basedb.sql \
+ revoke-basedb-libeufin.sql \
revoke-basedb.mpub
diff --git a/src/auditor/auditor-basedb-libeufin.sql b/src/auditor/auditor-basedb-libeufin.sql
new file mode 100644
index 00000000..2392e6e4
--- /dev/null
+++ b/src/auditor/auditor-basedb-libeufin.sql
@@ -0,0 +1,138 @@
+PRAGMA foreign_keys=OFF;
+BEGIN TRANSACTION;
+CREATE TABLE DemobankConfigs (id INTEGER PRIMARY KEY AUTOINCREMENT, currency TEXT NOT NULL, allowRegistrations BOOLEAN NOT NULL, withSignupBonus BOOLEAN NOT NULL, bankDebtLimit INT NOT NULL, usersDebtLimit INT NOT NULL, hostname TEXT NOT NULL, suggestedExchangeBaseUrl TEXT NULL, suggestedExchangePayto TEXT NULL, uiTitle TEXT NOT NULL);
+INSERT INTO DemobankConfigs VALUES(1,'TESTKUDOS',1,0,1000000,1000,'default','http://localhost:8081/','payto://iban/SANDBOXX/DE514871?receiver-name=Exchange+Company','Demo Bank');
+CREATE TABLE EbicsSubscriberPublicKeys (id INTEGER PRIMARY KEY AUTOINCREMENT, rsaPublicKey BLOB NOT NULL, "state" INT NOT NULL);
+INSERT INTO EbicsSubscriberPublicKeys VALUES(1,X'30820122300d06092a864886f70d01010105000382010f003082010a0282010100a03098ff00d2f1d4f9ef23e8c29e687c9d206404605896c548793a0fd6ad563bcd256524b3ca2816c1df50252b3a413c8ee1781cfcaf06cfea4adc64b4a895768b2ef25fe38011364e5b8198a4aa0a517a64bf01a798ddb1200439990e13e4cb3c82d79b8ece3f725e0d81053d5a31befdeb6e2841dc0a5404aaf31d7b9ce5398d97f362a531d2a4b199669072bed882bd10fb354b45416544d975a5cbde40c000ebcac8a6038ba921a46a69e3b9dc87c7ae8e5a4805b45f08e25b6e76f746ed82a86f5ae10ac5b4107722119e67db808508c73643b95b1855e45cfa9095ee7b07ffdd86486611eef5d581235fe5008a7e079f0897aa7103969926a9e76f239f0203010001',1);
+INSERT INTO EbicsSubscriberPublicKeys VALUES(2,X'30820122300d06092a864886f70d01010105000382010f003082010a028201010080f109291d50ac1d186bc40584f8a2115d736d7ad311bd4f62a0f83e6bd49b847a6d8875d5f9e1bf4055cabefd619fee55cf21723799d2415018ac98275716c67ec6fb51f88fa4ca09c1bd710f16c7c2a09c4d5bac2666bede0325655a409d4a08cee6221be791984c65985d434bb2ca10603c84237633ba5d32c4220d2f0ef7c25b94c18edbe30a55da170531b3b1edfac012dea78696981a3967e9dfae10006dc0f8ce1f8af3c6e99ba57e1c30118ca90b43aea96a49df16169163b21274a6ce568e306b15da4b95720ab58ebdd2bb618cc5330b5c969b4ab57cee55e1413012d305ce8c1a16aa938e5940d5daca716408f8a0ff0c2da516baed034cbbfde10203010001',1);
+INSERT INTO EbicsSubscriberPublicKeys VALUES(3,X'30820122300d06092a864886f70d01010105000382010f003082010a0282010100b0ceebf64877cd9a8f331caa9c24ea334e4afc1b9744aff9ea02b14d973f86018e00955e8e9e109fd6b55021e15adff4f224cf0c0736ed203fbf914dda8555f66ddb921bf2560637f6b3457a46bc2b83bea579fdc0e8254de0320bf6686c2571581e38ee204b7c366ee3299b683251596548d8944f8110613ddf2004770722c76f8ff1000c76dca6560d7725e9fe5fa6bb053db0bd567fe0831966fe2f5020aecc35d40154bd91275e0ca72c83b67b26b7dd597e3bf0ed83434ec87d107ad2fbdc4a0df2ecf974b5f0446d517a8bfce43e855b848f212d99ffa7c7590d7d8dfc93657b3ade490696f1e55bb8681009dd4403e13f9abe1dce30f24895fa7e0c990203010001',1);
+CREATE TABLE BankAccountTransactions (id INTEGER PRIMARY KEY AUTOINCREMENT, creditorIban TEXT NOT NULL, creditorBic TEXT NULL, creditorName TEXT NOT NULL, debtorIban TEXT NOT NULL, debtorBic TEXT NULL, debtorName TEXT NOT NULL, subject TEXT NOT NULL, amount TEXT NOT NULL, currency TEXT NOT NULL, "date" BIGINT NOT NULL, accountServicerReference TEXT NOT NULL, pmtInfId TEXT NULL, direction TEXT NOT NULL, account INT NOT NULL, demobank BIGINT NOT NULL, CONSTRAINT fk_BankAccountTransactions_account_id FOREIGN KEY (account) REFERENCES BankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_BankAccountTransactions_demobank_id FOREIGN KEY (demobank) REFERENCES DemobankConfigs(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO BankAccountTransactions VALUES(1,'DE514871','SANDBOXX','Exchange Company','DE729925','SANDBOXX','Name unknown','HTW6DPCWEB0QCYAZ7ZTD89N17AMYR7BCRY06R727YNNJ47Q4GTHG','10','TESTKUDOS',1660496839825,'LWA21AG2',NULL,'CRDT',4,1);
+INSERT INTO BankAccountTransactions VALUES(2,'DE514871','SANDBOXX','Exchange Company','DE729925','SANDBOXX','Name unknown','HTW6DPCWEB0QCYAZ7ZTD89N17AMYR7BCRY06R727YNNJ47Q4GTHG','10','TESTKUDOS',1660496839825,'LWA21AG2',NULL,'DBIT',9,1);
+INSERT INTO BankAccountTransactions VALUES(3,'DE514871','SANDBOXX','Exchange Company','DE729731','SANDBOXX','Name unknown','K2V2B3YEMZFMWQ475KNV2HT7RSPA1YXFY210749MN9WBDCBT94AG','18','TESTKUDOS',1660496846987,'DLBB92WX',NULL,'CRDT',4,1);
+INSERT INTO BankAccountTransactions VALUES(4,'DE514871','SANDBOXX','Exchange Company','DE729731','SANDBOXX','Name unknown','K2V2B3YEMZFMWQ475KNV2HT7RSPA1YXFY210749MN9WBDCBT94AG','18','TESTKUDOS',1660496846987,'DLBB92WX',NULL,'DBIT',10,1);
+CREATE TABLE BankAccounts (id INTEGER PRIMARY KEY AUTOINCREMENT, iban TEXT NOT NULL, bic TEXT DEFAULT 'SANDBOXX' NOT NULL, label TEXT NOT NULL, owner TEXT NOT NULL, isPublic BOOLEAN DEFAULT 0 NOT NULL, demoBank BIGINT NOT NULL, lastTransaction BIGINT NULL, CONSTRAINT fk_BankAccounts_demoBank_id FOREIGN KEY (demoBank) REFERENCES DemobankConfigs(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_BankAccounts_lastTransaction_id FOREIGN KEY (lastTransaction) REFERENCES BankAccountTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO BankAccounts VALUES(1,'DE123633','SANDBOXX','bank','bank',0,1,NULL);
+INSERT INTO BankAccounts VALUES(2,'DE402450','SANDBOXX','fortytwo','fortytwo',0,1,NULL);
+INSERT INTO BankAccounts VALUES(3,'DE320557','SANDBOXX','fortythree','fortythree',0,1,NULL);
+INSERT INTO BankAccounts VALUES(4,'DE514871','SANDBOXX','exchange','exchange',0,1,3);
+INSERT INTO BankAccounts VALUES(5,'DE784482','SANDBOXX','tor','tor',0,1,NULL);
+INSERT INTO BankAccounts VALUES(6,'DE822276','SANDBOXX','gnunet','gnunet',0,1,NULL);
+INSERT INTO BankAccounts VALUES(7,'DE652970','SANDBOXX','tutorial','tutorial',0,1,NULL);
+INSERT INTO BankAccounts VALUES(8,'DE064323','SANDBOXX','survey','survey',0,1,NULL);
+INSERT INTO BankAccounts VALUES(9,'DE729925','SANDBOXX','testuser-hwi9z7th','testuser-hwi9z7th',0,1,2);
+INSERT INTO BankAccounts VALUES(10,'DE729731','SANDBOXX','testuser-7wwue25w','testuser-7wwue25w',0,1,4);
+CREATE TABLE EbicsSubscribers (id INTEGER PRIMARY KEY AUTOINCREMENT, userID TEXT NOT NULL, partnerID TEXT NOT NULL, systemID TEXT NULL, hostID TEXT NOT NULL, signatureKey INT NULL, encryptionKey INT NULL, authorizationKey INT NULL, nextOrderID INT NOT NULL, "state" INT NOT NULL, bankAccount INT NULL, CONSTRAINT fk_EbicsSubscribers_signatureKey_id FOREIGN KEY (signatureKey) REFERENCES EbicsSubscriberPublicKeys(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_EbicsSubscribers_encryptionKey_id FOREIGN KEY (encryptionKey) REFERENCES EbicsSubscriberPublicKeys(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_EbicsSubscribers_authorizationKey_id FOREIGN KEY (authorizationKey) REFERENCES EbicsSubscriberPublicKeys(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_EbicsSubscribers_bankAccount_id FOREIGN KEY (bankAccount) REFERENCES BankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO EbicsSubscribers VALUES(1,'exchangeebics','talerpartner',NULL,'talerebics',1,3,2,1,3,4);
+CREATE TABLE EbicsHosts (id INTEGER PRIMARY KEY AUTOINCREMENT, hostID TEXT NOT NULL, ebicsVersion TEXT NOT NULL, signaturePrivateKey BLOB NOT NULL, encryptionPrivateKey BLOB NOT NULL, authenticationPrivateKey BLOB NOT NULL);
+INSERT INTO EbicsHosts VALUES(1,'talerebics','2.5',X'308204be020100300d06092a864886f70d0101010500048204a8308204a40201000282010100845de39a06645e17048233a6b50ff54823e026751ab484cf07a946b6088c8a73daa9b8b8277644079fe629b65d453ad4edb4794b7b56ee544bb0aae275859f77d9efe33facd83c1b14f86e32d7435207b4065b48e7d5d3483d92dc7c62fb2ba454062b532e745a9d2c7d2b417557754fd008cb011dc0f3612a8b1f4cc2f182e7c185cba1d76b86cab98125c6c15c18cd320da84e40b9ab01802b3a0ec63dac7f442c16aec2e0f33ccc8323391f9a48d84aaf1003c6584e406d8aeb48abc07e96c40d9f4242494324bd203330bface36777358d4921c4c2e33d42ea396d1dc3151756949d863722156b0fe7dd81b255ee007b901b964c0284ac9cb163d2fbc5c10203010001028201002d78574444e7db8e8aa4f37b53fd8c63e0b7125eedf28f20d35fea0384424b196b471c465e7ff8f4a990164a28162d14922789f74d025ad2a841a32231fed9fe00e6b028e28651777827b32b51d93567a20700fab57135a83e46a1e934d3557598cb99bc745bd1f8e61c856c7213be1fd1b6038e799b1bc0082e4c6d411657c224b9506fe4d1f9faf2ea2033fb9e3ee40b00760d26736a4d16a2cc6b4b1f712986b297948a035389d2f38c55a970280b8761fa45f20901d962f4a9c700cdb0184c410ce3d16dc14ad1a032848005c80771bde19d91e50b72d114e425c3df7e2aa7ee4196ebb065384795c8b4083f86256d9173b7572429212eb9134820a90bc102818100ec7e1e2f558008cf3b72a23fa7ce8da27063218de040802332d6b42fcde3b01975bf8ecd6592fbfac7b026cd698333a3948c881028304d245480ffb70186f94d6b0f54e6dc3037e09fb457d172910dfbc80cf9358d22f976bcb76cfc88856abea327bd522d2cd39a9767a8ea13d9b407e86dbbb3707d51a92c418ccc56a6db79028181008f4900d763d26019866414ae122b9ed02cb8660d63697a5ec07fc17195958e732861569e677015a6c31df9d3629ad5e50465abab6266af0a0dcdadb6a3336772d93bdd292b2782e84b1969fe4f5e4f25983de8209846702097e1c575d6f82e6052ac4b2a3866bb97190b2927856993a3cd95d94f67d2aaeddb2fb1891a0c62890281810094861460f7da842dda110172e6e9a32bfc5755b06bc1367864aa50d9a0fdb91014522cd6344f9e6efe5053de37c0cd82937dbaca22e34adf612eeeea394c526fdba7f25356bff5a7ddc4fe4e2d1c8a62b15dec79445d4dbcd38283310a7077fca82d020a85129d067ec5fc609dfce0c302a73ff5ced4f59f408b1e690a969a490281805ba9f255d8d04f16453965596eda6500fc7b031e71889af65ee3dc171400d75ea8688d074d591120dc16232aae1c2bd615180dd8d85ca482240e7ea1268ace15550fcd0e774311a615d52e4fb8eab66b7097ba1690140fcb6a1ecf39f1ca57b0db72c9ab3ae5ce007dcefc07027c662d166a54d94dac2219846d60803b1fcd3102818100da7322ec1e0b9f19aa9ca60f70f660559ddfe1fc34130b342e3de89cd73e682985c49d0c9ba8fb36d07d885f25e7a3316614b7438e036d66890d194dafeec9a1395dac762f874cc5a4cf21e267a1219968192a0837d29e6ae4f6c2f3bf38649e7879b23239bfca1051047fbcfcc0f271d8e9d36e785461f4ff0f0ae00476f6e1',X'308204be020100300d06092a864886f70d0101010500048204a8308204a40201000282010100a07146544ea9da3cad747f447799c166c54df89d908f65dbc5c9c509ce92427aa31a1f386d59adb8bbcc0e6272cc628c0b53e67efc853d93855bd058f1bc659e8c9cd67f52bb13b3008bc677763c9278ce6b1c76972e8ce2d3eecf0b408aa8fdc0615b680ba491f91ae9349072dbfa969cb007846e4282daebb0cbc9283cb6b4746a9da6824de3a09b486182d689cac024b6b5749f6d77b660f3aaa708c83a7534bc55e33298c0a59efa02db44438c4fa573f85921fa80e2e9bad798b3cbf8f965672d6a16219059e6bf6bfc78a7a6fb634922a7739aaf0a336466ddde78952639e54a0565ac71dee8d4fbef9a62be4c1ffe70df8da4e1b979bcc717d0826b010203010001028201002433eb2eb2e158c140527d3531d79bf058ad13605a724105aa47b112596e5f59d4dbdc179b7514e20e5e2910c5dea08e0130595e66149aa462ff28b0293bdda23d1056c63c20c27d2dae5c863043d2b937baab9d86d7962ac8afa6405fbbea0df80effd5266b6814d1a1b59eb28c38ab2b87fcea4106f907f50edbacf44b5ede55b8a306b7902fc0172b71924a4fd85cebf964b968be5bb1f773b633d71ecbae20fbbd239685fe1c041248f2faf2e09fbfa62ca3046ce29c7e39b246d512e0cf5d5980a8b8ca44518e1dfcdb3228bc6bf196f66ff978f110cb9940a7e0a9bad133f6873bf2f21f2906dde4c5bbb345ce3bd2253b7548d26ce41b086b3b3c5a5102818100cfeed83df59b45c8543d6b9df34b375bf8d253bd7d652dd607aa966327b59ba41aa47be8d377912360f1243ad9a34b6a08dc507e7bb3354ba9bb6eb0a4d2ddacd6a634d5120c934ec4f1b6c7ec53a72ec51d9dfae1ea27c250352415a9ae61a1e4f4b0261bea71af07bec0cc03f35a52c090e1233267fe04b2e5180ab66db7d302818100c58803bd89bd39168c3a1a90690f06f2cf9e042f8671300acf98c07c6e02b6f7a8fbb37d4049c09cb9bc796ff2508f3cb7b40a93cb0ca94182812ab70b46016e850b5fff01661ff23b16048a38c00be7cbe40e7d9f50a622584ff0b4eee4bb2fdfa49565cb47ad50aa9c04ed27123abf3f6e18e20d3189cbcaa6fec858e4c15b0281804e8de645ea1ee20b1fc0208308a216e4f928c49826e26da1993dda18d5aca78324c995424d79b36c513868be8ef041126b0c88a0702d30ea47d256ac0768de7468975c084f0c4f2e87fae559bc2f924e7a0b895e79b0d39a7660cd241df9924aee4b7eacb709282fbed652d200801454850976f4ac1b5b7cfcf4cdd3663e271f0281810096c708dbdfccc14bd5c3f04cf4f49480393c4bc39f22bce233ae4c976e3dc23def0e19e6ec709f86c23bfc9217eba83a579b254bc4fd28212a25c05e324bc082052a369f6708f62fa72c5a50cb9ac43bae25a96df872ce2d7f2d9df5ee38482df5cf227eae194b513cb995051502d436f18aef917532b0150fde42b2d92fdbeb028181008e6ed60bdeb541f51aad5c8d529230bfc5f235cf92a84c11061dad6278779b853fa883dc0d67527b01ec7875d43a7b8e363cb4e4bb1f7468d072daaae3236c26dc9c5f4d0bb96f11afa8dc74610ffedc41bd21e1edc4ff7aac2af9a4c0c31025c99cd39ee24433299b0e125ce89290b3f1dbaf77e768339ab36f46a92d56d444',X'308204bb020100300d06092a864886f70d0101010500048204a5308204a102010002820101009db344205a0a1da5925bce9ac63141e3df90bf37f9b48472d3ba9095ae5c471f6a4f3f2c662a2f76fb82e1c1c6f47c85db29df664cf629fb7c028b65a20b9632abda20a15fc1480cc40c0d35f252197b80cf3592f90891791fa9a9fd385043319f5bd904d4e14b4a3e1d4a21fa74e0f3b6a8d45a8016677a22dec34ae9c8659bfbfa65e04a30c4337699044f340995a6e6bc2003f1126e2c8cb1274bde543753cf7cc0fd643b4c3f9fa13e609b0ea0b6bda537209b1555eda704c98109aaaf4c9696b7ac5daefa8521ce5465bf791fab73012c053c9e3b11583cb7a3035f6c222a56e750425a7fca673e88fe893c53cfb907420e243a95fb858f84a4b8247d2102030100010281ff494e0b5cfe7db54a41be6b4b86d55ecb8e20bac24a509f40c12af80a9c02490d515d85001e7d7d92d157059a0de19800a0dfd5f8b7cdb5b630eefddd4076225b6b86f9a409dece9f208279a19a028fd5d90a78dcd8e622b92afeb30602274d14c3feede2511268ed19f2838347e90ca83d403d75d414960530305c977614b126148fddcd0b0f5cdc471282f1af91307761d8f86dfb3dcb185715defd02a031aa9cacb62cb7c59a3062afd289b85c9277dffb4b57bcba9a64900e463e0a9a6d40e4ef39d2a6a93c0b0e8d5414c3487fc6a4ae3a71f6cf7d21d75f85b2ac0463672ff9fbc07121fa17f941dfca46fc448d2c493ba5d8d9890a10ab4064cc459d02818100e5333484c6fb68268e3e57f96917deec4960e88dd5b2c5608eb0bba99aa98b84948754ba0d004d09eda6fb2d7b840d01bf3b4e9a882686b9ece61600e9b2ef88be0a751950f026d5883420a9dc6cef4e9d9698cf257122615a73e09ed152aa86357ce1f9bd2e587d569d05359e3d562b8b4958f530a518cd50e575f7b0f13e7f02818100b023cfc51e65f71cbd793e95e7f648f151631024766f33e7abdd8bbe7c6dff147ce9f86b4a7016f52f04925012d98b77cbf78704ee3511a115a8bb76d728388b38f34318b159f6be082ff622f37956f5444cbbd0913f7bc4cb37ec60482ce546d19d6b0828eab6f2d17d454bd1a9eb46b9ec5d68603a503e1fc77e6814d3b45f028180287bfaf2d912df3ab03562e4b3237c44d05145c287d4a3f8823bc56a17df8abd485eff203ddba7bff132657b8b2daffe7700cac990f2fd292a271a0bdf3bb403bb4dad91633288297f7d75a78b3fd2a55840998d3d57d672cbbf5c15b173a09b442762e2f1ff95b1cdf2be50d23a9355edac6f02202d894bfad60d184b30d191028181009ab359506f9a6ea73762bdad3bc5fbdab6f8a2bce3a857962a44b2efe2a95957cd3e51892a1fb88a2f797c6807a639f0459c6961d33598fe39dfb0867802436743e5a41093f3c7daafa630301257882072945280a491754b2a913b7274f1b98db19ce8dc89d35c4b77e2e671e8fbac40ba1af70f2d350a35060458e961216f510281805f354bc62c72a82628b2d91c56118edd8c0cad1dfec5432c0c599efc58245b527992a702fd0513e85dd81562efd5d78234ff4c56ef3a4cf28872e81aad86ee11b7925838f895a8afb426881ec4408637b2d6b4d6111dd8d4a065c2ae5e1cab59b23c493e107ab049ea5005117a9f149bfccb40de5c50f66968283cbd07533c04');
+CREATE TABLE EbicsDownloadTransactions (transactionID TEXT NOT NULL, orderType TEXT NOT NULL, host INT NOT NULL, subscriber INT NOT NULL, encodedResponse TEXT NOT NULL, transactionKeyEnc BLOB NOT NULL, numSegments INT NOT NULL, segmentSize INT NOT NULL, receiptReceived BOOLEAN NOT NULL, CONSTRAINT fk_EbicsDownloadTransactions_host_id FOREIGN KEY (host) REFERENCES EbicsHosts(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_EbicsDownloadTransactions_subscriber_id FOREIGN KEY (subscriber) REFERENCES EbicsSubscribers(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO EbicsDownloadTransactions VALUES('703DEA54DE1B8CE45A4AF81A27593992','HTD',1,1,'C6aVtscKHFxbLQsXpeMmREJ0z2Gg/S2cgtXdpou4yyRQiU6S4Pe9GDuS5qb0agkOAW9lvoB5KLwtwQB6jwWVaMr2x/goq6YCr5Qr/BKqR2ifzQ9svO+jicj6uy9yx6hPghoSdg2DiYJ/tDYvnym8r4NbxoswduZM7iD22jTz8AdbLOVIxyzIEXq80PF3pUqTzaiPMWbwfcJQPBeAg5k7NR77qND+egOkz6spSFASLssms+UfAC+XLdEkhNHeTsTIg+6q0ncnyKX2nhhLoFHYtslaZxb4koHiqyEJ1NOyUa1AUA0oW1wF5Nf+qnHwZUMWztZzVIRDfMC8moBmXT//TR+XVa+GWRKFeGyHi+NiXu0se4J+kw5B9RoNoDhB1e2nkvm7FQC3pSFZC1zkW4aLdHxMQI4IOhT+kVAN7yM3fMRLx+2BQP2N6eu9E1nSL5R9Lt+oNQV+Gxw49vwm6DHWsvlbJf2KohRhiiD8sF8p15GanLgqVdFWZUu+6ub0mE9TcgEBFVLna/EOv2CK2CmJryC54IUl2CCyM2X/MDgGladrf23njBX51xosrb1B8czghQYKqCRgYrkEjuKGt4hOG5O1IFDd7jZ8XnKBqSTRo8O/15OAcvhjQ1kc6h05mBLW7Fz9pLMI7InuXNkRIZDUj/mcJjihe+ZwAgF7+r70uWceIo28YUJzf+AcOXBGocyzGWzU289mdRFW02qjcmk27A==',X'4768f088251391c76108c17a6562e87db0549ee871847f4de9d1b6e29de5885113304f4f5c80d9a3294f384cfe696fa69ce38b2808c8a9127c2e210d7d456ec54083f23d284c4cdba79f63e99daddf470e994749c4ae183d789e74b83098631b053509ebc4aea8c5f524ddf2b2c37f8d657238b521b7d00a2faea02a17c9e1d768037f8ffb56f357cad1bdd615f7cf4fe60b91f9ee989c7a5f2a8c035a05f7087abaaaeee00682c28a7889e88333876f9d09545c8a3477d1d61883f5a4d52a5757dac9a87974f30838e07171f4634ef56bbeba53648288cbe811f8c098bc16c53473a343883b7d57d5f991d225e9fabc30c558d5cd76e6a8960f1bdcffb5a884',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('AA3A4C88BE37BE34E82AFE98D632602D','C52',1,1,'TuExSqrFjw+Gjnc89Pwm77gmleWSuAF7Q5i/8ioJpOvb/s3NS0ovMAoPn877ozkejOnGOgISjhbSvw8fSIEE6DR+q6gelQmz2svvdQOah3R/xhwCQtbzkAxl657QVHRNHgkCCqHXXT3AGzOZhKgYimxGcGiNJbp1XTtzmlKKlbgi1GQqO9CFClFYcpisVPMr0Go1AbLr0UG/QNJ+S+fsvy6x/gCaJ1HPhM+DovJHSqTbZk6WenMU1X/+3CE9XGrZKZvfxoPrFGYlwFMQv68C2zZnm/5r01yud1Wv9FYrHaZY32mFhfbpurFldsALS78yZnvZ7dON/7tSKovfxLYK47tsnztzkr7lWUSFiTcwPlJo5uSjEZIob3VFcvcs5vGwdYMdp6ibEJ+sTRm7gauUdJ7jI9JjD9oQA1KjM/TJw66Nb2v770t0P4GECicjCpSmxYFaSi/wceNa26k4sk+LjIScKdLkJsxJNDZhd3gfZkQ75kMyiQmmbOJAbw2YCnOMNPzu4zCEb8y7HdPi2/BxiYzrev/hJ+EOYBB4ck+GXj6FAF92HZ119fQlKDs5mtIH7lQ71qA53TSLBYFQCYyrfwkRUVI9KgzpARM7EkvFvPOaM6VPYMT8TT+UNLPsbT/bqoUyxzUV7J2cNxu0lkTd/1OY+VQUrtUJEEKl4DRNGWTU3B4lZPsceN6Dx1SiLfnEWe4q1kzyEw6lJfRTHGJz+w3PsmNZXImfp9anXqCfk8T5iEvcb88p9s0KW14wRSC8T1OGegRf8JzQZKU6sWlC6w60hYHHPwbjViVMd4M/++/CKq7dprJDmFkbr4XIU7/IqD5fZuYsV9U076dEyeKBNubPbfEeV1ueKBDy7CnGh1g=',X'15e037c1eafd1f9e2e8a775e004818341a16b462e71add887c2dd1f51593bf3c917893b16ad94436a3d3fcb15e32de51c8b25ee304fd28f64584d9025ab8cfe908bca00e551391d34b73806e21f2285e4e37fcd2af5ca685b747dc08d694b65820c3c61dbf47f00f60e94b0324807b7ea499f65f4ba8ba59e0c5440a8cd6412d67afc628a6765ebe46667db3499aa24139caf70c864b4325e5c19a5c6fad01e312487edc0359760126a161c9a94645d28d6cfd594a595d68131ed18e675b8954d1a5b2a7d939afb0ca07d84eedc9dd980406c33ae04d7cbbc28ca617989a58da0495bfa7fe2453e2493a00adf3affc78b096ce5f641a51791e526a7ec42fab8d',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('A2711F2886318EF5E1AA0CC88F04AB8C','C52',1,1,'36V7B89SVXgMESVQKpDQRIIydmgjL8nwKTd6zi5C78uY6iFZe2y6J4QiNZVfju+bEozSakKjpxPhSYgbO+/qeOqHBGgd0xOwM662VA+Seue+QDncPqMtpruei/KQmpSBI2FPYih2UUTgeHtTLAvJ4zj8m5x4U3M+uQ1LDn3RxbghANvYB+t0ZbAidM2Ww1xsGNpneDp1K3VW0wM2qkxJZOcl/IWG8E+y2EA+Z3VTVpqj6i1f0IDmydsBe+bJJIW8SHN9aE0aQBbRpKN/kLGaHa1oYGapgu/1vbul3Np37h0QnfVWlBeNGzTrfUnZSeKqX1OquD+g8HdRRc4b2dP9kn5dQXnyIXPJ1xPm6DG1KQQfTKcvTQGOzQbqabS70kePvcqGnxG0r2Oszl9tUL/QRkNBRPXsZLiE5LV7R9XH/5rn3cYKdE1dR0G8ZZonfoToDKiOIKBxqwafs77KnAu3YtqGXIYmHEeMY/4KaGIS6nRFmow+Hc8D2H4XrGBnbkfI32h8Zw9zseClE548OvM5plxkqwPE1BMVTGmKgTkk14hYEH6a/aA3sHhD6tzZuv/DKZWiy05Fka6Zc/Mng11SAotq9HR4M+AchF25MLOqyMEcGeIMlsFx7bVwlRWQ6XppFBeutKYhh5Ae/66MjB14T8bjaM+BiPxtuQ1gKfG3ekOcIA+ztEFycGXN0OFu57UXv2ITPyH4WjcyPixk64+u/+F1KJJXOQ7AVlHhZ6Rdpti/NaMwfhox8tV3hL7zEY70r88cSecTcwJ1qv6f9bajZOhhdqFaBGZtPGKBXHEr7RHvn2SCeQugMKaGzGwP7gHmTs7/OgcYsRclbtuA4KiaYo/YyyKmYflFIxd7y4VFDaA=',X'abd6417b1fac7b7d4423936831fc3f2b4ca0881e48e96ba1490dda1696339c62785be785e07d6fcf4b77b945bbd2ed06611a2a63f4f66beb2a80cc048f894949df8e5ca75a875e845710b2a7ee6289ffac867a8ee573882fc9a5776e56094156f84e1280cfd75ae31b89b0bfdd85cedd3f975e4dcaa2327b4de1fb82cda2d5de87fad03becabe14362b5241bcb765fa3d9ebf815d552547f118c6d1ff200082fd33403fd22a4ed40b0405f6389a2207966b5368d0153c2e1062c20bfa7620fd13af4bad91fae8d21597eeedd75e4baf131d8b88b101ce414fe4c5324b4f8259bbc0719fbd32ccdb5537b140ac89c874fd76ee262fae3dfbb7f318077e730f3c8',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('2F3BF32E9591B4DDABB5BB92B45B8C61','C52',1,1,'MJewVec3qTYR7WqN10EaoiplDJyE3bqPbcWx7e8hWmNTTqYmxAukHoaV5X1msZBCSKJv15zbhoIqlr8NVANcnTUm6obYLvZLZpP6tfDoVdhVwYelalh4GRRm/GfJ69346HKyJxOjYE12Amij0TNPZjOzmfQRhyODSqyHpLBwmNvcCt4wR8w4jFc1WPXOlJkdo/IDVGOrrTSHLOKYpwaegbaxp3IQ7qmnkcxtrUUjv12Deij6YnNab8Oru2vJHmQ68iVZeCDUtsQeQQuGdwhk+V+w1lr5mxEPDV8PU4ayfP7l9yXB4eiTek9HFtZC6t4MoWDfQZgEEBaL4U68OUH5bUsw2++8GP6uuTeE7wBj/VrHtkjdYFchI7+6edG5JIDkfQQuI4dgA6B08skk0Ovt7PFda3CK+h8PxWMh/kEwhB2tuBzoM8zcqzPliHUk7qLFQuDHwjrJAfnCUnyj/5oSihIdDt48WqXA5wrihPhvQJEJH77blDeXrgf0U/NVmjNlEFteEF5TvFG76eb83UNBzRk1xKMfbrwiewN7Xk+CFRQr3uqfPjPeo+qAYm5sfTTKa9y8OCeD7iIu2402OAb5hCuQflcSJQdlBVycAGl7DI/DeT8HtDCLpi7b7gbaZ8jD5eVmDiHUDxBFEUt0Cse0LdUVQGEgJnssNgPi0I8wQZb0KNSCXe7SeBiwnCc7l4OsgWROixmC1iEZNnpANLGl9V8PhDKrj490nXgWxvj69m1sfnh5VLIBNj6i2FrqOlcqwyHLJojXfrDTPBUr5k01X9FRYOY79wBsXHRS15zT+EJPj5Uskh0RqHr+KAH6SWNRw1UyOpDnpgHvJW6WUX1BEYEMVNMIvwoV34it3AGQeB8=',X'698348567dd0a168fa8a14ee072592913870c82df8b8c343292085cadf6e2c2f6941f65398ff218032ea8fe985f2839e4d8fc16f890e73b2d399b40233eaaaad9c1bf7caf54c5fde4deda0409a0bebc79117eb2baea0e69283d64fe7b04acaedb67043b451e32b852815181feed0051c40103c6b4c04ac9eb2f9abc2407f90b830965ee3d9d981962af90987db2d6cdc44b3adf53ace2022936344f68d38877ca7e0f50893f2cd3719091ec25e2630a3aa12cf64e90ad66b17e860d136bc82ba7883925e161c98fe2f85d4a0084b99f5989267cb638ae774166ee320459a95e9d9ce8685ea8d78637dc73ce6d11476464b687760707358a28b3b6e50e1a0d4aa',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('F049F3593A00B8FEB22457BDB6B40777','C52',1,1,'iSdT+peifVwyL2cbUHqzKsjlOgnaj1X5/6v+wNO9rSKOAwSVBK0C6YECE8Ux7PUkW/Vd/kuhQxn39wAhqtbohvEuTJbRt6pAUG+qaHuXy3NTOnD/3GNywyqNZfkuxhPNKK9LdSDp53wFrySZqjNpS2idprrYYGdFfVsYYbSt/lB2dPgRqOTV7atMwkIoAL7DG8f2CH/OXptC0eex+UzeRwMGPfRuD2g+qjhmsa23YlgBZ7ggMHgypGSR0hJp7KgaNYrBQPj0p8/cpZ6yKqvcYHpOcE9u8OoibpymrDhy+hRCKcnp5z16vgaUCyCyOqQL1dQxkF2leEgXYbK464GNoQF21BP6u+67TBTbMGUn02dwP0R7fk/z2fAQeMRSSXKstPO6qTuE7CWci+1JIsd4Utof5Ps5u0PCm/hIAPqgZf0FUMlrbNBz6yJN3V/LUdk2fbgIN5e8l5QAEoMUCM6RRJGRpXPadtU7LNgypiJLLcb23IKFAag0GqMZ72n4CZy39wgI0R1RfuVDLzjUMpAiA298xFnZSZJFHTEVbHisVQvIsBAXq5NXrtlwZEwkunYqJfDqKw+vQzTViGWFMqEgiEpTIEZxEmQvnhkLRPw2Gnjs+iRvj5CmNaUWkPa01eAsRaNQ/y7hBb6LHi4DaaY4hH9YcRR7KiUXkwvkbtcEE00MStyGr2FGeQimpqR1bjpk/ku0p3P+uQy52GdhH9wEIwvc/TAJkH9knX5bPZdrQ8qu6DL1fNTnsciSBUuReTLlG4gDarVy+7rqroVWAewKmtSnl462m7eV+trkUFkgSaK/mUBfjFZAdj/EbD4pS9nBxoMnt9ueKLiA5fPalkhJosmddii4KwhZqzO7LUb/vfQ=',X'908a6ff3c2b92cc47e35ee91065ae329d6107edf90abcf67e0c4444a0da3179ffdc8391b471c3805be70eaecaaad3f4831e83ba51bdf33a185f6ad87bb04b4e2a8b80e486e504774ec9114ec3f9da2988a3b588260d26b4d255dfa0010429362b662648274c1dc72e91d716de6c9b8fa8f522a3f70da4967f86abb5de638ba0eb44a8881319399d7062ac515bda493c88652a942a563198421f52b7a914997d08c9ba726385f9fc9ba2ceae88d9a0459b22e0d8a8ae8bcdaab2c8d2ba281dd83a8fbec0ace2b019a01f7c297d63afbc27aca4038ffe722e12772bc0b452d432eb98be82c0a3f8269567ce28770c4c953fdca76eb72b5393f24fac62578087dd4',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('6153951B34EE6086FF6324E1B932F894','C52',1,1,'dSpqmaMU2tdvg7WPW6TsGjW+lC1vypTxCyhOo9T1xHGiAPYGNew0ZCoD2pPw2P/8JWsgz0vF45UnkIy5hz/1D0kXeJbL4gV4ZvntXd6VjZXi2xETy1EnkDXs4PNoPyYExS5HWlm1uw3Y7DUf3VqWBrJNAXJBOvuiKnWEzRiwPN9QolHoAMHp05kR3Vj+MjcdKY6xzgUZKV/UYt1kdDMKS0J5KwHMG1irrHOAZALW+ZEJFh1Ur2E3+DA+nK9raLyvH9TfF+iYGOMquX0TPQEn2nIbo9OiBd5pWQQiZQakFe8EBKiMjeMvQFp4EcOK87tqpHSNb3YLufsjEA0iQ8ZsxpNaGkA1j6T7fBhgYW0QO8nrLKxKZhxzhq2z4cnc1DMhiAvRqaTy8mtLfIfiZRYiYv+m7oqbWMI4Ga4iZoZJ/ABnSi7TGVSViD2Yn+62auRM00jD2pfubC06aK//KTBwIycwmUbweIlAw+Adq1f1T/mX+1iuZrecwhRN05WT1T0yM9GpL1/EtWq1FjMTENH16g2mX+V6JbBtjrTNX7GkiNKrDwMMFJXbmogC/BFPwJfXF5BCApkO0DysH2Btdzl5wU0yMtGMWPS2U67okMvVexNoiQC06mRxLiY4uufTQ0emXN4KLbpc/K20qMxfwpltO1R51+yAE7wUav6hV7BuIUAdf5chVvm7YQqS3/pqysGyZ1A5gEJzCKh1yY2mIdI8zAvUiCbQibWWTnBIBuByg4JUCif+db+lHO+tmhA0xF9/FP23FRwiDLlFHUPRwUhY0B8R3GC+WW/o2DjkFyy1BzdfcfORmeDEpbVJzqPoEXCHqgm8vMO/vtsD6iIfwu9DpND3n2SQ4Ucs6pf79vN1+LM=',X'6012c09f966f96376c4bad17fface36241631ae4d4b9a1c9d14f19e50ab19b86bad919e9b60694fa1eea66fc78ecb628e50b24b311bac38f6de737e9e287cf9e12d102d47248900a4ceab16751bdfdce9512cde26a434df0fb326c34c11f80cff88e2a283096c0d51723b02e8bf4b47125800ce76cc6ca111aac789a95fbab89c18bb33e35c460a0aabd037ad8bc096cff3fdb0eef2370ad8597223dc9c3a664ffaf3e18e42d5de280b9434635dca47bfd133bfc5e84b3ff7b66bd1bb0128ec0e228825626219bd6e4a6a2288aa419f2bbe58aaff08a7506f43fa516b2fa46fe3ff839157a6e718d4b3aef649b67f06c3caeec0f49a76c8a6d29ec33123b2d41',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('C6E8E7702F05BE8FFB5A9058616387CD','C52',1,1,'kOF/k6tKwN2+Lm+EQHZPjhyGxpbZla5FlrLAVcHGbxW+2qmfx8bcgM/ahGP45DADSYyeRhBwQalW3FtIUtpSHuYaQiLDvHTHHHi76wjixqC8ydVeZGFt8sJqj1nfJWoMlOJMvYX/qIw6Pr9Tbv1ZrAyIlFN4R9qAFCVwsLG2jlKeB0E1czbz/rfx7Tv5NekrVsSEkfQeZj7J7mCXnmA5sXWv99E311j8rO6fX+i0NjJ06QfXLjpP6EnWoz5GEu50eHD+kYFd4NpBEo444+BFsX03abk28VMvzXihpyajM3XnGBncx9IhKKM+PkXQttx5X971AFOxqieh4dcvY3hMM3lktvNNL2p/dQ/YyOBFHLgttOj3wK7lut4S5d2jJa7CWWDWwRK7D1bwfaEIarwqi9gDty7GacTAlxSTPjc1kt9jL1XUIlru/z8YVRme6zDas1+BeXAvYn5UtcexZY8xeNpTUr+GpxU9BNaIuyQSPzGG5MbZKZ2KvIAaPizxGhLPDcUfmtlTSTo4Gagzn62xjKHUAM9icz/54/trUpq4YTGdrpYWhvO0Aw0Emume4o4n2tUUQFh6p6iQlIWj33ObOnTS0bfaw/MVQsl4vVVZDS6cj04l/kGtiknYMCo3N1mQELs2/iG9pUjPf33jxZt1avmkAK2MLicyO+qV1z/0d4XNToPsdQlp2agwF5Zk6Em1G7dKfbqgeG70ipyVaIdMnJWNNSXQY5JrOGCM7QqLSbT/CKWmZ3lIlovqnGQN7qoIPrVHucp4QQDk49vqoo8WJEGY5HmhME8MXExREr0kOyhFVxTw58UNKJbY6oBt01lhusT/0Aj7ZokvLVeIeEV4Ur3HJiHuaBsQXe/XVIe9UW6CCq4c+ME8iJdM3DVOlJ26wNyX2lSpzc/FSUETXaCMYtQRHOWELzkV8jOCsKEZ/+N9i5sFH6K8glgYC/TD0yJikGuLxCjMjo3L1mHSlu/1WZ83WKRGzL7sELnkNkUw6iVGis20eO+qNOCblFlKofYpI2ae//AGw0FRFrWUYQYoFH6PocaeYe/TEQK0TY7yvt1kq8TNh7WNIhQqqLJXKv170GkM+zPk4SABeTVaZGrv9X3K7D1pg6ODI/n6dh0wMNNe2CLHdwradnFHBATTI0dYNruWfHRHNcidhsjrOIjpPomZhd7Vg5rGXTMpK1CLu0J04Riox02WiS8fWVTP89KRFcww4NBLtYjSX0kU7wdQzd8TbSAFrgylkDE5Mav2IKmh6Iag/uGRoq8/QKGl8o+IfXtjnCt7P70bSRfZiqdSYTVU3rib0C3GerGTJ97u/ErlLLi0U3K6xds/rU9ckx0/smxpl52X9VYHcICK9FJ/v6Ix9ap4FtuJw6RX2APtYzFggsNs6kq+PlVazwfRZ4CKFcPN/sjHU8tU3NYHd2WL69YFHw6FfeYeVSRcnpGKMzY5EHlr3bJbkCflHoXnRP2lV3F3wa01FPKwBvlFtrPvOw==',X'14c789ad7283e71f2af23122e76ebb416234bca66a5989bd56aa8590a6e962959bba3be695f8d0a27314a389469b6237add1647ba2922d7e7850ac1a726064d784f6bbd35b94cc7fe0f64eec6efd3c270e4cdc72e00fde799537d935ea68592f3acf2d422b57340b40dbebd75f27e89d107cd411479d7486e4f0097caf524fc0afa5f714a02b0ac268ba1b826bd18336be456f2c6396df9c8fc525fd3d6396f37b0a8e3ca5b158c63b534f7b2adb7613f9518555426d72021aad0131f503621cf71d70561620e3c6054b6858071215774a036f354387c96e70d1965eaf882f4b04c7364ca5aad630bd28110e3f2b663cb5b8b34169ace4938e7aa6511008c560',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('B8AA73BE0B8D7822D959A7790A82607E','C52',1,1,'p4hzf74UZkce6ZaQ/inOiAAPJTjT49npCUQ5PW78p50cEoXJh6h5MM/G5YdJQdzmxh3+FbFxY3EWHFGPTws/AcCr7Q10XStJy5RI8VQsuGmqHqzitNsOpjd2PyAjHqPq//bxi/TUnRC9o+3Q4ZlsUd1eAjsx/uHqo0aleJeSofxggYkh+w/QbIf7qCfGK7nh6QXTJ7qhDhjlX60TrnElZrKFmLMqstMXgAT5FilAQdXPdLjbFnUrFQQjQaEDvyneoiS4iaC+blrHCwx0pI5XJTz6/PZt1iYj6IWluLPZ8j/jG65KyUntpQLCyP/lYxigYnB9nhU7DvsIJ7+SDE3AfBaF+bkHYdZrPIWeYNMay0IPI47lT4P5igVDTBw2cRiy0KJViieUfIAuhZg3DEcLKl5M6GT5jwesO950hMVZnHRpA6CUSB4je9uE0LIu/SgUv7kSPG5+CDejj+9fkSbYCFgL7BMf3TmLUilUUcCaBE9JpdoD6iL7On6zfBbN/Z9Ul1pnfpShYLN/px9k7j8l2gj5DoJyRTC4hEaf3w4XFvcUJ/eeKXfWPU9jrkunBwcjO6Y5vojjDssm9gxyURLTTi+O9XMGShICzSp5aYtLRdBp61OkfQTBHwI40ZViM73NoVppJo/D/ccDhf2bxpucpkDVHgzYB7Ho+0pujmbi7inqwI8Mu1XqR6dmDpw7THdiewUsq5rWBbNLIsh9lYHjD91GTzeQdDqIL6pnRm8HQPjzuoRl4ahHuIrPyNao0loEqtGejmORk7pANOzHst7JTOwXrV0j7FRV7WnKJkE76ZSt/F6rny3QfEbL0JZ/fYQBQa4UOI6HmnrDCBDXDcmgUchQKW2BSeDwyaIiELE6JwXEegWUlk+XmBcalkCg2HRqtIoJnSLyrZIVTy7A7J3tWPnq9qSYaXq2Hhckr5ovV7oDtAdLSNqo/f+SJBfmVenJ+aBD05JTj0auuctnCi/CBitgiVaB7gX6v0WRHycsA6Hf9ie/2mmkzt1nQKB1wjxus/sYxsc2RuZB5yL75dSeFPxW2T1GNlR0S5uPflIM5FjUsMrohuS0nlqgE8XM6xg6hIUqWE2AIZiPFG+plJ8OTvhBAKCqVCrj0DV1cd2LXsCLuXliygQu2JElGXJ75gEDK2qxR6B6lVvNSCAPXWJTSO/zu4zATWfHE6J5EFodWqgHVys0bHUDS9D+7qTlDiyWLI1FQCPkwyhIJ5AzMmSpi14KvibGmLleVtbZCj4S2Jnu0sdvZFSESLaRtUbftyDbAc5+ITlgmo+uZeIIt7N6xolioHuU7yHWHk9mWHWDK5C9tDuBSTquA9faCyYHQh+hRgOZZ1/cu52rJ0W3+JGRKQwD4+OV8NV5CYW7VScxga+lTZSKMBkMA+DrHI/0MtyzzGXkcrBcrP7rWQA3+pSoh0jek31WQoiK6Ki7V+D287ZRIDNiEABZdVr+XsaA2vuFuCVm/M5zttheiyIrGNgWBw==',X'4c684a8ff03b8831e90d396757b00284ee9f9c5a8abc475b08d1b3d922864b7a7bbb31da47193d8532c627583da5c5891e375b3f0740d6fbdf5709f37bcff3b2fa9f3489257b623625e6d569503467264800aaf7e7cad0a61a64146037942db5aad4d496ed75615b2914fdb0fb27d27fe2ed8eab922fbf683e05881224d4c232b5ef65ee5613702ab84d91905fcfc204a50ae8a1b89e48edccc083e81336a655c18a109eb9fd20b01cf55dc44e8f9c32371f7c1bc095b4b0a2496f9034aeccbff0bede4120af7a30c08427a5f96a26cfe9c5f18236fe5087a5616164fe58bda0eba60d3f02e40b5f9397e276cb8782daee360c546efc4e6505a2bc6d2fe74220',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('74FC29A02A40A36B7FDEE19410F296DD','C52',1,1,'AkFrU1APeExcg5ICD4Wa5rkAeqBTmFmJmAAz/EMqoTJ253s7+EWuEXJ/d7S20o6B0+Nk+U8onns2av1LKSYjZlPyp+XTi87Lpn8azKw0x7yY+pRa+AK2MUaDiOpwz8AN8dQi+DFS76DnFYzgolzwdJBrUh46Pm36K1JzSFLGlg/q2EiDK303y0AndEvIxLKvdpjJFInzKXh4XYaycdbQBrpV+xqzcbKqZEupf8HLEsTjqsPSsLJ5RyeOq+cbVi1sN4kM9S2SvxgYJyyIA6geyuywE7wWHDvfgFiAktpnQ1XXzpUYQDoc3TJ37t3qN78GQ06r8JU3ZNSnzCqVMddqDBdnJUmE7uOqolCM3b46MeAYn1CY9dyavnj/NHoxoLdb0tAC8u7GIIsqFXkZELCJVN3BC48jSTzcNmGSUYCxpOwpF9UTaydfR5LbuOuJYV8F5tZvotqGXkKMbONgIvyyR2swIDuSPLtlxCULXv3+AhRVsSdEi+zsNI2Uz0kFXq0+gNYTUjcW0EM//Hpi9qtsYzFCiIaSjseOqVQTsYkBcoL7x7UHlc/ydojdjixSmEOfpQVCbVQbFVftOl5FOKcIcWMt5kDu4pNbIWdlSVUUtkrGYhZtFEE3Jmq2nuO0TlhlZvkYITfZuBU0vg9RYWLcJO5mY+oA4Gxe/G/4xENhVAZrK0H1OmOFcDbnWPJzlCkvh1zIsHA5eCcxIOWIDejzgCnPz2xBahhcLuI7PsDodacDmIyPQpc4p6LvF2z8syw6+GsrooL2sWfM/RxDtkqX+NcoHib5B/qcjSsSNNLEHw+k4bKrv0ocC52zaWpy0WpMHR5JrcecFP0UzUwTQS0FNMF8hlqOvQk+twtUw2sU1a7o4u1kVvX55xSV5SuRAfvc3WzJWaF6GbYiNN6sR8X791CJ/9BwnOIBcSXiYoxKzT3dMwhgFr4GW6Z9242FZ1E5fYo/LlNlC8MMV6z1RvO2vTGFhP7VzQjQ+7gj8CPHPdljo9mKsjWUlV3eMRU5epzfJc/iGt8COA8MegXkWmEg77llQVI6x676yODOIKvKk1fOQ2Afdp3fyPWDQ3rNme1XeHBlc+H+PhRN/5kFXvy+Amn7GAMLJOJMYLNi2Va0u4BnwhC9TzBJYq403UbBM2uvMkZk3iMLoKZswbvRRRcyERxnhW6IUXgmDOif++uhxM5R7Ps/yvkQIVxXK9RG1cjLlZCkM/gy+aqXAHlaLfqZFD2V2O6cr/hFpTIhFDNoRK9bWxqwrQqYR+DHcRT8A3/EFU/uBqqzkUqf12u5pAu3YKCObxAtYtTlPyolR2wDMcpwjJQ6Tl1tFyKRvk94F8ypkQg9wIdJY3O3ebfJv6nmA+xyvAmv69fR2x/tMKiv45RD1hnTeGKr/WZC+dHNvGWaI6NaBkh1wn/A56+XuS7VbQ9xj0YkqOQOW+pdAAk9mRY+hyBzDCSJfqWaQ3UvISV8dQzkjXvc/EW+l8nmZrrivQ==',X'641839f19528e2af2fbf2e3e3bd94c755c5828a7890cfb4d9b13b53632a4426b499d7cc61b7abfd279a369cbdda2b785a36825401d0bc66f07d598d4f18068b5073802e237a86fbcbc99fd4068d68eb3609163bd93875f736fc187f59d32912ca09a8f5dcdba0593329b9ce3dc0b66120f40af9695434b71148ffcb92dcfbcd195e3f5a9f1621789c3340dbe9cda7e8ea558bea9ba1cfd143cb46a64f75a3ba109e0f7b98253b8594cb0fd0f9a0dfe4a7e3527c19b1ff9bfd6c1e1afcf23b9f638829950c43b3862211bdaaf447a065160393a723c8ee349e5016346ba2fdf38b39b12807cdef26fa6709854956fe75116d87ec0134aba23396226dcd8a60653',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('4F0DDCD6B21631E5B36B60C19B391B1B','C52',1,1,'Q1MQ1zNgGtX2z0CjJ3pzAbj1Z8CIU0krKNh4kCcD3Kte1HU9aErDc1+EpuNB6UqaHgmGcs2yUK999mBNDMQjKn3Xy4EOoeiJMHUMICcttD6dEoHRIKGCEFvR9QX+ZOj7Au5S+CRjaNApBct9nr8zEIUmkTpBFbQ9W74DgoWPhVMG+wDMsdTQAH9ATrYrecrmphWWPQ0aZGHQA8zfXPphB85bc74ARPj3z3gkV2iChjSKHPghI00Aia2KkL6hajAOC8qsaBnNdUWxI31HtvMT65Ej+qvHLCJ6dxXyfDcEZXr22yBM+nPJ8FD/ZLq8aJVcu4kN3fiiuok37zGh/AMXIlQL157KCmQkp8DtszMzWT0ka7VuYzgMMQJtAGjLYtyCuGqoX7laX+SVltkgbnB1cRKNekIdQU9YMQQIXgW+ZMDGP1NL4xWPVcWf7LR/nHOVAs2AI+8VkTmHLdT0NnAUw/954qJtQmkeDjJDMxBorqPEJAWi2IPcSUWQTFRqohuorlncOk+ijpqtnK/RaKBE7gOijJXkRTzImfM2rhtQ49NTIu+OSNT4b31EcNd60UgtQNh23+UYsGlk7j3EPskQl1SnFCjYVuqhNIj4WIs7RDJItLClwHw97RPyq0RVNBMTnXvP4sum22UxV/Mj3TRjjBbpZMcKdRx6iHy8Y5XcqfPgor9ojwUlpziPf/BR+dCbVtqTFaRJzl6E9dAHo4cnBmBa+bTKPCED1YNfZ6aUnICw6hYvpnmPsQ/lC1W7oRbGMQlfK5k/dc9BsRt0kOkma05mOYM3mkaxOl5bZFwf3jVkE/MB5pqxVWX2BsbHEEqd9gsae12tO5cKz+I0plMEKRS42AEoe3yJG2T5/z4dbf8nwBr+DiFGkV4Zx9cR2GBX4XVK0Ewy7XJ0dyjfHFAoZL6c3bchrf+gGnx45NK75s7h1BlvI6fP1BUvu28qSELVsJIWMq6P9wCL3qwA/6m9i0cAHilr8mxeN7ramN57xycBPXz+UMafOxNNs8Bib9RQlzYOUGgr4/lGTdFaa9UZSyQe5LvCoqwaglOR4btaIrN0tANz7tUMYRjT5Ed6QbJgzJwqEGdrQ6/K+dd+v920GJyEJUPi5wSzYNZQHcn4kpT7y2GlgBEOWgSQ4kRM8aWA5t11RrmKOKSNMiLCOEif2rxTxfSD9eaC3NjOrXh67VskaOy/e1kyAoaf/vbHfBKcmViowmfJ3GY0FV2uF0m/qY810HQCuu5OtWsIdRYZRM29yUQ+71m0zGW5iekX7wp2u1lKOye29NwzCAEq6v7ZyC4g8OmDlNT+yMpZz8qATJ6bHaTvckRMrunyvNha97eUjxe5Uha4gZxzh2EQcTUlYrCSQJKhyFCKJafdqAFfrj0cRWVqzPqq2piOt4lAqpXIVLoLZbxCWgiN2ohQtlDyIPEsLflXFe4CX7B1G8Dh99mtIJUB4AbDXlIAmcUqmBRstLjqi/WoYmCcUpmR/wcLuMRUM7yQ0L0sam5Pm8npetuu5LuGV7qnrJ11Nnc3X1hpS+Gx46gTH6QCyCN22/JeIizeUyrTW1FiEraONBvreHNYm4eq4oAIdx9Z1gg+v4P8j11a0iPFM3mO4US5qqNfDcJq4xd9lswN27Qex8XwUqA=',X'981a96283e83b2a85576dad342f3d7afce2c0165202549c4c2b87f40025b625a787eedfcf25c2bdb32366247048777708bdef222cd7f5528de59fa193326d50bf6639cfc93b24db7eb8abad34ce97bc9a6807f148a9e2a2e764102fe698762575422ebc947261df4a91de21b8ed32940ae1d40319d71b64b004a2bfc64f83d630549b9c45937d630e65ffb124d7a5f95c6412a85d76354fea19d8cb3d808ad79488a45fa53facd10e312b6d5b61b4846b12c77ef05594ce8ecd7ee42435f0b90e845ab11d0ab856b09b2ac81ce0fc1bbffe4a39b26c071de40213b5b06ce82406106af338212f51b72daaba830fe20ff495468d180cfbe4123372edae8dfacf6',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('C6B7A1D05CA9104E76C79C4F90110A5B','C52',1,1,'5oUFJDfg/kzP2qwKuuEwPVRVYi7CV21XlSt8ASX4bH2l3SX/h9O7sKgBpOv0tUFomVVjW6W2HBIppKMm0wRRGWU/zWFycGcJAtZJzOyw6HMs2Fjjw5imAScE9yvkwUsKguNLeG3jW2bzoa93gXvLCLBZEvPWQW4pbwOLkZ0IohoQaqqcw1IC7uKctuS6AgALV6G2YaZ5MUe7c9+dBA1xth/7DjECR3Z3MNIEYhLBBZG0NOfw0Geo2JK8+iRwbWoDxKK66PLdZba9ZDWFfMdnGXU3BZQU57/GE/Sm0AaiPm1zcBuT5koEB4QDCs1L26DislzlZ69MjhrNdnRv2kyTNx7v4X5JQsa0d+7Jcdoudt7IRduwtFoMq0xq52RHZwGIRuzoMb4u7JKESVKIxW4t5DjblEVTbbjKAw/sjm8rGbJNQQD8XVN7kF1u/G0NABK7MKtmGKNlgrlxEJc70xbQTrowC28D3mmz6RvhDToZuurNgcPFRnOGuGU5gC5JEgYtWmWiRVNDERqXgP2GNphmLyyU2R0dJCqH5Wlci19slohMYVctb27ggMPX4IiGP27NDPcT0jCyaWlXvGSa1z5MNFRcrImk1Za2IeYJsLhbIp9XrPoAm0F2FCH7GmDoTiD9VxWBi7Ip6wPAUkPxLo+U3KHpYm8bMM3tytm9Ayq5pn9Z0TROq4paQJp6jKaw6Q8fDX1Efd3zyh81V3Kt6kKBNrTHmh0HS5/6FVeRLvZBJ7BCzwSJf64wTFLnjJYBzOqLw4uHca1I9tN1P/ayv3GguGAL5+y2r5neRfwZY/SBMkpHMlqaT6t1VdO5RlyyMeNNn13zNlllm8tpOv6hWlkTfMqYRsp1AH8M5JR/iyPzaOjBb3wT9YDaaJjo615Golz8sa2iSX+DxDzdTjWwi6P2lynu5jWv8q3bEBgKzNmFpwdNh53Ht7xo2u4c7W5PsoheUYMTh5qDYdmgQUl0bLCvEptzbtlC4iGkGn9nXuKBuwNIvqKhIauMd/fwC3cBdcCbeStSdChDKxyZx5D/Ud4QmdjL0pkFiJDt1eRMeJXVVO962SDzOJM0dIobtz2VNRaGHQIa8/WzGChXP6HOCDi6HtLSf3E852PEUpYybMz53JZuUJSGIKKtQ8vW86U6/vzxIV0CbvjQcl/FJYpuXl5CgsZD8VfkQjQp0MvJlRWJgHTnvsl/4f0u2jEKy/MMCCe7Bkebf5XQKdOIBk+dn8Fwnt6f4qOADH04cvH1VsA5QbZjHjvExAt5HHtUzXiBylzhsuyW+NCXKGsJi46Dl3zhtPRVEHJXlHoXrZ/8mYpX/gQejCOprEHQBpBhHJJVKyabMjF1FT0Psk6WKvj6IXQRHJsg0KJkyfowgHN5EBLS5ezkwVcP+ZDupq09KskZrDMrQjJ64UOkS/dXzMS75787OpgFoqtOV4xKpI6puJTkOq8Ljy96GDrVsUTNE2qWCKXGOLqAsC3c+lKg24g4JUHYCP6bTYyhD7s7q7K7T96KMeZjSVMhT39rvT7zrdzw4JER/LoAdygB8p5MK9cfck8wKW6ju6nW15tMf5cgfgS0nD0pgqrBbQ4IvbKWJx9xoZyrJOrWkeLSSU2qhfvdsBXFFHk7fbkp7lmzS0nei0OfsYY=',X'4a2522e25e0566a4c77a7744a06c2304f325a4e781893b782cd133b00025e790e3d386041c7a6d85f5b7cbb46b54fbc9fcd0044a2395b9c40e2f19b867d0c212f76a89c79649b4038914fb97ae6b6e9da1ca8ac801d9c9d14638efed7de865f1272a71e58eed57aee5fe56586e56eb1be96eb195f7feff175576537f7b29e3ce1de0a35a0514d474d20a732e75573a37aa05c1a33031b3ff36c8ce8e08bd91e3fffac6bc1852c9354b6b909680298ea6737abee78f1654f51f5e6ae81b3c80e5f982c88ba83a482cde5f73ce85a6b76c5aa3ca6943ffb5cac3c92892560adad3e303d41ca7c7eb0788ec7a4e67954020285fda5d4304cdad6d5418b141467008',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('7E3487EF3E9F6ED90677E05B6D727106','C52',1,1,'ii4vegJRDL+1TBXNMijDWLMLQ6dGgGbk6VzI372UadlWJb8rC9I3m4vqgai1icUjxrsYbvcpZo0pY262e7pWdFhxzMxeAo/2kwhA1UIRW5Rf/4EuiLfMOFgHkbamjzMbdeO+ZNbPA1q8yriBp2fIer0QEgHRZ8XUCn9uKPSxZQtYPXxUOHcEY+MQdz/1sl6FIQwr+wg96DVzQXsECR2k+B8FmKLJWaxb145pDb4rwO0z5Eg2u/s1M+IlBhBYtU+J7xjb29MeyvqujlEwK/kibz1y4wtSOFc3dzLXv0gAnf03Qbrz0UuTo3Cc9uVHNLt2egfX2MKMEzJIixQPx/k/tNWU+12qX3/uxMSmExUmRC47m+quYFLfBZzV91KhKUmPAvlSL0PulRgSm77RFWqnbE0MtTkWweX3rkYFhU0NMqQHxTYkgB8uEplICzJ5dopMr8CYQQ2xwzwL87HDIi5ueOCVuk/Z6lOat4lyIq9gKfH3MLS3aN1xi9qsPXTUVVNVzOCM/WHp8BcKYct04Bet5u8EosgVD8VKI9ls5YhmeM6nBapw/2wYkd3ZcVRFcFOOvxmeaBdvwQyeTwu/vy4VMl3hqoAoon6hYLcA3Pe4W2PG4au591jtioUUPA3WIzgMiLRWJrosRY/NvTL3iiSXYXdPJbclUAX54KwPQRsXuRbnvLsRIAnj1jZOHVdylKpaqRhMaA+lvH7YvF4l7uFBrdSPUKbHQi1DU7JbRKrMRNHUSe8b3tDBeHEIx1O+t/AIMG/8mHKNpHZ0nNaSH6WYZM5eKU2v3coTzLHEYvPs0CtLhc6ALc3OqMQ/DE4BfXPHK97tPiY+ziWVn/bmeSoe65g4O9eOuPzvm4wV1D6Yn/k2DxqGdx+GXkiXTlUTl9esNGxptWS477pcdD4wLsWc40qHNMVfyHmEILKHsNzbeJbvuU+qehFFjQVIy3SohNqPI9gtcqhWbauXkUHQqbnKSjVkv0WvnHR9A7dLoUlcPZ6Ga8TpoXGu8cSaM/BSU1FGRiy2SzAgzFRIvMJSF2t3dafbCO7xF49aRkU8S2sXbbBABCw7XdxgcothyO4zXsiFHOejS2cS0Gjp4qN2VqWMAqgVPTC8NCsGj87HZwzIeQEp8HELC1FWbDOvOLsXmjlxQgOQSXh7CnUE5AYs9KFkMqZZjk4G+0WAejngV2f6TO5Yfb0/+7ssLzdgCQ5PfdNa1y2Rw7HhVleE8XizMJNq/2uf3kbpl5uMUASlezZngMlP/r6W/AWBALAKNzq56jZFb9wNizTaxWrfOL6Q7ihm4gSmLGXWxPdlF7P/jIEJ+W5yqWijsy/VfhR8bHgftG+gTOKpZBaVGsC54vbgZaAE8rlcjRbDPXdbxEnkBS9ytcqNdvYc4r4qD7v4ZUtR2UhXzBg/GjjC2DHbMXSMKvTufr0si1CbkRgo3lNEYqdwNlRgcZtQhB8gqB3DRGFUU+Lz4Qu3TkxiOr3jnTWgbPieT0WWHJQCRJoFy8pZixrUS0L7LLMePfw9klorGHiLpYw8rV+/58/o2Ua0oHboUeDsNGs/GggOs7jbTICqKgiYLArMmbfLrYKTAmXF61VmD3IKB6WgLSOoQkFgtmz6NMqbfIhq8kaoua+cyke7k76xQSI=',X'671b88221b1fb0ea2f408796c6554dccd04be83941e2fac3a454a93e98e9c95c56950bd8360666ffc6f3e7e7bdd34b7a182a7550624c7fed0d4962837c565b60fb7eba45a8567d328b1d3983f1d995e8a1607807f67e46b2e067b1cdeef70ee9a2d58b642332a6f9c647b0eb3b65d610426e456216bcb120c8116ccfdb2b0b85624acb588e3d7a8f1b560a5bd3e4f47f66806395661efe713723b444bc33bbd0a084c194a7a2498bbec44d3b125b1a47c5dd6faad609872ea35b1f9cdf679263c8cbc201a26d07c151f655b4da09116292d264c7aa3336ca425118a0122ee6e3fafdecae14df21d9c008fbaa89502fadeed6fa7182786b754036fbce5ef308ca',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('F640544C0C8F2B39DA4CB9A58B44538F','C52',1,1,'kp6gv2c4Hp/gP7F1u/UXOGDPd+wSctRxr6RCC8U+Mvaj/ZYXW354t7tnWvQH+1r7LvW3nDhhuWJMbhFjrVMR1GZlcnq+3WNlZxuj44q+zv/yKiWJPImt8/fXGyXYVe0+Ys9ol/n/grt/vEFrc8QXeNeiB3g1di1KXcxu9oRnOJhEh2RLRR4VljY+zC46pC+ijLUy88pnHfSs0Him/tehQ4lJ6C97WWFRYJquVd5FJx8grKhY6XEWxhjch+5tNKSX8OAMfDTmj/bXS1JYEwD8B2WqO1TcIY90U9KEg9abR3flxXQxL9ejJ9UoCjAd1aJ3Wx6kNwB5CWYCg+VSWxMpDjpdGKNTBhyX2ZKP5gIACL3M0pzR7kqGVbJU9ostGX2YszRfws1PNaroG1ZfK5Je/GMvpnx1D5lZfxpc93px5yQ9zp7KtHjaGsazvZ7xWkrm2QTS/2yyP3fhmW8CWEsJ3OboUdVHOtbZYkiaw6EjfybNpucoGspYgfs7aA+pC9S/OygfdebLZmP1fEuuJbYx8HsvwllW0mj6poWc/mCahzPJsbp3Kb5h55WsNpEf0gNLxrtGYE/6iskyG0RhB5YO/mt/7ewl1rtYw576iON2+PKnmSpqFVG5WrdmxZvoC0iH6f1cm2QRxiHLBk832LR3tC5utODUoIyn3DNBcow+aL18I+VCL7qDYzOf0mXLjJ4JrDkETjM6Yg0NATdJ5GAlxSQvcs75vJxylfitl+bTPBFhEs4wlttbNjCZeVIXC/6pqNq5YEU0kcQCSfhwKCWjepJpAwlG1yQoHPFaYxCmGOjxWgQCgJVGNLWgRBOhUKTa139Vf05ylToVYfQFMmloxhhg2CAAkTbIJ5Dlg8g49LhAa8Da/s+QZ0PzySUDT6NhEzp26gSg2CvYKWpCjFWKMNOtPTXPUYb5sI9nSCR0Inh7eJyejBET6wFE2zJlFFd9rNIp4noPi89so3IrKYT8DBdKvD0REtPpSDLpCCDypOOB38LjiJgZpw0AsDJ5UFIJW1HKSjCY9l0EqUia13LSHeNVXH8kTD1+dw+6WGQ6SRYBOMJWfOCMGTpBm8XDG5SSzUePqLBA4tiWm/bpTq1NGM9JhOTzRZt6DH65McQZGe5t+t8as74BCCdQCpjSs2jEpejjSO0H0dPKitCEyu02j877dyZ4MOel/NOshQg6bE8o0IXkBjc/fO+vXmfSNoql7V5Okoz5XFfa6BUSpBuBCOnJPDalErFWirhityHuDFz5ISI3ccg/qFP9Z73dt3CDeKcDFFwU8O7BE4BlmLJIF9SgIL3OTrsxP7pstEyHRluMr1ZVFLOFRJvX7ULWfg0TpOKSk+8AtTiJSkl/80xL6RTZ5XAiumUMm1O8jQnamVNw9koZQGyailuO55Gt2nE36Wj9YR1UVQQzaI31qp8RxP0RCVMJ7Wq7DgTmSF85p+1ZVFhPynredYyP3arJ6EEA1GaI4sp5FoxwFwg8XUcuN88RoLHBP/k5Ewiiewm1Uh7UY/smCsqWe9Ys+6lmH5P0NpgCtAtBgDbClikfzaB/iyqGxQ6RbTcbS2tr7L52RAp3VM5vLOpI+dc/B+9mLHyCwbkCK/UndteapD4bFn1uHQQ9qszHm5oaZ58UN+kTCFY=',X'5884751f3bdd78b65aaa46c9133fdd4cc82cd2c374e5db46a0d89d8ffcb958229558a7e026aa8ab8ed719a6099e1f45e127e56fead6aaef6203e395cffaa468bc4be638909e51c2a3c077e8eea53b0718a095c4efdff29b13fc4f8c653f69cff0cd38b3ea885e5337c1f06d4b49129fb6149265f160b01afe8d2646143ef7a1316f3c2708af7b51cfafe18a8e66afd2e99c086b82d9287981a25408f0bc8346ef01ecefd1176286d5e8e055ab69f5e6b1284163b6903a5120cc6e76a1574b52f37e44561f86c104298a7957b2c52a2be442958cfed49d7a9cf78f0487337cc02c467c984fba891414eb5a619662ff041436c8b446395dfb38d60bf9476eabaeb',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('40252EF44AB3332AB358FADB1C381C38','C52',1,1,'c1weJeiTVaUCFkNaF9Y4TWTpwjEUQh/Wfpmalwu4+t9aABurZPuu4JRKDNVOyO38IclQHoX2TP7kOoNtchAhOxt9/Ev05aTZdLUeBZoHAj3T3oBZBz/cwe+DRet88Y35QdN72EJYGuLsMgjCE0/dI9v+Nwwq7SX90hBNYPLX+Fuv6VAH0EYegO79jie2ppqZ/WClY1GxhTRtDgJ+GObIu9VTYdYvU3ZUBeK76wWPyYxgpWnGNzIBuJgUc780xZQCp33OnIRIzldPb5Hcr2ArXpZ5GxbH3uK3OOVB2krTPwPCcKDzcUtswyaga6vhDZVLiscjzPfvXHtytmZm7N1HqYuw8gUSmoqgCZhFfidzGOCZnZ1PCYiNXCA00V7ijRuLYhHUi2WT1+Lgyi7R+DEeVcA78DEAZm+4PyZG2YH3DVI11L0c1d+bKGiFag7O4ZPzFtY06XB3Z53ALofRoSLQPdyk0gbGHtp7ZxmDbgrHyghxvdO1kDNc5kOvKNRW0kftPROS6I1UWJSHMiraKkQgrAAFqmrEQcbjbw7WwJfedh0kdfV/MjlR3bOk4frsR7Mr5X82mieS/BOFQC1zna+YYNmWK8gn10Syh0bMbKZ6mMrvd430le8AqXazgal78yvwPFhz8/lxocb10quoGJLWW0wARpTBHBCUOiiqLlRnopeQmRpPexZvZ5tNRufIbyY4pT74I2AslWydr2Rr9K7e9kkzUMTKft127KOawHvMmWJFgxhy+u4uclGa776pfUF/yxuffKl9nO3pUYVh+704p5ufsYqGxj3suQtXNLRiNRb0pEnvdC7Uz93cQa6NRJvXj6Q+gFFN/CLdTCgA7S8BhZbP7cF7RpaQhcJ2L/n3ppUklAMcwQ6Zg8x5sM6djIi8YqamThZcD1srBrCZ1mnnWhm5z+IkdU4rTZLpG9+0TMJ7aDI0sDYAIzh7mTYPQAoRLSji4VUuiLf//EtEhcJrlXherYKRoly5zZf+78qrxQzNr32jO56vqYQ/PMG8KRFmP7AQcG0pDtSo+UVpviY1AASfN5V1w08ss3syf/jG95jpIHfVCQWf5z/5JNah03NVD7fAbQl533SvRHehO9HZrxDRRBdpiD+vAApRNzhhD4wnTf2bgptHfyhauRqZh1iG+kkPdPpUzdL+H7l6wKMJ3tqGUsqGTtHrMe9NscyI6w507MEhjPMUR5V3XCyeJ9HQ6/DsLfwCCNemz8oI8dHO57z2vvcWbVvLTWUpD7968y/yk0VrDqysWC/Io8ZysrY5SIYVm2Fh2LAuCGlV6kInSvG8MhV/BdtuMg7LsIT400EW/nUxF5ImgIqNgSU6f/3Bs8WItO9PP5MUSeu+5SrpnSuR3P0VRfXqzScLAqWuvZh4sDqABnHkk1jPG0WPFWj0uMxMkOdVF7/pF91XVopW+pTXhwikGD6StuvYKOLwhVwmwaeaQXoo+/+UT6vXT7fy0UCL4dpmYGTZfDuOkZzVGyN1VNGXeOEUeiFvOFlq1djfuFgyOYuJNA2JhA/HEZJvI5A0FcGeJLiG3Lkin1y497ZS3tERBFMJpTAmBDZDenRElCb3RthRhOOlbkUH1IXzLyzlQbsxHfukfvd1e4Uhi1G/LwJSR1KmGmFT1y8YM8Y=',X'8439ee47256c0c1269ef72fb7e482fe737eb05a2395486c7b44763f03ee53dc8d1229bccee28c23e2d64a1d852c628185266e571edf9b223c5c3311391452d7b0a61d08126bd94b7d0ea7d38101a005cd0643cc95f33a9e2fe02d316872f481d35cd40b019639b43bae5e5c4afd49efc3a3116b22e57ecc56189d6a97e7e16f0f8c761788c5afce631e75d9c78eb6d87ffefb0dfd36157d4f302c4ab7cf4c0ad6343b2a90c21c6666f871f3c008b57a99e09da7a0cd7ed3dfe08dc9c8b0434412f0079218fdabdbaa9415a856d341b0c3f18801dad90f859d7a831b7606b5eac294f1d4362aa57e22ea73cca4b7b0feeaeffcef1e779786764b62a8cadc183b9',1,4096,0);
+INSERT INTO EbicsDownloadTransactions VALUES('A39E4AED69FA52311187E0D04D2E719D','C52',1,1,'XbvlXVhRVYGsJiaYAiFiWUoLpj/nFXVLqQJIJ6o7qHU+N7TWOOEli5tCsdYcHenNMate/hHjnDTdXkXrLWxBEUUdk2ZOwCm5fd7/TIuu0op7rpRudXAjYJY0gGgQ1qcAf1ILBxq0A01k/x4tC9uXcCClAYm9FEy9vbtQveYopryLJDK2u69Nx0nf4QKTaj0IFK3Ne7QwlJygP2zuBF+KCpM6QWGeNUEL+2LY/Nv742quC91Pgd2KXY8bCK7LE7yKSOxLjjpqqj56BPtasmlwIJeU+P+7VQTi/aD8D4bNjzCtM9jTHg+4Je2UQQPZe6pA3eTQnED01G1IUu0pU027IaxjZUOLp4EHyWPNgNZqDDiIRmllypzQCU67Gco6G01qkcCOOhwpkiL3KiT0Jg4XrOTm7Ij0hhldVOE7d07WhQO1FPoD73C0Av1l3ZaxIRHYrPvskv6JGzN4O9h9fPw6/VH6LlbxZKt/h+4UefSkbYnfcyqG3qOYeBgPyMl9hBtBN0Hl10BV1tc7LK8niFHQZfzxx39YmmoJMKXYdgvzrBjyNjeHFEkvajBEsUkLY15hUTseq0V2lMKu1+vMlnzM/lgwwjjDWU6/CfUIJxWOwhCPWO6s11at0JVk2jjIQM1Wxl3JV8zi73bBt8sdGVPdeXioXsUvlRFZ1nW9MkNdjar7JrRDMfTusmzir38UeAM9AL57RwR8MuzJye/kkBtH/Qbw++0baULjhTzQSz3VRcl39suOoBtTXeJx+qwVa11KmryISxyIeFHVrheTI5lZSuamvIS3ccJhtPgv7kMoSr24kholZ4qlq7ljXo0t9jd0MwFF0k7fBPhAGDHR1pO2VV3FNYXX2NOwreqnm4htOJlj68qGWX+SHzBtG8puE1UdOhnvnaKx80ZJqx8r/oKV9YQnCyFdvcY2ACeCnCLilxOn+BzlHDFBX6r5bZ2GFDMgixkyad0OEr0p1C6JWyvoBG97f540mVq7JU/rrkrSNYVJhZt3fIjNWaj/XSNxkifWWTIcNYgAGdTl9FZFyD+UEvb/hjfIfyCXJo7qf+RExl33+E55ChNSHoQyotXveYZiQ1Hos6bGus/fhxZjacoATtp2H897jM92/PSomJbztcwKsBAFq1v3hFr9A7F2yOgPIl4+TcPWuOcD/nNnLFCSY68BItlInW/0pPwjqXy9o8OtIynigdJgepv3Z2LR9vmPsXWUHNuMsNmayajK0jGLqaMO60UTXUklYx65dyTFiqz40Somz8Xkz5zSfeGfsvqdyxoWmzdwnn5k+NTd2HVnQsefa5/a0ywNpdMVQB7sWsTXKSXFCz3LslWOOHPPp1uQf9k/k2CSLla4AZsNpuqbtchEoyqgROdoGcab6G73ZLgKSLKwCW9/URBc5ECj8hDN0pn0DBdJiNbHb348LLoiFiRB3rOpB+1d8KF9qKBzk8X22NDOuFtyvlTlZKfLRbgtmVVCG/SmpZFgpXaDyz6cYYu4vBtLOmdoD7jmI5F/v23ovZS5KJyr+BEPpAJ4ZUKNT7HfJeJY/g3eN3dLAmics8ribx4DGuKEZIyH9m5EUdKyX3QgXYh6fHEdBLXwltzYbHKZsM3VRI62bihGcburP5ON2DmyYVjy8Fn5eU0Ey8Y=',X'49328ac8d80a8d4ca6844d1571e85e4a92a8035cb22198417cbb03efc4cf7fc1dbfe363edd64189941753fe2f885c479f5394f1eda5a8417baeed03c41ab4e053170e5fa3ccbd00a91e612dfc12c65c4624bb1b9c0800cb961fce70ad5cbad687aaf708a0bd9dff3f6f5f30d27b474c25e7e9707b10489d6e7b3bac832aa152d8e9c4220307dd33b0a5990b01669f06eaf51e16f76109455a57640476a3b4f08e02ad9d97e5256cf3441304308ce535d83bc25527329f673bcde5684879ddf5f1abefd195df262866fccd34061e3f53306af6787275e44bc21ec1ce1ce95b02c68c507e98eeaac876c1fb2d33877e54dfd6697337786006529c31c861ff3a913',1,4096,0);
+CREATE TABLE EbicsUploadTransactions (transactionID TEXT NOT NULL, orderType TEXT NOT NULL, orderID TEXT NOT NULL, host INT NOT NULL, subscriber INT NOT NULL, numSegments INT NOT NULL, lastSeenSegment INT NOT NULL, transactionKeyEnc BLOB NOT NULL, CONSTRAINT fk_EbicsUploadTransactions_host_id FOREIGN KEY (host) REFERENCES EbicsHosts(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_EbicsUploadTransactions_subscriber_id FOREIGN KEY (subscriber) REFERENCES EbicsSubscribers(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE EbicsUploadTransactionChunks (transactionID TEXT NOT NULL, chunkIndex INT NOT NULL, chunkContent BLOB NOT NULL);
+CREATE TABLE EbicsOrderSignatures (id INTEGER PRIMARY KEY AUTOINCREMENT, orderID TEXT NOT NULL, orderType TEXT NOT NULL, partnerID TEXT NOT NULL, userID TEXT NOT NULL, signatureAlgorithm TEXT NOT NULL, signatureValue BLOB NOT NULL);
+CREATE TABLE BankAccountFreshTransactions (id INTEGER PRIMARY KEY AUTOINCREMENT, "transaction" BIGINT NOT NULL, CONSTRAINT fk_BankAccountFreshTransactions_transaction_id FOREIGN KEY ("transaction") REFERENCES BankAccountTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO BankAccountFreshTransactions VALUES(1,1);
+INSERT INTO BankAccountFreshTransactions VALUES(2,2);
+INSERT INTO BankAccountFreshTransactions VALUES(3,3);
+INSERT INTO BankAccountFreshTransactions VALUES(4,4);
+CREATE TABLE BankAccountReports (id INTEGER PRIMARY KEY AUTOINCREMENT, reportId TEXT NOT NULL, creationTime BIGINT NOT NULL, xmlMessage TEXT NOT NULL, bankAccount INT NOT NULL, CONSTRAINT fk_BankAccountReports_bankAccount_id FOREIGN KEY (bankAccount) REFERENCES BankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE BankAccountStatements (id INTEGER PRIMARY KEY AUTOINCREMENT, statementId TEXT NOT NULL, creationTime BIGINT NOT NULL, xmlMessage TEXT NOT NULL, bankAccount INT NOT NULL, balanceClbd TEXT NOT NULL, CONSTRAINT fk_BankAccountStatements_bankAccount_id FOREIGN KEY (bankAccount) REFERENCES BankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE TalerWithdrawals (id INTEGER PRIMARY KEY AUTOINCREMENT, wopid BINARY(16) NOT NULL, amount TEXT NOT NULL, selectionDone BOOLEAN DEFAULT 0 NOT NULL, aborted BOOLEAN DEFAULT 0 NOT NULL, confirmationDone BOOLEAN DEFAULT 0 NOT NULL, reservePub TEXT NULL, selectedExchangePayto TEXT NULL, walletBankAccount INT NOT NULL, CONSTRAINT fk_TalerWithdrawals_walletBankAccount_id FOREIGN KEY (walletBankAccount) REFERENCES BankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO TalerWithdrawals VALUES(1,X'e85c38b2920444c9aab20f4926d20a6c','10',1,0,1,'HTW6DPCWEB0QCYAZ7ZTD89N17AMYR7BCRY06R727YNNJ47Q4GTHG','payto://iban/SANDBOXX/DE514871?receiver-name=Exchange+Company',9);
+INSERT INTO TalerWithdrawals VALUES(2,X'f383c7879f26482584e86aa90b10aff2','18',1,0,1,'K2V2B3YEMZFMWQ475KNV2HT7RSPA1YXFY210749MN9WBDCBT94AG','payto://iban/SANDBOXX/DE514871?receiver-name=Exchange+Company',10);
+CREATE TABLE DemobankCustomers (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT NOT NULL, passwordHash TEXT NOT NULL, "name" TEXT NULL);
+INSERT INTO DemobankCustomers VALUES(1,'fortytwo','sha256-salted$UtJxNQYxLoI=$stx5iheOyEgzfK+m9P2r3JSy70D8JTWXJtCD7grFX9M=','Forty Two');
+INSERT INTO DemobankCustomers VALUES(2,'fortythree','sha256-salted$i1FyvNRmgeE=$fezKwJxZA3gPSJygSi8dXyvMRxMkQHtXII9X5NClMAk=','Forty Three');
+INSERT INTO DemobankCustomers VALUES(3,'exchange','sha256-salted$VDGQkn7Usqs=$9cnyVBjO+WVIgTIyeQ7pD+U1Yj1ZZXHk9nX81w0DoFY=','Exchange Company');
+INSERT INTO DemobankCustomers VALUES(4,'tor','sha256-salted$FEsrX8Efm6k=$ZRickLniKTQ7tYUNKc8lDq3VCbE9KRsOfbrdK+GWk6g=','Tor Project');
+INSERT INTO DemobankCustomers VALUES(5,'gnunet','sha256-salted$ufN49w1+i+I=$sns8F5C5a+roZ4u783zl/34OSUCOBqHdPFF8VuEA6FI=','GNUnet');
+INSERT INTO DemobankCustomers VALUES(6,'tutorial','sha256-salted$xk/oqfFugxM=$adk5C9K4czaHBlMQn0qLeJfkmgLi1eVpMjcCuGeHiWA=','Tutorial');
+INSERT INTO DemobankCustomers VALUES(7,'survey','sha256-salted$Ny4FhY94KyY=$gxN0i88OAuj6mAA7auEjXAyNjfmAyq7QuwAbXs+PDKU=','Survey');
+INSERT INTO DemobankCustomers VALUES(8,'testuser-hwi9z7th','sha256-salted$DeOWXrnBY6A=$zH37tTKxrQEgpv17d1UW/sDpOYqfPvSM31o9zGkQaEE=',NULL);
+INSERT INTO DemobankCustomers VALUES(9,'testuser-7wwue25w','sha256-salted$HwpnyLja5bE=$lGADKhJ+fKW7k4ec+uDMhWeCI3me0Y0YXcYFGXPa1OU=',NULL);
+CREATE TABLE NexusScheduledTasks (id INTEGER PRIMARY KEY AUTOINCREMENT, resourceType TEXT NOT NULL, resourceId TEXT NOT NULL, taskName TEXT NOT NULL, taskType TEXT NOT NULL, taskCronspec TEXT NOT NULL, taskParams TEXT NOT NULL, nextScheduledExecutionSec BIGINT NULL, lastScheduledExecutionSec BIGINT NULL);
+INSERT INTO NexusScheduledTasks VALUES(1,'bank-account','exchange-nexus','exchange-payments','submit','* * *',replace('{\n "rangeType" : null,\n "level" : null\n}','\n',char(10)),1660496860,1660496857);
+INSERT INTO NexusScheduledTasks VALUES(2,'bank-account','exchange-nexus','exchange-history','fetch','* * *',replace('{\n "rangeType" : "latest",\n "level" : "report"\n}','\n',char(10)),1660496860,1660496857);
+CREATE TABLE NexusUsers (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT NOT NULL, password TEXT NOT NULL, superuser BOOLEAN NOT NULL);
+INSERT INTO NexusUsers VALUES(1,'exchange','sha256-salted$/p962JXzi/E=$cmuLHvEgTfLAXqctQ2FOIuKzVxgw50UT65CSslAPFqw=',1);
+CREATE TABLE NexusBankConnections (id INTEGER PRIMARY KEY AUTOINCREMENT, connectionId TEXT NOT NULL, "type" TEXT NOT NULL, "user" BIGINT NOT NULL, CONSTRAINT fk_NexusBankConnections_user_id FOREIGN KEY ("user") REFERENCES NexusUsers(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO NexusBankConnections VALUES(1,'talerconn','ebics',1);
+CREATE TABLE NexusBankAccounts (id INTEGER PRIMARY KEY AUTOINCREMENT, bankAccountId TEXT NOT NULL, accountHolder TEXT NOT NULL, iban TEXT NOT NULL, bankCode TEXT NOT NULL, defaultBankConnection BIGINT NULL, lastStatementCreationTimestamp BIGINT NULL, lastReportCreationTimestamp BIGINT NULL, lastNotificationCreationTimestamp BIGINT NULL, highestSeenBankMessageSerialId BIGINT NOT NULL, pain001counter BIGINT DEFAULT 1 NOT NULL, CONSTRAINT fk_NexusBankAccounts_defaultBankConnection_id FOREIGN KEY (defaultBankConnection) REFERENCES NexusBankConnections(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO NexusBankAccounts VALUES(1,'exchange-nexus','Account Holder','DE514871','SANDBOXX',1,NULL,NULL,NULL,14,1);
+CREATE TABLE NexusBankTransactions (id INTEGER PRIMARY KEY AUTOINCREMENT, accountTransactionId TEXT NOT NULL, bankAccount BIGINT NOT NULL, creditDebitIndicator TEXT NOT NULL, currency TEXT NOT NULL, amount TEXT NOT NULL, status VARCHAR(16) NOT NULL, updatedBy BIGINT NULL, transactionJson TEXT NOT NULL, CONSTRAINT fk_NexusBankTransactions_bankAccount_id FOREIGN KEY (bankAccount) REFERENCES NexusBankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_NexusBankTransactions_updatedBy_id FOREIGN KEY (updatedBy) REFERENCES NexusBankTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO NexusBankTransactions VALUES(1,'AcctSvcrRef:LWA21AG2',1,'CRDT','TESTKUDOS','10','BOOK',NULL,replace('{\n "amount" : "TESTKUDOS:10",\n "creditDebitIndicator" : "CRDT",\n "status" : "BOOK",\n "bankTransactionCode" : "PMNT-ICDT-ESCT",\n "valueDate" : "2022-08-14Z",\n "bookingDate" : "2022-08-14Z",\n "accountServicerRef" : "LWA21AG2",\n "batches" : [ {\n "batchTransactions" : [ {\n "amount" : "TESTKUDOS:10",\n "creditDebitIndicator" : "CRDT",\n "details" : {\n "debtor" : {\n "name" : "Name unknown"\n },\n "debtorAccount" : {\n "iban" : "DE729925"\n },\n "debtorAgent" : {\n "bic" : "SANDBOXX"\n },\n "endToEndId" : "NOTPROVIDED",\n "paymentInformationId" : "NOTPROVIDED",\n "unstructuredRemittanceInformation" : "HTW6DPCWEB0QCYAZ7ZTD89N17AMYR7BCRY06R727YNNJ47Q4GTHG"\n }\n } ]\n } ]\n}','\n',char(10)));
+INSERT INTO NexusBankTransactions VALUES(2,'AcctSvcrRef:DLBB92WX',1,'CRDT','TESTKUDOS','18','BOOK',NULL,replace('{\n "amount" : "TESTKUDOS:18",\n "creditDebitIndicator" : "CRDT",\n "status" : "BOOK",\n "bankTransactionCode" : "PMNT-ICDT-ESCT",\n "valueDate" : "2022-08-14Z",\n "bookingDate" : "2022-08-14Z",\n "accountServicerRef" : "DLBB92WX",\n "batches" : [ {\n "batchTransactions" : [ {\n "amount" : "TESTKUDOS:18",\n "creditDebitIndicator" : "CRDT",\n "details" : {\n "debtor" : {\n "name" : "Name unknown"\n },\n "debtorAccount" : {\n "iban" : "DE729731"\n },\n "debtorAgent" : {\n "bic" : "SANDBOXX"\n },\n "endToEndId" : "NOTPROVIDED",\n "paymentInformationId" : "NOTPROVIDED",\n "unstructuredRemittanceInformation" : "K2V2B3YEMZFMWQ475KNV2HT7RSPA1YXFY210749MN9WBDCBT94AG"\n }\n } ]\n } ]\n}','\n',char(10)));
+CREATE TABLE PaymentInitiations (id INTEGER PRIMARY KEY AUTOINCREMENT, bankAccount BIGINT NOT NULL, preparationDate BIGINT NOT NULL, submissionDate BIGINT NULL, "sum" DECIMAL(20, 2) NOT NULL, currency TEXT NOT NULL, endToEndId TEXT NOT NULL, paymentInformationId TEXT NOT NULL, instructionId TEXT NOT NULL, subject TEXT NOT NULL, creditorIban TEXT NOT NULL, creditorBic TEXT NULL, creditorName TEXT NOT NULL, submitted BOOLEAN DEFAULT 0 NOT NULL, messageId TEXT NOT NULL, rawConfirmation BIGINT NULL, CONSTRAINT fk_PaymentInitiations_bankAccount_id FOREIGN KEY (bankAccount) REFERENCES NexusBankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_PaymentInitiations_rawConfirmation_id FOREIGN KEY (rawConfirmation) REFERENCES NexusBankTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE NexusEbicsSubscribers (id INTEGER PRIMARY KEY AUTOINCREMENT, ebicsURL TEXT NOT NULL, hostID TEXT NOT NULL, partnerID TEXT NOT NULL, userID TEXT NOT NULL, systemID TEXT NULL, signaturePrivateKey BLOB NOT NULL, encryptionPrivateKey BLOB NOT NULL, authenticationPrivateKey BLOB NOT NULL, bankEncryptionPublicKey BLOB NULL, bankAuthenticationPublicKey BLOB NULL, nexusBankConnection BIGINT NOT NULL, ebicsIniState VARCHAR(16) NOT NULL, ebicsHiaState VARCHAR(16) NOT NULL, CONSTRAINT fk_NexusEbicsSubscribers_nexusBankConnection_id FOREIGN KEY (nexusBankConnection) REFERENCES NexusBankConnections(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO NexusEbicsSubscribers VALUES(1,'http://localhost:18082/ebicsweb','talerebics','talerpartner','exchangeebics',NULL,X'308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100a03098ff00d2f1d4f9ef23e8c29e687c9d206404605896c548793a0fd6ad563bcd256524b3ca2816c1df50252b3a413c8ee1781cfcaf06cfea4adc64b4a895768b2ef25fe38011364e5b8198a4aa0a517a64bf01a798ddb1200439990e13e4cb3c82d79b8ece3f725e0d81053d5a31befdeb6e2841dc0a5404aaf31d7b9ce5398d97f362a531d2a4b199669072bed882bd10fb354b45416544d975a5cbde40c000ebcac8a6038ba921a46a69e3b9dc87c7ae8e5a4805b45f08e25b6e76f746ed82a86f5ae10ac5b4107722119e67db808508c73643b95b1855e45cfa9095ee7b07ffdd86486611eef5d581235fe5008a7e079f0897aa7103969926a9e76f239f020301000102820100401570ff82eae0c81cfca856f394bfa42a8fccb35b7fd541334f1c053e12b60ed27105577b7d8230287b17eae6b2356aee9610a1380d2522844e52810f2cea2e345c21a66eb2cb2ff884ef018bce62b659ca7807476f063157e798cb3c308535310dff0742480c65ca6e8890fa0c5d1e55229c3d0aabe68dda18318e37e77a63bb01c1768dbc9be48b9d805358862ae0035d74aade349aa9ce3856610f11e5ee3966f615ed159224629ab1c5a3cc1cb07cb6036e979b7b3fccf161e79619ddb5dfe6f6a50a930233a97cf2caa26ec676735a07e36b56f580e4c0400b3929fa51d7885b11530f060ecdf768a346b2c15c3e4476ee54869110cd061a9eee18dde102818100dffa28b59b6f7e0304d45389efd9981710afd8b742ce1e0756da8f1be3e2a9075ee651db9a3c47251155029b5de9090e4884772bb5de15421f442cc15d111c0bfae19eb16db8156625cb08da610b9bda781ccb388e531909bdb9f5f0735ed121d0e2df26b1f43ba7b9d78ca594a49bc59f694f77bd0d8d31907f60dc0910690902818100b717be36b3eb711cc9abf10e967cc79878344bfcc3d3deef4fad1bea89f681661c973315487064810c8cd6b4c9cc0e6ced1af95b1afda072a91f7e02e3de6f9fc30ea2c50d4e26861579114f8f71d6a6ad5d23e9ae08923e24db98d2ae2504468c2382a4bcb29f35998d21f27bcf1b9af205dbedeeb2f11123a878acfebb196702818100b62b89a0ec63aa625a33381f20ee223de05ca62fa82e6d4e1ade79377e0a84e071d7730ce24dd4afd9810335cb1417417ec9ff039650a389bc547ef266f7db9002e62f64b090e116cbf66fa4eef9ba31df2fcc3a9bc80abd598b3ef5eb605b48ddd5291b17f245f30dbcbbb0914db144f37b7c1f2fad2e01fa3d2052d72c79c1028180154635fce7350144a60e4b893565344ffc0f9f90b4346720097304de60bf7ad3a198d3ffb2161527858ccbd9dfe4ccfc4d24a83ab4cd299a891a36ab214d144d4cfde35de028e78306f5b5543847b2f855069088b3871d6f091b570b8bde933b9b46f9042944dc08ff598dcb3e2597808e84adc45ccb0005cccde38fbe5d811b02818005d64a2996a8decfed4e56984ca60b6852a8d5962d6f87a90b48c54989f9b07c549fa2eecb5954f6f40055404cf62c6cf5204ab55a3803ce5263068b25d46f4c3cd6c766eed9ffc03bf4b5f7fcaeff0647af27dd28896f63ebca820d53649c90fb0d19c7d88beaed67133e5e1dfaa09eb649b3bcff7fc0a88199e7a65ff402da',X'308204be020100300d06092a864886f70d0101010500048204a8308204a40201000282010100b0ceebf64877cd9a8f331caa9c24ea334e4afc1b9744aff9ea02b14d973f86018e00955e8e9e109fd6b55021e15adff4f224cf0c0736ed203fbf914dda8555f66ddb921bf2560637f6b3457a46bc2b83bea579fdc0e8254de0320bf6686c2571581e38ee204b7c366ee3299b683251596548d8944f8110613ddf2004770722c76f8ff1000c76dca6560d7725e9fe5fa6bb053db0bd567fe0831966fe2f5020aecc35d40154bd91275e0ca72c83b67b26b7dd597e3bf0ed83434ec87d107ad2fbdc4a0df2ecf974b5f0446d517a8bfce43e855b848f212d99ffa7c7590d7d8dfc93657b3ade490696f1e55bb8681009dd4403e13f9abe1dce30f24895fa7e0c99020301000102820100017e9e4c04acce9621e3c2b8467da16531a23ca357120392cf419a9217573820c73c8606b899e976107093eed562d945cece34d9db2dc1af661a8e75e405008706c2b6677a12f41681055eeefbae178813927e87809bf5c4c4c2678b7bb27e5688f228750adcd87df54e024a080574de9696990e17e5f5677d0867d2e1d6b39a8c5e49eb8e471a4ddcae02536a0b937d2f52b5eccf1c8e52af9946884b6b293fc40e7bdf5a40db014e3d75abf0e0b9cb02d5c37937da0873f7f7ba06a3eb3dcc1b6f616d0c87d6bf157e662d4320e4fcd317fffde0f7435cc45090b4e57f68dcc00c2af7b8ffd837fdcff124e80e5d684721b1dbc0a88d5add1e5f25a3ad7a0102818100edf52e9138afb895a59ecb0a98d208c8b04ded15132550bf46c86eb61139b87a8635bd0f4df060fa0194bd90e414dc7b9d972870394b16d00c93251f5cc64e8bbdee6d72d77b8c074fc8fe2845cadbc836b5f542d7028015c1df56c6e7a2ad27a7918cb5d95fc18b969b21d69684ec674cebc1b3253312e40f3303d3300b83b902818100be36d05e19b63c928b863c8be5828107414a9bb0712f98d6699e8a8083ffeb02b02aa292c6efb9ce84c76ef7c9d5fd0e9fec6720ce50ac2fc8e53ac3635b009484415a1046fcdb512c45fbcb428b790982589a11380de407a00e34bf56b20c31d7fee640a4fee327fdfa4dd27a1511263c6bc44f395482679a3eaf09927affe1028180595fd870b4f0d30c69db5d798a7280d817d7fcef0874e082272ccae05951eba7215777be12d0f12b95826f3cc75dca7e276f89c1b4d32e2b503dc818a278dd318151d70be6414213d0f4b5f91c5597fcf80799a9d425dd43cec07ad05459f65d4983d26ccecb375f9d5e80f41f2ea7b818dd07b0a88d29503d213513921d110902818100b9dd09c1c951fee21b1fb1ede8f79a68a26deaaf8009c8484ab03619d9e1a99bd8d3f04387cc1b3d271550e322ffcbe40c748d58cb009d1f9c28114176c6274cf7e67bc0c7fcafb9238fc6b8186ffc77443c9b5f13ecced27c9d25018a0f3447480db4a39a15cd94f8612ac5edb0c42f1e7f17356a899f5ae8a7339620e1bb4102818100c303637b559ae4d14e22edf46730a6af3fe48489fef315703684f985c4dbe4fa00162a47c06a91484966a99933676de2fdfb1db87bb83cfdf2c4468be2ebc32171132ea079f8b355b1f8256f4c29a1e509661e692031e330daa73141507181994a7887cf8cbc25a32b68ca001320d097f50a842e4707bb214e0133d72e1ebc29',X'308204bc020100300d06092a864886f70d0101010500048204a6308204a2020100028201010080f109291d50ac1d186bc40584f8a2115d736d7ad311bd4f62a0f83e6bd49b847a6d8875d5f9e1bf4055cabefd619fee55cf21723799d2415018ac98275716c67ec6fb51f88fa4ca09c1bd710f16c7c2a09c4d5bac2666bede0325655a409d4a08cee6221be791984c65985d434bb2ca10603c84237633ba5d32c4220d2f0ef7c25b94c18edbe30a55da170531b3b1edfac012dea78696981a3967e9dfae10006dc0f8ce1f8af3c6e99ba57e1c30118ca90b43aea96a49df16169163b21274a6ce568e306b15da4b95720ab58ebdd2bb618cc5330b5c969b4ab57cee55e1413012d305ce8c1a16aa938e5940d5daca716408f8a0ff0c2da516baed034cbbfde10203010001028201001135198ddd15a9027101e0b503dbd27512cd96acaf824c8b4d9441ccc2c32ac5f138b0df58e0f2197dd2752e2bce5d73870c0f6098bef46a36f034085227b328663ed3c74aae90c54dac074611476efd3045eba4f24265afcf1d085e903ed33ed0121c702cdd2876f4ab123c5000c829632a14a965ba1e891e6ae9f5c960a0548ba0f8c80fc0b44b2bcbfd7cb262faebcc48a1dd3087168e8ad688d81d1db2648a67827d7d6d19bbe2716cab80ee519f6df12a2717e1a72e1159a74ff99ab33bccf6457d00b311f4ce16c10dea334d6acdb49d17c3354c0bc09f76e0d67d889625b5bb88f54236e3f100a8175a0559b7313dca7c077137eb12a393f16b0a51e102818100b94d3e1b3c8fe822780894d402abc0bdb047e3ac6d61a472d1c97b29a1f5aedd285c13ef27bd96658a064f68d7834971912d9d44afcac8210b82d7be22959f1ec9bcdd35ca22b3be1fbf5e3a692083c34ad8fd4f9b3841ec6b7bdfe8a91c5d2029ec514e00d0a32795b4ea26f9f7e5bca01179384c27cfb87e5da67f14720b3502818100b222fdd00bac834f5d496bed29a79a956a20a9426e78cdaf75218c32a1a7c4a68e28bf063163aa0a5151ce4c99ea77bc80edfaf08f5966f05003cfd83aef41e04ac9f9795d55300a359bc0309663303b60c614aeeafd12534b5093789c03f772d5e0fd7b8b7c9c9a5a44a63019eb54bcdfebae30447276f8a368d97be0d6117d02818077010576e681213b29cd910f4b9bd44fbe6b9ceb3ae02f85d1f74c92e341ee8878081281500b71104b015c745f9c2049c04c04297da084c0bc2cceb37c708cdd70004c2ce4613f0046515789b9c438faee11c7351de1966ce86688d959ea2e609eabf7575a2ca3eba338a9fc5822fdb71331c5a1033fba26a9792999899ee85502818072abebcf9d74342346de18c7d6e4b9b22d5b511a1e9b4d6d016dd31e54c9f6e170e9f1ee3ea4f5b5269c0ebd68e772a4ba2a783b9b4be5e414de1f5206be361df887043d88436a65681517272fe832084747bbd0ce1c934b63543f5a88b454fa6b8c2620fdadfdf1aee23a4904a6652a20cb4a9a6fb56fb8a718bbc7eef85ed102818064df3f7c47baa50d894fefc0d712cb71579112d773bebfa89b01bee826800c0faf6307d5237adf7a2e12deff9968cc598e58e88298892d6b2051d9639377b36d765434136cea010e4b61a13eef486308e250f901c59ac9e6de8e14bcb34db3aa42918f98f24e8f5ecf882c7ba3814ae6fe5352ac009481239df40fde5e76db27',X'30820122300d06092a864886f70d01010105000382010f003082010a0282010100a07146544ea9da3cad747f447799c166c54df89d908f65dbc5c9c509ce92427aa31a1f386d59adb8bbcc0e6272cc628c0b53e67efc853d93855bd058f1bc659e8c9cd67f52bb13b3008bc677763c9278ce6b1c76972e8ce2d3eecf0b408aa8fdc0615b680ba491f91ae9349072dbfa969cb007846e4282daebb0cbc9283cb6b4746a9da6824de3a09b486182d689cac024b6b5749f6d77b660f3aaa708c83a7534bc55e33298c0a59efa02db44438c4fa573f85921fa80e2e9bad798b3cbf8f965672d6a16219059e6bf6bfc78a7a6fb634922a7739aaf0a336466ddde78952639e54a0565ac71dee8d4fbef9a62be4c1ffe70df8da4e1b979bcc717d0826b010203010001',X'30820122300d06092a864886f70d01010105000382010f003082010a02820101009db344205a0a1da5925bce9ac63141e3df90bf37f9b48472d3ba9095ae5c471f6a4f3f2c662a2f76fb82e1c1c6f47c85db29df664cf629fb7c028b65a20b9632abda20a15fc1480cc40c0d35f252197b80cf3592f90891791fa9a9fd385043319f5bd904d4e14b4a3e1d4a21fa74e0f3b6a8d45a8016677a22dec34ae9c8659bfbfa65e04a30c4337699044f340995a6e6bc2003f1126e2c8cb1274bde543753cf7cc0fd643b4c3f9fa13e609b0ea0b6bda537209b1555eda704c98109aaaf4c9696b7ac5daefa8521ce5465bf791fab73012c053c9e3b11583cb7a3035f6c222a56e750425a7fca673e88fe893c53cfb907420e243a95fb858f84a4b8247d210203010001',1,'SENT','SENT');
+CREATE TABLE NexusBankBalances (id INTEGER PRIMARY KEY AUTOINCREMENT, balance TEXT NOT NULL, creditDebitIndicator TEXT NOT NULL, bankAccount BIGINT NOT NULL, "date" TEXT NOT NULL, CONSTRAINT fk_NexusBankBalances_bankAccount_id FOREIGN KEY (bankAccount) REFERENCES NexusBankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE AnastasisIncomingPayments (id INTEGER PRIMARY KEY AUTOINCREMENT, payment BIGINT NOT NULL, subject TEXT NOT NULL, timestampMs BIGINT NOT NULL, incomingPaytoUri TEXT NOT NULL, CONSTRAINT fk_AnastasisIncomingPayments_payment_id FOREIGN KEY (payment) REFERENCES NexusBankTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE TalerIncomingPayments (id INTEGER PRIMARY KEY AUTOINCREMENT, payment BIGINT NOT NULL, reservePublicKey TEXT NOT NULL, timestampMs BIGINT NOT NULL, incomingPaytoUri TEXT NOT NULL, CONSTRAINT fk_TalerIncomingPayments_payment_id FOREIGN KEY (payment) REFERENCES NexusBankTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO TalerIncomingPayments VALUES(1,1,'HTW6DPCWEB0QCYAZ7ZTD89N17AMYR7BCRY06R727YNNJ47Q4GTHG',1660496840600,'payto://iban/SANDBOXX/DE729925?receiver-name=Name+unknown');
+INSERT INTO TalerIncomingPayments VALUES(2,2,'K2V2B3YEMZFMWQ475KNV2HT7RSPA1YXFY210749MN9WBDCBT94AG',1660496847228,'payto://iban/SANDBOXX/DE729731?receiver-name=Name+unknown');
+CREATE TABLE Facades (id INTEGER PRIMARY KEY AUTOINCREMENT, facadeName TEXT NOT NULL, "type" TEXT NOT NULL, creator BIGINT NOT NULL, CONSTRAINT fk_Facades_creator_id FOREIGN KEY (creator) REFERENCES NexusUsers(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO Facades VALUES(1,'test-facade','taler-wire-gateway',1);
+CREATE TABLE TalerRequestedPayments (id INTEGER PRIMARY KEY AUTOINCREMENT, facade BIGINT NOT NULL, payment BIGINT NOT NULL, requestUid TEXT NOT NULL, amount TEXT NOT NULL, exchangeBaseUrl TEXT NOT NULL, wtid TEXT NOT NULL, creditAccount TEXT NOT NULL, CONSTRAINT fk_TalerRequestedPayments_facade_id FOREIGN KEY (facade) REFERENCES Facades(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_TalerRequestedPayments_payment_id FOREIGN KEY (payment) REFERENCES PaymentInitiations(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE FacadeState (id INTEGER PRIMARY KEY AUTOINCREMENT, bankAccount TEXT NOT NULL, bankConnection TEXT NOT NULL, currency TEXT NOT NULL, reserveTransferLevel TEXT NOT NULL, facade BIGINT NOT NULL, highestSeenMessageSerialId BIGINT DEFAULT 0 NOT NULL, CONSTRAINT fk_FacadeState_facade_id FOREIGN KEY (facade) REFERENCES Facades(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO FacadeState VALUES(1,'exchange-nexus','talerconn','TESTKUDOS','UNUSED',1,2);
+CREATE TABLE TalerInvalidIncomingPayments (id INTEGER PRIMARY KEY AUTOINCREMENT, payment BIGINT NOT NULL, timestampMs BIGINT NOT NULL, refunded BOOLEAN DEFAULT 0 NOT NULL, CONSTRAINT fk_TalerInvalidIncomingPayments_payment_id FOREIGN KEY (payment) REFERENCES NexusBankTransactions(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+CREATE TABLE NexusBankMessages (id INTEGER PRIMARY KEY AUTOINCREMENT, bankConnection BIGINT NOT NULL, messageId TEXT NOT NULL, code TEXT NOT NULL, message BLOB NOT NULL, errors BOOLEAN DEFAULT 0 NOT NULL, CONSTRAINT fk_NexusBankMessages_bankConnection_id FOREIGN KEY (bankConnection) REFERENCES NexusBankConnections(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO NexusBankMessages VALUES(1,1,'sandbox-1660496829108','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363832393130383c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a30392e3130383535345a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a30392e3130383535345a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(2,1,'sandbox-1660496831480','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363833313438303c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31312e3438303730375a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31312e3438303730375a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(3,1,'sandbox-1660496833707','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363833333730373c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31332e3730373839325a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31332e3730373839325a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(4,1,'sandbox-1660496835920','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363833353932303c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31352e3932303532395a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31352e3932303532395a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(5,1,'sandbox-1660496838119','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363833383131393c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31382e3131393832325a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a31382e3131393832325a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(6,1,'sandbox-1660496840341','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363834303334313c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32302e3334313936365a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32302e3334313936365a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(7,1,'sandbox-1660496842676','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363834323637363c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32322e3637363138325a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32322e3637363138325a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(8,1,'sandbox-1660496844874','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363834343837343c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32342e3837343039335a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32342e3837343039335a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(9,1,'sandbox-1660496847050','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363834373035303c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32372e3035303630345a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32372e3035303630345a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e32383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e444c4242393257583c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393733313c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4b325632423359454d5a464d57513437354b4e56324854375253504131595846593231303734394d4e39574244434254393441473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(10,1,'sandbox-1660496849291','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363834393239313c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32392e3239313633385a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a32392e3239313633385a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e32383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e444c4242393257583c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393733313c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4b325632423359454d5a464d57513437354b4e56324854375253504131595846593231303734394d4e39574244434254393441473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(11,1,'sandbox-1660496851469','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363835313436393c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33312e3436393236315a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33312e3436393236315a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e32383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e444c4242393257583c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393733313c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4b325632423359454d5a464d57513437354b4e56324854375253504131595846593231303734394d4e39574244434254393441473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(12,1,'sandbox-1660496853634','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363835333633343c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33332e3633343034375a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33332e3633343034375a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e32383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e444c4242393257583c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393733313c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4b325632423359454d5a464d57513437354b4e56324854375253504131595846593231303734394d4e39574244434254393441473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(13,1,'sandbox-1660496855791','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363835353739313c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33352e3739313034345a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33352e3739313034345a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e32383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e444c4242393257583c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393733313c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4b325632423359454d5a464d57513437354b4e56324854375253504131595846593231303734394d4e39574244434254393441473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+INSERT INTO NexusBankMessages VALUES(14,1,'sandbox-1660496857946','C52',X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0a3c446f63756d656e7420786d6c6e733d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e636522207873693a736368656d614c6f636174696f6e3d2275726e3a69736f3a7374643a69736f3a32303032323a746563683a7873643a63616d742e3035322e3030312e30322063616d742e3035322e3030312e30322e787364223e0a20203c426b546f4373746d72416363745270743e0a202020203c4772704864723e0a2020202020203c4d736749643e73616e64626f782d313636303439363835373934363c2f4d736749643e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33372e3934363836335a3c2f4372654474546d3e0a202020203c2f4772704864723e0a202020203c5270743e0a2020202020203c49643e303c2f49643e0a2020202020203c456c6374726e635365714e623e303c2f456c6374726e635365714e623e0a2020202020203c4c676c5365714e623e303c2f4c676c5365714e623e0a2020202020203c4372654474546d3e323032322d30382d31345431373a30373a33372e3934363836335a3c2f4372654474546d3e0a2020202020203c416363743e0a20202020202020203c49643e0a202020202020202020203c4942414e3e44453531343837313c2f4942414e3e0a20202020202020203c2f49643e0a20202020202020203c4363793e544553544b55444f533c2f4363793e0a20202020202020203c4f776e723e0a202020202020202020203c4e6d3e44656269746f722f4f776e6572204e616d653c2f4e6d3e0a20202020202020203c2f4f776e723e0a20202020202020203c537663723e0a202020202020202020203c46696e496e73746e49643e0a2020202020202020202020203c4e6d3e4c6962657566696e2042616e6b3c2f4e6d3e0a2020202020202020202020203c4f7468723e0a20202020202020202020202020203c49643e303c2f49643e0a20202020202020202020202020203c497373723e58593c2f497373723e0a2020202020202020202020203c2f4f7468723e0a202020202020202020203c2f46696e496e73746e49643e0a20202020202020203c2f537663723e0a2020202020203c2f416363743e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e505243443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c42616c3e0a20202020202020203c54703e0a202020202020202020203c43644f7250727472793e0a2020202020202020202020203c43643e434c42443c2f43643e0a202020202020202020203c2f43644f7250727472793e0a20202020202020203c2f54703e0a20202020202020203c416d74204363793d22544553544b55444f53223e32383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f44743e0a2020202020203c2f42616c3e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e4c574132314147323c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31303c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393932353c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4854573644504357454230514359415a375a544438394e3137414d59523742435259303652373237594e4e4a34375134475448473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a2020202020203c4e7472793e0a20202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020203c436474446274496e643e435244543c2f436474446274496e643e0a20202020202020203c5374733e424f4f4b3c2f5374733e0a20202020202020203c426f6f6b6744743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f426f6f6b6744743e0a20202020202020203c56616c44743e0a202020202020202020203c44743e323032322d30382d31345a3c2f44743e0a20202020202020203c2f56616c44743e0a20202020202020203c41636374537663725265663e444c4242393257583c2f41636374537663725265663e0a20202020202020203c426b547843643e0a202020202020202020203c446f6d6e3e0a2020202020202020202020203c43643e504d4e543c2f43643e0a2020202020202020202020203c466d6c793e0a20202020202020202020202020203c43643e494344543c2f43643e0a20202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a2020202020202020202020203c2f466d6c793e0a202020202020202020203c2f446f6d6e3e0a202020202020202020203c50727472793e0a2020202020202020202020203c43643e303c2f43643e0a2020202020202020202020203c497373723e58593c2f497373723e0a202020202020202020203c2f50727472793e0a20202020202020203c2f426b547843643e0a20202020202020203c4e74727944746c733e0a202020202020202020203c547844746c733e0a2020202020202020202020203c526566733e0a20202020202020202020202020203c4d736749643e4e4f5450524f56494445443c2f4d736749643e0a20202020202020202020202020203c506d74496e6649643e4e4f5450524f56494445443c2f506d74496e6649643e0a20202020202020202020202020203c456e64546f456e6449643e4e4f5450524f56494445443c2f456e64546f456e6449643e0a2020202020202020202020203c2f526566733e0a2020202020202020202020203c416d7444746c733e0a20202020202020202020202020203c5478416d743e0a202020202020202020202020202020203c416d74204363793d22544553544b55444f53223e31383c2f416d743e0a20202020202020202020202020203c2f5478416d743e0a2020202020202020202020203c2f416d7444746c733e0a2020202020202020202020203c426b547843643e0a20202020202020202020202020203c446f6d6e3e0a202020202020202020202020202020203c43643e504d4e543c2f43643e0a202020202020202020202020202020203c466d6c793e0a2020202020202020202020202020202020203c43643e494344543c2f43643e0a2020202020202020202020202020202020203c537562466d6c7943643e455343543c2f537562466d6c7943643e0a202020202020202020202020202020203c2f466d6c793e0a20202020202020202020202020203c2f446f6d6e3e0a20202020202020202020202020203c50727472793e0a202020202020202020202020202020203c43643e303c2f43643e0a202020202020202020202020202020203c497373723e58593c2f497373723e0a20202020202020202020202020203c2f50727472793e0a2020202020202020202020203c2f426b547843643e0a2020202020202020202020203c526c746450746965733e0a20202020202020202020202020203c446274723e0a202020202020202020202020202020203c4e6d3e4e616d6520756e6b6e6f776e3c2f4e6d3e0a20202020202020202020202020203c2f446274723e0a20202020202020202020202020203c44627472416363743e0a202020202020202020202020202020203c49643e0a2020202020202020202020202020202020203c4942414e3e44453732393733313c2f4942414e3e0a202020202020202020202020202020203c2f49643e0a20202020202020202020202020203c2f44627472416363743e0a2020202020202020202020203c2f526c746450746965733e0a2020202020202020202020203c526c7464416774733e0a20202020202020202020202020203c446274724167743e0a202020202020202020202020202020203c46696e496e73746e49643e0a2020202020202020202020202020202020203c4249433e53414e44424f58583c2f4249433e0a202020202020202020202020202020203c2f46696e496e73746e49643e0a20202020202020202020202020203c2f446274724167743e0a2020202020202020202020203c2f526c7464416774733e0a2020202020202020202020203c526d74496e663e0a20202020202020202020202020203c55737472643e4b325632423359454d5a464d57513437354b4e56324854375253504131595846593231303734394d4e39574244434254393441473c2f55737472643e0a2020202020202020202020203c2f526d74496e663e0a202020202020202020203c2f547844746c733e0a20202020202020203c2f4e74727944746c733e0a2020202020203c2f4e7472793e0a202020203c2f5270743e0a20203c2f426b546f4373746d72416363745270743e0a3c2f446f63756d656e743e',0);
+CREATE TABLE OfferedBankAccounts (id INTEGER PRIMARY KEY AUTOINCREMENT, offeredAccountId TEXT NOT NULL, bankConnection BIGINT NOT NULL, iban TEXT NOT NULL, bankCode TEXT NOT NULL, holderName TEXT NOT NULL, imported BIGINT NULL, CONSTRAINT fk_OfferedBankAccounts_bankConnection_id FOREIGN KEY (bankConnection) REFERENCES NexusBankConnections(id) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT fk_OfferedBankAccounts_imported_id FOREIGN KEY (imported) REFERENCES NexusBankAccounts(id) ON DELETE RESTRICT ON UPDATE RESTRICT);
+INSERT INTO OfferedBankAccounts VALUES(1,'exchange',1,'DE514871','SANDBOXX','Account Holder',1);
+CREATE TABLE NexusPermissions (id INTEGER PRIMARY KEY AUTOINCREMENT, resourceType TEXT NOT NULL, resourceId TEXT NOT NULL, subjectType TEXT NOT NULL, subjectName TEXT NOT NULL, permissionName TEXT NOT NULL);
+DELETE FROM sqlite_sequence;
+INSERT INTO sqlite_sequence VALUES('DemobankConfigs',1);
+INSERT INTO sqlite_sequence VALUES('BankAccounts',10);
+INSERT INTO sqlite_sequence VALUES('DemobankCustomers',9);
+INSERT INTO sqlite_sequence VALUES('EbicsHosts',1);
+INSERT INTO sqlite_sequence VALUES('EbicsSubscribers',1);
+INSERT INTO sqlite_sequence VALUES('NexusUsers',1);
+INSERT INTO sqlite_sequence VALUES('NexusBankConnections',1);
+INSERT INTO sqlite_sequence VALUES('NexusEbicsSubscribers',1);
+INSERT INTO sqlite_sequence VALUES('EbicsSubscriberPublicKeys',3);
+INSERT INTO sqlite_sequence VALUES('OfferedBankAccounts',1);
+INSERT INTO sqlite_sequence VALUES('NexusBankAccounts',1);
+INSERT INTO sqlite_sequence VALUES('NexusScheduledTasks',2);
+INSERT INTO sqlite_sequence VALUES('Facades',1);
+INSERT INTO sqlite_sequence VALUES('FacadeState',1);
+INSERT INTO sqlite_sequence VALUES('NexusBankMessages',14);
+INSERT INTO sqlite_sequence VALUES('TalerWithdrawals',2);
+INSERT INTO sqlite_sequence VALUES('BankAccountTransactions',4);
+INSERT INTO sqlite_sequence VALUES('BankAccountFreshTransactions',4);
+INSERT INTO sqlite_sequence VALUES('NexusBankTransactions',2);
+INSERT INTO sqlite_sequence VALUES('TalerIncomingPayments',2);
+CREATE UNIQUE INDEX accountLabelIndex ON BankAccounts (label);
+CREATE UNIQUE INDEX NexusBankAccounts_bankAccountId ON NexusBankAccounts (bankAccountId);
+CREATE UNIQUE INDEX Facades_facadeName ON Facades (facadeName);
+CREATE UNIQUE INDEX OfferedBankAccounts_offeredAccountId_bankConnection ON OfferedBankAccounts (offeredAccountId, bankConnection);
+CREATE UNIQUE INDEX NexusPermissions_resourceType_resourceId_subjectType_subjectName_permissionName ON NexusPermissions (resourceType, resourceId, subjectType, subjectName, permissionName);
+COMMIT;
diff --git a/src/auditor/auditor-basedb.age b/src/auditor/auditor-basedb.age
index 18fdb08e..e704d4b5 100644
--- a/src/auditor/auditor-basedb.age
+++ b/src/auditor/auditor-basedb.age
@@ -1 +1 @@
-1651516353
+1660496859
diff --git a/src/auditor/auditor-basedb.conf b/src/auditor/auditor-basedb.conf
index a67f2bf1..5e3942a5 100644
--- a/src/auditor/auditor-basedb.conf
+++ b/src/auditor/auditor-basedb.conf
@@ -1,139 +1,139 @@
-[arm]
-CONFIG = /research/taler/exchange/src/auditor/auditor-basedb.conf
+[instance-default]
+KEYFILE = ${TALER_DATA_HOME}/merchant/default.priv
+NAME = Merchant Inc.
-[benchmark]
-MERCHANT_DETAILS = merchant_details.json
-BANK_DETAILS = bank_details.json
+[exchange-account-1]
+PAYTO_URI = payto://iban/SANDBOXX/DE514871?receiver-name=Exchange+Company
+enable_debit = yes
+enable_credit = yes
-[coin_kudos_10]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.01
-fee_refresh = TESTKUDOS:0.03
-fee_deposit = TESTKUDOS:0.01
-fee_withdraw = TESTKUDOS:0.01
-duration_legal = 3 years
-duration_spend = 2 years
-duration_withdraw = 7 days
-value = TESTKUDOS:10
+[exchange-accountcredentials-1]
+WIRE_GATEWAY_URL = http://localhost:8082/facades/test-facade/taler-wire-gateway/
+WIRE_GATEWAY_AUTH_METHOD = basic
+USERNAME = exchange
+PASSWORD = x
-[coin_kudos_8]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.04
-fee_refresh = TESTKUDOS:0.03
-fee_deposit = TESTKUDOS:0.02
-fee_withdraw = TESTKUDOS:0.05
-duration_legal = 3 years
-duration_spend = 2 years
-duration_withdraw = 7 days
-value = TESTKUDOS:8
+[merchant-account-merchant]
+PAYTO_URI = payto://x-taler-bank/localhost/42
+HONOR_default = YES
+ACTIVE_default = YES
-[coin_kudos_5]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.01
-fee_refresh = TESTKUDOS:0.03
-fee_deposit = TESTKUDOS:0.01
-fee_withdraw = TESTKUDOS:0.01
-duration_legal = 3 years
-duration_spend = 2 years
-duration_withdraw = 7 days
-value = TESTKUDOS:5
+[merchant-exchange-default]
+MASTER_KEY = 8PZ0QC89YREAFB9TAM2SK8NRA9G2RMXA4Q814N0RX3Y8DQ64H0G0
+EXCHANGE_BASE_URL = http://localhost:8081/
+CURRENCY = TESTKUDOS
-[coin_kudos_4]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.02
-fee_refresh = TESTKUDOS:0.04
-fee_deposit = TESTKUDOS:0.03
-fee_withdraw = TESTKUDOS:0.03
-duration_legal = 3 years
-duration_spend = 2 years
-duration_withdraw = 7 days
-value = TESTKUDOS:4
+[payments-generator]
+currency = TESTKUDOS
+instance = default
+bank = http://localhost:8082/
+merchant = http://localhost:9966/
+exchange_admin = http://localhost:18080/
+exchange-admin = http://localhost:18080/
+exchange = http://localhost:8081/
-[coin_kudos_2]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.02
-fee_refresh = TESTKUDOS:0.04
-fee_deposit = TESTKUDOS:0.03
-fee_withdraw = TESTKUDOS:0.03
-duration_legal = 3 years
-duration_spend = 2 years
+[coin_kudos_ct_1]
+value = TESTKUDOS:0.01
duration_withdraw = 7 days
-value = TESTKUDOS:2
-
-[coin_kudos_1]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.01
-fee_refresh = TESTKUDOS:0.03
-fee_deposit = TESTKUDOS:0.02
-fee_withdraw = TESTKUDOS:0.02
-duration_legal = 3 years
duration_spend = 2 years
-duration_withdraw = 7 days
-value = TESTKUDOS:1
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.01
+fee_deposit = TESTKUDOS:0.01
+fee_refresh = TESTKUDOS:0.01
+fee_refund = TESTKUDOS:0.01
+CIPHER = RSA
+rsa_keysize = 1024
[coin_kudos_ct_10]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.01
-fee_refresh = TESTKUDOS:0.03
-fee_deposit = TESTKUDOS:0.01
-fee_withdraw = TESTKUDOS:0.01
-duration_legal = 3 years
-duration_spend = 2 years
-duration_withdraw = 7 days
value = TESTKUDOS:0.10
-
-[coin_kudos_ct_1]
-rsa_keysize = 1024
-CIPHER = RSA
-fee_refund = TESTKUDOS:0.01
-fee_refresh = TESTKUDOS:0.01
-fee_deposit = TESTKUDOS:0.01
-fee_withdraw = TESTKUDOS:0.01
+duration_withdraw = 7 days
+duration_spend = 2 years
duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.01
+fee_deposit = TESTKUDOS:0.01
+fee_refresh = TESTKUDOS:0.03
+fee_refund = TESTKUDOS:0.01
+CIPHER = RSA
+rsa_keysize = 1024
+
+[coin_kudos_1]
+value = TESTKUDOS:1
+duration_withdraw = 7 days
duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.02
+fee_deposit = TESTKUDOS:0.02
+fee_refresh = TESTKUDOS:0.03
+fee_refund = TESTKUDOS:0.01
+CIPHER = RSA
+rsa_keysize = 1024
+
+[coin_kudos_2]
+value = TESTKUDOS:2
duration_withdraw = 7 days
-value = TESTKUDOS:0.01
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.03
+fee_deposit = TESTKUDOS:0.03
+fee_refresh = TESTKUDOS:0.04
+fee_refund = TESTKUDOS:0.02
+CIPHER = RSA
+rsa_keysize = 1024
-[payments-generator]
-exchange = http://localhost:8081/
-exchange-admin = http://localhost:18080/
-exchange_admin = http://localhost:18080/
-merchant = http://localhost:9966/
-bank = http://localhost:8082/
-instance = default
-currency = TESTKUDOS
+[coin_kudos_4]
+value = TESTKUDOS:4
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.03
+fee_deposit = TESTKUDOS:0.03
+fee_refresh = TESTKUDOS:0.04
+fee_refund = TESTKUDOS:0.02
+CIPHER = RSA
+rsa_keysize = 1024
-[merchant-exchange-default]
-CURRENCY = TESTKUDOS
-EXCHANGE_BASE_URL = http://localhost:8081/
-MASTER_KEY = W2824S2YNKFZDR0P57Q005J23XGFWSE2GB24A1YS0157NE3F24NG
+[coin_kudos_5]
+value = TESTKUDOS:5
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.01
+fee_deposit = TESTKUDOS:0.01
+fee_refresh = TESTKUDOS:0.03
+fee_refund = TESTKUDOS:0.01
+CIPHER = RSA
+rsa_keysize = 1024
-[merchant-account-merchant]
-ACTIVE_default = YES
-HONOR_default = YES
-PAYTO_URI = payto://x-taler-bank/localhost/42
+[coin_kudos_8]
+value = TESTKUDOS:8
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.05
+fee_deposit = TESTKUDOS:0.02
+fee_refresh = TESTKUDOS:0.03
+fee_refund = TESTKUDOS:0.04
+CIPHER = RSA
+rsa_keysize = 1024
-[exchange-accountcredentials-1]
-PASSWORD = x
-USERNAME = Exchange
-WIRE_GATEWAY_AUTH_METHOD = basic
-WIRE_GATEWAY_URL = http://localhost:8082/taler-wire-gateway/Exchange/
+[coin_kudos_10]
+value = TESTKUDOS:10
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = TESTKUDOS:0.01
+fee_deposit = TESTKUDOS:0.01
+fee_refresh = TESTKUDOS:0.03
+fee_refund = TESTKUDOS:0.01
+CIPHER = RSA
+rsa_keysize = 1024
-[exchange-account-1]
-enable_credit = yes
-enable_debit = yes
-PAYTO_URI = payto://x-taler-bank/localhost/Exchange
+[benchmark]
+BANK_DETAILS = bank_details.json
+MERCHANT_DETAILS = merchant_details.json
-[instance-default]
-NAME = Merchant Inc.
-KEYFILE = ${TALER_DATA_HOME}/merchant/default.priv
+[arm]
+CONFIG = /research/taler/exchange/src/auditor/auditor-basedb.conf
[taler]
CURRENCY_ROUND_UNIT = TESTKUDOS:0.01
@@ -143,10 +143,10 @@ CURRENCY = TESTKUDOS
CONFIG = postgres:///auditor-basedb
[merchant]
-DEFAULT_MAX_WIRE_FEE = TESTKUDOS:0.10
-KEYFILE = ${TALER_DATA_HOME}/merchant/merchant.priv
-DEFAULT_MAX_DEPOSIT_FEE = TESTKUDOS:0.1
WIREFORMAT = default
+DEFAULT_MAX_DEPOSIT_FEE = TESTKUDOS:0.1
+KEYFILE = ${TALER_DATA_HOME}/merchant/merchant.priv
+DEFAULT_MAX_WIRE_FEE = TESTKUDOS:0.10
WIRE_TRANSFER_DELAY = 1 minute
FORCE_AUDIT = YES
UNIXPATH = ${TALER_RUNTIME_DIR}/merchant.http
@@ -155,18 +155,18 @@ UNIXPATH = ${TALER_RUNTIME_DIR}/merchant.http
CONFIG = postgres:///auditor-basedb
[exchange]
-LOOKAHEAD_SIGN = 32 weeks 1 day
+MASTER_PUBLIC_KEY = 8PZ0QC89YREAFB9TAM2SK8NRA9G2RMXA4Q814N0RX3Y8DQ64H0G0
SIGNKEY_DURATION = 4 weeks
-MASTER_PUBLIC_KEY = W2824S2YNKFZDR0P57Q005J23XGFWSE2GB24A1YS0157NE3F24NG
+LOOKAHEAD_SIGN = 32 weeks 1 day
SIGNKEY_LEGAL_DURATION = 4 weeks
UNIXPATH = ${TALER_RUNTIME_DIR}/exchange.http
[bank]
-SERVE = http
-ALLOW_REGISTRATIONS = YES
-SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost/2
-SUGGESTED_EXCHANGE = http://localhost:8081/
HTTP_PORT = 8082
+SUGGESTED_EXCHANGE = http://localhost:8081/
+SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost/2
+ALLOW_REGISTRATIONS = YES
+SERVE = http
MAX_DEBT_BANK = TESTKUDOS:100000.0
MAX_DEBT = TESTKUDOS:50.0
DATABASE = postgres:///auditor-basedb
@@ -175,9 +175,9 @@ DATABASE = postgres:///auditor-basedb
CONFIG = postgres:///auditor-basedb
[auditor]
-PUBLIC_KEY = MSF4QDJMZTT9CC5EMHS480F652QAS40SEXEPAW0GGB9G9RB9B5T0
-TINY_AMOUNT = TESTKUDOS:0.01
BASE_URL = http://localhost:8083/
+TINY_AMOUNT = TESTKUDOS:0.01
+PUBLIC_KEY = 41SE6QAX583WXH9BD77YMXJ46DDZRK4Z3FA2H2Y5CH8XD2H547AG
[PATHS]
TALER_CACHE_HOME = $TALER_HOME/.cache/taler/
diff --git a/src/auditor/auditor-basedb.fees b/src/auditor/auditor-basedb.fees
deleted file mode 100644
index ef2a6d12..00000000
--- a/src/auditor/auditor-basedb.fees
+++ /dev/null
Binary files differ
diff --git a/src/auditor/auditor-basedb.mpub b/src/auditor/auditor-basedb.mpub
index efa2b454..5dc24b54 100644
--- a/src/auditor/auditor-basedb.mpub
+++ b/src/auditor/auditor-basedb.mpub
@@ -1 +1 @@
-NYBEPNN9Z5C6ZKM4BTD7TWRD9EBE6TE2YE12STA6GJHBP4HVQCYG
+8PZ0QC89YREAFB9TAM2SK8NRA9G2RMXA4Q814N0RX3Y8DQ64H0G0
diff --git a/src/auditor/auditor-basedb.sql b/src/auditor/auditor-basedb.sql
index e2b83be6..e60a1e0c 100644
--- a/src/auditor/auditor-basedb.sql
+++ b/src/auditor/auditor-basedb.sql
@@ -2,8 +2,8 @@
-- PostgreSQL database dump
--
--- Dumped from database version 13.5 (Debian 13.5-0+deb11u1)
--- Dumped by pg_dump version 13.5 (Debian 13.5-0+deb11u1)
+-- Dumped from database version 13.7 (Debian 13.7-0+deb11u1)
+-- Dumped by pg_dump version 13.7 (Debian 13.7-0+deb11u1)
SET statement_timeout = 0;
SET lock_timeout = 0;
@@ -31,6 +31,48 @@ COMMENT ON SCHEMA _v IS 'Schema for versioning data and functionality.';
--
+-- Name: auditor; Type: SCHEMA; Schema: -; Owner: -
+--
+
+CREATE SCHEMA auditor;
+
+
+--
+-- Name: SCHEMA auditor; Type: COMMENT; Schema: -; Owner: -
+--
+
+COMMENT ON SCHEMA auditor IS 'taler-auditor data';
+
+
+--
+-- Name: exchange; Type: SCHEMA; Schema: -; Owner: -
+--
+
+CREATE SCHEMA exchange;
+
+
+--
+-- Name: SCHEMA exchange; Type: COMMENT; Schema: -; Owner: -
+--
+
+COMMENT ON SCHEMA exchange IS 'taler-exchange data';
+
+
+--
+-- Name: merchant; Type: SCHEMA; Schema: -; Owner: -
+--
+
+CREATE SCHEMA merchant;
+
+
+--
+-- Name: SCHEMA merchant; Type: COMMENT; Schema: -; Owner: -
+--
+
+COMMENT ON SCHEMA merchant IS 'taler-merchant data';
+
+
+--
-- Name: assert_patch_is_applied(text); Type: FUNCTION; Schema: _v; Owner: -
--
@@ -257,10 +299,10 @@ COMMENT ON FUNCTION _v.unregister_patch(in_patch_name text, OUT versioning integ
--
--- Name: add_constraints_to_account_merges_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_account_merges_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_account_merges_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_account_merges_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -274,10 +316,10 @@ $$;
--
--- Name: add_constraints_to_aggregation_tracking_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_aggregation_tracking_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_aggregation_tracking_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_aggregation_tracking_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -291,10 +333,10 @@ $$;
--
--- Name: add_constraints_to_contracts_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_contracts_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_contracts_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_contracts_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -308,10 +350,10 @@ $$;
--
--- Name: add_constraints_to_cs_nonce_locks_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_cs_nonce_locks_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_cs_nonce_locks_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_cs_nonce_locks_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -325,10 +367,10 @@ $$;
--
--- Name: add_constraints_to_deposits_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_deposits_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_deposits_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_deposits_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -344,10 +386,10 @@ $$;
--
--- Name: add_constraints_to_known_coins_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_known_coins_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_known_coins_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_known_coins_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -361,10 +403,39 @@ $$;
--
--- Name: add_constraints_to_purse_deposits_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_legitimizations_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_purse_deposits_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_legitimizations_partition(partition_suffix character varying) RETURNS void
+ LANGUAGE plpgsql
+ AS $$
+DECLARE
+ partition_name VARCHAR;
+BEGIN
+ partition_name = concat_ws('_', 'legitimizations', partition_suffix);
+ EXECUTE FORMAT (
+ 'ALTER TABLE ' || partition_name
+ || ' '
+ 'ADD CONSTRAINT ' || partition_name || '_legitimization_serial_id_key '
+ 'UNIQUE (legitimization_serial_id)');
+ EXECUTE FORMAT (
+ 'CREATE INDEX IF NOT EXISTS ' || partition_name || '_by_provider_and_legi_index '
+ 'ON '|| partition_name || ' '
+ '(provider_section,provider_legitimization_id)'
+ );
+ EXECUTE FORMAT (
+ 'COMMENT ON INDEX ' || partition_name || '_by_provider_and_legi_index '
+ 'IS ' || quote_literal('used (rarely) in kyc_provider_account_lookup') || ';'
+ );
+END
+$$;
+
+
+--
+-- Name: add_constraints_to_purse_deposits_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
+--
+
+CREATE FUNCTION exchange.add_constraints_to_purse_deposits_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -378,10 +449,10 @@ $$;
--
--- Name: add_constraints_to_purse_merges_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_purse_merges_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_purse_merges_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_purse_merges_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -395,10 +466,27 @@ $$;
--
--- Name: add_constraints_to_purse_requests_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_purse_refunds_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
+--
+
+CREATE FUNCTION exchange.add_constraints_to_purse_refunds_partition(partition_suffix character varying) RETURNS void
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ EXECUTE FORMAT (
+ 'ALTER TABLE purse_refunds_' || partition_suffix || ' '
+ 'ADD CONSTRAINT purse_refunds_' || partition_suffix || '_purse_refunds_serial_id_key '
+ 'UNIQUE (purse_refunds_serial_id) '
+ );
+END
+$$;
+
+
+--
+-- Name: add_constraints_to_purse_requests_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_purse_requests_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_purse_requests_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -412,10 +500,10 @@ $$;
--
--- Name: add_constraints_to_recoup_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_recoup_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_recoup_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_recoup_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -429,10 +517,10 @@ $$;
--
--- Name: add_constraints_to_recoup_refresh_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_recoup_refresh_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_recoup_refresh_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_recoup_refresh_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -446,10 +534,10 @@ $$;
--
--- Name: add_constraints_to_refresh_commitments_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_refresh_commitments_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_refresh_commitments_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_refresh_commitments_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -463,10 +551,10 @@ $$;
--
--- Name: add_constraints_to_refresh_revealed_coins_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_refresh_revealed_coins_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_refresh_revealed_coins_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_refresh_revealed_coins_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -485,10 +573,10 @@ $$;
--
--- Name: add_constraints_to_refresh_transfer_keys_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_refresh_transfer_keys_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_refresh_transfer_keys_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_refresh_transfer_keys_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -502,10 +590,10 @@ $$;
--
--- Name: add_constraints_to_refunds_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_refunds_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_refunds_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_refunds_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -520,10 +608,10 @@ $$;
--
--- Name: add_constraints_to_reserves_close_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_reserves_close_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_reserves_close_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_reserves_close_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -537,10 +625,10 @@ $$;
--
--- Name: add_constraints_to_reserves_in_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_reserves_in_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_reserves_in_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_reserves_in_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -554,10 +642,10 @@ $$;
--
--- Name: add_constraints_to_reserves_out_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_reserves_out_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_reserves_out_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_reserves_out_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -571,10 +659,10 @@ $$;
--
--- Name: add_constraints_to_wad_in_entries_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_wad_in_entries_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_wad_in_entries_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_wad_in_entries_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -588,10 +676,10 @@ $$;
--
--- Name: add_constraints_to_wad_out_entries_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_wad_out_entries_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_wad_out_entries_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_wad_out_entries_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -605,10 +693,10 @@ $$;
--
--- Name: add_constraints_to_wads_in_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_wads_in_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_wads_in_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_wads_in_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -624,10 +712,10 @@ $$;
--
--- Name: add_constraints_to_wads_out_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_wads_out_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_wads_out_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_wads_out_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -641,10 +729,10 @@ $$;
--
--- Name: add_constraints_to_wire_out_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_wire_out_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_wire_out_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_wire_out_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -658,14 +746,13 @@ $$;
--
--- Name: add_constraints_to_wire_targets_partition(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: add_constraints_to_wire_targets_partition(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.add_constraints_to_wire_targets_partition(partition_suffix character varying) RETURNS void
+CREATE FUNCTION exchange.add_constraints_to_wire_targets_partition(partition_suffix character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
EXECUTE FORMAT (
'ALTER TABLE wire_targets_' || partition_suffix || ' '
'ADD CONSTRAINT wire_targets_' || partition_suffix || '_wire_target_serial_id_key '
@@ -676,16 +763,14 @@ $$;
--
--- Name: create_foreign_hash_partition(character varying, integer, character varying, integer, character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_foreign_hash_partition(character varying, integer, character varying, integer, character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_foreign_hash_partition(source_table_name character varying, modulus integer, shard_suffix character varying, current_shard_num integer, local_user character varying DEFAULT 'taler-exchange-httpd'::character varying) RETURNS void
+CREATE FUNCTION exchange.create_foreign_hash_partition(source_table_name character varying, modulus integer, shard_suffix character varying, current_shard_num integer, local_user character varying DEFAULT 'taler-exchange-httpd'::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
RAISE NOTICE 'Creating %_% on %', source_table_name, shard_suffix, shard_suffix;
-
EXECUTE FORMAT(
'CREATE FOREIGN TABLE IF NOT EXISTS %I '
'PARTITION OF %I '
@@ -697,22 +782,20 @@ BEGIN
,current_shard_num-1
,shard_suffix
);
-
EXECUTE FORMAT(
'ALTER FOREIGN TABLE %I OWNER TO %I'
,source_table_name || '_' || shard_suffix
,local_user
);
-
END
$$;
--
--- Name: create_foreign_range_partition(character varying, integer); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_foreign_range_partition(character varying, integer); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_foreign_range_partition(source_table_name character varying, partition_num integer) RETURNS void
+CREATE FUNCTION exchange.create_foreign_range_partition(source_table_name character varying, partition_num integer) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -722,16 +805,14 @@ $$;
--
--- Name: create_foreign_servers(integer, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_foreign_servers(integer, character varying, character varying, character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_foreign_servers(amount integer, domain character varying, remote_user character varying DEFAULT 'taler'::character varying, remote_user_password character varying DEFAULT 'taler'::character varying) RETURNS void
+CREATE FUNCTION exchange.create_foreign_servers(amount integer, domain character varying, remote_user character varying DEFAULT 'taler'::character varying, remote_user_password character varying DEFAULT 'taler'::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
PERFORM prepare_sharding();
-
FOR i IN 1..amount LOOP
PERFORM create_shard_server(
i::varchar
@@ -745,24 +826,20 @@ BEGIN
,'taler-exchange-httpd'
);
END LOOP;
-
PERFORM drop_default_partitions();
-
END
$$;
--
--- Name: create_hash_partition(character varying, integer, integer); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_hash_partition(character varying, integer, integer); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_hash_partition(source_table_name character varying, modulus integer, partition_num integer) RETURNS void
+CREATE FUNCTION exchange.create_hash_partition(source_table_name character varying, modulus integer, partition_num integer) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
RAISE NOTICE 'Creating partition %_%', source_table_name, partition_num;
-
EXECUTE FORMAT(
'CREATE TABLE IF NOT EXISTS %I '
'PARTITION OF %I '
@@ -772,307 +849,236 @@ BEGIN
,modulus
,partition_num-1
);
-
END
$$;
--
--- Name: create_partitioned_table(character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_partitioned_table(character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_partitioned_table(table_definition character varying, table_name character varying, main_table_partition_str character varying, shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_partitioned_table(table_definition character varying, table_name character varying, main_table_partition_str character varying, shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
IF shard_suffix IS NOT NULL THEN
table_name=table_name || '_' || shard_suffix;
main_table_partition_str = '';
END IF;
-
EXECUTE FORMAT(
table_definition,
table_name,
main_table_partition_str
);
-
END
$$;
--
--- Name: create_partitions(integer); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_partitions(integer); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_partitions(num_partitions integer) RETURNS void
+CREATE FUNCTION exchange.create_partitions(num_partitions integer) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
modulus INTEGER;
BEGIN
-
modulus := num_partitions;
-
PERFORM detach_default_partitions();
-
LOOP
-
PERFORM create_hash_partition(
'wire_targets'
,modulus
,num_partitions
);
PERFORM add_constraints_to_wire_targets_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'reserves'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'reserves_in'
,modulus
,num_partitions
);
PERFORM add_constraints_to_reserves_in_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'reserves_close'
,modulus
,num_partitions
);
PERFORM add_constraints_to_reserves_close_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'reserves_out'
,modulus
,num_partitions
);
PERFORM add_constraints_to_reserves_out_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'reserves_out_by_reserve'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'known_coins'
,modulus
,num_partitions
);
PERFORM add_constraints_to_known_coins_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'refresh_commitments'
,modulus
,num_partitions
);
PERFORM add_constraints_to_refresh_commitments_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'refresh_revealed_coins'
,modulus
,num_partitions
);
PERFORM add_constraints_to_refresh_revealed_coins_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'refresh_transfer_keys'
,modulus
,num_partitions
);
PERFORM add_constraints_to_refresh_transfer_keys_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'deposits'
,modulus
,num_partitions
);
PERFORM add_constraints_to_deposits_partition(num_partitions::varchar);
-
--- TODO: dynamically (!) creating/deleting deposits partitions:
--- create new partitions 'as needed', drop old ones once the aggregator has made
--- them empty; as 'new' deposits will always have deadlines in the future, this
--- would basically guarantee no conflict between aggregator and exchange service!
--- SEE also: https://www.cybertec-postgresql.com/en/automatic-partition-creation-in-postgresql/
--- (article is slightly wrong, as this works:)
---CREATE TABLE tab (
--- id bigint GENERATED ALWAYS AS IDENTITY,
--- ts timestamp NOT NULL,
--- data text
--- PARTITION BY LIST ((ts::date));
--- CREATE TABLE tab_def PARTITION OF tab DEFAULT;
--- BEGIN
--- CREATE TABLE tab_part2 (LIKE tab);
--- insert into tab_part2 (id,ts, data) values (5,'2022-03-21', 'foo');
--- alter table tab attach partition tab_part2 for values in ('2022-03-21');
--- commit;
--- Naturally, to ensure this is actually 100% conflict-free, we'd
--- need to create tables at the granularity of the wire/refund deadlines;
--- that is right now configurable via AGGREGATOR_SHIFT option.
-
--- FIXME: range partitioning
--- PERFORM create_range_partition(
--- 'deposits_by_ready'
--- ,modulus
--- ,num_partitions
--- );
---
--- PERFORM create_range_partition(
--- 'deposits_for_matching'
--- ,modulus
--- ,num_partitions
--- );
-
PERFORM create_hash_partition(
'refunds'
,modulus
,num_partitions
);
PERFORM add_constraints_to_refunds_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'wire_out'
,modulus
,num_partitions
);
PERFORM add_constraints_to_wire_out_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'aggregation_transient'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'aggregation_tracking'
,modulus
,num_partitions
);
PERFORM add_constraints_to_aggregation_tracking_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'recoup'
,modulus
,num_partitions
);
PERFORM add_constraints_to_recoup_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'recoup_by_reserve'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'recoup_refresh'
,modulus
,num_partitions
);
PERFORM add_constraints_to_recoup_refresh_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'prewire'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'cs_nonce_locks'
,modulus
,num_partitions
);
PERFORM add_constraints_to_cs_nonce_locks_partition(num_partitions::varchar);
-
- ---------------- P2P ----------------------
-
PERFORM create_hash_partition(
'purse_requests'
,modulus
,num_partitions
);
PERFORM add_constraints_to_purse_requests_partition(num_partitions::varchar);
-
+ PERFORM create_hash_partition(
+ 'purse_refunds'
+ ,modulus
+ ,num_partitions
+ );
+ PERFORM add_constraints_to_purse_refunds_partition(num_partitions::varchar);
PERFORM create_hash_partition(
'purse_merges'
,modulus
,num_partitions
);
PERFORM add_constraints_to_purse_merges_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'account_merges'
,modulus
,num_partitions
);
PERFORM add_constraints_to_account_merges_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'contracts'
,modulus
,num_partitions
);
PERFORM add_constraints_to_contracts_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'history_requests'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'close_requests'
,modulus
,num_partitions
);
-
PERFORM create_hash_partition(
'purse_deposits'
,modulus
,num_partitions
);
PERFORM add_constraints_to_purse_deposits_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'wad_out_entries'
,modulus
,num_partitions
);
PERFORM add_constraints_to_wad_out_entries_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'wads_in'
,modulus
,num_partitions
);
PERFORM add_constraints_to_wads_in_partition(num_partitions::varchar);
-
PERFORM create_hash_partition(
'wad_in_entries'
,modulus
,num_partitions
);
PERFORM add_constraints_to_wad_in_entries_partition(num_partitions::varchar);
-
num_partitions=num_partitions-1;
EXIT WHEN num_partitions=0;
-
END LOOP;
-
PERFORM drop_default_partitions();
-
END
$$;
--
--- Name: create_range_partition(character varying, integer); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_range_partition(character varying, integer); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_range_partition(source_table_name character varying, partition_num integer) RETURNS void
+CREATE FUNCTION exchange.create_range_partition(source_table_name character varying, partition_num integer) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
@@ -1082,16 +1088,14 @@ $$;
--
--- Name: create_shard_server(character varying, integer, integer, character varying, character varying, character varying, character varying, integer, character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_shard_server(character varying, integer, integer, character varying, character varying, character varying, character varying, integer, character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_shard_server(shard_suffix character varying, total_num_shards integer, current_shard_num integer, remote_host character varying, remote_user character varying, remote_user_password character varying, remote_db_name character varying DEFAULT 'taler-exchange'::character varying, remote_port integer DEFAULT 5432, local_user character varying DEFAULT 'taler-exchange-httpd'::character varying) RETURNS void
+CREATE FUNCTION exchange.create_shard_server(shard_suffix character varying, total_num_shards integer, current_shard_num integer, remote_host character varying, remote_user character varying, remote_user_password character varying, remote_db_name character varying DEFAULT 'taler-exchange'::character varying, remote_port integer DEFAULT 5432, local_user character varying DEFAULT 'taler-exchange-httpd'::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
RAISE NOTICE 'Creating server %', remote_host;
-
EXECUTE FORMAT(
'CREATE SERVER IF NOT EXISTS %I '
'FOREIGN DATA WRAPPER postgres_fdw '
@@ -1101,7 +1105,6 @@ BEGIN
,remote_host
,remote_port
);
-
EXECUTE FORMAT(
'CREATE USER MAPPING IF NOT EXISTS '
'FOR %I SERVER %I '
@@ -1111,7 +1114,6 @@ BEGIN
,remote_user
,remote_user_password
);
-
EXECUTE FORMAT(
'GRANT ALL PRIVILEGES '
'ON FOREIGN SERVER %I '
@@ -1119,7 +1121,6 @@ BEGIN
,shard_suffix
,local_user
);
-
PERFORM create_foreign_hash_partition(
'wire_targets'
,total_num_shards
@@ -1197,20 +1198,6 @@ BEGIN
,current_shard_num
,local_user
);
--- PERFORM create_foreign_range_partition(
--- 'deposits_by_ready'
--- ,total_num_shards
--- ,shard_suffix
--- ,current_shard_num
--- ,local_user
--- );
--- PERFORM create_foreign_range_partition(
--- 'deposits_for_matching'
--- ,total_num_shards
--- ,shard_suffix
--- ,current_shard_num
--- ,local_user
--- );
PERFORM create_foreign_hash_partition(
'refunds'
,total_num_shards
@@ -1274,9 +1261,6 @@ BEGIN
,current_shard_num
,local_user
);
-
- ------------------- P2P --------------------
-
PERFORM create_foreign_hash_partition(
'purse_requests'
,total_num_shards
@@ -1285,6 +1269,13 @@ BEGIN
,local_user
);
PERFORM create_foreign_hash_partition(
+ 'purse_refunds'
+ ,total_num_shards
+ ,shard_suffix
+ ,current_shard_num
+ ,local_user
+ );
+ PERFORM create_foreign_hash_partition(
'purse_merges'
,total_num_shards
,shard_suffix
@@ -1347,80 +1338,72 @@ BEGIN
,current_shard_num
,local_user
);
-
END
$$;
--
--- Name: FUNCTION create_shard_server(shard_suffix character varying, total_num_shards integer, current_shard_num integer, remote_host character varying, remote_user character varying, remote_user_password character varying, remote_db_name character varying, remote_port integer, local_user character varying); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION create_shard_server(shard_suffix character varying, total_num_shards integer, current_shard_num integer, remote_host character varying, remote_user character varying, remote_user_password character varying, remote_db_name character varying, remote_port integer, local_user character varying); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.create_shard_server(shard_suffix character varying, total_num_shards integer, current_shard_num integer, remote_host character varying, remote_user character varying, remote_user_password character varying, remote_db_name character varying, remote_port integer, local_user character varying) IS 'Create a shard server on the master
+COMMENT ON FUNCTION exchange.create_shard_server(shard_suffix character varying, total_num_shards integer, current_shard_num integer, remote_host character varying, remote_user character varying, remote_user_password character varying, remote_db_name character varying, remote_port integer, local_user character varying) IS 'Create a shard server on the master
node with all foreign tables and user mappings';
--
--- Name: create_table_account_merges(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_account_merges(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_account_merges(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_account_merges(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'account_merges';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(account_merge_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE
- ',reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)' -- REFERENCES reserves (reserve_pub) ON DELETE CASCADE
+ '(account_merge_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)'
',reserve_sig BYTEA NOT NULL CHECK (LENGTH(reserve_sig)=64)'
- ',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)' -- REFERENCES purse_requests (purse_pub)
+ ',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)'
+ ',wallet_h_payto BYTEA NOT NULL CHECK (LENGTH(wallet_h_payto)=32)'
',PRIMARY KEY (purse_pub)'
') %s ;'
,table_name
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: change to materialized index by reserve_pub!
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_reserve_pub '
'ON ' || table_name || ' '
'(reserve_pub);'
);
-
END
$$;
--
--- Name: create_table_aggregation_tracking(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_aggregation_tracking(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_aggregation_tracking(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_aggregation_tracking(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'aggregation_tracking';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME chnage to coint_pub + deposit_serial_id for more efficient depost -- or something else ???
- ',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE'
+ '(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',deposit_serial_id INT8 PRIMARY KEY'
+ ',wtid_raw BYTEA NOT NULL'
') %s ;'
,table_name
,'PARTITION BY HASH (deposit_serial_id)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_wtid_raw_index '
'ON ' || table_name || ' '
@@ -1430,27 +1413,26 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_by_wtid_raw_index '
'IS ' || quote_literal('for lookup_transactions') || ';'
);
-
END
$$;
--
--- Name: create_table_aggregation_transient(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_aggregation_transient(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_aggregation_transient(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_aggregation_transient(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'aggregation_transient';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
'(amount_val INT8 NOT NULL'
',amount_frac INT4 NOT NULL'
',wire_target_h_payto BYTEA CHECK (LENGTH(wire_target_h_payto)=32)'
+ ',merchant_pub BYTEA CHECK (LENGTH(merchant_pub)=32)'
',exchange_account_section TEXT NOT NULL'
',wtid_raw BYTEA NOT NULL CHECK (LENGTH(wtid_raw)=32)'
') %s ;'
@@ -1458,25 +1440,24 @@ BEGIN
,'PARTITION BY HASH (wire_target_h_payto)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_close_requests(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_close_requests(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_close_requests(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_close_requests(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'close_requests';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)' -- REFERENCES reserves(reserve_pub) ON DELETE CASCADE
+ '(close_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)'
',close_timestamp INT8 NOT NULL'
',reserve_sig BYTEA NOT NULL CHECK (LENGTH(reserve_sig)=64)'
',close_val INT8 NOT NULL'
@@ -1487,25 +1468,23 @@ BEGIN
,'PARTITION BY HASH (reserve_pub)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_contracts(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_contracts(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_contracts(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_contracts(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'contracts';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(contract_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' --UNIQUE
+ '(contract_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)'
',pub_ckey BYTEA NOT NULL CHECK (LENGTH(pub_ckey)=32)'
',contract_sig BYTEA NOT NULL CHECK (LENGTH(contract_sig)=64)'
@@ -1517,23 +1496,21 @@ BEGIN
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_cs_nonce_locks(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_cs_nonce_locks(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_cs_nonce_locks(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_cs_nonce_locks(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(cs_nonce_lock_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
+ '(cs_nonce_lock_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',nonce BYTEA PRIMARY KEY CHECK (LENGTH(nonce)=32)'
',op_hash BYTEA NOT NULL CHECK (LENGTH(op_hash)=64)'
',max_denomination_serial INT8 NOT NULL'
@@ -1542,28 +1519,26 @@ BEGIN
,'PARTITION BY HASH (nonce)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_deposits(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_deposits(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_deposits(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_deposits(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'deposits';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(deposit_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- PRIMARY KEY'
+ '(deposit_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',shard INT8 NOT NULL'
- ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)' -- REFERENCES known_coins (coin_pub) ON DELETE CASCADE
- ',known_coin_id INT8 NOT NULL' -- REFERENCES known_coins (known_coin_id) ON DELETE CASCADE' --- FIXME: column needed???
+ ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)'
+ ',known_coin_id INT8 NOT NULL'
',amount_with_fee_val INT8 NOT NULL'
',amount_with_fee_frac INT4 NOT NULL'
',wallet_timestamp INT8 NOT NULL'
@@ -1577,36 +1552,32 @@ BEGIN
',wire_target_h_payto BYTEA CHECK (LENGTH(wire_target_h_payto)=32)'
',done BOOLEAN NOT NULL DEFAULT FALSE'
',extension_blocked BOOLEAN NOT NULL DEFAULT FALSE'
- ',extension_details_serial_id INT8' -- REFERENCES extension_details (extension_details_serial_id) ON DELETE CASCADE'
+ ',extension_details_serial_id INT8'
') %s ;'
,table_name
,'PARTITION BY HASH (coin_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_coin_pub_index '
'ON ' || table_name || ' '
'(coin_pub);'
);
-
END
$$;
--
--- Name: create_table_deposits_by_ready(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_deposits_by_ready(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_deposits_by_ready(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_deposits_by_ready(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'deposits_by_ready';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
'(wire_deadline INT8 NOT NULL'
@@ -1618,68 +1589,61 @@ BEGIN
,'PARTITION BY RANGE (wire_deadline)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_main_index '
'ON ' || table_name || ' '
'(wire_deadline ASC, shard ASC, coin_pub);'
);
-
END
$$;
--
--- Name: create_table_deposits_for_matching(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_deposits_for_matching(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_deposits_for_matching(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_deposits_for_matching(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'deposits_for_matching';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
'(refund_deadline INT8 NOT NULL'
',merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)'
- ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)' -- REFERENCES known_coins (coin_pub) ON DELETE CASCADE
+ ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)'
',deposit_serial_id INT8'
') %s ;'
,table_name
,'PARTITION BY RANGE (refund_deadline)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_main_index '
'ON ' || table_name || ' '
'(refund_deadline ASC, merchant_pub, coin_pub);'
);
-
END
$$;
--
--- Name: create_table_history_requests(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_history_requests(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_history_requests(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_history_requests(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'history_requests';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)' -- REFERENCES reserves(reserve_pub) ON DELETE CASCADE
+ '(history_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)'
',request_timestamp INT8 NOT NULL'
',reserve_sig BYTEA NOT NULL CHECK (LENGTH(reserve_sig)=64)'
',history_fee_val INT8 NOT NULL'
@@ -1690,54 +1654,75 @@ BEGIN
,'PARTITION BY HASH (reserve_pub)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_known_coins(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_known_coins(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_known_coins(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_known_coins(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR default 'known_coins';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(known_coin_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',denominations_serial INT8 NOT NULL' -- REFERENCES denominations (denominations_serial) ON DELETE CASCADE'
+ '(known_coin_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',denominations_serial INT8 NOT NULL'
',coin_pub BYTEA NOT NULL PRIMARY KEY CHECK (LENGTH(coin_pub)=32)'
',age_commitment_hash BYTEA CHECK (LENGTH(age_commitment_hash)=32)'
',denom_sig BYTEA NOT NULL'
- ',remaining_val INT8 NOT NULL'
- ',remaining_frac INT4 NOT NULL'
+ ',remaining_val INT8 NOT NULL DEFAULT(0)'
+ ',remaining_frac INT4 NOT NULL DEFAULT(0)'
') %s ;'
,table_name
- ,'PARTITION BY HASH (coin_pub)' -- FIXME: or include denominations_serial? or multi-level partitioning?;
+ ,'PARTITION BY HASH (coin_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
+END
+$$;
+
+
+--
+-- Name: create_table_legitimizations(character varying); Type: FUNCTION; Schema: exchange; Owner: -
+--
+CREATE FUNCTION exchange.create_table_legitimizations(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ PERFORM create_partitioned_table(
+ 'CREATE TABLE IF NOT EXISTS %I'
+ '(legitimization_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',h_payto BYTEA NOT NULL CHECK (LENGTH(h_payto)=32)'
+ ',expiration_time INT8 NOT NULL DEFAULT (0)'
+ ',provider_section VARCHAR NOT NULL'
+ ',provider_user_id VARCHAR DEFAULT NULL'
+ ',provider_legitimization_id VARCHAR DEFAULT NULL'
+ ',UNIQUE (h_payto, provider_section)'
+ ') %s ;'
+ ,'legitimizations'
+ ,'PARTITION BY HASH (h_payto)'
+ ,shard_suffix
+ );
END
$$;
--
--- Name: create_table_prewire(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_prewire(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_prewire(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_prewire(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'prewire';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
'(prewire_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY'
@@ -1750,9 +1735,7 @@ BEGIN
,'PARTITION BY HASH (prewire_uuid)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_finished_index '
'ON ' || table_name || ' '
@@ -1762,7 +1745,6 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_by_finished_index '
'IS ' || quote_literal('for gc_prewire') || ';'
);
- -- FIXME: find a way to combine these two indices?
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_failed_finished_index '
'ON ' || table_name || ' '
@@ -1772,28 +1754,26 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_by_failed_finished_index '
'IS ' || quote_literal('for wire_prepare_data_get') || ';'
);
-
END
$$;
--
--- Name: create_table_purse_deposits(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_purse_deposits(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_purse_deposits(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_purse_deposits(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'purse_deposits';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(purse_deposit_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE
- ',partner_serial_id INT8' -- REFERENCES partners(partner_serial_id) ON DELETE CASCADE'
+ '(purse_deposit_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',partner_serial_id INT8'
',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)'
- ',coin_pub BYTEA NOT NULL' -- REFERENCES known_coins (coin_pub) ON DELETE CASCADE'
+ ',coin_pub BYTEA NOT NULL'
',amount_with_fee_val INT8 NOT NULL'
',amount_with_fee_frac INT4 NOT NULL'
',coin_sig BYTEA NOT NULL CHECK(LENGTH(coin_sig)=64)'
@@ -1803,37 +1783,32 @@ BEGIN
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: change to materialized index by coin_pub!
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_coin_pub '
'ON ' || table_name || ' '
'(coin_pub);'
);
-
END
$$;
--
--- Name: create_table_purse_merges(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_purse_merges(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_purse_merges(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_purse_merges(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'purse_merges';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(purse_merge_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY '-- UNIQUE
- ',partner_serial_id INT8' -- REFERENCES partners(partner_serial_id) ON DELETE CASCADE
- ',reserve_pub BYTEA NOT NULL CHECK(length(reserve_pub)=32)'--REFERENCES reserves (reserve_pub) ON DELETE CASCADE
- ',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)' --REFERENCES purse_requests (purse_pub) ON DELETE CASCADE
+ '(purse_merge_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY '
+ ',partner_serial_id INT8'
+ ',reserve_pub BYTEA NOT NULL CHECK(length(reserve_pub)=32)'
+ ',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)'
',merge_sig BYTEA NOT NULL CHECK (LENGTH(merge_sig)=64)'
',merge_timestamp INT8 NOT NULL'
',PRIMARY KEY (purse_pub)'
@@ -1842,10 +1817,7 @@ BEGIN
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: change to materialized index by reserve_pub!
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_reserve_pub '
'ON ' || table_name || ' '
@@ -1855,32 +1827,62 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_reserve_pub '
'IS ' || quote_literal('needed in reserve history computation') || ';'
);
+END
+$$;
+
+--
+-- Name: create_table_purse_refunds(character varying); Type: FUNCTION; Schema: exchange; Owner: -
+--
+
+CREATE FUNCTION exchange.create_table_purse_refunds(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+ LANGUAGE plpgsql
+ AS $$
+DECLARE
+ table_name VARCHAR DEFAULT 'purse_refunds';
+BEGIN
+ PERFORM create_partitioned_table(
+ 'CREATE TABLE IF NOT EXISTS %I '
+ '(purse_refunds_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)'
+ ',PRIMARY KEY (purse_pub)'
+ ') %s ;'
+ ,table_name
+ ,'PARTITION BY HASH (purse_pub)'
+ ,shard_suffix
+ );
+ table_name = concat_ws('_', table_name, shard_suffix);
END
$$;
--
--- Name: create_table_purse_requests(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_purse_requests(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_purse_requests(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_purse_requests(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'purse_requests';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(purse_requests_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' --UNIQUE
+ '(purse_requests_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',purse_pub BYTEA NOT NULL CHECK (LENGTH(purse_pub)=32)'
',merge_pub BYTEA NOT NULL CHECK (LENGTH(merge_pub)=32)'
+ ',purse_creation INT8 NOT NULL'
',purse_expiration INT8 NOT NULL'
',h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64)'
',age_limit INT4 NOT NULL'
+ ',flags INT4 NOT NULL'
+ ',refunded BOOLEAN NOT NULL DEFAULT(FALSE)'
+ ',finished BOOLEAN NOT NULL DEFAULT(FALSE)'
+ ',in_reserve_quota BOOLEAN NOT NULL DEFAULT(FALSE)'
',amount_with_fee_val INT8 NOT NULL'
',amount_with_fee_frac INT4 NOT NULL'
+ ',purse_fee_val INT8 NOT NULL'
+ ',purse_fee_frac INT4 NOT NULL'
',balance_val INT8 NOT NULL DEFAULT (0)'
',balance_frac INT4 NOT NULL DEFAULT (0)'
',purse_sig BYTEA NOT NULL CHECK(LENGTH(purse_sig)=64)'
@@ -1890,124 +1892,112 @@ BEGIN
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: change to materialized index by marge_pub!
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_merge_pub '
'ON ' || table_name || ' '
'(merge_pub);'
);
-
+ EXECUTE FORMAT (
+ 'CREATE INDEX IF NOT EXISTS ' || table_name || '_purse_expiration '
+ 'ON ' || table_name || ' '
+ '(purse_expiration);'
+ );
END
$$;
--
--- Name: create_table_recoup(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_recoup(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_recoup(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_recoup(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'recoup';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(recoup_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)' -- REFERENCES known_coins (coin_pub)
+ '(recoup_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)'
',coin_sig BYTEA NOT NULL CHECK(LENGTH(coin_sig)=64)'
',coin_blind BYTEA NOT NULL CHECK(LENGTH(coin_blind)=32)'
',amount_val INT8 NOT NULL'
',amount_frac INT4 NOT NULL'
',recoup_timestamp INT8 NOT NULL'
- ',reserve_out_serial_id INT8 NOT NULL' -- REFERENCES reserves_out (reserve_out_serial_id) ON DELETE CASCADE'
+ ',reserve_out_serial_id INT8 NOT NULL'
') %s ;'
,table_name
,'PARTITION BY HASH (coin_pub);'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_coin_pub_index '
'ON ' || table_name || ' '
'(coin_pub);'
);
-
END
$$;
--
--- Name: create_table_recoup_by_reserve(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_recoup_by_reserve(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_recoup_by_reserve(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_recoup_by_reserve(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'recoup_by_reserve';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(reserve_out_serial_id INT8 NOT NULL' -- REFERENCES reserves (reserve_out_serial_id) ON DELETE CASCADE
- ',coin_pub BYTEA CHECK (LENGTH(coin_pub)=32)' -- REFERENCES known_coins (coin_pub)
+ '(reserve_out_serial_id INT8 NOT NULL'
+ ',coin_pub BYTEA CHECK (LENGTH(coin_pub)=32)'
') %s ;'
,table_name
,'PARTITION BY HASH (reserve_out_serial_id)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_main_index '
'ON ' || table_name || ' '
'(reserve_out_serial_id);'
);
-
END
$$;
--
--- Name: create_table_recoup_refresh(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_recoup_refresh(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_recoup_refresh(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_recoup_refresh(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'recoup_refresh';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(recoup_refresh_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)' -- REFERENCES known_coins (coin_pub)
- ',known_coin_id BIGINT NOT NULL' -- REFERENCES known_coins (known_coin_id) ON DELETE CASCADE
+ '(recoup_refresh_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)'
+ ',known_coin_id BIGINT NOT NULL'
',coin_sig BYTEA NOT NULL CHECK(LENGTH(coin_sig)=64)'
',coin_blind BYTEA NOT NULL CHECK(LENGTH(coin_blind)=32)'
',amount_val INT8 NOT NULL'
',amount_frac INT4 NOT NULL'
',recoup_timestamp INT8 NOT NULL'
- ',rrc_serial INT8 NOT NULL' -- REFERENCES refresh_revealed_coins (rrc_serial) ON DELETE CASCADE -- UNIQUE'
+ ',rrc_serial INT8 NOT NULL'
') %s ;'
,table_name
,'PARTITION BY HASH (coin_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: any query using this index will be slow. Materialize index or change query?
- -- Also: which query uses this index?
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_rrc_serial_index '
'ON ' || table_name || ' '
@@ -2018,27 +2008,25 @@ BEGIN
'ON ' || table_name || ' '
'(coin_pub);'
);
-
END
$$;
--
--- Name: create_table_refresh_commitments(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_refresh_commitments(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_refresh_commitments(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_refresh_commitments(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'refresh_commitments';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(melt_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
+ '(melt_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',rc BYTEA PRIMARY KEY CHECK (LENGTH(rc)=64)'
- ',old_coin_pub BYTEA NOT NULL' -- REFERENCES known_coins (coin_pub) ON DELETE CASCADE'
+ ',old_coin_pub BYTEA NOT NULL'
',old_coin_sig BYTEA NOT NULL CHECK(LENGTH(old_coin_sig)=64)'
',amount_with_fee_val INT8 NOT NULL'
',amount_with_fee_frac INT4 NOT NULL'
@@ -2048,76 +2036,66 @@ BEGIN
,'PARTITION BY HASH (rc)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- Note: index spans partitions, may need to be materialized.
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_old_coin_pub_index '
'ON ' || table_name || ' '
'(old_coin_pub);'
);
-
END
$$;
--
--- Name: create_table_refresh_revealed_coins(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_refresh_revealed_coins(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_refresh_revealed_coins(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_refresh_revealed_coins(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'refresh_revealed_coins';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(rrc_serial BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',melt_serial_id INT8 NOT NULL' -- REFERENCES refresh_commitments (melt_serial_id) ON DELETE CASCADE'
+ '(rrc_serial BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',melt_serial_id INT8 NOT NULL'
',freshcoin_index INT4 NOT NULL'
',link_sig BYTEA NOT NULL CHECK(LENGTH(link_sig)=64)'
- ',denominations_serial INT8 NOT NULL' -- REFERENCES denominations (denominations_serial) ON DELETE CASCADE'
- ',coin_ev BYTEA NOT NULL' -- UNIQUE'
- ',h_coin_ev BYTEA NOT NULL CHECK(LENGTH(h_coin_ev)=64)' -- UNIQUE'
+ ',denominations_serial INT8 NOT NULL'
+ ',coin_ev BYTEA NOT NULL'
+ ',h_coin_ev BYTEA NOT NULL CHECK(LENGTH(h_coin_ev)=64)'
',ev_sig BYTEA NOT NULL'
',ewv BYTEA NOT NULL'
- -- ,PRIMARY KEY (melt_serial_id, freshcoin_index) -- done per shard
') %s ;'
,table_name
,'PARTITION BY HASH (melt_serial_id)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_coins_by_melt_serial_id_index '
'ON ' || table_name || ' '
'(melt_serial_id);'
);
-
END
$$;
--
--- Name: create_table_refresh_transfer_keys(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_refresh_transfer_keys(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_refresh_transfer_keys(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_refresh_transfer_keys(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'refresh_transfer_keys';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(rtc_serial BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',melt_serial_id INT8 PRIMARY KEY' -- REFERENCES refresh_commitments (melt_serial_id) ON DELETE CASCADE'
+ '(rtc_serial BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',melt_serial_id INT8 PRIMARY KEY'
',transfer_pub BYTEA NOT NULL CHECK(LENGTH(transfer_pub)=32)'
',transfer_privs BYTEA NOT NULL'
') %s ;'
@@ -2125,71 +2103,63 @@ BEGIN
,'PARTITION BY HASH (melt_serial_id)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_refunds(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_refunds(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_refunds(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_refunds(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'refunds';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(refund_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)' -- REFERENCES known_coins (coin_pub) ON DELETE CASCADE
- ',deposit_serial_id INT8 NOT NULL' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE'
+ '(refund_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)'
+ ',deposit_serial_id INT8 NOT NULL'
',merchant_sig BYTEA NOT NULL CHECK(LENGTH(merchant_sig)=64)'
',rtransaction_id INT8 NOT NULL'
',amount_with_fee_val INT8 NOT NULL'
',amount_with_fee_frac INT4 NOT NULL'
- -- ,PRIMARY KEY (deposit_serial_id, rtransaction_id) -- done per shard!
') %s ;'
,table_name
,'PARTITION BY HASH (coin_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_coin_pub_index '
'ON ' || table_name || ' '
'(coin_pub);'
);
-
END
$$;
--
--- Name: create_table_reserves(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_reserves(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_reserves(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_reserves(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'reserves';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
'(reserve_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY'
',reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32)'
- ',current_balance_val INT8 NOT NULL'
- ',current_balance_frac INT4 NOT NULL'
+ ',current_balance_val INT8 NOT NULL DEFAULT(0)'
+ ',current_balance_frac INT4 NOT NULL DEFAULT(0)'
',purses_active INT8 NOT NULL DEFAULT(0)'
',purses_allowed INT8 NOT NULL DEFAULT(0)'
- ',kyc_required BOOLEAN NOT NULL DEFAULT(FALSE)'
- ',kyc_passed BOOLEAN NOT NULL DEFAULT(FALSE)'
+ ',max_age INT4 NOT NULL DEFAULT(120)'
',expiration_date INT8 NOT NULL'
',gc_date INT8 NOT NULL'
') %s ;'
@@ -2197,9 +2167,7 @@ BEGIN
,'PARTITION BY HASH (reserve_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_expiration_index '
'ON ' || table_name || ' '
@@ -2226,26 +2194,24 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_by_gc_date_index '
'IS ' || quote_literal('for reserve garbage collection') || ';'
);
-
END
$$;
--
--- Name: create_table_reserves_close(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_reserves_close(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_reserves_close(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_reserves_close(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR default 'reserves_close';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(close_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE / PRIMARY KEY'
- ',reserve_pub BYTEA NOT NULL' -- REFERENCES reserves (reserve_pub) ON DELETE CASCADE'
+ '(close_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',reserve_pub BYTEA NOT NULL'
',execution_date INT8 NOT NULL'
',wtid BYTEA NOT NULL CHECK (LENGTH(wtid)=32)'
',wire_target_h_payto BYTEA CHECK (LENGTH(wire_target_h_payto)=32)'
@@ -2258,9 +2224,7 @@ BEGIN
,'PARTITION BY HASH (reserve_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_close_uuid_index '
'ON ' || table_name || ' '
@@ -2276,20 +2240,19 @@ $$;
--
--- Name: create_table_reserves_in(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_reserves_in(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_reserves_in(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_reserves_in(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR default 'reserves_in';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(reserve_in_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
- ',reserve_pub BYTEA PRIMARY KEY' -- REFERENCES reserves (reserve_pub) ON DELETE CASCADE'
+ '(reserve_in_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',reserve_pub BYTEA PRIMARY KEY'
',wire_reference INT8 NOT NULL'
',credit_val INT8 NOT NULL'
',credit_frac INT4 NOT NULL'
@@ -2301,15 +2264,12 @@ BEGIN
,'PARTITION BY HASH (reserve_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_reserve_in_serial_id_index '
'ON ' || table_name || ' '
'(reserve_in_serial_id);'
);
- -- FIXME: where do we need this index? Can we do better?
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_exch_accnt_section_execution_date_idx '
'ON ' || table_name || ' '
@@ -2317,7 +2277,6 @@ BEGIN
',execution_date'
');'
);
- -- FIXME: where do we need this index? Can we do better?
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_exch_accnt_reserve_in_serial_id_idx '
'ON ' || table_name || ' '
@@ -2325,29 +2284,27 @@ BEGIN
'reserve_in_serial_id DESC'
');'
);
-
END
$$;
--
--- Name: create_table_reserves_out(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_reserves_out(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_reserves_out(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_reserves_out(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR default 'reserves_out';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(reserve_out_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
+ '(reserve_out_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',h_blind_ev BYTEA CHECK (LENGTH(h_blind_ev)=64) UNIQUE'
- ',denominations_serial INT8 NOT NULL' -- REFERENCES denominations (denominations_serial)'
+ ',denominations_serial INT8 NOT NULL'
',denom_sig BYTEA NOT NULL'
- ',reserve_uuid INT8 NOT NULL' -- REFERENCES reserves (reserve_uuid) ON DELETE CASCADE'
+ ',reserve_uuid INT8 NOT NULL'
',reserve_sig BYTEA NOT NULL CHECK (LENGTH(reserve_sig)=64)'
',execution_date INT8 NOT NULL'
',amount_with_fee_val INT8 NOT NULL'
@@ -2357,15 +2314,12 @@ BEGIN
,'PARTITION BY HASH (h_blind_ev)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_reserve_out_serial_id_index '
'ON ' || table_name || ' '
'(reserve_out_serial_id);'
);
- -- FIXME: change query to use reserves_out_by_reserve instead and materialize execution_date there as well???
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_reserve_uuid_and_execution_date_index '
'ON ' || table_name || ' '
@@ -2375,59 +2329,53 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_by_reserve_uuid_and_execution_date_index '
'IS ' || quote_literal('for get_reserves_out and exchange_do_withdraw_limit_check') || ';'
);
-
END
$$;
--
--- Name: create_table_reserves_out_by_reserve(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_reserves_out_by_reserve(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_reserves_out_by_reserve(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_reserves_out_by_reserve(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'reserves_out_by_reserve';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(reserve_uuid INT8 NOT NULL' -- REFERENCES reserves (reserve_uuid) ON DELETE CASCADE
+ '(reserve_uuid INT8 NOT NULL'
',h_blind_ev BYTEA CHECK (LENGTH(h_blind_ev)=64)'
') %s '
,table_name
,'PARTITION BY HASH (reserve_uuid)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_main_index '
'ON ' || table_name || ' '
'(reserve_uuid);'
);
-
END
$$;
--
--- Name: create_table_wad_in_entries(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_wad_in_entries(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_wad_in_entries(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_wad_in_entries(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'wad_in_entries';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(wad_in_entry_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' --UNIQUE
- ',wad_in_serial_id INT8' -- REFERENCES wads_in (wad_in_serial_id) ON DELETE CASCADE
+ '(wad_in_entry_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',wad_in_serial_id INT8'
',reserve_pub BYTEA NOT NULL CHECK(LENGTH(reserve_pub)=32)'
',purse_pub BYTEA PRIMARY KEY CHECK(LENGTH(purse_pub)=32)'
',h_contract BYTEA NOT NULL CHECK(LENGTH(h_contract)=64)'
@@ -2446,10 +2394,7 @@ BEGIN
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: change to materialized index by reserve_pub!
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_reserve_pub '
'ON ' || table_name || ' '
@@ -2459,26 +2404,24 @@ BEGIN
'COMMENT ON INDEX ' || table_name || '_reserve_pub '
'IS ' || quote_literal('needed in reserve history computation') || ';'
);
-
END
$$;
--
--- Name: create_table_wad_out_entries(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_wad_out_entries(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_wad_out_entries(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_wad_out_entries(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'wad_out_entries';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(wad_out_entry_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' --UNIQUE
- ',wad_out_serial_id INT8' -- REFERENCES wads_out (wad_out_serial_id) ON DELETE CASCADE
+ '(wad_out_entry_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ ',wad_out_serial_id INT8'
',reserve_pub BYTEA NOT NULL CHECK(LENGTH(reserve_pub)=32)'
',purse_pub BYTEA PRIMARY KEY CHECK(LENGTH(purse_pub)=32)'
',h_contract BYTEA NOT NULL CHECK(LENGTH(h_contract)=64)'
@@ -2497,34 +2440,29 @@ BEGIN
,'PARTITION BY HASH (purse_pub)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
- -- FIXME: change to materialized index by reserve_pub!
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_reserve_pub '
'ON ' || table_name || ' '
'(reserve_pub);'
);
-
END
$$;
--
--- Name: create_table_wads_in(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_wads_in(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_wads_in(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_wads_in(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'wads_in';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(wad_in_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' --UNIQUE
+ '(wad_in_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',wad_id BYTEA PRIMARY KEY CHECK (LENGTH(wad_id)=24)'
',origin_exchange_url TEXT NOT NULL'
',amount_val INT8 NOT NULL'
@@ -2536,27 +2474,25 @@ BEGIN
,'PARTITION BY HASH (wad_id)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_wads_out(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_wads_out(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_wads_out(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_wads_out(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'wads_out';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I '
- '(wad_out_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' --UNIQUE
+ '(wad_out_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',wad_id BYTEA PRIMARY KEY CHECK (LENGTH(wad_id)=24)'
- ',partner_serial_id INT8 NOT NULL' -- REFERENCES partners(partner_serial_id) ON DELETE CASCADE
+ ',partner_serial_id INT8 NOT NULL'
',amount_val INT8 NOT NULL'
',amount_frac INT4 NOT NULL'
',execution_time INT8 NOT NULL'
@@ -2565,25 +2501,23 @@ BEGIN
,'PARTITION BY HASH (wad_id)'
,shard_suffix
);
-
END
$$;
--
--- Name: create_table_wire_out(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_wire_out(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_wire_out(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_wire_out(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
table_name VARCHAR DEFAULT 'wire_out';
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(wireout_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY' -- PRIMARY KEY'
+ '(wireout_uuid BIGINT GENERATED BY DEFAULT AS IDENTITY'
',execution_date INT8 NOT NULL'
',wtid_raw BYTEA UNIQUE NOT NULL CHECK (LENGTH(wtid_raw)=32)'
',wire_target_h_payto BYTEA CHECK (LENGTH(wire_target_h_payto)=32)'
@@ -2595,58 +2529,50 @@ BEGIN
,'PARTITION BY HASH (wtid_raw)'
,shard_suffix
);
-
table_name = concat_ws('_', table_name, shard_suffix);
-
EXECUTE FORMAT (
'CREATE INDEX IF NOT EXISTS ' || table_name || '_by_wire_target_h_payto_index '
'ON ' || table_name || ' '
'(wire_target_h_payto);'
);
-
-
END
$$;
--
--- Name: create_table_wire_targets(character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: create_table_wire_targets(character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.create_table_wire_targets(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
+CREATE FUNCTION exchange.create_table_wire_targets(shard_suffix character varying DEFAULT NULL::character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
- '(wire_target_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
+ '(wire_target_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',wire_target_h_payto BYTEA PRIMARY KEY CHECK (LENGTH(wire_target_h_payto)=32)'
',payto_uri VARCHAR NOT NULL'
- ',kyc_ok BOOLEAN NOT NULL DEFAULT (FALSE)'
- ',external_id VARCHAR'
') %s ;'
,'wire_targets'
,'PARTITION BY HASH (wire_target_h_payto)'
,shard_suffix
);
-
END
$$;
--
--- Name: defer_wire_out(); Type: PROCEDURE; Schema: public; Owner: -
+-- Name: defer_wire_out(); Type: PROCEDURE; Schema: exchange; Owner: -
--
-CREATE PROCEDURE public.defer_wire_out()
+CREATE PROCEDURE exchange.defer_wire_out()
LANGUAGE plpgsql
AS $$
BEGIN
IF EXISTS (
SELECT 1
- FROM information_Schema.constraint_column_usage
+ FROM exchange.information_Schema.constraint_column_usage
WHERE table_name='wire_out'
AND constraint_name='wire_out_ref')
THEN
@@ -2657,25 +2583,24 @@ END $$;
--
--- Name: deposits_delete_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: deposits_delete_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.deposits_delete_trigger() RETURNS trigger
+CREATE FUNCTION exchange.deposits_delete_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE
was_ready BOOLEAN;
BEGIN
- was_ready = NOT (OLD.done OR OLD.extension_blocked);
-
+ was_ready = NOT (OLD.done OR OLD.extension_blocked);
IF (was_ready)
THEN
- DELETE FROM deposits_by_ready
+ DELETE FROM exchange.deposits_by_ready
WHERE wire_deadline = OLD.wire_deadline
AND shard = OLD.shard
AND coin_pub = OLD.coin_pub
AND deposit_serial_id = OLD.deposit_serial_id;
- DELETE FROM deposits_for_matching
+ DELETE FROM exchange.deposits_for_matching
WHERE refund_deadline = OLD.refund_deadline
AND merchant_pub = OLD.merchant_pub
AND coin_pub = OLD.coin_pub
@@ -2686,27 +2611,26 @@ END $$;
--
--- Name: FUNCTION deposits_delete_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION deposits_delete_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.deposits_delete_trigger() IS 'Replicate deposit deletions into materialized indices.';
+COMMENT ON FUNCTION exchange.deposits_delete_trigger() IS 'Replicate deposit deletions into materialized indices.';
--
--- Name: deposits_insert_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: deposits_insert_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.deposits_insert_trigger() RETURNS trigger
+CREATE FUNCTION exchange.deposits_insert_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE
is_ready BOOLEAN;
BEGIN
- is_ready = NOT (NEW.done OR NEW.extension_blocked);
-
+ is_ready = NOT (NEW.done OR NEW.extension_blocked);
IF (is_ready)
THEN
- INSERT INTO deposits_by_ready
+ INSERT INTO exchange.deposits_by_ready
(wire_deadline
,shard
,coin_pub
@@ -2716,7 +2640,7 @@ BEGIN
,NEW.shard
,NEW.coin_pub
,NEW.deposit_serial_id);
- INSERT INTO deposits_for_matching
+ INSERT INTO exchange.deposits_for_matching
(refund_deadline
,merchant_pub
,coin_pub
@@ -2732,17 +2656,17 @@ END $$;
--
--- Name: FUNCTION deposits_insert_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION deposits_insert_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.deposits_insert_trigger() IS 'Replicate deposit inserts into materialized indices.';
+COMMENT ON FUNCTION exchange.deposits_insert_trigger() IS 'Replicate deposit inserts into materialized indices.';
--
--- Name: deposits_update_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: deposits_update_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.deposits_update_trigger() RETURNS trigger
+CREATE FUNCTION exchange.deposits_update_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE
@@ -2751,15 +2675,15 @@ DECLARE
is_ready BOOLEAN;
BEGIN
was_ready = NOT (OLD.done OR OLD.extension_blocked);
- is_ready = NOT (NEW.done OR NEW.extension_blocked);
+ is_ready = NOT (NEW.done OR NEW.extension_blocked);
IF (was_ready AND NOT is_ready)
THEN
- DELETE FROM deposits_by_ready
+ DELETE FROM exchange.deposits_by_ready
WHERE wire_deadline = OLD.wire_deadline
AND shard = OLD.shard
AND coin_pub = OLD.coin_pub
AND deposit_serial_id = OLD.deposit_serial_id;
- DELETE FROM deposits_for_matching
+ DELETE FROM exchange.deposits_for_matching
WHERE refund_deadline = OLD.refund_deadline
AND merchant_pub = OLD.merchant_pub
AND coin_pub = OLD.coin_pub
@@ -2767,7 +2691,7 @@ BEGIN
END IF;
IF (is_ready AND NOT was_ready)
THEN
- INSERT INTO deposits_by_ready
+ INSERT INTO exchange.deposits_by_ready
(wire_deadline
,shard
,coin_pub
@@ -2777,7 +2701,7 @@ BEGIN
,NEW.shard
,NEW.coin_pub
,NEW.deposit_serial_id);
- INSERT INTO deposits_for_matching
+ INSERT INTO exchange.deposits_for_matching
(refund_deadline
,merchant_pub
,coin_pub
@@ -2793,117 +2717,81 @@ END $$;
--
--- Name: FUNCTION deposits_update_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION deposits_update_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.deposits_update_trigger() IS 'Replicate deposits changes into materialized indices.';
+COMMENT ON FUNCTION exchange.deposits_update_trigger() IS 'Replicate deposits changes into materialized indices.';
--
--- Name: detach_default_partitions(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: detach_default_partitions(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.detach_default_partitions() RETURNS void
+CREATE FUNCTION exchange.detach_default_partitions() RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
RAISE NOTICE 'Detaching all default table partitions';
-
ALTER TABLE IF EXISTS wire_targets
DETACH PARTITION wire_targets_default;
-
ALTER TABLE IF EXISTS reserves
DETACH PARTITION reserves_default;
-
ALTER TABLE IF EXISTS reserves_in
DETACH PARTITION reserves_in_default;
-
ALTER TABLE IF EXISTS reserves_close
DETACH PARTITION reserves_close_default;
-
ALTER TABLE IF EXISTS reserves_out
DETACH PARTITION reserves_out_default;
-
ALTER TABLE IF EXISTS reserves_out_by_reserve
DETACH PARTITION reserves_out_by_reserve_default;
-
ALTER TABLE IF EXISTS known_coins
DETACH PARTITION known_coins_default;
-
ALTER TABLE IF EXISTS refresh_commitments
DETACH PARTITION refresh_commitments_default;
-
ALTER TABLE IF EXISTS refresh_revealed_coins
DETACH PARTITION refresh_revealed_coins_default;
-
ALTER TABLE IF EXISTS refresh_transfer_keys
DETACH PARTITION refresh_transfer_keys_default;
-
ALTER TABLE IF EXISTS deposits
DETACH PARTITION deposits_default;
-
---- TODO range partitioning
--- ALTER TABLE IF EXISTS deposits_by_ready
--- DETACH PARTITION deposits_by_ready_default;
---
--- ALTER TABLE IF EXISTS deposits_for_matching
--- DETACH PARTITION deposits_default_for_matching_default;
-
ALTER TABLE IF EXISTS refunds
DETACH PARTITION refunds_default;
-
ALTER TABLE IF EXISTS wire_out
DETACH PARTITION wire_out_default;
-
ALTER TABLE IF EXISTS aggregation_transient
DETACH PARTITION aggregation_transient_default;
-
ALTER TABLE IF EXISTS aggregation_tracking
DETACH PARTITION aggregation_tracking_default;
-
ALTER TABLE IF EXISTS recoup
DETACH PARTITION recoup_default;
-
ALTER TABLE IF EXISTS recoup_by_reserve
DETACH PARTITION recoup_by_reserve_default;
-
ALTER TABLE IF EXISTS recoup_refresh
DETACH PARTITION recoup_refresh_default;
-
ALTER TABLE IF EXISTS prewire
DETACH PARTITION prewire_default;
-
ALTER TABLE IF EXISTS cs_nonce_locks
DETACH partition cs_nonce_locks_default;
-
ALTER TABLE IF EXISTS purse_requests
DETACH partition purse_requests_default;
-
+ ALTER TABLE IF EXISTS purse_refunds
+ DETACH partition purse_refunds_default;
ALTER TABLE IF EXISTS purse_merges
DETACH partition purse_merges_default;
-
ALTER TABLE IF EXISTS account_merges
DETACH partition account_merges_default;
-
ALTER TABLE IF EXISTS contracts
DETACH partition contracts_default;
-
ALTER TABLE IF EXISTS history_requests
DETACH partition history_requests_default;
-
ALTER TABLE IF EXISTS close_requests
DETACH partition close_requests_default;
-
ALTER TABLE IF EXISTS purse_deposits
DETACH partition purse_deposits_default;
-
ALTER TABLE IF EXISTS wad_out_entries
DETACH partition wad_out_entries_default;
-
ALTER TABLE IF EXISTS wads_in
DETACH partition wads_in_default;
-
ALTER TABLE IF EXISTS wad_in_entries
DETACH partition wad_in_entries_default;
END
@@ -2911,24 +2799,22 @@ $$;
--
--- Name: FUNCTION detach_default_partitions(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION detach_default_partitions(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.detach_default_partitions() IS 'We need to drop default and create new one before deleting the default partitions
+COMMENT ON FUNCTION exchange.detach_default_partitions() IS 'We need to drop default and create new one before deleting the default partitions
otherwise constraints get lost too. Might be needed in shardig too';
--
--- Name: drop_default_partitions(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: drop_default_partitions(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.drop_default_partitions() RETURNS void
+CREATE FUNCTION exchange.drop_default_partitions() RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
RAISE NOTICE 'Dropping default table partitions';
-
DROP TABLE IF EXISTS wire_targets_default;
DROP TABLE IF EXISTS reserves_default;
DROP TABLE IF EXISTS reserves_in_default;
@@ -2940,8 +2826,6 @@ BEGIN
DROP TABLE IF EXISTS refresh_revealed_coins_default;
DROP TABLE IF EXISTS refresh_transfer_keys_default;
DROP TABLE IF EXISTS deposits_default;
---DROP TABLE IF EXISTS deposits_by_ready_default;
---DROP TABLE IF EXISTS deposits_for_matching_default;
DROP TABLE IF EXISTS refunds_default;
DROP TABLE IF EXISTS wire_out_default;
DROP TABLE IF EXISTS aggregation_transient_default;
@@ -2951,8 +2835,8 @@ BEGIN
DROP TABLE IF EXISTS recoup_refresh_default;
DROP TABLE IF EXISTS prewire_default;
DROP TABLE IF EXISTS cs_nonce_locks_default;
-
DROP TABLE IF EXISTS purse_requests_default;
+ DROP TABLE IF EXISTS purse_refunds_default;
DROP TABLE IF EXISTS purse_merges_default;
DROP TABLE IF EXISTS account_merges_default;
DROP TABLE IF EXISTS contracts_default;
@@ -2962,24 +2846,23 @@ BEGIN
DROP TABLE IF EXISTS wad_out_entries_default;
DROP TABLE IF EXISTS wads_in_default;
DROP TABLE IF EXISTS wad_in_entries_default;
-
END
$$;
--
--- Name: FUNCTION drop_default_partitions(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION drop_default_partitions(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.drop_default_partitions() IS 'Drop all default partitions once other partitions are attached.
+COMMENT ON FUNCTION exchange.drop_default_partitions() IS 'Drop all default partitions once other partitions are attached.
Might be needed in sharding too.';
--
--- Name: exchange_do_account_merge(bytea, bytea, bytea); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_account_merge(bytea, bytea, bytea); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_account_merge(in_purse_pub bytea, in_reserve_pub bytea, in_reserve_sig bytea, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_account_merge(in_purse_pub bytea, in_reserve_pub bytea, in_reserve_sig bytea, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
BEGIN
@@ -2988,10 +2871,10 @@ END $$;
--
--- Name: exchange_do_batch_withdraw(bigint, integer, bytea, bigint, bigint); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_batch_withdraw(bigint, integer, bytea, bigint, bigint); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_batch_withdraw(amount_val bigint, amount_frac integer, rpub bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT kycok boolean, OUT account_uuid bigint, OUT ruuid bigint) RETURNS record
+CREATE FUNCTION exchange.exchange_do_batch_withdraw(amount_val bigint, amount_frac integer, rpub bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT ruuid bigint) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -3017,7 +2900,7 @@ SELECT
,reserve_frac
,reserve_gc
,ruuid
- FROM reserves
+ FROM exchange.reserves
WHERE reserves.reserve_pub=rpub;
IF NOT FOUND
@@ -3025,8 +2908,6 @@ THEN
-- reserve unknown
reserve_found=FALSE;
balance_ok=FALSE;
- kycok=FALSE;
- account_uuid=0;
ruuid=2;
RETURN;
END IF;
@@ -3050,8 +2931,6 @@ ELSE
ELSE
reserve_found=TRUE;
balance_ok=FALSE;
- kycok=FALSE; -- we do not really know or care
- account_uuid=0;
RETURN;
END IF;
END IF;
@@ -3070,52 +2949,21 @@ WHERE
reserve_found=TRUE;
balance_ok=TRUE;
-
--- Obtain KYC status based on the last wire transfer into
--- this reserve. FIXME: likely not adequate for reserves that got P2P transfers!
--- SELECT
--- kyc_ok
--- ,wire_target_serial_id
--- INTO
--- kycok
--- ,account_uuid
--- FROM reserves_in
--- JOIN wire_targets ON (wire_source_h_payto = wire_target_h_payto)
--- WHERE reserve_pub=rpub
--- LIMIT 1; -- limit 1 should not be required (without p2p transfers)
-
-WITH reserves_in AS materialized (
- SELECT wire_source_h_payto
- FROM reserves_in WHERE
- reserve_pub=rpub
-)
-SELECT
- kyc_ok
- ,wire_target_serial_id
-INTO
- kycok
- ,account_uuid
-FROM wire_targets
- WHERE wire_target_h_payto = (
- SELECT wire_source_h_payto
- FROM reserves_in
- );
-
END $$;
--
--- Name: FUNCTION exchange_do_batch_withdraw(amount_val bigint, amount_frac integer, rpub bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT kycok boolean, OUT account_uuid bigint, OUT ruuid bigint); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION exchange_do_batch_withdraw(amount_val bigint, amount_frac integer, rpub bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT ruuid bigint); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.exchange_do_batch_withdraw(amount_val bigint, amount_frac integer, rpub bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT kycok boolean, OUT account_uuid bigint, OUT ruuid bigint) IS 'Checks whether the reserve has sufficient balance for a withdraw operation (or the request is repeated and was previously approved) and if so updates the database with the result. Excludes storing the planchets.';
+COMMENT ON FUNCTION exchange.exchange_do_batch_withdraw(amount_val bigint, amount_frac integer, rpub bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT ruuid bigint) IS 'Checks whether the reserve has sufficient balance for a withdraw operation (or the request is repeated and was previously approved) and if so updates the database with the result. Excludes storing the planchets.';
--
--- Name: exchange_do_batch_withdraw_insert(bytea, bigint, integer, bytea, bigint, bytea, bytea, bytea, bigint); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_batch_withdraw_insert(bytea, bigint, integer, bytea, bigint, bytea, bytea, bytea, bigint); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_batch_withdraw_insert(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, ruuid bigint, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, OUT out_denom_unknown boolean, OUT out_nonce_reuse boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_batch_withdraw_insert(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, ruuid bigint, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, OUT out_denom_unknown boolean, OUT out_nonce_reuse boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -3133,7 +2981,7 @@ out_nonce_reuse=TRUE;
SELECT denominations_serial
INTO denom_serial
- FROM denominations
+ FROM exchange.denominations
WHERE denom_pub_hash=h_denom_pub;
IF NOT FOUND
@@ -3145,7 +2993,7 @@ THEN
END IF;
out_denom_unknown=FALSE;
-INSERT INTO reserves_out
+INSERT INTO exchange.reserves_out
(h_blind_ev
,denominations_serial
,denom_sig
@@ -3178,7 +3026,7 @@ IF NOT NULL cs_nonce
THEN
-- Cache CS signature to prevent replays in the future
-- (and check if cached signature exists at the same time).
- INSERT INTO cs_nonce_locks
+ INSERT INTO exchange.cs_nonce_locks
(nonce
,max_denomination_serial
,op_hash)
@@ -3192,7 +3040,7 @@ THEN
THEN
-- See if the existing entry is identical.
SELECT 1
- FROM cs_nonce_locks
+ FROM exchange.cs_nonce_locks
WHERE nonce=cs_nonce
AND op_hash=h_coin_envelope;
IF NOT FOUND
@@ -3208,29 +3056,67 @@ END $$;
--
--- Name: FUNCTION exchange_do_batch_withdraw_insert(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, ruuid bigint, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, OUT out_denom_unknown boolean, OUT out_nonce_reuse boolean, OUT out_conflict boolean); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION exchange_do_batch_withdraw_insert(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, ruuid bigint, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, OUT out_denom_unknown boolean, OUT out_nonce_reuse boolean, OUT out_conflict boolean); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.exchange_do_batch_withdraw_insert(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, ruuid bigint, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, OUT out_denom_unknown boolean, OUT out_nonce_reuse boolean, OUT out_conflict boolean) IS 'Stores information about a planchet for a batch withdraw operation. Checks if the planchet already exists, and in that case indicates a conflict';
+COMMENT ON FUNCTION exchange.exchange_do_batch_withdraw_insert(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, ruuid bigint, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, OUT out_denom_unknown boolean, OUT out_nonce_reuse boolean, OUT out_conflict boolean) IS 'Stores information about a planchet for a batch withdraw operation. Checks if the planchet already exists, and in that case indicates a conflict';
--
--- Name: exchange_do_close_request(bytea, bytea); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_close_request(bytea, bigint, bytea); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_close_request(in_reserve_pub bytea, in_reserve_sig bytea, OUT out_final_balance_val bigint, OUT out_final_balance_frac integer, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_close_request(in_reserve_pub bytea, in_close_timestamp bigint, in_reserve_sig bytea, OUT out_final_balance_val bigint, OUT out_final_balance_frac integer, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
BEGIN
- -- FIXME
+
+ SELECT
+ current_balance_val
+ ,current_balance_frac
+ INTO
+ out_final_balance_val
+ ,out_final_balance_frac
+ FROM exchange.reserves
+ WHERE reserve_pub=in_reserve_pub;
+
+ IF NOT FOUND
+ THEN
+ out_final_balance_val=0;
+ out_final_balance_frac=0;
+ out_balance_ok = FALSE;
+ out_conflict = FALSE;
+ END IF;
+
+ INSERT INTO exchange.close_requests
+ (reserve_pub
+ ,close_timestamp
+ ,reserve_sig
+ ,close_val
+ ,close_frac)
+ VALUES
+ (in_reserve_pub
+ ,in_close_timestamp
+ ,in_reserve_sig
+ ,out_final_balance_val
+ ,out_final_balance_frac)
+ ON CONFLICT DO NOTHING;
+ out_conflict = NOT FOUND;
+
+ UPDATE reserves SET
+ current_balance_val=0
+ ,current_balance_frac=0
+ WHERE reserve_pub=in_reserve_pub;
+ out_balance_ok = TRUE;
+
END $$;
--
--- Name: exchange_do_deposit(bigint, integer, bytea, bytea, bigint, bigint, bigint, bigint, bytea, character varying, bytea, bigint, bytea, bytea, bigint, boolean, character varying); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_deposit(bigint, integer, bytea, bytea, bigint, bigint, bigint, bigint, bytea, character varying, bytea, bigint, bytea, bytea, bigint, boolean, character varying); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_deposit(in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_h_contract_terms bytea, in_wire_salt bytea, in_wallet_timestamp bigint, in_exchange_timestamp bigint, in_refund_deadline bigint, in_wire_deadline bigint, in_merchant_pub bytea, in_receiver_wire_account character varying, in_h_payto bytea, in_known_coin_id bigint, in_coin_pub bytea, in_coin_sig bytea, in_shard bigint, in_extension_blocked boolean, in_extension_details character varying, OUT out_exchange_timestamp bigint, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_deposit(in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_h_contract_terms bytea, in_wire_salt bytea, in_wallet_timestamp bigint, in_exchange_timestamp bigint, in_refund_deadline bigint, in_wire_deadline bigint, in_merchant_pub bytea, in_receiver_wire_account character varying, in_h_payto bytea, in_known_coin_id bigint, in_coin_pub bytea, in_coin_sig bytea, in_shard bigint, in_extension_blocked boolean, in_extension_details character varying, OUT out_exchange_timestamp bigint, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -3245,7 +3131,7 @@ BEGIN
IF NOT NULL in_extension_details
THEN
- INSERT INTO extension_details
+ INSERT INTO exchange.extension_details
(extension_options)
VALUES
(in_extension_details)
@@ -3255,7 +3141,7 @@ ELSE
END IF;
-INSERT INTO wire_targets
+INSERT INTO exchange.wire_targets
(wire_target_h_payto
,payto_uri)
VALUES
@@ -3268,12 +3154,12 @@ IF NOT FOUND
THEN
SELECT wire_target_serial_id
INTO wtsi
- FROM wire_targets
+ FROM exchange.wire_targets
WHERE wire_target_h_payto=in_h_payto;
END IF;
-INSERT INTO deposits
+INSERT INTO exchange.deposits
(shard
,coin_pub
,known_coin_id
@@ -3321,7 +3207,7 @@ THEN
exchange_timestamp
INTO
out_exchange_timestamp
- FROM deposits
+ FROM exchange.deposits
WHERE shard=in_shard
AND merchant_pub=in_merchant_pub
AND wire_target_h_payto=in_h_payto
@@ -3382,10 +3268,81 @@ END $$;
--
--- Name: exchange_do_gc(bigint, bigint); Type: PROCEDURE; Schema: public; Owner: -
+-- Name: exchange_do_expire_purse(bigint, bigint); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE PROCEDURE public.exchange_do_gc(in_ancient_date bigint, in_now bigint)
+CREATE FUNCTION exchange.exchange_do_expire_purse(in_start_time bigint, in_end_time bigint, OUT out_found boolean) RETURNS boolean
+ LANGUAGE plpgsql
+ AS $$
+DECLARE
+ my_purse_pub BYTEA;
+DECLARE
+ my_deposit record;
+BEGIN
+
+SELECT purse_pub
+ INTO my_purse_pub
+ FROM exchange.purse_requests
+ WHERE (purse_expiration >= in_start_time) AND
+ (purse_expiration < in_end_time) AND
+ (NOT finished) AND
+ (NOT refunded)
+ ORDER BY purse_expiration ASC
+ LIMIT 1;
+out_found = FOUND;
+IF NOT FOUND
+THEN
+ RETURN;
+END IF;
+
+UPDATE purse_requests
+ SET refunded=TRUE,
+ finished=TRUE
+ WHERE purse_pub=my_purse_pub;
+
+INSERT INTO exchange.purse_refunds
+ (purse_pub)
+ VALUES
+ (my_purse_pub);
+
+-- restore balance to each coin deposited into the purse
+FOR my_deposit IN
+ SELECT coin_pub
+ ,amount_with_fee_val
+ ,amount_with_fee_frac
+ FROM exchange.purse_deposits
+ WHERE purse_pub = my_purse_pub
+LOOP
+ UPDATE known_coins SET
+ remaining_frac=remaining_frac+my_deposit.amount_with_fee_frac
+ - CASE
+ WHEN remaining_frac+my_deposit.amount_with_fee_frac >= 100000000
+ THEN 100000000
+ ELSE 0
+ END,
+ remaining_val=remaining_val+my_deposit.amount_with_fee_val
+ + CASE
+ WHEN remaining_frac+my_deposit.amount_with_fee_frac >= 100000000
+ THEN 1
+ ELSE 0
+ END
+ WHERE coin_pub = my_deposit.coin_pub;
+ END LOOP;
+END $$;
+
+
+--
+-- Name: FUNCTION exchange_do_expire_purse(in_start_time bigint, in_end_time bigint, OUT out_found boolean); Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON FUNCTION exchange.exchange_do_expire_purse(in_start_time bigint, in_end_time bigint, OUT out_found boolean) IS 'Finds an expired purse in the given time range and refunds the coins (if any).';
+
+
+--
+-- Name: exchange_do_gc(bigint, bigint); Type: PROCEDURE; Schema: exchange; Owner: -
+--
+
+CREATE PROCEDURE exchange.exchange_do_gc(in_ancient_date bigint, in_now bigint)
LANGUAGE plpgsql
AS $$
DECLARE
@@ -3402,14 +3359,14 @@ DECLARE
denom_min INT8; -- minimum denomination still alive
BEGIN
-DELETE FROM prewire
+DELETE FROM exchange.prewire
WHERE finished=TRUE;
-DELETE FROM wire_fee
+DELETE FROM exchange.wire_fee
WHERE end_date < in_ancient_date;
-- TODO: use closing fee as threshold?
-DELETE FROM reserves
+DELETE FROM exchange.reserves
WHERE gc_date < in_now
AND current_balance_val = 0
AND current_balance_frac = 0;
@@ -3418,11 +3375,11 @@ SELECT
reserve_out_serial_id
INTO
reserve_out_min
- FROM reserves_out
+ FROM exchange.reserves_out
ORDER BY reserve_out_serial_id ASC
LIMIT 1;
-DELETE FROM recoup
+DELETE FROM exchange.recoup
WHERE reserve_out_serial_id < reserve_out_min;
-- FIXME: recoup_refresh lacks GC!
@@ -3430,103 +3387,157 @@ SELECT
reserve_uuid
INTO
reserve_uuid_min
- FROM reserves
+ FROM exchange.reserves
ORDER BY reserve_uuid ASC
LIMIT 1;
-DELETE FROM reserves_out
+DELETE FROM exchange.reserves_out
WHERE reserve_uuid < reserve_uuid_min;
-- FIXME: this query will be horribly slow;
-- need to find another way to formulate it...
-DELETE FROM denominations
+DELETE FROM exchange.denominations
WHERE expire_legal < in_now
AND denominations_serial NOT IN
(SELECT DISTINCT denominations_serial
- FROM reserves_out)
+ FROM exchange.reserves_out)
AND denominations_serial NOT IN
(SELECT DISTINCT denominations_serial
- FROM known_coins
+ FROM exchange.known_coins
WHERE coin_pub IN
(SELECT DISTINCT coin_pub
- FROM recoup))
+ FROM exchange.recoup))
AND denominations_serial NOT IN
(SELECT DISTINCT denominations_serial
- FROM known_coins
+ FROM exchange.known_coins
WHERE coin_pub IN
(SELECT DISTINCT coin_pub
- FROM recoup_refresh));
+ FROM exchange.recoup_refresh));
SELECT
melt_serial_id
INTO
melt_min
- FROM refresh_commitments
+ FROM exchange.refresh_commitments
ORDER BY melt_serial_id ASC
LIMIT 1;
-DELETE FROM refresh_revealed_coins
+DELETE FROM exchange.refresh_revealed_coins
WHERE melt_serial_id < melt_min;
-DELETE FROM refresh_transfer_keys
+DELETE FROM exchange.refresh_transfer_keys
WHERE melt_serial_id < melt_min;
SELECT
known_coin_id
INTO
coin_min
- FROM known_coins
+ FROM exchange.known_coins
ORDER BY known_coin_id ASC
LIMIT 1;
-DELETE FROM deposits
+DELETE FROM exchange.deposits
WHERE known_coin_id < coin_min;
SELECT
deposit_serial_id
INTO
deposit_min
- FROM deposits
+ FROM exchange.deposits
ORDER BY deposit_serial_id ASC
LIMIT 1;
-DELETE FROM refunds
+DELETE FROM exchange.refunds
WHERE deposit_serial_id < deposit_min;
-DELETE FROM aggregation_tracking
+DELETE FROM exchange.aggregation_tracking
WHERE deposit_serial_id < deposit_min;
SELECT
denominations_serial
INTO
denom_min
- FROM denominations
+ FROM exchange.denominations
ORDER BY denominations_serial ASC
LIMIT 1;
-DELETE FROM cs_nonce_locks
+DELETE FROM exchange.cs_nonce_locks
WHERE max_denomination_serial <= denom_min;
END $$;
--
--- Name: exchange_do_history_request(bytea, bytea, bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_history_request(bytea, bytea, bigint, bigint, integer); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_history_request(in_reserve_pub bytea, in_reserve_sig bytea, in_request_timestamp bigint, in_history_fee_val bigint, in_history_fee_frac integer, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_history_request(in_reserve_pub bytea, in_reserve_sig bytea, in_request_timestamp bigint, in_history_fee_val bigint, in_history_fee_frac integer, OUT out_balance_ok boolean, OUT out_idempotent boolean) RETURNS record
LANGUAGE plpgsql
AS $$
BEGIN
- -- FIXME
+
+ -- Insert and check for idempotency.
+ INSERT INTO exchange.history_requests
+ (reserve_pub
+ ,request_timestamp
+ ,reserve_sig
+ ,history_fee_val
+ ,history_fee_frac)
+ VALUES
+ (in_reserve_pub
+ ,in_request_timestamp
+ ,in_reserve_sig
+ ,in_history_fee_val
+ ,in_history_fee_frac)
+ ON CONFLICT DO NOTHING;
+
+ IF NOT FOUND
+ THEN
+ out_balance_ok=TRUE;
+ out_idempotent=TRUE;
+ RETURN;
+ END IF;
+
+ out_idempotent=FALSE;
+
+ -- Update reserve balance.
+ UPDATE reserves
+ SET
+ current_balance_frac=current_balance_frac-in_history_fee_frac
+ + CASE
+ WHEN current_balance_frac < in_history_fee_frac
+ THEN 100000000
+ ELSE 0
+ END,
+ current_balance_val=current_balance_val-in_history_fee_val
+ - CASE
+ WHEN current_balance_frac < in_history_fee_frac
+ THEN 1
+ ELSE 0
+ END
+ WHERE
+ reserve_pub=in_reserve_pub
+ AND ( (current_balance_val > in_history_fee_val) OR
+ ( (current_balance_frac >= in_history_fee_frac) AND
+ (current_balance_val >= in_history_fee_val) ) );
+
+ IF NOT FOUND
+ THEN
+ -- Either reserve does not exist, or balance insufficient.
+ -- Both we treat the same here as balance insufficient.
+ out_balance_ok=FALSE;
+ RETURN;
+ END IF;
+
+ out_balance_ok=TRUE;
END $$;
--
--- Name: exchange_do_melt(bytea, bigint, integer, bytea, bytea, bytea, bigint, integer, boolean); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_melt(bytea, bigint, integer, bytea, bytea, bytea, bigint, integer, boolean); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_melt(in_cs_rms bytea, in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_rc bytea, in_old_coin_pub bytea, in_old_coin_sig bytea, in_known_coin_id bigint, in_noreveal_index integer, in_zombie_required boolean, OUT out_balance_ok boolean, OUT out_zombie_bad boolean, OUT out_noreveal_index integer) RETURNS record
+CREATE FUNCTION exchange.exchange_do_melt(in_cs_rms bytea, in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_rc bytea, in_old_coin_pub bytea, in_old_coin_sig bytea, in_known_coin_id bigint, in_noreveal_index integer, in_zombie_required boolean, OUT out_balance_ok boolean, OUT out_zombie_bad boolean, OUT out_noreveal_index integer) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -3538,7 +3549,7 @@ BEGIN
-- (rare:) PERFORM recoup_refresh (by rrc_serial) -- crosses shards!
-- UPDATE known_coins (by coin_pub)
-INSERT INTO refresh_commitments
+INSERT INTO exchange.refresh_commitments
(rc
,old_coin_pub
,old_coin_sig
@@ -3563,7 +3574,7 @@ THEN
noreveal_index
INTO
out_noreveal_index
- FROM refresh_commitments
+ FROM exchange.refresh_commitments
WHERE rc=in_rc;
out_balance_ok=FOUND;
out_zombie_bad=FALSE; -- zombie is OK
@@ -3581,13 +3592,13 @@ THEN
-- operations, and then see if any of these
-- reveal operations was involved in a recoup.
PERFORM
- FROM recoup_refresh
+ FROM exchange.recoup_refresh
WHERE rrc_serial IN
(SELECT rrc_serial
- FROM refresh_revealed_coins
+ FROM exchange.refresh_revealed_coins
WHERE melt_serial_id IN
(SELECT melt_serial_id
- FROM refresh_commitments
+ FROM exchange.refresh_commitments
WHERE old_coin_pub=in_old_coin_pub));
IF NOT FOUND
THEN
@@ -3640,13 +3651,13 @@ THEN
denominations_serial
INTO
denom_max
- FROM denominations
+ FROM exchange.denominations
ORDER BY denominations_serial DESC
LIMIT 1;
-- Cache CS signature to prevent replays in the future
-- (and check if cached signature exists at the same time).
- INSERT INTO cs_nonce_locks
+ INSERT INTO exchange.cs_nonce_locks
(nonce
,max_denomination_serial
,op_hash)
@@ -3660,7 +3671,7 @@ THEN
THEN
-- Record exists, make sure it is the same
SELECT 1
- FROM cs_nonce_locks
+ FROM exchange.cs_nonce_locks
WHERE nonce=cs_rms
AND op_hash=in_rc;
@@ -3683,16 +3694,28 @@ END $$;
--
--- Name: exchange_do_purse_deposit(bigint, bytea, bigint, integer, bytea, bytea, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_purse_deposit(bigint, bytea, bigint, integer, bytea, bytea, bigint, integer); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_purse_deposit(in_partner_id bigint, in_purse_pub bytea, in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_coin_pub bytea, in_coin_sig bytea, in_amount_without_fee_val bigint, in_amount_without_fee_frac integer, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_purse_deposit(in_partner_id bigint, in_purse_pub bytea, in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_coin_pub bytea, in_coin_sig bytea, in_amount_without_fee_val bigint, in_amount_without_fee_frac integer, OUT out_balance_ok boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
+DECLARE
+ was_merged BOOLEAN;
+DECLARE
+ psi INT8; -- partner's serial ID (set if merged)
+DECLARE
+ my_amount_val INT8; -- total in purse
+DECLARE
+ my_amount_frac INT4; -- total in purse
+DECLARE
+ was_paid BOOLEAN;
+DECLARE
+ my_reserve_pub BYTEA;
BEGIN
-- Store the deposit request.
-INSERT INTO purse_deposits
+INSERT INTO exchange.purse_deposits
(partner_serial_id
,purse_pub
,coin_pub
@@ -3712,9 +3735,8 @@ IF NOT FOUND
THEN
-- Idempotency check: check if coin_sig is the same,
-- if so, success, otherwise conflict!
- SELECT
- 1
- FROM purse_deposits
+ PERFORM
+ FROM exchange.purse_deposits
WHERE coin_pub = in_coin_pub
AND purse_pub = in_purse_pub
AND coin_sig = in_cion_sig;
@@ -3778,18 +3800,90 @@ UPDATE purse_requests
out_conflict=FALSE;
out_balance_ok=TRUE;
+-- See if we can finish the merge or need to update the trigger time and partner.
+SELECT partner_serial_id
+ ,reserve_pub
+ INTO psi
+ ,my_reserve_pub
+ FROM exchange.purse_merges
+ WHERE purse_pub=in_purse_pub;
+
+IF NOT FOUND
+THEN
+ RETURN;
+END IF;
+
+SELECT
+ amount_with_fee_val
+ ,amount_with_fee_frac
+ INTO
+ my_amount_val
+ ,my_amount_frac
+ FROM exchange.purse_requests
+ WHERE (purse_pub=in_purse_pub)
+ AND ( ( ( (amount_with_fee_val <= balance_val)
+ AND (amount_with_fee_frac <= balance_frac) )
+ OR (amount_with_fee_val < balance_val) ) );
+IF NOT FOUND
+THEN
+ RETURN;
+END IF;
+
+IF (0 != psi)
+THEN
+ -- The taler-exchange-router will take care of this.
+ UPDATE purse_actions
+ SET action_date=0 --- "immediately"
+ ,partner_serial_id=psi
+ WHERE purse_pub=in_purse_pub;
+ELSE
+ -- This is a local reserve, update balance immediately.
+ UPDATE reserves
+ SET
+ current_balance_frac=current_balance_frac+my_amount_frac
+ - CASE
+ WHEN current_balance_frac + my_amount_frac >= 100000000
+ THEN 100000000
+ ELSE 0
+ END,
+ current_balance_val=current_balance_val+my_amount_val
+ + CASE
+ WHEN current_balance_frac + my_amount_frac >= 100000000
+ THEN 1
+ ELSE 0
+ END
+ WHERE reserve_pub=my_reserve_pub;
+
+ -- ... and mark purse as finished.
+ -- FIXME: combine with UPDATE above?
+ UPDATE purse_requests
+ SET finished=true
+ WHERE purse_pub=in_purse_pub;
+END IF;
+
+
END $$;
--
--- Name: exchange_do_purse_merge(bytea, bytea, bigint, bytea, character varying, bytea); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_purse_merge(bytea, bytea, bigint, bytea, character varying, bytea, bytea); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_purse_merge(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_partner_url character varying, in_reserve_pub bytea, OUT out_no_partner boolean, OUT out_no_balance boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_purse_merge(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_partner_url character varying, in_reserve_pub bytea, in_wallet_h_payto bytea, OUT out_no_partner boolean, OUT out_no_balance boolean, OUT out_no_reserve boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
+ my_amount_val INT8;
+DECLARE
+ my_amount_frac INT4;
+DECLARE
+ my_purse_fee_val INT8;
+DECLARE
+ my_purse_fee_frac INT4;
+DECLARE
my_partner_serial_id INT8;
+DECLARE
+ my_finished BOOLEAN;
BEGIN
IF in_partner_url IS NULL
@@ -3800,7 +3894,7 @@ ELSE
partner_serial_id
INTO
my_partner_serial_id
- FROM partners
+ FROM exchange.partners
WHERE partner_base_url=in_partner_url
AND start_date <= in_merge_timestamp
AND end_date > in_merge_timestamp;
@@ -3808,6 +3902,7 @@ ELSE
THEN
out_no_partner=TRUE;
out_conflict=FALSE;
+ out_no_reserve=FALSE;
RETURN;
END IF;
END IF;
@@ -3816,8 +3911,17 @@ out_no_partner=FALSE;
-- Check purse is 'full'.
-PERFORM
- FROM purse_requests
+SELECT amount_with_fee_val
+ ,amount_with_fee_frac
+ ,purse_fee_val
+ ,purse_fee_frac
+ ,finished
+ INTO my_amount_val
+ ,my_amount_frac
+ ,my_purse_fee_val
+ ,my_purse_fee_frac
+ ,my_finished
+ FROM exchange.purse_requests
WHERE purse_pub=in_purse_pub
AND balance_val >= amount_with_fee_val
AND ( (balance_frac >= amount_with_fee_frac) OR
@@ -3826,14 +3930,13 @@ IF NOT FOUND
THEN
out_no_balance=TRUE;
out_conflict=FALSE;
+ out_no_reserve=FALSE;
RETURN;
END IF;
out_no_balance=FALSE;
-
-
-- Store purse merge signature, checks for purse_pub uniqueness
-INSERT INTO purse_merges
+INSERT INTO exchange.purse_merges
(partner_serial_id
,reserve_pub
,purse_pub
@@ -3853,31 +3956,89 @@ THEN
-- Note that by checking 'merge_sig', we implicitly check
-- identity over everything that the signature covers.
PERFORM
- FROM purse_merges
+ FROM exchange.purse_merges
WHERE purse_pub=in_purse_pub
AND merge_sig=in_merge_sig;
IF NOT FOUND
THEN
-- Purse was merged, but to some other reserve. Not allowed.
out_conflict=TRUE;
+ out_no_reserve=FALSE;
RETURN;
END IF;
-- "success"
out_conflict=FALSE;
+ out_no_reserve=FALSE;
RETURN;
END IF;
out_conflict=FALSE;
+ASSERT NOT my_finished, 'internal invariant failed';
+
+PERFORM
+ FROM exchange.reserves
+ WHERE reserve_pub=in_reserve_pub;
+
+IF NOT FOUND
+THEN
+ out_no_reserve=TRUE;
+ RETURN;
+END IF;
+out_no_reserve=FALSE;
+
+
-- Store account merge signature.
-INSERT INTO account_merges
+INSERT INTO exchange.account_merges
(reserve_pub
,reserve_sig
- ,purse_pub)
+ ,purse_pub
+ ,wallet_h_payto)
VALUES
(in_reserve_pub
,in_reserve_sig
- ,in_purse_pub);
+ ,in_purse_pub
+ ,in_wallet_h_payto);
+
+-- If we need a wad transfer, mark purse ready for it.
+IF (0 != my_partner_serial_id)
+THEN
+ -- The taler-exchange-router will take care of this.
+ UPDATE purse_actions
+ SET action_date=0 --- "immediately"
+ ,partner_serial_id=my_partner_serial_id
+ WHERE purse_pub=in_purse_pub;
+ELSE
+ -- This is a local reserve, update reserve balance immediately.
+
+ -- Refund the purse fee, by adding it to the purse value:
+ my_amount_val = my_amount_val + my_purse_fee_val;
+ my_amount_frac = my_amount_frac + my_purse_fee_frac;
+ -- normalize result
+ my_amount_val = my_amount_val + my_amount_frac / 100000000;
+ my_amount_frac = my_amount_frac % 100000000;
+
+ UPDATE reserves
+ SET
+ current_balance_frac=current_balance_frac+my_amount_frac
+ - CASE
+ WHEN current_balance_frac + my_amount_frac >= 100000000
+ THEN 100000000
+ ELSE 0
+ END,
+ current_balance_val=current_balance_val+my_amount_val
+ + CASE
+ WHEN current_balance_frac + my_amount_frac >= 100000000
+ THEN 1
+ ELSE 0
+ END
+ WHERE reserve_pub=in_reserve_pub;
+
+ -- ... and mark purse as finished.
+ UPDATE purse_requests
+ SET finished=true
+ WHERE purse_pub=in_purse_pub;
+END IF;
RETURN;
@@ -3886,10 +4047,78 @@ END $$;
--
--- Name: exchange_do_recoup_to_coin(bytea, bigint, bytea, bytea, bigint, bytea, bigint); Type: FUNCTION; Schema: public; Owner: -
+-- Name: FUNCTION exchange_do_purse_merge(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_partner_url character varying, in_reserve_pub bytea, in_wallet_h_payto bytea, OUT out_no_partner boolean, OUT out_no_balance boolean, OUT out_no_reserve boolean, OUT out_conflict boolean); Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON FUNCTION exchange.exchange_do_purse_merge(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_partner_url character varying, in_reserve_pub bytea, in_wallet_h_payto bytea, OUT out_no_partner boolean, OUT out_no_balance boolean, OUT out_no_reserve boolean, OUT out_conflict boolean) IS 'Checks that the partner exists, the purse has not been merged with a different reserve and that the purse is full. If so, persists the merge data and either merges the purse with the reserve or marks it as ready for the taler-exchange-router. Caller MUST abort the transaction on failures so as to not persist data by accident.';
+
+
+--
+-- Name: exchange_do_recoup_by_reserve(bytea); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_recoup_to_coin(in_old_coin_pub bytea, in_rrc_serial bigint, in_coin_blind bytea, in_coin_pub bytea, in_known_coin_id bigint, in_coin_sig bytea, in_recoup_timestamp bigint, OUT out_recoup_ok boolean, OUT out_internal_failure boolean, OUT out_recoup_timestamp bigint) RETURNS record
+CREATE FUNCTION exchange.exchange_do_recoup_by_reserve(res_pub bytea) RETURNS TABLE(denom_sig bytea, denominations_serial bigint, coin_pub bytea, coin_sig bytea, coin_blind bytea, amount_val bigint, amount_frac integer, recoup_timestamp bigint)
+ LANGUAGE plpgsql
+ AS $$
+DECLARE
+ res_uuid BIGINT;
+ blind_ev BYTEA;
+ c_pub BYTEA;
+BEGIN
+ SELECT reserve_uuid
+ INTO res_uuid
+ FROM exchange.reserves
+ WHERE reserves.reserve_pub = res_pub;
+
+ FOR blind_ev IN
+ SELECT h_blind_ev
+ FROM exchange.reserves_out_by_reserve
+ WHERE reserves_out_by_reserve.reserve_uuid = res_uuid
+ LOOP
+ SELECT robr.coin_pub
+ INTO c_pub
+ FROM exchange.recoup_by_reserve robr
+ WHERE robr.reserve_out_serial_id = (
+ SELECT reserves_out.reserve_out_serial_id
+ FROM exchange.reserves_out
+ WHERE reserves_out.h_blind_ev = blind_ev
+ );
+ RETURN QUERY
+ SELECT kc.denom_sig,
+ kc.denominations_serial,
+ rc.coin_pub,
+ rc.coin_sig,
+ rc.coin_blind,
+ rc.amount_val,
+ rc.amount_frac,
+ rc.recoup_timestamp
+ FROM (
+ SELECT *
+ FROM exchange.known_coins
+ WHERE known_coins.coin_pub = c_pub
+ ) kc
+ JOIN (
+ SELECT *
+ FROM exchange.recoup
+ WHERE recoup.coin_pub = c_pub
+ ) rc USING (coin_pub);
+ END LOOP;
+END;
+$$;
+
+
+--
+-- Name: FUNCTION exchange_do_recoup_by_reserve(res_pub bytea); Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON FUNCTION exchange.exchange_do_recoup_by_reserve(res_pub bytea) IS 'Recoup by reserve as a function to make sure we hit only the needed partition and not all when joining as joins on distributed tables fetch ALL rows from the shards';
+
+
+--
+-- Name: exchange_do_recoup_to_coin(bytea, bigint, bytea, bytea, bigint, bytea, bigint); Type: FUNCTION; Schema: exchange; Owner: -
+--
+
+CREATE FUNCTION exchange.exchange_do_recoup_to_coin(in_old_coin_pub bytea, in_rrc_serial bigint, in_coin_blind bytea, in_coin_pub bytea, in_known_coin_id bigint, in_coin_sig bytea, in_recoup_timestamp bigint, OUT out_recoup_ok boolean, OUT out_internal_failure boolean, OUT out_recoup_timestamp bigint) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -3914,7 +4143,7 @@ SELECT
INTO
tmp_frac
,tmp_val
-FROM known_coins
+FROM exchange.known_coins
WHERE coin_pub=in_coin_pub;
IF NOT FOUND
@@ -3931,7 +4160,7 @@ THEN
recoup_timestamp
INTO
out_recoup_timestamp
- FROM recoup_refresh
+ FROM exchange.recoup_refresh
WHERE coin_pub=in_coin_pub;
out_recoup_ok=FOUND;
RETURN;
@@ -3972,7 +4201,7 @@ THEN
END IF;
-INSERT INTO recoup_refresh
+INSERT INTO exchange.recoup_refresh
(coin_pub
,known_coin_id
,coin_sig
@@ -4000,10 +4229,10 @@ END $$;
--
--- Name: exchange_do_recoup_to_reserve(bytea, bigint, bytea, bytea, bigint, bytea, bigint, bigint, bigint); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_recoup_to_reserve(bytea, bigint, bytea, bytea, bigint, bytea, bigint, bigint, bigint); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_recoup_to_reserve(in_reserve_pub bytea, in_reserve_out_serial_id bigint, in_coin_blind bytea, in_coin_pub bytea, in_known_coin_id bigint, in_coin_sig bytea, in_reserve_gc bigint, in_reserve_expiration bigint, in_recoup_timestamp bigint, OUT out_recoup_ok boolean, OUT out_internal_failure boolean, OUT out_recoup_timestamp bigint) RETURNS record
+CREATE FUNCTION exchange.exchange_do_recoup_to_reserve(in_reserve_pub bytea, in_reserve_out_serial_id bigint, in_coin_blind bytea, in_coin_pub bytea, in_known_coin_id bigint, in_coin_sig bytea, in_reserve_gc bigint, in_reserve_expiration bigint, in_recoup_timestamp bigint, OUT out_recoup_ok boolean, OUT out_internal_failure boolean, OUT out_recoup_timestamp bigint) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -4027,7 +4256,7 @@ SELECT
INTO
tmp_frac
,tmp_val
-FROM known_coins
+FROM exchange.known_coins
WHERE coin_pub=in_coin_pub;
IF NOT FOUND
@@ -4044,7 +4273,7 @@ THEN
recoup_timestamp
INTO
out_recoup_timestamp
- FROM recoup
+ FROM exchange.recoup
WHERE coin_pub=in_coin_pub;
out_recoup_ok=FOUND;
@@ -4089,7 +4318,7 @@ THEN
END IF;
-INSERT INTO recoup
+INSERT INTO exchange.recoup
(coin_pub
,coin_sig
,coin_blind
@@ -4115,10 +4344,10 @@ END $$;
--
--- Name: exchange_do_refund(bigint, integer, bigint, integer, bigint, integer, bytea, bigint, bigint, bigint, bytea, bytea, bytea); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_refund(bigint, integer, bigint, integer, bigint, integer, bytea, bigint, bigint, bigint, bytea, bytea, bytea); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_refund(in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_amount_val bigint, in_amount_frac integer, in_deposit_fee_val bigint, in_deposit_fee_frac integer, in_h_contract_terms bytea, in_rtransaction_id bigint, in_deposit_shard bigint, in_known_coin_id bigint, in_coin_pub bytea, in_merchant_pub bytea, in_merchant_sig bytea, OUT out_not_found boolean, OUT out_refund_ok boolean, OUT out_gone boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_refund(in_amount_with_fee_val bigint, in_amount_with_fee_frac integer, in_amount_val bigint, in_amount_frac integer, in_deposit_fee_val bigint, in_deposit_fee_frac integer, in_h_contract_terms bytea, in_rtransaction_id bigint, in_deposit_shard bigint, in_known_coin_id bigint, in_coin_pub bytea, in_merchant_pub bytea, in_merchant_sig bytea, OUT out_not_found boolean, OUT out_refund_ok boolean, OUT out_gone boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -4147,7 +4376,7 @@ INTO
,deposit_val
,deposit_frac
,out_gone
-FROM deposits
+FROM exchange.deposits
WHERE coin_pub=in_coin_pub
AND shard=in_deposit_shard
AND merchant_pub=in_merchant_pub
@@ -4163,7 +4392,7 @@ THEN
RETURN;
END IF;
-INSERT INTO refunds
+INSERT INTO exchange.refunds
(deposit_serial_id
,coin_pub
,merchant_sig
@@ -4188,7 +4417,7 @@ THEN
-- We do select over merchant_pub and h_contract_terms
-- primarily here to maximally use the existing index.
PERFORM
- FROM refunds
+ FROM exchange.refunds
WHERE coin_pub=in_coin_pub
AND deposit_serial_id=dsi
AND rtransaction_id=in_rtransaction_id
@@ -4228,7 +4457,7 @@ SELECT
INTO
tmp_val
,tmp_frac
- FROM refunds
+ FROM exchange.refunds
WHERE coin_pub=in_coin_pub
AND deposit_serial_id=dsi;
IF tmp_val IS NULL
@@ -4294,34 +4523,16 @@ END $$;
--
--- Name: exchange_do_reserve_purse(bytea, bytea, bigint, bytea, bigint, integer, bytea); Type: FUNCTION; Schema: public; Owner: -
+-- Name: exchange_do_reserve_purse(bytea, bytea, bigint, bytea, boolean, bigint, integer, bytea, bytea); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_reserve_purse(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_purse_fee_val bigint, in_purse_fee_frac integer, in_reserve_pub bytea, OUT out_no_funds boolean, OUT out_conflict boolean) RETURNS record
+CREATE FUNCTION exchange.exchange_do_reserve_purse(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_reserve_quota boolean, in_purse_fee_val bigint, in_purse_fee_frac integer, in_reserve_pub bytea, in_wallet_h_payto bytea, OUT out_no_funds boolean, OUT out_no_reserve boolean, OUT out_conflict boolean) RETURNS record
LANGUAGE plpgsql
AS $$
-DECLARE
- my_purses_active INT8;
-DECLARE
- my_purses_allowed INT8;
-DECLARE
- my_balance_val INT8;
-DECLARE
- my_balance_frac INT4;
-DECLARE
- my_kyc_passed BOOLEAN;
BEGIN
--- comment out for now
-IF TRUE
-THEN
- out_no_funds=FALSE;
- out_conflict=FALSE;
- RETURN;
-END IF;
-
-- Store purse merge signature, checks for purse_pub uniqueness
-INSERT INTO purse_merges
+INSERT INTO exchange.purse_merges
(partner_serial_id
,reserve_pub
,purse_pub
@@ -4341,118 +4552,107 @@ THEN
-- Note that by checking 'merge_sig', we implicitly check
-- identity over everything that the signature covers.
PERFORM
- FROM purse_merges
+ FROM exchange.purse_merges
WHERE purse_pub=in_purse_pub
AND merge_sig=in_merge_sig;
IF NOT FOUND
THEN
-- Purse was merged, but to some other reserve. Not allowed.
out_conflict=TRUE;
+ out_no_reserve=FALSE;
+ out_no_funds=FALSE;
RETURN;
END IF;
-- "success"
out_conflict=FALSE;
out_no_funds=FALSE;
+ out_no_reserve=FALSE;
RETURN;
END IF;
out_conflict=FALSE;
-
--- Store account merge signature.
-INSERT INTO account_merges
- (reserve_pub
- ,reserve_sig
- ,purse_pub)
- VALUES
- (in_reserve_pub
- ,in_reserve_sig
- ,in_purse_pub);
-
-
-
--- Charge reserve for purse creation.
--- FIXME: Use different type of purse
--- signature in this case, so that we
--- can properly account for the purse
--- fees when auditing!!!
-SELECT
- purses_active
- ,purses_allowed
- ,kyc_passed
- ,current_balance_val
- ,current_balance_frac
-INTO
- my_purses_active
- ,my_purses_allowed
- ,my_kyc_passed
- ,my_balance_val
- ,my_balance_frac
-FROM reserves
-WHERE reserve_pub=in_reserve_pub;
+PERFORM
+ FROM exchange.reserves
+ WHERE reserve_pub=in_reserve_pub;
IF NOT FOUND
THEN
- out_no_funds=TRUE;
- -- FIXME: be more specific in the returned
- -- error that we don't know the reserve
- -- (instead of merely saying it has no funds)
- RETURN;
-END IF;
-
-IF NOT my_kyc_passed
-THEN
- -- FIXME: might want to categorically disallow
- -- purse creation without KYC (depending on
- -- exchange settings => new argument?)
-END IF;
-
-IF ( (my_purses_active >= my_purses_allowed) AND
- ( (my_balance_val < in_purse_fee_val) OR
- ( (my_balance_val <= in_purse_fee_val) AND
- (my_balance_frac < in_purse_fee_frac) ) ) )
-THEN
+ out_no_reserve=TRUE;
out_no_funds=TRUE;
RETURN;
END IF;
+out_no_reserve=FALSE;
-IF (my_purses_active < my_purses_allowed)
+IF (in_reserve_quota)
THEN
- my_purses_active = my_purses_active + 1;
+ -- Increment active purses per reserve (and check this is allowed)
+ UPDATE reserves
+ SET purses_active=purses_active+1
+ WHERE reserve_pub=in_reserve_pub
+ AND purses_active < purses_allowed;
+ IF NOT FOUND
+ THEN
+ out_no_funds=TRUE;
+ RETURN;
+ END IF;
ELSE
- -- FIXME: See above: we should probably have
- -- very explicit wallet-approval in the
- -- signature to charge the reserve!
- my_balance_val = my_balance_val - in_purse_fee_val;
- IF (my_balance_frac > in_purse_fee_frac)
+ -- UPDATE reserves balance (and check if balance is enough to pay the fee)
+ UPDATE reserves
+ SET
+ current_balance_frac=current_balance_frac-in_purse_fee_frac
+ + CASE
+ WHEN current_balance_frac < in_purse_fee_frac
+ THEN 100000000
+ ELSE 0
+ END,
+ current_balance_val=current_balance_val-in_purse_fee_val
+ - CASE
+ WHEN current_balance_frac < in_purse_fee_frac
+ THEN 1
+ ELSE 0
+ END
+ WHERE reserve_pub=in_reserve_pub
+ AND ( (current_balance_val > in_purse_fee_val) OR
+ ( (current_balance_frac >= in_purse_fee_frac) AND
+ (current_balance_val >= in_purse_fee_val) ) );
+ IF NOT FOUND
THEN
- my_balance_frac = my_balance_frac - in_purse_fee_frac;
- ELSE
- my_balance_val = my_balance_val - 1;
- my_balance_frac = my_balance_frac + 100000000 - in_purse_fee_frac;
+ out_no_funds=TRUE;
+ RETURN;
END IF;
END IF;
-UPDATE reserves SET
- gc_date=min_reserve_gc
- ,current_balance_val=my_balance_val
- ,current_balance_frac=my_balance_frac
- ,purses_active=my_purses_active
- ,kyc_required=TRUE
-WHERE
- reserves.reserve_pub=rpub;
-
out_no_funds=FALSE;
+-- Store account merge signature.
+INSERT INTO exchange.account_merges
+ (reserve_pub
+ ,reserve_sig
+ ,purse_pub
+ ,wallet_h_payto)
+ VALUES
+ (in_reserve_pub
+ ,in_reserve_sig
+ ,in_purse_pub
+ ,in_wallet_h_payto);
+
END $$;
--
--- Name: exchange_do_withdraw(bytea, bigint, integer, bytea, bytea, bytea, bytea, bytea, bigint, bigint); Type: FUNCTION; Schema: public; Owner: -
+-- Name: FUNCTION exchange_do_reserve_purse(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_reserve_quota boolean, in_purse_fee_val bigint, in_purse_fee_frac integer, in_reserve_pub bytea, in_wallet_h_payto bytea, OUT out_no_funds boolean, OUT out_no_reserve boolean, OUT out_conflict boolean); Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON FUNCTION exchange.exchange_do_reserve_purse(in_purse_pub bytea, in_merge_sig bytea, in_merge_timestamp bigint, in_reserve_sig bytea, in_reserve_quota boolean, in_purse_fee_val bigint, in_purse_fee_frac integer, in_reserve_pub bytea, in_wallet_h_payto bytea, OUT out_no_funds boolean, OUT out_no_reserve boolean, OUT out_conflict boolean) IS 'Create a purse for a reserve.';
+
+
+--
+-- Name: exchange_do_withdraw(bytea, bigint, integer, bytea, bytea, bytea, bytea, bytea, bigint, bigint); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.exchange_do_withdraw(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, rpub bytea, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT kycok boolean, OUT account_uuid bigint, OUT ruuid bigint) RETURNS record
+CREATE FUNCTION exchange.exchange_do_withdraw(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, rpub bytea, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT nonce_ok boolean, OUT ruuid bigint) RETURNS record
LANGUAGE plpgsql
AS $$
DECLARE
@@ -4472,7 +4672,7 @@ BEGIN
SELECT denominations_serial
INTO denom_serial
- FROM denominations
+ FROM exchange.denominations
WHERE denom_pub_hash=h_denom_pub;
IF NOT FOUND
@@ -4480,8 +4680,6 @@ THEN
-- denomination unknown, should be impossible!
reserve_found=FALSE;
balance_ok=FALSE;
- kycok=FALSE;
- account_uuid=0;
ruuid=0;
ASSERT false, 'denomination unknown';
RETURN;
@@ -4498,7 +4696,7 @@ SELECT
,reserve_frac
,reserve_gc
,ruuid
- FROM reserves
+ FROM exchange.reserves
WHERE reserves.reserve_pub=rpub;
IF NOT FOUND
@@ -4506,15 +4704,14 @@ THEN
-- reserve unknown
reserve_found=FALSE;
balance_ok=FALSE;
- kycok=FALSE;
- account_uuid=0;
+ nonce_ok=TRUE;
ruuid=2;
RETURN;
END IF;
-- We optimistically insert, and then on conflict declare
-- the query successful due to idempotency.
-INSERT INTO reserves_out
+INSERT INTO exchange.reserves_out
(h_blind_ev
,denominations_serial
,denom_sig
@@ -4539,8 +4736,7 @@ THEN
-- idempotent query, all constraints must be satisfied
reserve_found=TRUE;
balance_ok=TRUE;
- kycok=TRUE;
- account_uuid=0;
+ nonce_ok=TRUE;
RETURN;
END IF;
@@ -4562,9 +4758,8 @@ ELSE
reserve_frac=reserve_frac - amount_frac;
ELSE
reserve_found=TRUE;
+ nonce_ok=TRUE; -- we do not really know
balance_ok=FALSE;
- kycok=FALSE; -- we do not really know or care
- account_uuid=0;
RETURN;
END IF;
END IF;
@@ -4590,7 +4785,7 @@ IF NOT NULL cs_nonce
THEN
-- Cache CS signature to prevent replays in the future
-- (and check if cached signature exists at the same time).
- INSERT INTO cs_nonce_locks
+ INSERT INTO exchange.cs_nonce_locks
(nonce
,max_denomination_serial
,op_hash)
@@ -4604,256 +4799,214 @@ THEN
THEN
-- See if the existing entry is identical.
SELECT 1
- FROM cs_nonce_locks
+ FROM exchange.cs_nonce_locks
WHERE nonce=cs_nonce
AND op_hash=h_coin_envelope;
IF NOT FOUND
THEN
reserve_found=FALSE;
balance_ok=FALSE;
- kycok=FALSE;
- account_uuid=0;
- ruuid=1; -- FIXME: return error message more nicely!
- ASSERT false, 'nonce reuse attempted by client';
+ nonce_ok=FALSE;
+ RETURN;
END IF;
END IF;
+ELSE
+ nonce_ok=TRUE; -- no nonce, hence OK!
END IF;
-
-
--- Obtain KYC status based on the last wire transfer into
--- this reserve. FIXME: likely not adequate for reserves that got P2P transfers!
--- SELECT
--- kyc_ok
--- ,wire_target_serial_id
--- INTO
--- kycok
--- ,account_uuid
--- FROM reserves_in
--- JOIN wire_targets ON (wire_source_h_payto = wire_target_h_payto)
--- WHERE reserve_pub=rpub
--- LIMIT 1; -- limit 1 should not be required (without p2p transfers)
-
-WITH reserves_in AS materialized (
- SELECT wire_source_h_payto
- FROM reserves_in WHERE
- reserve_pub=rpub
-)
-SELECT
- kyc_ok
- ,wire_target_serial_id
-INTO
- kycok
- ,account_uuid
-FROM wire_targets
- WHERE wire_target_h_payto = (
- SELECT wire_source_h_payto
- FROM reserves_in
- );
-
-END $$;
-
-
---
--- Name: FUNCTION exchange_do_withdraw(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, rpub bytea, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT kycok boolean, OUT account_uuid bigint, OUT ruuid bigint); Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON FUNCTION public.exchange_do_withdraw(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, rpub bytea, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT kycok boolean, OUT account_uuid bigint, OUT ruuid bigint) IS 'Checks whether the reserve has sufficient balance for a withdraw operation (or the request is repeated and was previously approved) and if so updates the database with the result';
-
-
---
--- Name: exchange_do_withdraw_limit_check(bigint, bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
---
-
-CREATE FUNCTION public.exchange_do_withdraw_limit_check(ruuid bigint, start_time bigint, upper_limit_val bigint, upper_limit_frac integer, OUT below_limit boolean) RETURNS boolean
- LANGUAGE plpgsql
- AS $$
-DECLARE
- total_val INT8;
-DECLARE
- total_frac INT8; -- INT4 could overflow during accumulation!
-BEGIN
--- NOTE: Read-only, but crosses shards.
--- Shards: reserves by reserve_pub
--- reserves_out by reserve_uuid -- crosses shards!!
-
-
-SELECT
- SUM(amount_with_fee_val) -- overflow here is not plausible
- ,SUM(CAST(amount_with_fee_frac AS INT8)) -- compute using 64 bits
- INTO
- total_val
- ,total_frac
- FROM reserves_out
- WHERE reserve_uuid=ruuid
- AND execution_date > start_time;
-
--- normalize result
-total_val = total_val + total_frac / 100000000;
-total_frac = total_frac % 100000000;
-
--- compare to threshold
-below_limit = (total_val < upper_limit_val) OR
- ( (total_val = upper_limit_val) AND
- (total_frac <= upper_limit_frac) );
END $$;
--
--- Name: FUNCTION exchange_do_withdraw_limit_check(ruuid bigint, start_time bigint, upper_limit_val bigint, upper_limit_frac integer, OUT below_limit boolean); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION exchange_do_withdraw(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, rpub bytea, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT nonce_ok boolean, OUT ruuid bigint); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.exchange_do_withdraw_limit_check(ruuid bigint, start_time bigint, upper_limit_val bigint, upper_limit_frac integer, OUT below_limit boolean) IS 'Check whether the withdrawals from the given reserve since the given time are below the given threshold';
+COMMENT ON FUNCTION exchange.exchange_do_withdraw(cs_nonce bytea, amount_val bigint, amount_frac integer, h_denom_pub bytea, rpub bytea, reserve_sig bytea, h_coin_envelope bytea, denom_sig bytea, now bigint, min_reserve_gc bigint, OUT reserve_found boolean, OUT balance_ok boolean, OUT nonce_ok boolean, OUT ruuid bigint) IS 'Checks whether the reserve has sufficient balance for a withdraw operation (or the request is repeated and was previously approved) and if so updates the database with the result';
--
--- Name: prepare_sharding(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: prepare_sharding(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.prepare_sharding() RETURNS void
+CREATE FUNCTION exchange.prepare_sharding() RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-
CREATE EXTENSION IF NOT EXISTS postgres_fdw;
-
PERFORM detach_default_partitions();
-
ALTER TABLE IF EXISTS wire_targets
DROP CONSTRAINT IF EXISTS wire_targets_pkey CASCADE
;
-
ALTER TABLE IF EXISTS reserves
DROP CONSTRAINT IF EXISTS reserves_pkey CASCADE
;
-
ALTER TABLE IF EXISTS reserves_in
DROP CONSTRAINT IF EXISTS reserves_in_pkey CASCADE
;
-
ALTER TABLE IF EXISTS reserves_close
DROP CONSTRAINT IF EXISTS reserves_close_pkey CASCADE
;
-
ALTER TABLE IF EXISTS reserves_out
DROP CONSTRAINT IF EXISTS reserves_out_pkey CASCADE
,DROP CONSTRAINT IF EXISTS reserves_out_denominations_serial_fkey
,DROP CONSTRAINT IF EXISTS reserves_out_h_blind_ev_key
;
-
ALTER TABLE IF EXISTS known_coins
DROP CONSTRAINT IF EXISTS known_coins_pkey CASCADE
,DROP CONSTRAINT IF EXISTS known_coins_denominations_serial_fkey
;
-
ALTER TABLE IF EXISTS refresh_commitments
DROP CONSTRAINT IF EXISTS refresh_commitments_pkey CASCADE
,DROP CONSTRAINT IF EXISTS refresh_old_coin_pub_fkey
;
-
ALTER TABLE IF EXISTS refresh_revealed_coins
DROP CONSTRAINT IF EXISTS refresh_revealed_coins_pkey CASCADE
,DROP CONSTRAINT IF EXISTS refresh_revealed_coins_denominations_serial_fkey
;
-
ALTER TABLE IF EXISTS refresh_transfer_keys
DROP CONSTRAINT IF EXISTS refresh_transfer_keys_pkey CASCADE
;
-
ALTER TABLE IF EXISTS deposits
DROP CONSTRAINT IF EXISTS deposits_pkey CASCADE
,DROP CONSTRAINT IF EXISTS deposits_extension_details_serial_id_fkey
,DROP CONSTRAINT IF EXISTS deposits_coin_pub_merchant_pub_h_contract_terms_key CASCADE
;
-
ALTER TABLE IF EXISTS refunds
DROP CONSTRAINT IF EXISTS refunds_pkey CASCADE
;
-
ALTER TABLE IF EXISTS wire_out
DROP CONSTRAINT IF EXISTS wire_out_pkey CASCADE
,DROP CONSTRAINT IF EXISTS wire_out_wtid_raw_key CASCADE
;
-
ALTER TABLE IF EXISTS aggregation_tracking
DROP CONSTRAINT IF EXISTS aggregation_tracking_pkey CASCADE
,DROP CONSTRAINT IF EXISTS aggregation_tracking_wtid_raw_fkey
;
-
ALTER TABLE IF EXISTS recoup
DROP CONSTRAINT IF EXISTS recoup_pkey CASCADE
;
-
ALTER TABLE IF EXISTS recoup_refresh
DROP CONSTRAINT IF EXISTS recoup_refresh_pkey CASCADE
;
-
ALTER TABLE IF EXISTS prewire
DROP CONSTRAINT IF EXISTS prewire_pkey CASCADE
;
-
ALTER TABLE IF EXISTS cs_nonce_locks
DROP CONSTRAINT IF EXISTS cs_nonce_locks_pkey CASCADE
;
-
ALTER TABLE IF EXISTS purse_requests
DROP CONSTRAINT IF EXISTS purse_requests_pkey CASCADE
;
-
+ ALTER TABLE IF EXISTS purse_refunds
+ DROP CONSTRAINT IF EXISTS purse_refunds_pkey CASCADE
+ ;
ALTER TABLE IF EXISTS purse_merges
DROP CONSTRAINT IF EXISTS purse_merges_pkey CASCADE
;
-
ALTER TABLE IF EXISTS account_merges
DROP CONSTRAINT IF EXISTS account_merges_pkey CASCADE
;
-
ALTER TABLE IF EXISTS contracts
DROP CONSTRAINT IF EXISTS contracts_pkey CASCADE
;
-
ALTER TABLE IF EXISTS history_requests
DROP CONSTRAINT IF EXISTS history_requests_pkey CASCADE
;
-
ALTER TABLE IF EXISTS close_requests
DROP CONSTRAINT IF EXISTS close_requests_pkey CASCADE
;
-
ALTER TABLE IF EXISTS purse_deposits
DROP CONSTRAINT IF EXISTS purse_deposits_pkey CASCADE
;
-
ALTER TABLE IF EXISTS wads_out
DROP CONSTRAINT IF EXISTS wads_out_pkey CASCADE
;
-
ALTER TABLE IF EXISTS wad_out_entries
DROP CONSTRAINT IF EXISTS wad_out_entries_pkey CASCADE
;
-
ALTER TABLE IF EXISTS wads_in
DROP CONSTRAINT IF EXISTS wads_in_pkey CASCADE
,DROP CONSTRAINT IF EXISTS wads_in_wad_id_origin_exchange_url_key
;
-
ALTER TABLE IF EXISTS wad_in_entries
DROP CONSTRAINT IF EXISTS wad_in_entries_pkey CASCADE
;
-
END
$$;
--
--- Name: recoup_delete_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: purse_requests_insert_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.recoup_delete_trigger() RETURNS trigger
+CREATE FUNCTION exchange.purse_requests_insert_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- DELETE FROM recoup_by_reserve
+ ASSERT NOT NEW.finished,'Internal invariant violated';
+ INSERT INTO
+ purse_actions
+ (purse_pub
+ ,action_date)
+ VALUES
+ (NEW.purse_pub
+ ,NEW.purse_expiration);
+ RETURN NEW;
+END $$;
+
+
+--
+-- Name: FUNCTION purse_requests_insert_trigger(); Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON FUNCTION exchange.purse_requests_insert_trigger() IS 'When a purse is created, insert it into the purse_action table to take action when the purse expires.';
+
+
+--
+-- Name: purse_requests_on_update_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
+--
+
+CREATE FUNCTION exchange.purse_requests_on_update_trigger() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ IF (NEW.finished AND NOT OLD.finished)
+ THEN
+ IF (NEW.in_reserve_quota)
+ THEN
+ UPDATE reserves
+ SET purses_active=purses_active-1
+ WHERE reserve_pub IN
+ (SELECT reserve_pub
+ FROM exchange.purse_merges
+ WHERE purse_pub=NEW.purse_pub
+ LIMIT 1);
+ NEW.in_reserve_quota=FALSE;
+ END IF;
+ DELETE FROM exchange.purse_actions
+ WHERE purse_pub=NEW.purse_pub;
+ RETURN NEW;
+ END IF;
+ RETURN NEW;
+END $$;
+
+
+--
+-- Name: FUNCTION purse_requests_on_update_trigger(); Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON FUNCTION exchange.purse_requests_on_update_trigger() IS 'Trigger the router if the purse is ready. Also removes the entry from the router watchlist once the purse is finished.';
+
+
+--
+-- Name: recoup_delete_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
+--
+
+CREATE FUNCTION exchange.recoup_delete_trigger() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ DELETE FROM exchange.recoup_by_reserve
WHERE reserve_out_serial_id = OLD.reserve_out_serial_id
AND coin_pub = OLD.coin_pub;
RETURN OLD;
@@ -4861,21 +5014,21 @@ END $$;
--
--- Name: FUNCTION recoup_delete_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION recoup_delete_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.recoup_delete_trigger() IS 'Replicate recoup deletions into recoup_by_reserve table.';
+COMMENT ON FUNCTION exchange.recoup_delete_trigger() IS 'Replicate recoup deletions into recoup_by_reserve table.';
--
--- Name: recoup_insert_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: recoup_insert_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.recoup_insert_trigger() RETURNS trigger
+CREATE FUNCTION exchange.recoup_insert_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- INSERT INTO recoup_by_reserve
+ INSERT INTO exchange.recoup_by_reserve
(reserve_out_serial_id
,coin_pub)
VALUES
@@ -4886,42 +5039,42 @@ END $$;
--
--- Name: FUNCTION recoup_insert_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION recoup_insert_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.recoup_insert_trigger() IS 'Replicate recoup inserts into recoup_by_reserve table.';
+COMMENT ON FUNCTION exchange.recoup_insert_trigger() IS 'Replicate recoup inserts into recoup_by_reserve table.';
--
--- Name: reserves_out_by_reserve_delete_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: reserves_out_by_reserve_delete_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.reserves_out_by_reserve_delete_trigger() RETURNS trigger
+CREATE FUNCTION exchange.reserves_out_by_reserve_delete_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- DELETE FROM reserves_out_by_reserve
+ DELETE FROM exchange.reserves_out_by_reserve
WHERE reserve_uuid = OLD.reserve_uuid;
RETURN OLD;
END $$;
--
--- Name: FUNCTION reserves_out_by_reserve_delete_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION reserves_out_by_reserve_delete_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.reserves_out_by_reserve_delete_trigger() IS 'Replicate reserve_out deletions into reserve_out_by_reserve table.';
+COMMENT ON FUNCTION exchange.reserves_out_by_reserve_delete_trigger() IS 'Replicate reserve_out deletions into reserve_out_by_reserve table.';
--
--- Name: reserves_out_by_reserve_insert_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: reserves_out_by_reserve_insert_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.reserves_out_by_reserve_insert_trigger() RETURNS trigger
+CREATE FUNCTION exchange.reserves_out_by_reserve_insert_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- INSERT INTO reserves_out_by_reserve
+ INSERT INTO exchange.reserves_out_by_reserve
(reserve_uuid
,h_blind_ev)
VALUES
@@ -4932,31 +5085,31 @@ END $$;
--
--- Name: FUNCTION reserves_out_by_reserve_insert_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION reserves_out_by_reserve_insert_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.reserves_out_by_reserve_insert_trigger() IS 'Replicate reserve_out inserts into reserve_out_by_reserve table.';
+COMMENT ON FUNCTION exchange.reserves_out_by_reserve_insert_trigger() IS 'Replicate reserve_out inserts into reserve_out_by_reserve table.';
--
--- Name: wire_out_delete_trigger(); Type: FUNCTION; Schema: public; Owner: -
+-- Name: wire_out_delete_trigger(); Type: FUNCTION; Schema: exchange; Owner: -
--
-CREATE FUNCTION public.wire_out_delete_trigger() RETURNS trigger
+CREATE FUNCTION exchange.wire_out_delete_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- DELETE FROM aggregation_tracking
+ DELETE FROM exchange.aggregation_tracking
WHERE wtid_raw = OLD.wtid_raw;
RETURN OLD;
END $$;
--
--- Name: FUNCTION wire_out_delete_trigger(); Type: COMMENT; Schema: public; Owner: -
+-- Name: FUNCTION wire_out_delete_trigger(); Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON FUNCTION public.wire_out_delete_trigger() IS 'Replicate reserve_out deletions into aggregation_tracking. This replaces an earlier use of an ON DELETE CASCADE that required a DEFERRABLE constraint and conflicted with nice partitioning.';
+COMMENT ON FUNCTION exchange.wire_out_delete_trigger() IS 'Replicate reserve_out deletions into aggregation_tracking. This replaces an earlier use of an ON DELETE CASCADE that required a DEFERRABLE constraint and conflicted with nice partitioning.';
SET default_tablespace = '';
@@ -5019,271 +5172,10 @@ COMMENT ON COLUMN _v.patches.conflicts IS 'List of patches that conflict with gi
--
--- Name: account_merges; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.account_merges (
- account_merge_request_serial_id bigint NOT NULL,
- reserve_pub bytea NOT NULL,
- reserve_sig bytea NOT NULL,
- purse_pub bytea NOT NULL,
- CONSTRAINT account_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
- CONSTRAINT account_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
- CONSTRAINT account_merges_reserve_sig_check CHECK ((length(reserve_sig) = 64))
-)
-PARTITION BY HASH (purse_pub);
-
-
---
--- Name: TABLE account_merges; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.account_merges IS 'Merge requests where a purse- and account-owner requested merging the purse into the account';
-
-
---
--- Name: COLUMN account_merges.reserve_pub; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.account_merges.reserve_pub IS 'public key of the target reserve';
-
-
---
--- Name: COLUMN account_merges.reserve_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.account_merges.reserve_sig IS 'signature by the reserve private key affirming the merge, of type TALER_SIGNATURE_WALLET_ACCOUNT_MERGE';
-
-
---
--- Name: COLUMN account_merges.purse_pub; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.account_merges.purse_pub IS 'public key of the purse';
-
-
---
--- Name: account_merges_account_merge_request_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.account_merges ALTER COLUMN account_merge_request_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.account_merges_account_merge_request_serial_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: account_merges_default; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.account_merges_default (
- account_merge_request_serial_id bigint NOT NULL,
- reserve_pub bytea NOT NULL,
- reserve_sig bytea NOT NULL,
- purse_pub bytea NOT NULL,
- CONSTRAINT account_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
- CONSTRAINT account_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
- CONSTRAINT account_merges_reserve_sig_check CHECK ((length(reserve_sig) = 64))
-);
-ALTER TABLE ONLY public.account_merges ATTACH PARTITION public.account_merges_default FOR VALUES WITH (modulus 1, remainder 0);
-
-
---
--- Name: aggregation_tracking; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.aggregation_tracking (
- aggregation_serial_id bigint NOT NULL,
- deposit_serial_id bigint NOT NULL,
- wtid_raw bytea NOT NULL
-)
-PARTITION BY HASH (deposit_serial_id);
-
-
---
--- Name: TABLE aggregation_tracking; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.aggregation_tracking IS 'mapping from wire transfer identifiers (WTID) to deposits (and back)';
-
-
---
--- Name: COLUMN aggregation_tracking.wtid_raw; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.aggregation_tracking.wtid_raw IS 'identifier of the wire transfer';
-
-
---
--- Name: aggregation_tracking_aggregation_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.aggregation_tracking ALTER COLUMN aggregation_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.aggregation_tracking_aggregation_serial_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: aggregation_tracking_default; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.aggregation_tracking_default (
- aggregation_serial_id bigint NOT NULL,
- deposit_serial_id bigint NOT NULL,
- wtid_raw bytea NOT NULL
-);
-ALTER TABLE ONLY public.aggregation_tracking ATTACH PARTITION public.aggregation_tracking_default FOR VALUES WITH (modulus 1, remainder 0);
-
-
---
--- Name: aggregation_transient; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.aggregation_transient (
- amount_val bigint NOT NULL,
- amount_frac integer NOT NULL,
- wire_target_h_payto bytea,
- exchange_account_section text NOT NULL,
- wtid_raw bytea NOT NULL,
- CONSTRAINT aggregation_transient_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32)),
- CONSTRAINT aggregation_transient_wtid_raw_check CHECK ((length(wtid_raw) = 32))
-)
-PARTITION BY HASH (wire_target_h_payto);
-
-
---
--- Name: TABLE aggregation_transient; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.aggregation_transient IS 'aggregations currently happening (lacking wire_out, usually because the amount is too low); this table is not replicated';
-
-
---
--- Name: COLUMN aggregation_transient.amount_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.aggregation_transient.amount_val IS 'Sum of all of the aggregated deposits (without deposit fees)';
-
-
---
--- Name: COLUMN aggregation_transient.wtid_raw; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.aggregation_transient.wtid_raw IS 'identifier of the wire transfer';
-
-
---
--- Name: aggregation_transient_default; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.aggregation_transient_default (
- amount_val bigint NOT NULL,
- amount_frac integer NOT NULL,
- wire_target_h_payto bytea,
- exchange_account_section text NOT NULL,
- wtid_raw bytea NOT NULL,
- CONSTRAINT aggregation_transient_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32)),
- CONSTRAINT aggregation_transient_wtid_raw_check CHECK ((length(wtid_raw) = 32))
-);
-ALTER TABLE ONLY public.aggregation_transient ATTACH PARTITION public.aggregation_transient_default FOR VALUES WITH (modulus 1, remainder 0);
-
-
---
--- Name: app_bankaccount; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.app_bankaccount (
- is_public boolean NOT NULL,
- account_no integer NOT NULL,
- balance character varying NOT NULL,
- user_id integer NOT NULL
-);
-
-
---
--- Name: app_bankaccount_account_no_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.app_bankaccount_account_no_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: app_bankaccount_account_no_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.app_bankaccount_account_no_seq OWNED BY public.app_bankaccount.account_no;
-
-
---
--- Name: app_banktransaction; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.app_banktransaction (
- id bigint NOT NULL,
- amount character varying NOT NULL,
- subject character varying(200) NOT NULL,
- date timestamp with time zone NOT NULL,
- cancelled boolean NOT NULL,
- request_uid character varying(128) NOT NULL,
- credit_account_id integer NOT NULL,
- debit_account_id integer NOT NULL
-);
-
-
---
--- Name: app_banktransaction_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.app_banktransaction_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: app_banktransaction_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: auditor_balance_summary; Type: TABLE; Schema: auditor; Owner: -
--
-ALTER SEQUENCE public.app_banktransaction_id_seq OWNED BY public.app_banktransaction.id;
-
-
---
--- Name: app_talerwithdrawoperation; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.app_talerwithdrawoperation (
- withdraw_id uuid NOT NULL,
- amount character varying NOT NULL,
- selection_done boolean NOT NULL,
- confirmation_done boolean NOT NULL,
- aborted boolean NOT NULL,
- selected_reserve_pub text,
- selected_exchange_account_id integer,
- withdraw_account_id integer NOT NULL
-);
-
-
---
--- Name: auditor_balance_summary; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.auditor_balance_summary (
+CREATE TABLE auditor.auditor_balance_summary (
master_pub bytea NOT NULL,
denom_balance_val bigint NOT NULL,
denom_balance_frac integer NOT NULL,
@@ -5303,72 +5195,17 @@ CREATE TABLE public.auditor_balance_summary (
--
--- Name: TABLE auditor_balance_summary; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.auditor_balance_summary IS 'the sum of the outstanding coins from auditor_denomination_pending (denom_pubs must belong to the respectives exchange master public key); it represents the auditor_balance_summary of the exchange at this point (modulo unexpected historic_loss-style events where denomination keys are compromised)';
-
-
---
--- Name: auditor_denom_sigs; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.auditor_denom_sigs (
- auditor_denom_serial bigint NOT NULL,
- auditor_uuid bigint NOT NULL,
- denominations_serial bigint NOT NULL,
- auditor_sig bytea,
- CONSTRAINT auditor_denom_sigs_auditor_sig_check CHECK ((length(auditor_sig) = 64))
-);
-
-
---
--- Name: TABLE auditor_denom_sigs; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.auditor_denom_sigs IS 'Table with auditor signatures on exchange denomination keys.';
-
-
---
--- Name: COLUMN auditor_denom_sigs.auditor_uuid; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_balance_summary; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON COLUMN public.auditor_denom_sigs.auditor_uuid IS 'Identifies the auditor.';
+COMMENT ON TABLE auditor.auditor_balance_summary IS 'the sum of the outstanding coins from auditor_denomination_pending (denom_pubs must belong to the respectives exchange master public key); it represents the auditor_balance_summary of the exchange at this point (modulo unexpected historic_loss-style events where denomination keys are compromised)';
--
--- Name: COLUMN auditor_denom_sigs.denominations_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: auditor_denomination_pending; Type: TABLE; Schema: auditor; Owner: -
--
-COMMENT ON COLUMN public.auditor_denom_sigs.denominations_serial IS 'Denomination the signature is for.';
-
-
---
--- Name: COLUMN auditor_denom_sigs.auditor_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.auditor_denom_sigs.auditor_sig IS 'Signature of the auditor, of purpose TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS.';
-
-
---
--- Name: auditor_denom_sigs_auditor_denom_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.auditor_denom_sigs ALTER COLUMN auditor_denom_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.auditor_denom_sigs_auditor_denom_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: auditor_denomination_pending; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.auditor_denomination_pending (
+CREATE TABLE auditor.auditor_denomination_pending (
denom_pub_hash bytea NOT NULL,
denom_balance_val bigint NOT NULL,
denom_balance_frac integer NOT NULL,
@@ -5384,38 +5221,38 @@ CREATE TABLE public.auditor_denomination_pending (
--
--- Name: TABLE auditor_denomination_pending; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_denomination_pending; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_denomination_pending 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).';
+COMMENT ON TABLE auditor.auditor_denomination_pending 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).';
--
--- Name: COLUMN auditor_denomination_pending.num_issued; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN auditor_denomination_pending.num_issued; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON COLUMN public.auditor_denomination_pending.num_issued IS 'counts the number of coins issued (withdraw, refresh) of this denomination';
+COMMENT ON COLUMN auditor.auditor_denomination_pending.num_issued IS 'counts the number of coins issued (withdraw, refresh) of this denomination';
--
--- Name: COLUMN auditor_denomination_pending.denom_risk_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN auditor_denomination_pending.denom_risk_val; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON COLUMN public.auditor_denomination_pending.denom_risk_val IS 'amount that could theoretically be lost in the future due to recoup operations';
+COMMENT ON COLUMN auditor.auditor_denomination_pending.denom_risk_val IS 'amount that could theoretically be lost in the future due to recoup operations';
--
--- Name: COLUMN auditor_denomination_pending.recoup_loss_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN auditor_denomination_pending.recoup_loss_val; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON COLUMN public.auditor_denomination_pending.recoup_loss_val IS 'amount actually lost due to recoup operations past revocation';
+COMMENT ON COLUMN auditor.auditor_denomination_pending.recoup_loss_val IS 'amount actually lost due to recoup operations past revocation';
--
--- Name: auditor_exchange_signkeys; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_exchange_signkeys; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_exchange_signkeys (
+CREATE TABLE auditor.auditor_exchange_signkeys (
master_pub bytea NOT NULL,
ep_start bigint NOT NULL,
ep_expire bigint NOT NULL,
@@ -5428,17 +5265,17 @@ CREATE TABLE public.auditor_exchange_signkeys (
--
--- Name: TABLE auditor_exchange_signkeys; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_exchange_signkeys; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_exchange_signkeys IS 'list of the online signing keys of exchanges we are auditing';
+COMMENT ON TABLE auditor.auditor_exchange_signkeys IS 'list of the online signing keys of exchanges we are auditing';
--
--- Name: auditor_exchanges; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_exchanges; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_exchanges (
+CREATE TABLE auditor.auditor_exchanges (
master_pub bytea NOT NULL,
exchange_url character varying NOT NULL,
CONSTRAINT auditor_exchanges_master_pub_check CHECK ((length(master_pub) = 32))
@@ -5446,17 +5283,17 @@ CREATE TABLE public.auditor_exchanges (
--
--- Name: TABLE auditor_exchanges; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_exchanges; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_exchanges IS 'list of the exchanges we are auditing';
+COMMENT ON TABLE auditor.auditor_exchanges IS 'list of the exchanges we are auditing';
--
--- Name: auditor_historic_denomination_revenue; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_historic_denomination_revenue; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_historic_denomination_revenue (
+CREATE TABLE auditor.auditor_historic_denomination_revenue (
master_pub bytea NOT NULL,
denom_pub_hash bytea NOT NULL,
revenue_timestamp bigint NOT NULL,
@@ -5469,24 +5306,24 @@ CREATE TABLE public.auditor_historic_denomination_revenue (
--
--- Name: TABLE auditor_historic_denomination_revenue; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_historic_denomination_revenue; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_historic_denomination_revenue IS 'Table with historic profits; basically, when a denom_pub has expired and everything associated with it is garbage collected, the final profits end up in here; note that the denom_pub here is not a foreign key, we just keep it as a reference point.';
+COMMENT ON TABLE auditor.auditor_historic_denomination_revenue IS 'Table with historic profits; basically, when a denom_pub has expired and everything associated with it is garbage collected, the final profits end up in here; note that the denom_pub here is not a foreign key, we just keep it as a reference point.';
--
--- Name: COLUMN auditor_historic_denomination_revenue.revenue_balance_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN auditor_historic_denomination_revenue.revenue_balance_val; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON COLUMN public.auditor_historic_denomination_revenue.revenue_balance_val IS 'the sum of all of the profits we made on the coin except for withdraw fees (which are in historic_reserve_revenue); so this includes the deposit, melt and refund fees';
+COMMENT ON COLUMN auditor.auditor_historic_denomination_revenue.revenue_balance_val IS 'the sum of all of the profits we made on the coin except for withdraw fees (which are in historic_reserve_revenue); so this includes the deposit, melt and refund fees';
--
--- Name: auditor_historic_reserve_summary; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_historic_reserve_summary; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_historic_reserve_summary (
+CREATE TABLE auditor.auditor_historic_reserve_summary (
master_pub bytea NOT NULL,
start_date bigint NOT NULL,
end_date bigint NOT NULL,
@@ -5496,135 +5333,148 @@ CREATE TABLE public.auditor_historic_reserve_summary (
--
--- Name: TABLE auditor_historic_reserve_summary; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_historic_reserve_summary; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_historic_reserve_summary IS 'historic profits from reserves; we eventually GC auditor_historic_reserve_revenue, and then store the totals in here (by time intervals).';
+COMMENT ON TABLE auditor.auditor_historic_reserve_summary IS 'historic profits from reserves; we eventually GC auditor_historic_reserve_revenue, and then store the totals in here (by time intervals).';
--
--- Name: auditor_predicted_result; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_predicted_result; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_predicted_result (
+CREATE TABLE auditor.auditor_predicted_result (
master_pub bytea NOT NULL,
balance_val bigint NOT NULL,
- balance_frac integer NOT NULL
+ balance_frac integer NOT NULL,
+ drained_val bigint NOT NULL,
+ drained_frac integer NOT NULL
);
--
--- Name: TABLE auditor_predicted_result; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_predicted_result; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_predicted_result IS 'Table with the sum of the ledger, auditor_historic_revenue and the auditor_reserve_balance. This is the final amount that the exchange should have in its bank account right now.';
+COMMENT ON TABLE auditor.auditor_predicted_result IS 'Table with the sum of the ledger, auditor_historic_revenue and the auditor_reserve_balance and the drained profits. This is the final amount that the exchange should have in its bank account right now (and the total amount drained as profits to non-escrow accounts).';
--
--- Name: auditor_progress_aggregation; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_progress_aggregation; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_progress_aggregation (
+CREATE TABLE auditor.auditor_progress_aggregation (
master_pub bytea NOT NULL,
last_wire_out_serial_id bigint DEFAULT 0 NOT NULL
);
--
--- Name: TABLE auditor_progress_aggregation; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_progress_aggregation; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_progress_aggregation IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
+COMMENT ON TABLE auditor.auditor_progress_aggregation IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
statements to process. The indices include the last serial ID from the respective tables that we have processed. Thus, we need to select those table entries that are strictly larger (and process in monotonically increasing order).';
--
--- Name: auditor_progress_coin; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_progress_coin; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_progress_coin (
+CREATE TABLE auditor.auditor_progress_coin (
master_pub bytea NOT NULL,
last_withdraw_serial_id bigint DEFAULT 0 NOT NULL,
last_deposit_serial_id bigint DEFAULT 0 NOT NULL,
last_melt_serial_id bigint DEFAULT 0 NOT NULL,
last_refund_serial_id bigint DEFAULT 0 NOT NULL,
last_recoup_serial_id bigint DEFAULT 0 NOT NULL,
- last_recoup_refresh_serial_id bigint DEFAULT 0 NOT NULL
+ last_recoup_refresh_serial_id bigint DEFAULT 0 NOT NULL,
+ last_purse_deposits_serial_id bigint DEFAULT 0 NOT NULL,
+ last_purse_refunds_serial_id bigint DEFAULT 0 NOT NULL
);
--
--- Name: TABLE auditor_progress_coin; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_progress_coin; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_progress_coin IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
+COMMENT ON TABLE auditor.auditor_progress_coin IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
statements to process. The indices include the last serial ID from the respective tables that we have processed. Thus, we need to select those table entries that are strictly larger (and process in monotonically increasing order).';
--
--- Name: auditor_progress_deposit_confirmation; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_progress_deposit_confirmation; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_progress_deposit_confirmation (
+CREATE TABLE auditor.auditor_progress_deposit_confirmation (
master_pub bytea NOT NULL,
last_deposit_confirmation_serial_id bigint DEFAULT 0 NOT NULL
);
--
--- Name: TABLE auditor_progress_deposit_confirmation; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_progress_deposit_confirmation; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_progress_deposit_confirmation IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
+COMMENT ON TABLE auditor.auditor_progress_deposit_confirmation IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
statements to process. The indices include the last serial ID from the respective tables that we have processed. Thus, we need to select those table entries that are strictly larger (and process in monotonically increasing order).';
--
--- Name: auditor_progress_reserve; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_progress_reserve; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_progress_reserve (
+CREATE TABLE auditor.auditor_progress_reserve (
master_pub bytea NOT NULL,
last_reserve_in_serial_id bigint DEFAULT 0 NOT NULL,
last_reserve_out_serial_id bigint DEFAULT 0 NOT NULL,
last_reserve_recoup_serial_id bigint DEFAULT 0 NOT NULL,
- last_reserve_close_serial_id bigint DEFAULT 0 NOT NULL
+ last_reserve_close_serial_id bigint DEFAULT 0 NOT NULL,
+ last_purse_merges_serial_id bigint DEFAULT 0 NOT NULL,
+ last_purse_deposits_serial_id bigint DEFAULT 0 NOT NULL,
+ last_account_merges_serial_id bigint DEFAULT 0 NOT NULL,
+ last_history_requests_serial_id bigint DEFAULT 0 NOT NULL,
+ last_close_requests_serial_id bigint DEFAULT 0 NOT NULL
);
--
--- Name: TABLE auditor_progress_reserve; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_progress_reserve; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_progress_reserve IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
+COMMENT ON TABLE auditor.auditor_progress_reserve IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
statements to process. The indices include the last serial ID from the respective tables that we have processed. Thus, we need to select those table entries that are strictly larger (and process in monotonically increasing order).';
--
--- Name: auditor_reserve_balance; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_reserve_balance; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_reserve_balance (
+CREATE TABLE auditor.auditor_reserve_balance (
master_pub bytea NOT NULL,
reserve_balance_val bigint NOT NULL,
reserve_balance_frac integer NOT NULL,
withdraw_fee_balance_val bigint NOT NULL,
- withdraw_fee_balance_frac integer NOT NULL
+ withdraw_fee_balance_frac integer NOT NULL,
+ purse_fee_balance_val bigint NOT NULL,
+ purse_fee_balance_frac integer NOT NULL,
+ history_fee_balance_val bigint NOT NULL,
+ history_fee_balance_frac integer NOT NULL
);
--
--- Name: TABLE auditor_reserve_balance; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_reserve_balance; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_reserve_balance IS 'sum of the balances of all customer reserves (by exchange master public key)';
+COMMENT ON TABLE auditor.auditor_reserve_balance IS 'sum of the balances of all customer reserves (by exchange master public key)';
--
--- Name: auditor_reserves; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_reserves; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_reserves (
+CREATE TABLE auditor.auditor_reserves (
reserve_pub bytea NOT NULL,
master_pub bytea NOT NULL,
reserve_balance_val bigint NOT NULL,
@@ -5639,17 +5489,17 @@ CREATE TABLE public.auditor_reserves (
--
--- Name: TABLE auditor_reserves; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_reserves; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_reserves IS 'all of the customer reserves and their respective balances that the auditor is aware of';
+COMMENT ON TABLE auditor.auditor_reserves IS 'all of the customer reserves and their respective balances that the auditor is aware of';
--
--- Name: auditor_reserves_auditor_reserves_rowid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: auditor_reserves_auditor_reserves_rowid_seq; Type: SEQUENCE; Schema: auditor; Owner: -
--
-CREATE SEQUENCE public.auditor_reserves_auditor_reserves_rowid_seq
+CREATE SEQUENCE auditor.auditor_reserves_auditor_reserves_rowid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -5658,17 +5508,17 @@ CREATE SEQUENCE public.auditor_reserves_auditor_reserves_rowid_seq
--
--- Name: auditor_reserves_auditor_reserves_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: auditor_reserves_auditor_reserves_rowid_seq; Type: SEQUENCE OWNED BY; Schema: auditor; Owner: -
--
-ALTER SEQUENCE public.auditor_reserves_auditor_reserves_rowid_seq OWNED BY public.auditor_reserves.auditor_reserves_rowid;
+ALTER SEQUENCE auditor.auditor_reserves_auditor_reserves_rowid_seq OWNED BY auditor.auditor_reserves.auditor_reserves_rowid;
--
--- Name: auditor_wire_fee_balance; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_wire_fee_balance; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditor_wire_fee_balance (
+CREATE TABLE auditor.auditor_wire_fee_balance (
master_pub bytea NOT NULL,
wire_fee_balance_val bigint NOT NULL,
wire_fee_balance_frac integer NOT NULL
@@ -5676,68 +5526,154 @@ CREATE TABLE public.auditor_wire_fee_balance (
--
--- Name: TABLE auditor_wire_fee_balance; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE auditor_wire_fee_balance; Type: COMMENT; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditor_wire_fee_balance IS 'sum of the balances of all wire fees (by exchange master public key)';
+COMMENT ON TABLE auditor.auditor_wire_fee_balance IS 'sum of the balances of all wire fees (by exchange master public key)';
--
--- Name: auditors; Type: TABLE; Schema: public; Owner: -
+-- Name: deposit_confirmations; Type: TABLE; Schema: auditor; Owner: -
--
-CREATE TABLE public.auditors (
- auditor_uuid bigint NOT NULL,
- auditor_pub bytea NOT NULL,
- auditor_name character varying NOT NULL,
- auditor_url character varying NOT NULL,
- is_active boolean NOT NULL,
- last_change bigint NOT NULL,
- CONSTRAINT auditors_auditor_pub_check CHECK ((length(auditor_pub) = 32))
+CREATE TABLE auditor.deposit_confirmations (
+ master_pub bytea NOT NULL,
+ serial_id bigint NOT NULL,
+ h_contract_terms bytea NOT NULL,
+ h_extensions bytea NOT NULL,
+ h_wire bytea NOT NULL,
+ exchange_timestamp bigint NOT NULL,
+ refund_deadline bigint NOT NULL,
+ wire_deadline bigint NOT NULL,
+ amount_without_fee_val bigint NOT NULL,
+ amount_without_fee_frac integer NOT NULL,
+ coin_pub bytea NOT NULL,
+ merchant_pub bytea NOT NULL,
+ exchange_sig bytea NOT NULL,
+ exchange_pub bytea NOT NULL,
+ master_sig bytea NOT NULL,
+ CONSTRAINT deposit_confirmations_coin_pub_check CHECK ((length(coin_pub) = 32)),
+ CONSTRAINT deposit_confirmations_exchange_pub_check CHECK ((length(exchange_pub) = 32)),
+ CONSTRAINT deposit_confirmations_exchange_sig_check CHECK ((length(exchange_sig) = 64)),
+ CONSTRAINT deposit_confirmations_h_contract_terms_check CHECK ((length(h_contract_terms) = 64)),
+ CONSTRAINT deposit_confirmations_h_contract_terms_check1 CHECK ((length(h_contract_terms) = 64)),
+ CONSTRAINT deposit_confirmations_h_wire_check CHECK ((length(h_wire) = 64)),
+ CONSTRAINT deposit_confirmations_master_sig_check CHECK ((length(master_sig) = 64)),
+ CONSTRAINT deposit_confirmations_merchant_pub_check CHECK ((length(merchant_pub) = 32))
);
--
--- Name: TABLE auditors; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE deposit_confirmations; Type: COMMENT; Schema: auditor; Owner: -
+--
+
+COMMENT ON TABLE auditor.deposit_confirmations IS 'deposit confirmation sent to us by merchants; we must check that the exchange reported these properly.';
+
+
+--
+-- Name: deposit_confirmations_serial_id_seq; Type: SEQUENCE; Schema: auditor; Owner: -
+--
+
+CREATE SEQUENCE auditor.deposit_confirmations_serial_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: deposit_confirmations_serial_id_seq; Type: SEQUENCE OWNED BY; Schema: auditor; Owner: -
--
-COMMENT ON TABLE public.auditors IS 'Table with auditors the exchange uses or has used in the past. Entries never expire as we need to remember the last_change column indefinitely.';
+ALTER SEQUENCE auditor.deposit_confirmations_serial_id_seq OWNED BY auditor.deposit_confirmations.serial_id;
+
+
+--
+-- Name: wire_auditor_account_progress; Type: TABLE; Schema: auditor; Owner: -
+--
+
+CREATE TABLE auditor.wire_auditor_account_progress (
+ master_pub bytea NOT NULL,
+ account_name text NOT NULL,
+ last_wire_reserve_in_serial_id bigint DEFAULT 0 NOT NULL,
+ last_wire_wire_out_serial_id bigint DEFAULT 0 NOT NULL,
+ wire_in_off bigint NOT NULL,
+ wire_out_off bigint NOT NULL
+);
+
+
+--
+-- Name: TABLE wire_auditor_account_progress; Type: COMMENT; Schema: auditor; Owner: -
+--
+
+COMMENT ON TABLE auditor.wire_auditor_account_progress IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
+ statements to process. The indices include the last serial ID from the respective tables that we have processed. Thus, we need to select those table entries that are strictly larger (and process in monotonically increasing order).';
+
+
+--
+-- Name: wire_auditor_progress; Type: TABLE; Schema: auditor; Owner: -
+--
+
+CREATE TABLE auditor.wire_auditor_progress (
+ master_pub bytea NOT NULL,
+ last_timestamp bigint NOT NULL,
+ last_reserve_close_uuid bigint NOT NULL
+);
+
+
+--
+-- Name: account_merges; Type: TABLE; Schema: exchange; Owner: -
+--
+
+CREATE TABLE exchange.account_merges (
+ account_merge_request_serial_id bigint NOT NULL,
+ reserve_pub bytea NOT NULL,
+ reserve_sig bytea NOT NULL,
+ purse_pub bytea NOT NULL,
+ wallet_h_payto bytea NOT NULL,
+ CONSTRAINT account_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
+ CONSTRAINT account_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
+ CONSTRAINT account_merges_reserve_sig_check CHECK ((length(reserve_sig) = 64)),
+ CONSTRAINT account_merges_wallet_h_payto_check CHECK ((length(wallet_h_payto) = 32))
+)
+PARTITION BY HASH (purse_pub);
--
--- Name: COLUMN auditors.auditor_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE account_merges; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.auditors.auditor_pub IS 'Public key of the auditor.';
+COMMENT ON TABLE exchange.account_merges IS 'Merge requests where a purse- and account-owner requested merging the purse into the account';
--
--- Name: COLUMN auditors.auditor_url; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN account_merges.reserve_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.auditors.auditor_url IS 'The base URL of the auditor.';
+COMMENT ON COLUMN exchange.account_merges.reserve_pub IS 'public key of the target reserve';
--
--- Name: COLUMN auditors.is_active; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN account_merges.reserve_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.auditors.is_active IS 'true if we are currently supporting the use of this auditor.';
+COMMENT ON COLUMN exchange.account_merges.reserve_sig IS 'signature by the reserve private key affirming the merge, of type TALER_SIGNATURE_WALLET_ACCOUNT_MERGE';
--
--- Name: COLUMN auditors.last_change; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN account_merges.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.auditors.last_change IS 'Latest time when active status changed. Used to detect replays of old messages.';
+COMMENT ON COLUMN exchange.account_merges.purse_pub IS 'public key of the purse';
--
--- Name: auditors_auditor_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: account_merges_account_merge_request_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.auditors ALTER COLUMN auditor_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.auditors_auditor_uuid_seq
+ALTER TABLE exchange.account_merges ALTER COLUMN account_merge_request_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.account_merges_account_merge_request_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -5747,198 +5683,257 @@ ALTER TABLE public.auditors ALTER COLUMN auditor_uuid ADD GENERATED BY DEFAULT A
--
--- Name: auth_group; Type: TABLE; Schema: public; Owner: -
+-- Name: account_merges_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.auth_group (
- id integer NOT NULL,
- name character varying(150) NOT NULL
+CREATE TABLE exchange.account_merges_default (
+ account_merge_request_serial_id bigint NOT NULL,
+ reserve_pub bytea NOT NULL,
+ reserve_sig bytea NOT NULL,
+ purse_pub bytea NOT NULL,
+ wallet_h_payto bytea NOT NULL,
+ CONSTRAINT account_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
+ CONSTRAINT account_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
+ CONSTRAINT account_merges_reserve_sig_check CHECK ((length(reserve_sig) = 64)),
+ CONSTRAINT account_merges_wallet_h_payto_check CHECK ((length(wallet_h_payto) = 32))
);
+ALTER TABLE ONLY exchange.account_merges ATTACH PARTITION exchange.account_merges_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: aggregation_tracking; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE SEQUENCE public.auth_group_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
+CREATE TABLE exchange.aggregation_tracking (
+ aggregation_serial_id bigint NOT NULL,
+ deposit_serial_id bigint NOT NULL,
+ wtid_raw bytea NOT NULL
+)
+PARTITION BY HASH (deposit_serial_id);
--
--- Name: auth_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: TABLE aggregation_tracking; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER SEQUENCE public.auth_group_id_seq OWNED BY public.auth_group.id;
+COMMENT ON TABLE exchange.aggregation_tracking IS 'mapping from wire transfer identifiers (WTID) to deposits (and back)';
--
--- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN aggregation_tracking.wtid_raw; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.auth_group_permissions (
- id bigint NOT NULL,
- group_id integer NOT NULL,
- permission_id integer NOT NULL
-);
+COMMENT ON COLUMN exchange.aggregation_tracking.wtid_raw IS 'identifier of the wire transfer';
--
--- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: aggregation_tracking_aggregation_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-CREATE SEQUENCE public.auth_group_permissions_id_seq
+ALTER TABLE exchange.aggregation_tracking ALTER COLUMN aggregation_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.aggregation_tracking_aggregation_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
- CACHE 1;
+ CACHE 1
+);
--
--- Name: auth_group_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: aggregation_tracking_default; Type: TABLE; Schema: exchange; Owner: -
--
-ALTER SEQUENCE public.auth_group_permissions_id_seq OWNED BY public.auth_group_permissions.id;
+CREATE TABLE exchange.aggregation_tracking_default (
+ aggregation_serial_id bigint NOT NULL,
+ deposit_serial_id bigint NOT NULL,
+ wtid_raw bytea NOT NULL
+);
+ALTER TABLE ONLY exchange.aggregation_tracking ATTACH PARTITION exchange.aggregation_tracking_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: auth_permission; Type: TABLE; Schema: public; Owner: -
+-- Name: aggregation_transient; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.auth_permission (
- id integer NOT NULL,
- name character varying(255) NOT NULL,
- content_type_id integer NOT NULL,
- codename character varying(100) NOT NULL
-);
+CREATE TABLE exchange.aggregation_transient (
+ amount_val bigint NOT NULL,
+ amount_frac integer NOT NULL,
+ wire_target_h_payto bytea,
+ merchant_pub bytea,
+ exchange_account_section text NOT NULL,
+ wtid_raw bytea NOT NULL,
+ CONSTRAINT aggregation_transient_merchant_pub_check CHECK ((length(merchant_pub) = 32)),
+ CONSTRAINT aggregation_transient_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32)),
+ CONSTRAINT aggregation_transient_wtid_raw_check CHECK ((length(wtid_raw) = 32))
+)
+PARTITION BY HASH (wire_target_h_payto);
--
--- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: TABLE aggregation_transient; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE SEQUENCE public.auth_permission_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
+COMMENT ON TABLE exchange.aggregation_transient IS 'aggregations currently happening (lacking wire_out, usually because the amount is too low); this table is not replicated';
--
--- Name: auth_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: COLUMN aggregation_transient.amount_val; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER SEQUENCE public.auth_permission_id_seq OWNED BY public.auth_permission.id;
+COMMENT ON COLUMN exchange.aggregation_transient.amount_val IS 'Sum of all of the aggregated deposits (without deposit fees)';
--
--- Name: auth_user; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN aggregation_transient.wtid_raw; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.auth_user (
- id integer NOT NULL,
- password character varying(128) NOT NULL,
- last_login timestamp with time zone,
- is_superuser boolean NOT NULL,
- username character varying(150) NOT NULL,
- first_name character varying(150) NOT NULL,
- last_name character varying(150) NOT NULL,
- email character varying(254) NOT NULL,
- is_staff boolean NOT NULL,
- is_active boolean NOT NULL,
- date_joined timestamp with time zone NOT NULL
+COMMENT ON COLUMN exchange.aggregation_transient.wtid_raw IS 'identifier of the wire transfer';
+
+
+--
+-- Name: aggregation_transient_default; Type: TABLE; Schema: exchange; Owner: -
+--
+
+CREATE TABLE exchange.aggregation_transient_default (
+ amount_val bigint NOT NULL,
+ amount_frac integer NOT NULL,
+ wire_target_h_payto bytea,
+ merchant_pub bytea,
+ exchange_account_section text NOT NULL,
+ wtid_raw bytea NOT NULL,
+ CONSTRAINT aggregation_transient_merchant_pub_check CHECK ((length(merchant_pub) = 32)),
+ CONSTRAINT aggregation_transient_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32)),
+ CONSTRAINT aggregation_transient_wtid_raw_check CHECK ((length(wtid_raw) = 32))
);
+ALTER TABLE ONLY exchange.aggregation_transient ATTACH PARTITION exchange.aggregation_transient_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: auth_user_groups; Type: TABLE; Schema: public; Owner: -
+-- Name: auditor_denom_sigs; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.auth_user_groups (
- id bigint NOT NULL,
- user_id integer NOT NULL,
- group_id integer NOT NULL
+CREATE TABLE exchange.auditor_denom_sigs (
+ auditor_denom_serial bigint NOT NULL,
+ auditor_uuid bigint NOT NULL,
+ denominations_serial bigint NOT NULL,
+ auditor_sig bytea,
+ CONSTRAINT auditor_denom_sigs_auditor_sig_check CHECK ((length(auditor_sig) = 64))
);
--
--- Name: auth_user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: TABLE auditor_denom_sigs; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE SEQUENCE public.auth_user_groups_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
+COMMENT ON TABLE exchange.auditor_denom_sigs IS 'Table with auditor signatures on exchange denomination keys.';
+
+
+--
+-- Name: COLUMN auditor_denom_sigs.auditor_uuid; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.auditor_denom_sigs.auditor_uuid IS 'Identifies the auditor.';
+
+
+--
+-- Name: COLUMN auditor_denom_sigs.denominations_serial; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.auditor_denom_sigs.denominations_serial IS 'Denomination the signature is for.';
--
--- Name: auth_user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: COLUMN auditor_denom_sigs.auditor_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER SEQUENCE public.auth_user_groups_id_seq OWNED BY public.auth_user_groups.id;
+COMMENT ON COLUMN exchange.auditor_denom_sigs.auditor_sig IS 'Signature of the auditor, of purpose TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS.';
--
--- Name: auth_user_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: auditor_denom_sigs_auditor_denom_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-CREATE SEQUENCE public.auth_user_id_seq
+ALTER TABLE exchange.auditor_denom_sigs ALTER COLUMN auditor_denom_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.auditor_denom_sigs_auditor_denom_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
- CACHE 1;
+ CACHE 1
+);
--
--- Name: auth_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: auditors; Type: TABLE; Schema: exchange; Owner: -
--
-ALTER SEQUENCE public.auth_user_id_seq OWNED BY public.auth_user.id;
+CREATE TABLE exchange.auditors (
+ auditor_uuid bigint NOT NULL,
+ auditor_pub bytea NOT NULL,
+ auditor_name character varying NOT NULL,
+ auditor_url character varying NOT NULL,
+ is_active boolean NOT NULL,
+ last_change bigint NOT NULL,
+ CONSTRAINT auditors_auditor_pub_check CHECK ((length(auditor_pub) = 32))
+);
--
--- Name: auth_user_user_permissions; Type: TABLE; Schema: public; Owner: -
+-- Name: TABLE auditors; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.auth_user_user_permissions (
- id bigint NOT NULL,
- user_id integer NOT NULL,
- permission_id integer NOT NULL
-);
+COMMENT ON TABLE exchange.auditors IS 'Table with auditors the exchange uses or has used in the past. Entries never expire as we need to remember the last_change column indefinitely.';
--
--- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: COLUMN auditors.auditor_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE SEQUENCE public.auth_user_user_permissions_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
+COMMENT ON COLUMN exchange.auditors.auditor_pub IS 'Public key of the auditor.';
+
+
+--
+-- Name: COLUMN auditors.auditor_url; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.auditors.auditor_url IS 'The base URL of the auditor.';
+
+
+--
+-- Name: COLUMN auditors.is_active; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.auditors.is_active IS 'true if we are currently supporting the use of this auditor.';
+
+
+--
+-- Name: COLUMN auditors.last_change; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.auditors.last_change IS 'Latest time when active status changed. Used to detect replays of old messages.';
--
--- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+-- Name: auditors_auditor_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER SEQUENCE public.auth_user_user_permissions_id_seq OWNED BY public.auth_user_user_permissions.id;
+ALTER TABLE exchange.auditors ALTER COLUMN auditor_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.auditors_auditor_uuid_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
--
--- Name: close_requests; Type: TABLE; Schema: public; Owner: -
+-- Name: close_requests; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.close_requests (
+CREATE TABLE exchange.close_requests (
+ close_request_serial_id bigint NOT NULL,
reserve_pub bytea NOT NULL,
close_timestamp bigint NOT NULL,
reserve_sig bytea NOT NULL,
@@ -5951,38 +5946,53 @@ PARTITION BY HASH (reserve_pub);
--
--- Name: TABLE close_requests; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE close_requests; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.close_requests IS 'Explicit requests by a reserve owner to close a reserve immediately';
+COMMENT ON TABLE exchange.close_requests IS 'Explicit requests by a reserve owner to close a reserve immediately';
--
--- Name: COLUMN close_requests.close_timestamp; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN close_requests.close_timestamp; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.close_requests.close_timestamp IS 'When the request was created by the client';
+COMMENT ON COLUMN exchange.close_requests.close_timestamp IS 'When the request was created by the client';
--
--- Name: COLUMN close_requests.reserve_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN close_requests.reserve_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.close_requests.reserve_sig IS 'Signature affirming that the reserve is to be closed';
+COMMENT ON COLUMN exchange.close_requests.reserve_sig IS 'Signature affirming that the reserve is to be closed';
--
--- Name: COLUMN close_requests.close_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN close_requests.close_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.close_requests.close_val IS 'Balance of the reserve at the time of closing, to be wired to the associated bank account (minus the closing fee)';
+COMMENT ON COLUMN exchange.close_requests.close_val IS 'Balance of the reserve at the time of closing, to be wired to the associated bank account (minus the closing fee)';
--
--- Name: close_requests_default; Type: TABLE; Schema: public; Owner: -
+-- Name: close_requests_close_request_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-CREATE TABLE public.close_requests_default (
+ALTER TABLE exchange.close_requests ALTER COLUMN close_request_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.close_requests_close_request_serial_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
+
+
+--
+-- Name: close_requests_default; Type: TABLE; Schema: exchange; Owner: -
+--
+
+CREATE TABLE exchange.close_requests_default (
+ close_request_serial_id bigint NOT NULL,
reserve_pub bytea NOT NULL,
close_timestamp bigint NOT NULL,
reserve_sig bytea NOT NULL,
@@ -5991,14 +6001,14 @@ CREATE TABLE public.close_requests_default (
CONSTRAINT close_requests_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
CONSTRAINT close_requests_reserve_sig_check CHECK ((length(reserve_sig) = 64))
);
-ALTER TABLE ONLY public.close_requests ATTACH PARTITION public.close_requests_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.close_requests ATTACH PARTITION exchange.close_requests_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: contracts; Type: TABLE; Schema: public; Owner: -
+-- Name: contracts; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.contracts (
+CREATE TABLE exchange.contracts (
contract_serial_id bigint NOT NULL,
purse_pub bytea NOT NULL,
pub_ckey bytea NOT NULL,
@@ -6013,46 +6023,46 @@ PARTITION BY HASH (purse_pub);
--
--- Name: TABLE contracts; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE contracts; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.contracts IS 'encrypted contracts associated with purses';
+COMMENT ON TABLE exchange.contracts IS 'encrypted contracts associated with purses';
--
--- Name: COLUMN contracts.purse_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN contracts.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.contracts.purse_pub IS 'public key of the purse that the contract is associated with';
+COMMENT ON COLUMN exchange.contracts.purse_pub IS 'public key of the purse that the contract is associated with';
--
--- Name: COLUMN contracts.pub_ckey; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN contracts.pub_ckey; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.contracts.pub_ckey IS 'Public ECDH key used to encrypt the contract, to be used with the purse private key for decryption';
+COMMENT ON COLUMN exchange.contracts.pub_ckey IS 'Public ECDH key used to encrypt the contract, to be used with the purse private key for decryption';
--
--- Name: COLUMN contracts.contract_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN contracts.contract_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.contracts.contract_sig IS 'signature over the encrypted contract by the purse contract key';
+COMMENT ON COLUMN exchange.contracts.contract_sig IS 'signature over the encrypted contract by the purse contract key';
--
--- Name: COLUMN contracts.e_contract; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN contracts.e_contract; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.contracts.e_contract IS 'AES-GCM encrypted contract terms (contains gzip compressed JSON after decryption)';
+COMMENT ON COLUMN exchange.contracts.e_contract IS 'AES-GCM encrypted contract terms (contains gzip compressed JSON after decryption)';
--
--- Name: contracts_contract_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: contracts_contract_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.contracts ALTER COLUMN contract_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.contracts_contract_serial_id_seq
+ALTER TABLE exchange.contracts ALTER COLUMN contract_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.contracts_contract_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6062,10 +6072,10 @@ ALTER TABLE public.contracts ALTER COLUMN contract_serial_id ADD GENERATED BY DE
--
--- Name: contracts_default; Type: TABLE; Schema: public; Owner: -
+-- Name: contracts_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.contracts_default (
+CREATE TABLE exchange.contracts_default (
contract_serial_id bigint NOT NULL,
purse_pub bytea NOT NULL,
pub_ckey bytea NOT NULL,
@@ -6076,14 +6086,14 @@ CREATE TABLE public.contracts_default (
CONSTRAINT contracts_pub_ckey_check CHECK ((length(pub_ckey) = 32)),
CONSTRAINT contracts_purse_pub_check CHECK ((length(purse_pub) = 32))
);
-ALTER TABLE ONLY public.contracts ATTACH PARTITION public.contracts_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.contracts ATTACH PARTITION exchange.contracts_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: cs_nonce_locks; Type: TABLE; Schema: public; Owner: -
+-- Name: cs_nonce_locks; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.cs_nonce_locks (
+CREATE TABLE exchange.cs_nonce_locks (
cs_nonce_lock_serial_id bigint NOT NULL,
nonce bytea NOT NULL,
op_hash bytea NOT NULL,
@@ -6095,39 +6105,39 @@ PARTITION BY HASH (nonce);
--
--- Name: TABLE cs_nonce_locks; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE cs_nonce_locks; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.cs_nonce_locks IS 'ensures a Clause Schnorr client nonce is locked for use with an operation identified by a hash';
+COMMENT ON TABLE exchange.cs_nonce_locks IS 'ensures a Clause Schnorr client nonce is locked for use with an operation identified by a hash';
--
--- Name: COLUMN cs_nonce_locks.nonce; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN cs_nonce_locks.nonce; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.cs_nonce_locks.nonce IS 'actual nonce submitted by the client';
+COMMENT ON COLUMN exchange.cs_nonce_locks.nonce IS 'actual nonce submitted by the client';
--
--- Name: COLUMN cs_nonce_locks.op_hash; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN cs_nonce_locks.op_hash; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.cs_nonce_locks.op_hash IS 'hash (RC for refresh, blind coin hash for withdraw) the nonce may be used with';
+COMMENT ON COLUMN exchange.cs_nonce_locks.op_hash IS 'hash (RC for refresh, blind coin hash for withdraw) the nonce may be used with';
--
--- Name: COLUMN cs_nonce_locks.max_denomination_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN cs_nonce_locks.max_denomination_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.cs_nonce_locks.max_denomination_serial IS 'Maximum number of a CS denomination serial the nonce could be used with, for GC';
+COMMENT ON COLUMN exchange.cs_nonce_locks.max_denomination_serial IS 'Maximum number of a CS denomination serial the nonce could be used with, for GC';
--
--- Name: cs_nonce_locks_cs_nonce_lock_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: cs_nonce_locks_cs_nonce_lock_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.cs_nonce_locks ALTER COLUMN cs_nonce_lock_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.cs_nonce_locks_cs_nonce_lock_serial_id_seq
+ALTER TABLE exchange.cs_nonce_locks ALTER COLUMN cs_nonce_lock_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.cs_nonce_locks_cs_nonce_lock_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6137,10 +6147,10 @@ ALTER TABLE public.cs_nonce_locks ALTER COLUMN cs_nonce_lock_serial_id ADD GENER
--
--- Name: cs_nonce_locks_default; Type: TABLE; Schema: public; Owner: -
+-- Name: cs_nonce_locks_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.cs_nonce_locks_default (
+CREATE TABLE exchange.cs_nonce_locks_default (
cs_nonce_lock_serial_id bigint NOT NULL,
nonce bytea NOT NULL,
op_hash bytea NOT NULL,
@@ -6148,14 +6158,14 @@ CREATE TABLE public.cs_nonce_locks_default (
CONSTRAINT cs_nonce_locks_nonce_check CHECK ((length(nonce) = 32)),
CONSTRAINT cs_nonce_locks_op_hash_check CHECK ((length(op_hash) = 64))
);
-ALTER TABLE ONLY public.cs_nonce_locks ATTACH PARTITION public.cs_nonce_locks_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.cs_nonce_locks ATTACH PARTITION exchange.cs_nonce_locks_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: denomination_revocations; Type: TABLE; Schema: public; Owner: -
+-- Name: denomination_revocations; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.denomination_revocations (
+CREATE TABLE exchange.denomination_revocations (
denom_revocations_serial_id bigint NOT NULL,
denominations_serial bigint NOT NULL,
master_sig bytea NOT NULL,
@@ -6164,18 +6174,18 @@ CREATE TABLE public.denomination_revocations (
--
--- Name: TABLE denomination_revocations; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE denomination_revocations; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.denomination_revocations IS 'remembering which denomination keys have been revoked';
+COMMENT ON TABLE exchange.denomination_revocations IS 'remembering which denomination keys have been revoked';
--
--- Name: denomination_revocations_denom_revocations_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: denomination_revocations_denom_revocations_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.denomination_revocations ALTER COLUMN denom_revocations_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.denomination_revocations_denom_revocations_serial_id_seq
+ALTER TABLE exchange.denomination_revocations ALTER COLUMN denom_revocations_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.denomination_revocations_denom_revocations_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6185,10 +6195,10 @@ ALTER TABLE public.denomination_revocations ALTER COLUMN denom_revocations_seria
--
--- Name: denominations; Type: TABLE; Schema: public; Owner: -
+-- Name: denominations; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.denominations (
+CREATE TABLE exchange.denominations (
denominations_serial bigint NOT NULL,
denom_pub_hash bytea NOT NULL,
denom_type integer DEFAULT 1 NOT NULL,
@@ -6215,39 +6225,39 @@ CREATE TABLE public.denominations (
--
--- Name: TABLE denominations; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE denominations; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.denominations IS 'Main denominations table. All the valid denominations the exchange knows about.';
+COMMENT ON TABLE exchange.denominations IS 'Main denominations table. All the valid denominations the exchange knows about.';
--
--- Name: COLUMN denominations.denominations_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN denominations.denominations_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.denominations.denominations_serial IS 'needed for exchange-auditor replication logic';
+COMMENT ON COLUMN exchange.denominations.denominations_serial IS 'needed for exchange-auditor replication logic';
--
--- Name: COLUMN denominations.denom_type; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN denominations.denom_type; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.denominations.denom_type IS 'determines cipher type for blind signatures used with this denomination; 0 is for RSA';
+COMMENT ON COLUMN exchange.denominations.denom_type IS 'determines cipher type for blind signatures used with this denomination; 0 is for RSA';
--
--- Name: COLUMN denominations.age_mask; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN denominations.age_mask; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.denominations.age_mask IS 'bitmask with the age restrictions that are being used for this denomination; 0 if denomination does not support the use of age restrictions';
+COMMENT ON COLUMN exchange.denominations.age_mask IS 'bitmask with the age restrictions that are being used for this denomination; 0 if denomination does not support the use of age restrictions';
--
--- Name: denominations_denominations_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: denominations_denominations_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.denominations ALTER COLUMN denominations_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.denominations_denominations_serial_seq
+ALTER TABLE exchange.denominations ALTER COLUMN denominations_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.denominations_denominations_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6257,67 +6267,10 @@ ALTER TABLE public.denominations ALTER COLUMN denominations_serial ADD GENERATED
--
--- Name: deposit_confirmations; Type: TABLE; Schema: public; Owner: -
+-- Name: deposits; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.deposit_confirmations (
- master_pub bytea NOT NULL,
- serial_id bigint NOT NULL,
- h_contract_terms bytea NOT NULL,
- h_extensions bytea NOT NULL,
- h_wire bytea NOT NULL,
- exchange_timestamp bigint NOT NULL,
- refund_deadline bigint NOT NULL,
- wire_deadline bigint NOT NULL,
- amount_without_fee_val bigint NOT NULL,
- amount_without_fee_frac integer NOT NULL,
- coin_pub bytea NOT NULL,
- merchant_pub bytea NOT NULL,
- exchange_sig bytea NOT NULL,
- exchange_pub bytea NOT NULL,
- master_sig bytea NOT NULL,
- CONSTRAINT deposit_confirmations_coin_pub_check CHECK ((length(coin_pub) = 32)),
- CONSTRAINT deposit_confirmations_exchange_pub_check CHECK ((length(exchange_pub) = 32)),
- CONSTRAINT deposit_confirmations_exchange_sig_check CHECK ((length(exchange_sig) = 64)),
- CONSTRAINT deposit_confirmations_h_contract_terms_check CHECK ((length(h_contract_terms) = 64)),
- CONSTRAINT deposit_confirmations_h_contract_terms_check1 CHECK ((length(h_contract_terms) = 64)),
- CONSTRAINT deposit_confirmations_h_wire_check CHECK ((length(h_wire) = 64)),
- CONSTRAINT deposit_confirmations_master_sig_check CHECK ((length(master_sig) = 64)),
- CONSTRAINT deposit_confirmations_merchant_pub_check CHECK ((length(merchant_pub) = 32))
-);
-
-
---
--- Name: TABLE deposit_confirmations; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.deposit_confirmations IS 'deposit confirmation sent to us by merchants; we must check that the exchange reported these properly.';
-
-
---
--- Name: deposit_confirmations_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.deposit_confirmations_serial_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: deposit_confirmations_serial_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.deposit_confirmations_serial_id_seq OWNED BY public.deposit_confirmations.serial_id;
-
-
---
--- Name: deposits; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.deposits (
+CREATE TABLE exchange.deposits (
deposit_serial_id bigint NOT NULL,
shard bigint NOT NULL,
coin_pub bytea NOT NULL,
@@ -6347,66 +6300,66 @@ PARTITION BY HASH (coin_pub);
--
--- Name: TABLE deposits; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE deposits; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.deposits IS 'Deposits we have received and for which we need to make (aggregate) wire transfers (and manage refunds).';
+COMMENT ON TABLE exchange.deposits IS 'Deposits we have received and for which we need to make (aggregate) wire transfers (and manage refunds).';
--
--- Name: COLUMN deposits.shard; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.shard; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.shard IS 'Used for load sharding in the materialized indices. Should be set based on merchant_pub. 64-bit value because we need an *unsigned* 32-bit value.';
+COMMENT ON COLUMN exchange.deposits.shard IS 'Used for load sharding in the materialized indices. Should be set based on merchant_pub. 64-bit value because we need an *unsigned* 32-bit value.';
--
--- Name: COLUMN deposits.known_coin_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.known_coin_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.known_coin_id IS 'Used for garbage collection';
+COMMENT ON COLUMN exchange.deposits.known_coin_id IS 'Used for garbage collection';
--
--- Name: COLUMN deposits.wire_salt; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.wire_salt; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.wire_salt IS 'Salt used when hashing the payto://-URI to get the h_wire';
+COMMENT ON COLUMN exchange.deposits.wire_salt IS 'Salt used when hashing the payto://-URI to get the h_wire';
--
--- Name: COLUMN deposits.wire_target_h_payto; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.wire_target_h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.wire_target_h_payto IS 'Identifies the target bank account and KYC status';
+COMMENT ON COLUMN exchange.deposits.wire_target_h_payto IS 'Identifies the target bank account and KYC status';
--
--- Name: COLUMN deposits.done; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.done; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.done IS 'Set to TRUE once we have included this deposit in some aggregate wire transfer to the merchant';
+COMMENT ON COLUMN exchange.deposits.done IS 'Set to TRUE once we have included this deposit in some aggregate wire transfer to the merchant';
--
--- Name: COLUMN deposits.extension_blocked; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.extension_blocked; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.extension_blocked IS 'True if the aggregation of the deposit is currently blocked by some extension mechanism. Used to filter out deposits that must not be processed by the canonical deposit logic.';
+COMMENT ON COLUMN exchange.deposits.extension_blocked IS 'True if the aggregation of the deposit is currently blocked by some extension mechanism. Used to filter out deposits that must not be processed by the canonical deposit logic.';
--
--- Name: COLUMN deposits.extension_details_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN deposits.extension_details_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.deposits.extension_details_serial_id IS 'References extensions table, NULL if extensions are not used';
+COMMENT ON COLUMN exchange.deposits.extension_details_serial_id IS 'References extensions table, NULL if extensions are not used';
--
--- Name: deposits_by_ready; Type: TABLE; Schema: public; Owner: -
+-- Name: deposits_by_ready; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.deposits_by_ready (
+CREATE TABLE exchange.deposits_by_ready (
wire_deadline bigint NOT NULL,
shard bigint NOT NULL,
coin_pub bytea NOT NULL,
@@ -6417,31 +6370,31 @@ PARTITION BY RANGE (wire_deadline);
--
--- Name: TABLE deposits_by_ready; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE deposits_by_ready; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.deposits_by_ready IS 'Enables fast lookups for deposits_get_ready, auto-populated via TRIGGER below';
+COMMENT ON TABLE exchange.deposits_by_ready IS 'Enables fast lookups for deposits_get_ready, auto-populated via TRIGGER below';
--
--- Name: deposits_by_ready_default; Type: TABLE; Schema: public; Owner: -
+-- Name: deposits_by_ready_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.deposits_by_ready_default (
+CREATE TABLE exchange.deposits_by_ready_default (
wire_deadline bigint NOT NULL,
shard bigint NOT NULL,
coin_pub bytea NOT NULL,
deposit_serial_id bigint,
CONSTRAINT deposits_by_ready_coin_pub_check CHECK ((length(coin_pub) = 32))
);
-ALTER TABLE ONLY public.deposits_by_ready ATTACH PARTITION public.deposits_by_ready_default DEFAULT;
+ALTER TABLE ONLY exchange.deposits_by_ready ATTACH PARTITION exchange.deposits_by_ready_default DEFAULT;
--
--- Name: deposits_default; Type: TABLE; Schema: public; Owner: -
+-- Name: deposits_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.deposits_default (
+CREATE TABLE exchange.deposits_default (
deposit_serial_id bigint NOT NULL,
shard bigint NOT NULL,
coin_pub bytea NOT NULL,
@@ -6467,15 +6420,15 @@ CREATE TABLE public.deposits_default (
CONSTRAINT deposits_wire_salt_check CHECK ((length(wire_salt) = 16)),
CONSTRAINT deposits_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32))
);
-ALTER TABLE ONLY public.deposits ATTACH PARTITION public.deposits_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.deposits ATTACH PARTITION exchange.deposits_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: deposits_deposit_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: deposits_deposit_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.deposits ALTER COLUMN deposit_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.deposits_deposit_serial_id_seq
+ALTER TABLE exchange.deposits ALTER COLUMN deposit_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.deposits_deposit_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6485,10 +6438,10 @@ ALTER TABLE public.deposits ALTER COLUMN deposit_serial_id ADD GENERATED BY DEFA
--
--- Name: deposits_for_matching; Type: TABLE; Schema: public; Owner: -
+-- Name: deposits_for_matching; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.deposits_for_matching (
+CREATE TABLE exchange.deposits_for_matching (
refund_deadline bigint NOT NULL,
merchant_pub bytea NOT NULL,
coin_pub bytea NOT NULL,
@@ -6500,17 +6453,17 @@ PARTITION BY RANGE (refund_deadline);
--
--- Name: TABLE deposits_for_matching; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE deposits_for_matching; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.deposits_for_matching IS 'Enables fast lookups for deposits_iterate_matching, auto-populated via TRIGGER below';
+COMMENT ON TABLE exchange.deposits_for_matching IS 'Enables fast lookups for deposits_iterate_matching, auto-populated via TRIGGER below';
--
--- Name: deposits_for_matching_default; Type: TABLE; Schema: public; Owner: -
+-- Name: deposits_for_matching_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.deposits_for_matching_default (
+CREATE TABLE exchange.deposits_for_matching_default (
refund_deadline bigint NOT NULL,
merchant_pub bytea NOT NULL,
coin_pub bytea NOT NULL,
@@ -6518,86 +6471,14 @@ CREATE TABLE public.deposits_for_matching_default (
CONSTRAINT deposits_for_matching_coin_pub_check CHECK ((length(coin_pub) = 32)),
CONSTRAINT deposits_for_matching_merchant_pub_check CHECK ((length(merchant_pub) = 32))
);
-ALTER TABLE ONLY public.deposits_for_matching ATTACH PARTITION public.deposits_for_matching_default DEFAULT;
+ALTER TABLE ONLY exchange.deposits_for_matching ATTACH PARTITION exchange.deposits_for_matching_default DEFAULT;
--
--- Name: django_content_type; Type: TABLE; Schema: public; Owner: -
+-- Name: exchange_sign_keys; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.django_content_type (
- id integer NOT NULL,
- app_label character varying(100) NOT NULL,
- model character varying(100) NOT NULL
-);
-
-
---
--- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.django_content_type_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: django_content_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.django_content_type_id_seq OWNED BY public.django_content_type.id;
-
-
---
--- Name: django_migrations; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.django_migrations (
- id bigint NOT NULL,
- app character varying(255) NOT NULL,
- name character varying(255) NOT NULL,
- applied timestamp with time zone NOT NULL
-);
-
-
---
--- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.django_migrations_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.django_migrations_id_seq OWNED BY public.django_migrations.id;
-
-
---
--- Name: django_session; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.django_session (
- session_key character varying(40) NOT NULL,
- session_data text NOT NULL,
- expire_date timestamp with time zone NOT NULL
-);
-
-
---
--- Name: exchange_sign_keys; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.exchange_sign_keys (
+CREATE TABLE exchange.exchange_sign_keys (
esk_serial bigint NOT NULL,
exchange_pub bytea NOT NULL,
master_sig bytea NOT NULL,
@@ -6610,53 +6491,53 @@ CREATE TABLE public.exchange_sign_keys (
--
--- Name: TABLE exchange_sign_keys; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE exchange_sign_keys; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.exchange_sign_keys IS 'Table with master public key signatures on exchange online signing keys.';
+COMMENT ON TABLE exchange.exchange_sign_keys IS 'Table with master public key signatures on exchange online signing keys.';
--
--- Name: COLUMN exchange_sign_keys.exchange_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN exchange_sign_keys.exchange_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.exchange_sign_keys.exchange_pub IS 'Public online signing key of the exchange.';
+COMMENT ON COLUMN exchange.exchange_sign_keys.exchange_pub IS 'Public online signing key of the exchange.';
--
--- Name: COLUMN exchange_sign_keys.master_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN exchange_sign_keys.master_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.exchange_sign_keys.master_sig IS 'Signature affirming the validity of the signing key of purpose TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY.';
+COMMENT ON COLUMN exchange.exchange_sign_keys.master_sig IS 'Signature affirming the validity of the signing key of purpose TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY.';
--
--- Name: COLUMN exchange_sign_keys.valid_from; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN exchange_sign_keys.valid_from; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.exchange_sign_keys.valid_from IS 'Time when this online signing key will first be used to sign messages.';
+COMMENT ON COLUMN exchange.exchange_sign_keys.valid_from IS 'Time when this online signing key will first be used to sign messages.';
--
--- Name: COLUMN exchange_sign_keys.expire_sign; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN exchange_sign_keys.expire_sign; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.exchange_sign_keys.expire_sign IS 'Time when this online signing key will no longer be used to sign.';
+COMMENT ON COLUMN exchange.exchange_sign_keys.expire_sign IS 'Time when this online signing key will no longer be used to sign.';
--
--- Name: COLUMN exchange_sign_keys.expire_legal; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN exchange_sign_keys.expire_legal; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.exchange_sign_keys.expire_legal IS 'Time when this online signing key legally expires.';
+COMMENT ON COLUMN exchange.exchange_sign_keys.expire_legal IS 'Time when this online signing key legally expires.';
--
--- Name: exchange_sign_keys_esk_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: exchange_sign_keys_esk_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.exchange_sign_keys ALTER COLUMN esk_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.exchange_sign_keys_esk_serial_seq
+ALTER TABLE exchange.exchange_sign_keys ALTER COLUMN esk_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.exchange_sign_keys_esk_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6666,10 +6547,10 @@ ALTER TABLE public.exchange_sign_keys ALTER COLUMN esk_serial ADD GENERATED BY D
--
--- Name: extension_details; Type: TABLE; Schema: public; Owner: -
+-- Name: extension_details; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.extension_details (
+CREATE TABLE exchange.extension_details (
extension_details_serial_id bigint NOT NULL,
extension_options character varying
)
@@ -6677,36 +6558,36 @@ PARTITION BY HASH (extension_details_serial_id);
--
--- Name: TABLE extension_details; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE extension_details; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.extension_details IS 'Extensions that were provided with deposits (not yet used).';
+COMMENT ON TABLE exchange.extension_details IS 'Extensions that were provided with deposits (not yet used).';
--
--- Name: COLUMN extension_details.extension_options; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN extension_details.extension_options; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.extension_details.extension_options IS 'JSON object with options set that the exchange needs to consider when executing a deposit. Supported details depend on the extensions supported by the exchange.';
+COMMENT ON COLUMN exchange.extension_details.extension_options IS 'JSON object with options set that the exchange needs to consider when executing a deposit. Supported details depend on the extensions supported by the exchange.';
--
--- Name: extension_details_default; Type: TABLE; Schema: public; Owner: -
+-- Name: extension_details_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.extension_details_default (
+CREATE TABLE exchange.extension_details_default (
extension_details_serial_id bigint NOT NULL,
extension_options character varying
);
-ALTER TABLE ONLY public.extension_details ATTACH PARTITION public.extension_details_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.extension_details ATTACH PARTITION exchange.extension_details_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: extension_details_extension_details_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: extension_details_extension_details_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.extension_details ALTER COLUMN extension_details_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.extension_details_extension_details_serial_id_seq
+ALTER TABLE exchange.extension_details ALTER COLUMN extension_details_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.extension_details_extension_details_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6716,10 +6597,10 @@ ALTER TABLE public.extension_details ALTER COLUMN extension_details_serial_id AD
--
--- Name: extensions; Type: TABLE; Schema: public; Owner: -
+-- Name: extensions; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.extensions (
+CREATE TABLE exchange.extensions (
extension_id bigint NOT NULL,
name character varying NOT NULL,
config bytea
@@ -6727,32 +6608,32 @@ CREATE TABLE public.extensions (
--
--- Name: TABLE extensions; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE extensions; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.extensions IS 'Configurations of the activated extensions';
+COMMENT ON TABLE exchange.extensions IS 'Configurations of the activated extensions';
--
--- Name: COLUMN extensions.name; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN extensions.name; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.extensions.name IS 'Name of the extension';
+COMMENT ON COLUMN exchange.extensions.name IS 'Name of the extension';
--
--- Name: COLUMN extensions.config; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN extensions.config; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.extensions.config IS 'Configuration of the extension as JSON-blob, maybe NULL';
+COMMENT ON COLUMN exchange.extensions.config IS 'Configuration of the extension as JSON-blob, maybe NULL';
--
--- Name: extensions_extension_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: extensions_extension_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.extensions ALTER COLUMN extension_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.extensions_extension_id_seq
+ALTER TABLE exchange.extensions ALTER COLUMN extension_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.extensions_extension_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6762,10 +6643,10 @@ ALTER TABLE public.extensions ALTER COLUMN extension_id ADD GENERATED BY DEFAULT
--
--- Name: global_fee; Type: TABLE; Schema: public; Owner: -
+-- Name: global_fee; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.global_fee (
+CREATE TABLE exchange.global_fee (
global_fee_serial bigint NOT NULL,
start_date bigint NOT NULL,
end_date bigint NOT NULL,
@@ -6787,25 +6668,25 @@ CREATE TABLE public.global_fee (
--
--- Name: TABLE global_fee; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE global_fee; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.global_fee IS 'list of the global fees of this exchange, by date';
+COMMENT ON TABLE exchange.global_fee IS 'list of the global fees of this exchange, by date';
--
--- Name: COLUMN global_fee.global_fee_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN global_fee.global_fee_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.global_fee.global_fee_serial IS 'needed for exchange-auditor replication logic';
+COMMENT ON COLUMN exchange.global_fee.global_fee_serial IS 'needed for exchange-auditor replication logic';
--
--- Name: global_fee_global_fee_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: global_fee_global_fee_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.global_fee ALTER COLUMN global_fee_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.global_fee_global_fee_serial_seq
+ALTER TABLE exchange.global_fee ALTER COLUMN global_fee_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.global_fee_global_fee_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6815,10 +6696,11 @@ ALTER TABLE public.global_fee ALTER COLUMN global_fee_serial ADD GENERATED BY DE
--
--- Name: history_requests; Type: TABLE; Schema: public; Owner: -
+-- Name: history_requests; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.history_requests (
+CREATE TABLE exchange.history_requests (
+ history_request_serial_id bigint NOT NULL,
reserve_pub bytea NOT NULL,
request_timestamp bigint NOT NULL,
reserve_sig bytea NOT NULL,
@@ -6831,38 +6713,39 @@ PARTITION BY HASH (reserve_pub);
--
--- Name: TABLE history_requests; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE history_requests; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.history_requests IS 'Paid history requests issued by a client against a reserve';
+COMMENT ON TABLE exchange.history_requests IS 'Paid history requests issued by a client against a reserve';
--
--- Name: COLUMN history_requests.request_timestamp; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN history_requests.request_timestamp; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.history_requests.request_timestamp IS 'When was the history request made';
+COMMENT ON COLUMN exchange.history_requests.request_timestamp IS 'When was the history request made';
--
--- Name: COLUMN history_requests.reserve_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN history_requests.reserve_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.history_requests.reserve_sig IS 'Signature approving payment for the history request';
+COMMENT ON COLUMN exchange.history_requests.reserve_sig IS 'Signature approving payment for the history request';
--
--- Name: COLUMN history_requests.history_fee_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN history_requests.history_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.history_requests.history_fee_val IS 'History fee approved by the signature';
+COMMENT ON COLUMN exchange.history_requests.history_fee_val IS 'History fee approved by the signature';
--
--- Name: history_requests_default; Type: TABLE; Schema: public; Owner: -
+-- Name: history_requests_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.history_requests_default (
+CREATE TABLE exchange.history_requests_default (
+ history_request_serial_id bigint NOT NULL,
reserve_pub bytea NOT NULL,
request_timestamp bigint NOT NULL,
reserve_sig bytea NOT NULL,
@@ -6871,21 +6754,35 @@ CREATE TABLE public.history_requests_default (
CONSTRAINT history_requests_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
CONSTRAINT history_requests_reserve_sig_check CHECK ((length(reserve_sig) = 64))
);
-ALTER TABLE ONLY public.history_requests ATTACH PARTITION public.history_requests_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.history_requests ATTACH PARTITION exchange.history_requests_default FOR VALUES WITH (modulus 1, remainder 0);
+
+
+--
+-- Name: history_requests_history_request_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
+--
+
+ALTER TABLE exchange.history_requests ALTER COLUMN history_request_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.history_requests_history_request_serial_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
--
--- Name: known_coins; Type: TABLE; Schema: public; Owner: -
+-- Name: known_coins; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.known_coins (
+CREATE TABLE exchange.known_coins (
known_coin_id bigint NOT NULL,
denominations_serial bigint NOT NULL,
coin_pub bytea NOT NULL,
age_commitment_hash bytea,
denom_sig bytea NOT NULL,
- remaining_val bigint NOT NULL,
- remaining_frac integer NOT NULL,
+ remaining_val bigint DEFAULT 0 NOT NULL,
+ remaining_frac integer DEFAULT 0 NOT NULL,
CONSTRAINT known_coins_age_commitment_hash_check CHECK ((length(age_commitment_hash) = 32)),
CONSTRAINT known_coins_coin_pub_check CHECK ((length(coin_pub) = 32))
)
@@ -6893,71 +6790,71 @@ PARTITION BY HASH (coin_pub);
--
--- Name: TABLE known_coins; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE known_coins; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.known_coins IS 'information about coins and their signatures, so we do not have to store the signatures more than once if a coin is involved in multiple operations';
+COMMENT ON TABLE exchange.known_coins IS 'information about coins and their signatures, so we do not have to store the signatures more than once if a coin is involved in multiple operations';
--
--- Name: COLUMN known_coins.denominations_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN known_coins.denominations_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.known_coins.denominations_serial IS 'Denomination of the coin, determines the value of the original coin and applicable fees for coin-specific operations.';
+COMMENT ON COLUMN exchange.known_coins.denominations_serial IS 'Denomination of the coin, determines the value of the original coin and applicable fees for coin-specific operations.';
--
--- Name: COLUMN known_coins.coin_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN known_coins.coin_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.known_coins.coin_pub IS 'EdDSA public key of the coin';
+COMMENT ON COLUMN exchange.known_coins.coin_pub IS 'EdDSA public key of the coin';
--
--- Name: COLUMN known_coins.age_commitment_hash; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN known_coins.age_commitment_hash; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.known_coins.age_commitment_hash IS 'Optional hash of the age commitment for age restrictions as per DD 24 (active if denom_type has the respective bit set)';
+COMMENT ON COLUMN exchange.known_coins.age_commitment_hash IS 'Optional hash of the age commitment for age restrictions as per DD 24 (active if denom_type has the respective bit set)';
--
--- Name: COLUMN known_coins.denom_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN known_coins.denom_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.known_coins.denom_sig IS 'This is the signature of the exchange that affirms that the coin is a valid coin. The specific signature type depends on denom_type of the denomination.';
+COMMENT ON COLUMN exchange.known_coins.denom_sig IS 'This is the signature of the exchange that affirms that the coin is a valid coin. The specific signature type depends on denom_type of the denomination.';
--
--- Name: COLUMN known_coins.remaining_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN known_coins.remaining_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.known_coins.remaining_val IS 'Value of the coin that remains to be spent';
+COMMENT ON COLUMN exchange.known_coins.remaining_val IS 'Value of the coin that remains to be spent';
--
--- Name: known_coins_default; Type: TABLE; Schema: public; Owner: -
+-- Name: known_coins_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.known_coins_default (
+CREATE TABLE exchange.known_coins_default (
known_coin_id bigint NOT NULL,
denominations_serial bigint NOT NULL,
coin_pub bytea NOT NULL,
age_commitment_hash bytea,
denom_sig bytea NOT NULL,
- remaining_val bigint NOT NULL,
- remaining_frac integer NOT NULL,
+ remaining_val bigint DEFAULT 0 NOT NULL,
+ remaining_frac integer DEFAULT 0 NOT NULL,
CONSTRAINT known_coins_age_commitment_hash_check CHECK ((length(age_commitment_hash) = 32)),
CONSTRAINT known_coins_coin_pub_check CHECK ((length(coin_pub) = 32))
);
-ALTER TABLE ONLY public.known_coins ATTACH PARTITION public.known_coins_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.known_coins ATTACH PARTITION exchange.known_coins_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: known_coins_known_coin_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: known_coins_known_coin_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.known_coins ALTER COLUMN known_coin_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.known_coins_known_coin_id_seq
+ALTER TABLE exchange.known_coins ALTER COLUMN known_coin_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.known_coins_known_coin_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -6967,274 +6864,124 @@ ALTER TABLE public.known_coins ALTER COLUMN known_coin_id ADD GENERATED BY DEFAU
--
--- Name: merchant_accounts; Type: TABLE; Schema: public; Owner: -
+-- Name: kyc_alerts; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_accounts (
- account_serial bigint NOT NULL,
- merchant_serial bigint NOT NULL,
- h_wire bytea NOT NULL,
- salt bytea NOT NULL,
- payto_uri character varying NOT NULL,
- active boolean NOT NULL,
- CONSTRAINT merchant_accounts_h_wire_check CHECK ((length(h_wire) = 64)),
- CONSTRAINT merchant_accounts_salt_check CHECK ((length(salt) = 16))
+CREATE TABLE exchange.kyc_alerts (
+ h_payto bytea NOT NULL,
+ trigger_type integer NOT NULL,
+ CONSTRAINT kyc_alerts_h_payto_check CHECK ((length(h_payto) = 32))
);
--
--- Name: TABLE merchant_accounts; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE kyc_alerts; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_accounts IS 'bank accounts of the instances';
+COMMENT ON TABLE exchange.kyc_alerts IS 'alerts about completed KYC events reliably notifying other components (even if they are not running)';
--
--- Name: COLUMN merchant_accounts.h_wire; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN kyc_alerts.h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_accounts.h_wire IS 'salted hash of payto_uri';
+COMMENT ON COLUMN exchange.kyc_alerts.h_payto IS 'hash of the payto://-URI for which the KYC status changed';
--
--- Name: COLUMN merchant_accounts.salt; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN kyc_alerts.trigger_type; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_accounts.salt IS 'salt used when hashing payto_uri into h_wire';
+COMMENT ON COLUMN exchange.kyc_alerts.trigger_type IS 'identifies the receiver of the alert, as the same h_payto may require multiple components to be notified';
--
--- Name: COLUMN merchant_accounts.payto_uri; Type: COMMENT; Schema: public; Owner: -
+-- Name: legitimizations; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_accounts.payto_uri IS 'payto URI of a merchant bank account';
-
-
---
--- Name: COLUMN merchant_accounts.active; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_accounts.active IS 'true if we actively use this bank account, false if it is just kept around for older contracts to refer to';
-
-
---
--- Name: merchant_accounts_account_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_accounts ALTER COLUMN account_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_accounts_account_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: merchant_contract_terms; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_contract_terms (
- order_serial bigint NOT NULL,
- merchant_serial bigint NOT NULL,
- order_id character varying NOT NULL,
- contract_terms bytea NOT NULL,
- h_contract_terms bytea NOT NULL,
- creation_time bigint NOT NULL,
- pay_deadline bigint NOT NULL,
- refund_deadline bigint NOT NULL,
- paid boolean DEFAULT false NOT NULL,
- wired boolean DEFAULT false NOT NULL,
- fulfillment_url character varying,
- session_id character varying DEFAULT ''::character varying NOT NULL,
- claim_token bytea NOT NULL,
- CONSTRAINT merchant_contract_terms_claim_token_check CHECK ((length(claim_token) = 16)),
- CONSTRAINT merchant_contract_terms_h_contract_terms_check CHECK ((length(h_contract_terms) = 64))
-);
-
-
---
--- Name: TABLE merchant_contract_terms; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_contract_terms IS 'Contracts are orders that have been claimed by a wallet';
-
-
---
--- Name: COLUMN merchant_contract_terms.merchant_serial; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.merchant_serial IS 'Identifies the instance offering the contract';
-
-
---
--- Name: COLUMN merchant_contract_terms.order_id; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.order_id IS 'Not a foreign key into merchant_orders because paid contracts persist after expiration';
-
-
---
--- Name: COLUMN merchant_contract_terms.contract_terms; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.contract_terms IS 'These contract terms include the wallet nonce';
-
-
---
--- Name: COLUMN merchant_contract_terms.h_contract_terms; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.h_contract_terms IS 'Hash over contract_terms';
-
-
---
--- Name: COLUMN merchant_contract_terms.pay_deadline; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.pay_deadline IS 'How long is the offer valid. After this time, the order can be garbage collected';
-
-
---
--- Name: COLUMN merchant_contract_terms.refund_deadline; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.refund_deadline IS 'By what times do refunds have to be approved (useful to reject refund requests)';
-
-
---
--- Name: COLUMN merchant_contract_terms.paid; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_contract_terms.paid IS 'true implies the customer paid for this contract; order should be DELETEd from merchant_orders once paid is set to release merchant_order_locks; paid remains true even if the payment was later refunded';
+CREATE TABLE exchange.legitimizations (
+ legitimization_serial_id bigint NOT NULL,
+ h_payto bytea NOT NULL,
+ expiration_time bigint DEFAULT 0 NOT NULL,
+ provider_section character varying NOT NULL,
+ provider_user_id character varying,
+ provider_legitimization_id character varying,
+ CONSTRAINT legitimizations_h_payto_check CHECK ((length(h_payto) = 32))
+)
+PARTITION BY HASH (h_payto);
--
--- Name: COLUMN merchant_contract_terms.wired; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE legitimizations; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_contract_terms.wired IS 'true implies the exchange wired us the full amount for all non-refunded payments under this contract';
+COMMENT ON TABLE exchange.legitimizations IS 'List of legitimizations (required and completed) by account and provider';
--
--- Name: COLUMN merchant_contract_terms.fulfillment_url; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN legitimizations.legitimization_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_contract_terms.fulfillment_url IS 'also included in contract_terms, but we need it here to SELECT on it during repurchase detection; can be NULL if the contract has no fulfillment URL';
+COMMENT ON COLUMN exchange.legitimizations.legitimization_serial_id IS 'unique ID for this legitimization process at the exchange';
--
--- Name: COLUMN merchant_contract_terms.session_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN legitimizations.h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_contract_terms.session_id IS 'last session_id from we confirmed the paying client to use, empty string for none';
+COMMENT ON COLUMN exchange.legitimizations.h_payto IS 'foreign key linking the entry to the wire_targets table, NOT a primary key (multiple legitimizations are possible per wire target)';
--
--- Name: COLUMN merchant_contract_terms.claim_token; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN legitimizations.expiration_time; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_contract_terms.claim_token IS 'Token optionally used to access the status of the order. All zeros (not NULL) if not used';
+COMMENT ON COLUMN exchange.legitimizations.expiration_time IS 'in the future if the respective KYC check was passed successfully';
--
--- Name: merchant_deposit_to_transfer; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN legitimizations.provider_section; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_deposit_to_transfer (
- deposit_serial bigint NOT NULL,
- coin_contribution_value_val bigint NOT NULL,
- coin_contribution_value_frac integer NOT NULL,
- credit_serial bigint NOT NULL,
- execution_time bigint NOT NULL,
- signkey_serial bigint NOT NULL,
- exchange_sig bytea NOT NULL,
- CONSTRAINT merchant_deposit_to_transfer_exchange_sig_check CHECK ((length(exchange_sig) = 64))
-);
+COMMENT ON COLUMN exchange.legitimizations.provider_section IS 'Configuration file section with details about this provider';
--
--- Name: TABLE merchant_deposit_to_transfer; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN legitimizations.provider_user_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_deposit_to_transfer IS 'Mapping of deposits to (possibly unconfirmed) wire transfers; NOTE: not used yet';
+COMMENT ON COLUMN exchange.legitimizations.provider_user_id IS 'Identifier for the user at the provider that was used for the legitimization. NULL if provider is unaware.';
--
--- Name: COLUMN merchant_deposit_to_transfer.execution_time; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN legitimizations.provider_legitimization_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_deposit_to_transfer.execution_time IS 'Execution time as claimed by the exchange, roughly matches time seen by merchant';
+COMMENT ON COLUMN exchange.legitimizations.provider_legitimization_id IS 'Identifier for the specific legitimization process at the provider. NULL if legitimization was not started.';
--
--- Name: merchant_deposits; Type: TABLE; Schema: public; Owner: -
+-- Name: legitimizations_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_deposits (
- deposit_serial bigint NOT NULL,
- order_serial bigint,
- deposit_timestamp bigint NOT NULL,
- coin_pub bytea NOT NULL,
- exchange_url character varying NOT NULL,
- amount_with_fee_val bigint NOT NULL,
- amount_with_fee_frac integer NOT NULL,
- deposit_fee_val bigint NOT NULL,
- deposit_fee_frac integer NOT NULL,
- refund_fee_val bigint NOT NULL,
- refund_fee_frac integer NOT NULL,
- wire_fee_val bigint NOT NULL,
- wire_fee_frac integer NOT NULL,
- signkey_serial bigint NOT NULL,
- exchange_sig bytea NOT NULL,
- account_serial bigint NOT NULL,
- CONSTRAINT merchant_deposits_coin_pub_check CHECK ((length(coin_pub) = 32)),
- CONSTRAINT merchant_deposits_exchange_sig_check CHECK ((length(exchange_sig) = 64))
+CREATE TABLE exchange.legitimizations_default (
+ legitimization_serial_id bigint NOT NULL,
+ h_payto bytea NOT NULL,
+ expiration_time bigint DEFAULT 0 NOT NULL,
+ provider_section character varying NOT NULL,
+ provider_user_id character varying,
+ provider_legitimization_id character varying,
+ CONSTRAINT legitimizations_h_payto_check CHECK ((length(h_payto) = 32))
);
+ALTER TABLE ONLY exchange.legitimizations ATTACH PARTITION exchange.legitimizations_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: TABLE merchant_deposits; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_deposits IS 'Refunds approved by the merchant (backoffice) logic, excludes abort refunds';
-
-
---
--- Name: COLUMN merchant_deposits.deposit_timestamp; Type: COMMENT; Schema: public; Owner: -
+-- Name: legitimizations_legitimization_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_deposits.deposit_timestamp IS 'Time when the exchange generated the deposit confirmation';
-
-
---
--- Name: COLUMN merchant_deposits.wire_fee_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_deposits.wire_fee_val IS 'We MAY want to see if we should try to get this via merchant_exchange_wire_fees (not sure, may be too complicated with the date range, etc.)';
-
-
---
--- Name: COLUMN merchant_deposits.signkey_serial; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_deposits.signkey_serial IS 'Online signing key of the exchange on the deposit confirmation';
-
-
---
--- Name: COLUMN merchant_deposits.exchange_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_deposits.exchange_sig IS 'Signature of the exchange over the deposit confirmation';
-
-
---
--- Name: merchant_deposits_deposit_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_deposits ALTER COLUMN deposit_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_deposits_deposit_serial_seq
+ALTER TABLE exchange.legitimizations ALTER COLUMN legitimization_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.legitimizations_legitimization_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -7244,183 +6991,135 @@ ALTER TABLE public.merchant_deposits ALTER COLUMN deposit_serial ADD GENERATED B
--
--- Name: merchant_exchange_signing_keys; Type: TABLE; Schema: public; Owner: -
+-- Name: partner_accounts; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_exchange_signing_keys (
- signkey_serial bigint NOT NULL,
- master_pub bytea NOT NULL,
- exchange_pub bytea NOT NULL,
- start_date bigint NOT NULL,
- expire_date bigint NOT NULL,
- end_date bigint NOT NULL,
- master_sig bytea NOT NULL,
- CONSTRAINT merchant_exchange_signing_keys_exchange_pub_check CHECK ((length(exchange_pub) = 32)),
- CONSTRAINT merchant_exchange_signing_keys_master_pub_check CHECK ((length(master_pub) = 32)),
- CONSTRAINT merchant_exchange_signing_keys_master_sig_check CHECK ((length(master_sig) = 64))
+CREATE TABLE exchange.partner_accounts (
+ payto_uri character varying NOT NULL,
+ partner_serial_id bigint,
+ partner_master_sig bytea,
+ last_seen bigint NOT NULL,
+ CONSTRAINT partner_accounts_partner_master_sig_check CHECK ((length(partner_master_sig) = 64))
);
--
--- Name: TABLE merchant_exchange_signing_keys; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE partner_accounts; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_exchange_signing_keys IS 'Here we store proofs of the exchange online signing keys being signed by the exchange master key';
+COMMENT ON TABLE exchange.partner_accounts IS 'Table with bank accounts of the partner exchange. Entries never expire as we need to remember the signature for the auditor.';
--
--- Name: COLUMN merchant_exchange_signing_keys.master_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partner_accounts.payto_uri; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_exchange_signing_keys.master_pub IS 'Master public key of the exchange with these online signing keys';
+COMMENT ON COLUMN exchange.partner_accounts.payto_uri IS 'payto URI (RFC 8905) with the bank account of the partner exchange.';
--
--- Name: merchant_exchange_signing_keys_signkey_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: COLUMN partner_accounts.partner_master_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER TABLE public.merchant_exchange_signing_keys ALTER COLUMN signkey_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_exchange_signing_keys_signkey_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
+COMMENT ON COLUMN exchange.partner_accounts.partner_master_sig IS 'Signature of purpose TALER_SIGNATURE_MASTER_WIRE_DETAILS by the partner master public key';
--
--- Name: merchant_exchange_wire_fees; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN partner_accounts.last_seen; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_exchange_wire_fees (
- wirefee_serial bigint NOT NULL,
- master_pub bytea NOT NULL,
- h_wire_method bytea NOT NULL,
+COMMENT ON COLUMN exchange.partner_accounts.last_seen IS 'Last time we saw this account as being active at the partner exchange. Used to select the most recent entry, and to detect when we should check again.';
+
+
+--
+-- Name: partners; Type: TABLE; Schema: exchange; Owner: -
+--
+
+CREATE TABLE exchange.partners (
+ partner_serial_id bigint NOT NULL,
+ partner_master_pub bytea NOT NULL,
start_date bigint NOT NULL,
end_date bigint NOT NULL,
- wire_fee_val bigint NOT NULL,
- wire_fee_frac integer NOT NULL,
- closing_fee_val bigint NOT NULL,
- closing_fee_frac integer NOT NULL,
+ next_wad bigint DEFAULT 0 NOT NULL,
+ wad_frequency bigint NOT NULL,
wad_fee_val bigint NOT NULL,
wad_fee_frac integer NOT NULL,
master_sig bytea NOT NULL,
- CONSTRAINT merchant_exchange_wire_fees_h_wire_method_check CHECK ((length(h_wire_method) = 64)),
- CONSTRAINT merchant_exchange_wire_fees_master_pub_check CHECK ((length(master_pub) = 32)),
- CONSTRAINT merchant_exchange_wire_fees_master_sig_check CHECK ((length(master_sig) = 64))
+ partner_base_url text NOT NULL,
+ CONSTRAINT partners_master_sig_check CHECK ((length(master_sig) = 64)),
+ CONSTRAINT partners_partner_master_pub_check CHECK ((length(partner_master_pub) = 32))
);
--
--- Name: TABLE merchant_exchange_wire_fees; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE partners; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_exchange_wire_fees IS 'Here we store proofs of the wire fee structure of the various exchanges';
+COMMENT ON TABLE exchange.partners IS 'exchanges we do wad transfers to';
--
--- Name: COLUMN merchant_exchange_wire_fees.master_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.partner_master_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_exchange_wire_fees.master_pub IS 'Master public key of the exchange with these wire fees';
-
-
---
--- Name: merchant_exchange_wire_fees_wirefee_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_exchange_wire_fees ALTER COLUMN wirefee_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_exchange_wire_fees_wirefee_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: merchant_instances; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_instances (
- merchant_serial bigint NOT NULL,
- merchant_pub bytea NOT NULL,
- auth_hash bytea,
- auth_salt bytea,
- merchant_id character varying NOT NULL,
- merchant_name character varying NOT NULL,
- address bytea NOT NULL,
- jurisdiction bytea NOT NULL,
- default_max_deposit_fee_val bigint NOT NULL,
- default_max_deposit_fee_frac integer NOT NULL,
- default_max_wire_fee_val bigint NOT NULL,
- default_max_wire_fee_frac integer NOT NULL,
- default_wire_fee_amortization integer NOT NULL,
- default_wire_transfer_delay bigint NOT NULL,
- default_pay_delay bigint NOT NULL,
- CONSTRAINT merchant_instances_auth_hash_check CHECK ((length(auth_hash) = 64)),
- CONSTRAINT merchant_instances_auth_salt_check CHECK ((length(auth_salt) = 32)),
- CONSTRAINT merchant_instances_merchant_pub_check CHECK ((length(merchant_pub) = 32))
-);
+COMMENT ON COLUMN exchange.partners.partner_master_pub IS 'offline master public key of the partner';
--
--- Name: TABLE merchant_instances; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.start_date; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_instances IS 'all the instances supported by this backend';
+COMMENT ON COLUMN exchange.partners.start_date IS 'starting date of the partnership';
--
--- Name: COLUMN merchant_instances.auth_hash; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.end_date; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_instances.auth_hash IS 'hash used for merchant back office Authorization, NULL for no check';
+COMMENT ON COLUMN exchange.partners.end_date IS 'end date of the partnership';
--
--- Name: COLUMN merchant_instances.auth_salt; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.next_wad; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_instances.auth_salt IS 'salt to use when hashing Authorization header before comparing with auth_hash';
+COMMENT ON COLUMN exchange.partners.next_wad IS 'at what time should we do the next wad transfer to this partner (frequently updated); set to forever after the end_date';
--
--- Name: COLUMN merchant_instances.merchant_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.wad_frequency; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_instances.merchant_id IS 'identifier of the merchant as used in the base URL (required)';
+COMMENT ON COLUMN exchange.partners.wad_frequency IS 'how often do we promise to do wad transfers';
--
--- Name: COLUMN merchant_instances.merchant_name; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.wad_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_instances.merchant_name IS 'legal name of the merchant as a simple string (required)';
+COMMENT ON COLUMN exchange.partners.wad_fee_val IS 'how high is the fee for a wallet to be added to a wad to this partner';
--
--- Name: COLUMN merchant_instances.address; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.master_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_instances.address IS 'physical address of the merchant as a Location in JSON format (required)';
+COMMENT ON COLUMN exchange.partners.master_sig IS 'signature of our master public key affirming the partnership, of purpose TALER_SIGNATURE_MASTER_PARTNER_DETAILS';
--
--- Name: COLUMN merchant_instances.jurisdiction; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN partners.partner_base_url; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_instances.jurisdiction IS 'jurisdiction of the merchant as a Location in JSON format (required)';
+COMMENT ON COLUMN exchange.partners.partner_base_url IS 'base URL of the REST API for this partner';
--
--- Name: merchant_instances_merchant_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: partners_partner_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.merchant_instances ALTER COLUMN merchant_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_instances_merchant_serial_seq
+ALTER TABLE exchange.partners ALTER COLUMN partner_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.partners_partner_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -7430,160 +7129,67 @@ ALTER TABLE public.merchant_instances ALTER COLUMN merchant_serial ADD GENERATED
--
--- Name: merchant_inventory; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_inventory (
- product_serial bigint NOT NULL,
- merchant_serial bigint NOT NULL,
- product_id character varying NOT NULL,
- description character varying NOT NULL,
- description_i18n bytea NOT NULL,
- unit character varying NOT NULL,
- image bytea NOT NULL,
- taxes bytea NOT NULL,
- price_val bigint NOT NULL,
- price_frac integer NOT NULL,
- total_stock bigint NOT NULL,
- total_sold bigint DEFAULT 0 NOT NULL,
- total_lost bigint DEFAULT 0 NOT NULL,
- address bytea NOT NULL,
- next_restock bigint NOT NULL,
- minimum_age integer DEFAULT 0 NOT NULL
-);
-
-
---
--- Name: TABLE merchant_inventory; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_inventory IS 'products offered by the merchant (may be incomplete, frontend can override)';
-
-
---
--- Name: COLUMN merchant_inventory.description; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.description IS 'Human-readable product description';
-
-
---
--- Name: COLUMN merchant_inventory.description_i18n; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.description_i18n IS 'JSON map from IETF BCP 47 language tags to localized descriptions';
-
-
---
--- Name: COLUMN merchant_inventory.unit; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.unit IS 'Unit of sale for the product (liters, kilograms, packages)';
-
-
---
--- Name: COLUMN merchant_inventory.image; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.image IS 'NOT NULL, but can be 0 bytes; must contain an ImageDataUrl';
-
-
---
--- Name: COLUMN merchant_inventory.taxes; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.taxes IS 'JSON array containing taxes the merchant pays, must be JSON, but can be just "[]"';
-
-
---
--- Name: COLUMN merchant_inventory.price_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.price_val IS 'Current price of one unit of the product';
-
-
---
--- Name: COLUMN merchant_inventory.total_stock; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory.total_stock IS 'A value of -1 is used for unlimited (electronic good), may never be lowered';
-
-
---
--- Name: COLUMN merchant_inventory.total_sold; Type: COMMENT; Schema: public; Owner: -
+-- Name: prewire; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_inventory.total_sold IS 'Number of products sold, must be below total_stock, non-negative, may never be lowered';
+CREATE TABLE exchange.prewire (
+ prewire_uuid bigint NOT NULL,
+ wire_method text NOT NULL,
+ finished boolean DEFAULT false NOT NULL,
+ failed boolean DEFAULT false NOT NULL,
+ buf bytea NOT NULL
+)
+PARTITION BY HASH (prewire_uuid);
--
--- Name: COLUMN merchant_inventory.total_lost; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE prewire; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_inventory.total_lost IS 'Number of products that used to be in stock but were lost (spoiled, damaged), may never be lowered; total_stock >= total_sold + total_lost must always hold';
+COMMENT ON TABLE exchange.prewire IS 'pre-commit data for wire transfers we are about to execute';
--
--- Name: COLUMN merchant_inventory.address; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN prewire.finished; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_inventory.address IS 'JSON formatted Location of where the product is stocked';
+COMMENT ON COLUMN exchange.prewire.finished IS 'set to TRUE once bank confirmed receiving the wire transfer request';
--
--- Name: COLUMN merchant_inventory.next_restock; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN prewire.failed; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_inventory.next_restock IS 'GNUnet absolute time indicating when the next restock is expected. 0 for unknown.';
+COMMENT ON COLUMN exchange.prewire.failed IS 'set to TRUE if the bank responded with a non-transient failure to our transfer request';
--
--- Name: COLUMN merchant_inventory.minimum_age; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN prewire.buf; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_inventory.minimum_age IS 'Minimum age of the customer in years, to be used if an exchange supports the age restriction extension.';
+COMMENT ON COLUMN exchange.prewire.buf IS 'serialized data to send to the bank to execute the wire transfer';
--
--- Name: merchant_inventory_locks; Type: TABLE; Schema: public; Owner: -
+-- Name: prewire_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_inventory_locks (
- product_serial bigint NOT NULL,
- lock_uuid bytea NOT NULL,
- total_locked bigint NOT NULL,
- expiration bigint NOT NULL,
- CONSTRAINT merchant_inventory_locks_lock_uuid_check CHECK ((length(lock_uuid) = 16))
+CREATE TABLE exchange.prewire_default (
+ prewire_uuid bigint NOT NULL,
+ wire_method text NOT NULL,
+ finished boolean DEFAULT false NOT NULL,
+ failed boolean DEFAULT false NOT NULL,
+ buf bytea NOT NULL
);
+ALTER TABLE ONLY exchange.prewire ATTACH PARTITION exchange.prewire_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: TABLE merchant_inventory_locks; Type: COMMENT; Schema: public; Owner: -
+-- Name: prewire_prewire_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_inventory_locks IS 'locks on inventory helt by shopping carts; note that locks MAY not be honored if merchants increase total_lost for inventory';
-
-
---
--- Name: COLUMN merchant_inventory_locks.total_locked; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory_locks.total_locked IS 'how many units of the product does this lock reserve';
-
-
---
--- Name: COLUMN merchant_inventory_locks.expiration; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_inventory_locks.expiration IS 'when does this lock automatically expire (if no order is created)';
-
-
---
--- Name: merchant_inventory_product_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_inventory ALTER COLUMN product_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_inventory_product_serial_seq
+ALTER TABLE exchange.prewire ALTER COLUMN prewire_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.prewire_prewire_uuid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -7593,103 +7199,86 @@ ALTER TABLE public.merchant_inventory ALTER COLUMN product_serial ADD GENERATED
--
--- Name: merchant_keys; Type: TABLE; Schema: public; Owner: -
+-- Name: profit_drains; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_keys (
- merchant_priv bytea NOT NULL,
- merchant_serial bigint NOT NULL,
- CONSTRAINT merchant_keys_merchant_priv_check CHECK ((length(merchant_priv) = 32))
-);
-
-
---
--- Name: TABLE merchant_keys; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_keys IS 'private keys of instances that have not been deleted';
-
-
---
--- Name: merchant_kyc; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_kyc (
- kyc_serial_id bigint NOT NULL,
- kyc_timestamp bigint NOT NULL,
- kyc_ok boolean DEFAULT false NOT NULL,
- exchange_sig bytea,
- exchange_pub bytea,
- exchange_kyc_serial bigint DEFAULT 0 NOT NULL,
- account_serial bigint NOT NULL,
- exchange_url character varying NOT NULL,
- CONSTRAINT merchant_kyc_exchange_pub_check CHECK ((length(exchange_pub) = 32)),
- CONSTRAINT merchant_kyc_exchange_sig_check CHECK ((length(exchange_sig) = 64))
+CREATE TABLE exchange.profit_drains (
+ profit_drain_serial_id bigint NOT NULL,
+ wtid bytea NOT NULL,
+ account_section character varying NOT NULL,
+ payto_uri character varying NOT NULL,
+ trigger_date bigint NOT NULL,
+ amount_val bigint NOT NULL,
+ amount_frac bigint NOT NULL,
+ master_sig bytea NOT NULL,
+ executed boolean DEFAULT false NOT NULL,
+ CONSTRAINT profit_drains_master_sig_check CHECK ((length(master_sig) = 64)),
+ CONSTRAINT profit_drains_wtid_check CHECK ((length(wtid) = 32))
);
--
--- Name: TABLE merchant_kyc; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE profit_drains; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_kyc IS 'Status of the KYC process of a merchant account at an exchange';
+COMMENT ON TABLE exchange.profit_drains IS 'transactions to be performed to move profits from the escrow account of the exchange to a regular account';
--
--- Name: COLUMN merchant_kyc.kyc_timestamp; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.wtid; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.kyc_timestamp IS 'Last time we checked our KYC status at the exchange. Useful to re-check if the status is very stale. Also the timestamp used for the exchange signature (if present).';
+COMMENT ON COLUMN exchange.profit_drains.wtid IS 'randomly chosen nonce, unique to prevent double-submission';
--
--- Name: COLUMN merchant_kyc.kyc_ok; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.account_section; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.kyc_ok IS 'true if the KYC check was passed successfully';
+COMMENT ON COLUMN exchange.profit_drains.account_section IS 'specifies the configuration section in the taler-exchange-drain configuration with the wire account to drain';
--
--- Name: COLUMN merchant_kyc.exchange_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.payto_uri; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.exchange_sig IS 'signature of the exchange affirming the KYC passed (or NULL if exchange does not require KYC or not kyc_ok)';
+COMMENT ON COLUMN exchange.profit_drains.payto_uri IS 'specifies the account to be credited';
--
--- Name: COLUMN merchant_kyc.exchange_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.trigger_date; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.exchange_pub IS 'public key used with exchange_sig (or NULL if exchange_sig is NULL)';
+COMMENT ON COLUMN exchange.profit_drains.trigger_date IS 'set by taler-exchange-offline at the time of making the signature; not necessarily the exact date of execution of the wire transfer, just for orientation';
--
--- Name: COLUMN merchant_kyc.exchange_kyc_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.amount_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.exchange_kyc_serial IS 'Number to use in the KYC-endpoints of the exchange to check the KYC status or begin the KYC process. 0 if we do not know it yet.';
+COMMENT ON COLUMN exchange.profit_drains.amount_val IS 'amount to be transferred';
--
--- Name: COLUMN merchant_kyc.account_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.master_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.account_serial IS 'Which bank account of the merchant is the KYC status for';
+COMMENT ON COLUMN exchange.profit_drains.master_sig IS 'EdDSA signature of type TALER_SIGNATURE_MASTER_DRAIN_PROFIT';
--
--- Name: COLUMN merchant_kyc.exchange_url; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN profit_drains.executed; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_kyc.exchange_url IS 'Which exchange base URL is this KYC status valid for';
+COMMENT ON COLUMN exchange.profit_drains.executed IS 'set to TRUE by taler-exchange-drain on execution of the transaction, not replicated to auditor';
--
--- Name: merchant_kyc_kyc_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: profit_drains_profit_drain_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.merchant_kyc ALTER COLUMN kyc_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_kyc_kyc_serial_id_seq
+ALTER TABLE exchange.profit_drains ALTER COLUMN profit_drain_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.profit_drains_profit_drain_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -7699,212 +7288,129 @@ ALTER TABLE public.merchant_kyc ALTER COLUMN kyc_serial_id ADD GENERATED BY DEFA
--
--- Name: merchant_order_locks; Type: TABLE; Schema: public; Owner: -
+-- Name: purse_actions; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_order_locks (
- product_serial bigint NOT NULL,
- total_locked bigint NOT NULL,
- order_serial bigint NOT NULL
+CREATE TABLE exchange.purse_actions (
+ purse_pub bytea NOT NULL,
+ action_date bigint NOT NULL,
+ partner_serial_id bigint,
+ CONSTRAINT purse_actions_purse_pub_check CHECK ((length(purse_pub) = 32))
);
--
--- Name: TABLE merchant_order_locks; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE purse_actions; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_order_locks IS 'locks on orders awaiting claim and payment; note that locks MAY not be honored if merchants increase total_lost for inventory';
+COMMENT ON TABLE exchange.purse_actions IS 'purses awaiting some action by the router';
--
--- Name: COLUMN merchant_order_locks.total_locked; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_actions.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_order_locks.total_locked IS 'how many units of the product does this lock reserve';
+COMMENT ON COLUMN exchange.purse_actions.purse_pub IS 'public (contract) key of the purse';
--
--- Name: merchant_orders; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN purse_actions.action_date; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_orders (
- order_serial bigint NOT NULL,
- merchant_serial bigint NOT NULL,
- order_id character varying NOT NULL,
- claim_token bytea NOT NULL,
- h_post_data bytea NOT NULL,
- pay_deadline bigint NOT NULL,
- creation_time bigint NOT NULL,
- contract_terms bytea NOT NULL,
- CONSTRAINT merchant_orders_claim_token_check CHECK ((length(claim_token) = 16)),
- CONSTRAINT merchant_orders_h_post_data_check CHECK ((length(h_post_data) = 64))
-);
+COMMENT ON COLUMN exchange.purse_actions.action_date IS 'when is the purse ready for action';
--
--- Name: TABLE merchant_orders; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_actions.partner_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_orders IS 'Orders we offered to a customer, but that have not yet been claimed';
+COMMENT ON COLUMN exchange.purse_actions.partner_serial_id IS 'wad target of an outgoing wire transfer, 0 for local, NULL if the purse is unmerged and thus the target is still unknown';
--
--- Name: COLUMN merchant_orders.merchant_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: purse_deposits; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_orders.merchant_serial IS 'Identifies the instance offering the contract';
+CREATE TABLE exchange.purse_deposits (
+ purse_deposit_serial_id bigint NOT NULL,
+ partner_serial_id bigint,
+ purse_pub bytea NOT NULL,
+ coin_pub bytea NOT NULL,
+ amount_with_fee_val bigint NOT NULL,
+ amount_with_fee_frac integer NOT NULL,
+ coin_sig bytea NOT NULL,
+ CONSTRAINT purse_deposits_coin_sig_check CHECK ((length(coin_sig) = 64)),
+ CONSTRAINT purse_deposits_purse_pub_check CHECK ((length(purse_pub) = 32))
+)
+PARTITION BY HASH (purse_pub);
--
--- Name: COLUMN merchant_orders.claim_token; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE purse_deposits; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_orders.claim_token IS 'Token optionally used to authorize the wallet to claim the order. All zeros (not NULL) if not used';
+COMMENT ON TABLE exchange.purse_deposits IS 'Requests depositing coins into a purse';
--
--- Name: COLUMN merchant_orders.h_post_data; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_deposits.partner_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_orders.h_post_data IS 'Hash of the POST request that created this order, for idempotency checks';
+COMMENT ON COLUMN exchange.purse_deposits.partner_serial_id IS 'identifies the partner exchange, NULL in case the target purse lives at this exchange';
--
--- Name: COLUMN merchant_orders.pay_deadline; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_deposits.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_orders.pay_deadline IS 'How long is the offer valid. After this time, the order can be garbage collected';
+COMMENT ON COLUMN exchange.purse_deposits.purse_pub IS 'Public key of the purse';
--
--- Name: COLUMN merchant_orders.contract_terms; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_deposits.coin_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_orders.contract_terms IS 'Claiming changes the contract_terms, hence we have no hash of the terms in this table';
+COMMENT ON COLUMN exchange.purse_deposits.coin_pub IS 'Public key of the coin being deposited';
--
--- Name: merchant_orders_order_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: COLUMN purse_deposits.amount_with_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER TABLE public.merchant_orders ALTER COLUMN order_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_orders_order_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
+COMMENT ON COLUMN exchange.purse_deposits.amount_with_fee_val IS 'Total amount being deposited';
--
--- Name: merchant_refund_proofs; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN purse_deposits.coin_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_refund_proofs (
- refund_serial bigint NOT NULL,
- exchange_sig bytea NOT NULL,
- signkey_serial bigint NOT NULL,
- CONSTRAINT merchant_refund_proofs_exchange_sig_check CHECK ((length(exchange_sig) = 64))
-);
+COMMENT ON COLUMN exchange.purse_deposits.coin_sig IS 'Signature of the coin affirming the deposit into the purse, of type TALER_SIGNATURE_PURSE_DEPOSIT';
--
--- Name: TABLE merchant_refund_proofs; Type: COMMENT; Schema: public; Owner: -
+-- Name: purse_deposits_default; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_refund_proofs IS 'Refunds confirmed by the exchange (not all approved refunds are grabbed by the wallet)';
-
-
---
--- Name: merchant_refunds; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_refunds (
- refund_serial bigint NOT NULL,
- order_serial bigint NOT NULL,
- rtransaction_id bigint NOT NULL,
- refund_timestamp bigint NOT NULL,
+CREATE TABLE exchange.purse_deposits_default (
+ purse_deposit_serial_id bigint NOT NULL,
+ partner_serial_id bigint,
+ purse_pub bytea NOT NULL,
coin_pub bytea NOT NULL,
- reason character varying NOT NULL,
- refund_amount_val bigint NOT NULL,
- refund_amount_frac integer NOT NULL
-);
-
-
---
--- Name: COLUMN merchant_refunds.rtransaction_id; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_refunds.rtransaction_id IS 'Needed for uniqueness in case a refund is increased for the same order';
-
-
---
--- Name: COLUMN merchant_refunds.refund_timestamp; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_refunds.refund_timestamp IS 'Needed for grouping of refunds in the wallet UI; has no semantics in the protocol (only for UX), but should be from the time when the merchant internally approved the refund';
-
-
---
--- Name: merchant_refunds_refund_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_refunds ALTER COLUMN refund_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_refunds_refund_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: merchant_tip_pickup_signatures; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_tip_pickup_signatures (
- pickup_serial bigint NOT NULL,
- coin_offset integer NOT NULL,
- blind_sig bytea NOT NULL
-);
-
-
---
--- Name: TABLE merchant_tip_pickup_signatures; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_tip_pickup_signatures IS 'blind signatures we got from the exchange during the tip pickup';
-
-
---
--- Name: merchant_tip_pickups; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_tip_pickups (
- pickup_serial bigint NOT NULL,
- tip_serial bigint NOT NULL,
- pickup_id bytea NOT NULL,
- amount_val bigint NOT NULL,
- amount_frac integer NOT NULL,
- CONSTRAINT merchant_tip_pickups_pickup_id_check CHECK ((length(pickup_id) = 64))
+ amount_with_fee_val bigint NOT NULL,
+ amount_with_fee_frac integer NOT NULL,
+ coin_sig bytea NOT NULL,
+ CONSTRAINT purse_deposits_coin_sig_check CHECK ((length(coin_sig) = 64)),
+ CONSTRAINT purse_deposits_purse_pub_check CHECK ((length(purse_pub) = 32))
);
+ALTER TABLE ONLY exchange.purse_deposits ATTACH PARTITION exchange.purse_deposits_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: TABLE merchant_tip_pickups; Type: COMMENT; Schema: public; Owner: -
+-- Name: purse_deposits_purse_deposit_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_tip_pickups IS 'tips that have been picked up';
-
-
---
--- Name: merchant_tip_pickups_pickup_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_tip_pickups ALTER COLUMN pickup_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_tip_pickups_pickup_serial_seq
+ALTER TABLE exchange.purse_deposits ALTER COLUMN purse_deposit_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.purse_deposits_purse_deposit_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -7914,497 +7420,89 @@ ALTER TABLE public.merchant_tip_pickups ALTER COLUMN pickup_serial ADD GENERATED
--
--- Name: merchant_tip_reserve_keys; Type: TABLE; Schema: public; Owner: -
+-- Name: purse_merges; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_tip_reserve_keys (
- reserve_serial bigint NOT NULL,
- reserve_priv bytea NOT NULL,
- exchange_url character varying NOT NULL,
- payto_uri character varying,
- CONSTRAINT merchant_tip_reserve_keys_reserve_priv_check CHECK ((length(reserve_priv) = 32))
-);
-
-
---
--- Name: COLUMN merchant_tip_reserve_keys.payto_uri; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tip_reserve_keys.payto_uri IS 'payto:// URI used to fund the reserve, may be NULL once reserve is funded';
-
-
---
--- Name: merchant_tip_reserves; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_tip_reserves (
- reserve_serial bigint NOT NULL,
+CREATE TABLE exchange.purse_merges (
+ purse_merge_request_serial_id bigint NOT NULL,
+ partner_serial_id bigint,
reserve_pub bytea NOT NULL,
- merchant_serial bigint NOT NULL,
- creation_time bigint NOT NULL,
- expiration bigint NOT NULL,
- merchant_initial_balance_val bigint NOT NULL,
- merchant_initial_balance_frac integer NOT NULL,
- exchange_initial_balance_val bigint DEFAULT 0 NOT NULL,
- exchange_initial_balance_frac integer DEFAULT 0 NOT NULL,
- tips_committed_val bigint DEFAULT 0 NOT NULL,
- tips_committed_frac integer DEFAULT 0 NOT NULL,
- tips_picked_up_val bigint DEFAULT 0 NOT NULL,
- tips_picked_up_frac integer DEFAULT 0 NOT NULL,
- CONSTRAINT merchant_tip_reserves_reserve_pub_check CHECK ((length(reserve_pub) = 32))
-);
-
-
---
--- Name: TABLE merchant_tip_reserves; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_tip_reserves IS 'private keys of reserves that have not been deleted';
-
-
---
--- Name: COLUMN merchant_tip_reserves.expiration; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tip_reserves.expiration IS 'FIXME: EXCHANGE API needs to tell us when reserves close if we are to compute this';
-
-
---
--- Name: COLUMN merchant_tip_reserves.merchant_initial_balance_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tip_reserves.merchant_initial_balance_val IS 'Set to the initial balance the merchant told us when creating the reserve';
-
-
---
--- Name: COLUMN merchant_tip_reserves.exchange_initial_balance_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tip_reserves.exchange_initial_balance_val IS 'Set to the initial balance the exchange told us when we queried the reserve status';
-
-
---
--- Name: COLUMN merchant_tip_reserves.tips_committed_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tip_reserves.tips_committed_val IS 'Amount of outstanding approved tips that have not been picked up';
-
-
---
--- Name: COLUMN merchant_tip_reserves.tips_picked_up_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tip_reserves.tips_picked_up_val IS 'Total amount tips that have been picked up from this reserve';
-
-
---
--- Name: merchant_tip_reserves_reserve_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_tip_reserves ALTER COLUMN reserve_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_tip_reserves_reserve_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: merchant_tips; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_tips (
- tip_serial bigint NOT NULL,
- reserve_serial bigint NOT NULL,
- tip_id bytea NOT NULL,
- justification character varying NOT NULL,
- next_url character varying NOT NULL,
- expiration bigint NOT NULL,
- amount_val bigint NOT NULL,
- amount_frac integer NOT NULL,
- picked_up_val bigint DEFAULT 0 NOT NULL,
- picked_up_frac integer DEFAULT 0 NOT NULL,
- was_picked_up boolean DEFAULT false NOT NULL,
- CONSTRAINT merchant_tips_tip_id_check CHECK ((length(tip_id) = 64))
-);
-
-
---
--- Name: TABLE merchant_tips; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_tips IS 'tips that have been authorized';
-
-
---
--- Name: COLUMN merchant_tips.reserve_serial; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tips.reserve_serial IS 'Reserve from which this tip is funded';
-
-
---
--- Name: COLUMN merchant_tips.expiration; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tips.expiration IS 'by when does the client have to pick up the tip';
-
-
---
--- Name: COLUMN merchant_tips.amount_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tips.amount_val IS 'total transaction cost for all coins including withdraw fees';
-
-
---
--- Name: COLUMN merchant_tips.picked_up_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_tips.picked_up_val IS 'Tip amount left to be picked up';
-
-
---
--- Name: merchant_tips_tip_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.merchant_tips ALTER COLUMN tip_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_tips_tip_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: merchant_transfer_signatures; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_transfer_signatures (
- credit_serial bigint NOT NULL,
- signkey_serial bigint NOT NULL,
- wire_fee_val bigint NOT NULL,
- wire_fee_frac integer NOT NULL,
- credit_amount_val bigint NOT NULL,
- credit_amount_frac integer NOT NULL,
- execution_time bigint NOT NULL,
- exchange_sig bytea NOT NULL,
- CONSTRAINT merchant_transfer_signatures_exchange_sig_check CHECK ((length(exchange_sig) = 64))
-);
-
-
---
--- Name: TABLE merchant_transfer_signatures; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_transfer_signatures IS 'table represents the main information returned from the /transfer request to the exchange.';
-
-
---
--- Name: COLUMN merchant_transfer_signatures.credit_amount_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_transfer_signatures.credit_amount_val IS 'actual value of the (aggregated) wire transfer, excluding the wire fee, according to the exchange';
-
-
---
--- Name: COLUMN merchant_transfer_signatures.execution_time; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_transfer_signatures.execution_time IS 'Execution time as claimed by the exchange, roughly matches time seen by merchant';
-
-
---
--- Name: merchant_transfer_to_coin; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.merchant_transfer_to_coin (
- deposit_serial bigint NOT NULL,
- credit_serial bigint NOT NULL,
- offset_in_exchange_list bigint NOT NULL,
- exchange_deposit_value_val bigint NOT NULL,
- exchange_deposit_value_frac integer NOT NULL,
- exchange_deposit_fee_val bigint NOT NULL,
- exchange_deposit_fee_frac integer NOT NULL
-);
-
-
---
--- Name: TABLE merchant_transfer_to_coin; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.merchant_transfer_to_coin IS 'Mapping of (credit) transfers to (deposited) coins';
-
-
---
--- Name: COLUMN merchant_transfer_to_coin.exchange_deposit_value_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_transfer_to_coin.exchange_deposit_value_val IS 'Deposit value as claimed by the exchange, should match our values in merchant_deposits minus refunds';
-
-
---
--- Name: COLUMN merchant_transfer_to_coin.exchange_deposit_fee_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.merchant_transfer_to_coin.exchange_deposit_fee_val IS 'Deposit value as claimed by the exchange, should match our values in merchant_deposits';
+ purse_pub bytea NOT NULL,
+ merge_sig bytea NOT NULL,
+ merge_timestamp bigint NOT NULL,
+ CONSTRAINT purse_merges_merge_sig_check CHECK ((length(merge_sig) = 64)),
+ CONSTRAINT purse_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
+ CONSTRAINT purse_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32))
+)
+PARTITION BY HASH (purse_pub);
--
--- Name: merchant_transfers; Type: TABLE; Schema: public; Owner: -
+-- Name: TABLE purse_merges; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.merchant_transfers (
- credit_serial bigint NOT NULL,
- exchange_url character varying NOT NULL,
- wtid bytea,
- credit_amount_val bigint NOT NULL,
- credit_amount_frac integer NOT NULL,
- account_serial bigint NOT NULL,
- verified boolean DEFAULT false NOT NULL,
- confirmed boolean DEFAULT false NOT NULL,
- CONSTRAINT merchant_transfers_wtid_check CHECK ((length(wtid) = 32))
-);
+COMMENT ON TABLE exchange.purse_merges IS 'Merge requests where a purse-owner requested merging the purse into the account';
--
--- Name: TABLE merchant_transfers; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_merges.partner_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.merchant_transfers IS 'table represents the information provided by the (trusted) merchant about incoming wire transfers';
+COMMENT ON COLUMN exchange.purse_merges.partner_serial_id IS 'identifies the partner exchange, NULL in case the target reserve lives at this exchange';
--
--- Name: COLUMN merchant_transfers.credit_amount_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_merges.reserve_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_transfers.credit_amount_val IS 'actual value of the (aggregated) wire transfer, excluding the wire fee, according to the merchant';
+COMMENT ON COLUMN exchange.purse_merges.reserve_pub IS 'public key of the target reserve';
--
--- Name: COLUMN merchant_transfers.verified; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_merges.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_transfers.verified IS 'true once we got an acceptable response from the exchange for this transfer';
+COMMENT ON COLUMN exchange.purse_merges.purse_pub IS 'public key of the purse';
--
--- Name: COLUMN merchant_transfers.confirmed; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_merges.merge_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.merchant_transfers.confirmed IS 'true once the merchant confirmed that this transfer was received';
+COMMENT ON COLUMN exchange.purse_merges.merge_sig IS 'signature by the purse private key affirming the merge, of type TALER_SIGNATURE_WALLET_PURSE_MERGE';
--
--- Name: merchant_transfers_credit_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: COLUMN purse_merges.merge_timestamp; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER TABLE public.merchant_transfers ALTER COLUMN credit_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.merchant_transfers_credit_serial_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
+COMMENT ON COLUMN exchange.purse_merges.merge_timestamp IS 'when was the merge message signed';
--
--- Name: partner_accounts; Type: TABLE; Schema: public; Owner: -
+-- Name: purse_merges_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.partner_accounts (
- payto_uri character varying NOT NULL,
+CREATE TABLE exchange.purse_merges_default (
+ purse_merge_request_serial_id bigint NOT NULL,
partner_serial_id bigint,
- partner_master_sig bytea,
- last_seen bigint NOT NULL,
- CONSTRAINT partner_accounts_partner_master_sig_check CHECK ((length(partner_master_sig) = 64))
-);
-
-
---
--- Name: TABLE partner_accounts; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.partner_accounts IS 'Table with bank accounts of the partner exchange. Entries never expire as we need to remember the signature for the auditor.';
-
-
---
--- Name: COLUMN partner_accounts.payto_uri; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partner_accounts.payto_uri IS 'payto URI (RFC 8905) with the bank account of the partner exchange.';
-
-
---
--- Name: COLUMN partner_accounts.partner_master_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partner_accounts.partner_master_sig IS 'Signature of purpose TALER_SIGNATURE_MASTER_WIRE_DETAILS by the partner master public key';
-
-
---
--- Name: COLUMN partner_accounts.last_seen; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partner_accounts.last_seen IS 'Last time we saw this account as being active at the partner exchange. Used to select the most recent entry, and to detect when we should check again.';
-
-
---
--- Name: partners; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.partners (
- partner_serial_id bigint NOT NULL,
- partner_master_pub bytea NOT NULL,
- start_date bigint NOT NULL,
- end_date bigint NOT NULL,
- wad_frequency bigint NOT NULL,
- wad_fee_val bigint NOT NULL,
- wad_fee_frac integer NOT NULL,
- master_sig bytea NOT NULL,
- partner_base_url text NOT NULL,
- CONSTRAINT partners_master_sig_check CHECK ((length(master_sig) = 64)),
- CONSTRAINT partners_partner_master_pub_check CHECK ((length(partner_master_pub) = 32))
-);
-
-
---
--- Name: TABLE partners; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.partners IS 'exchanges we do wad transfers to';
-
-
---
--- Name: COLUMN partners.partner_master_pub; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.partner_master_pub IS 'offline master public key of the partner';
-
-
---
--- Name: COLUMN partners.start_date; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.start_date IS 'starting date of the partnership';
-
-
---
--- Name: COLUMN partners.end_date; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.end_date IS 'end date of the partnership';
-
-
---
--- Name: COLUMN partners.wad_frequency; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.wad_frequency IS 'how often do we promise to do wad transfers';
-
-
---
--- Name: COLUMN partners.wad_fee_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.wad_fee_val IS 'how high is the fee for a wallet to be added to a wad to this partner';
-
-
---
--- Name: COLUMN partners.master_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.master_sig IS 'signature of our master public key affirming the partnership, of purpose TALER_SIGNATURE_MASTER_PARTNER_DETAILS';
-
-
---
--- Name: COLUMN partners.partner_base_url; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.partners.partner_base_url IS 'base URL of the REST API for this partner';
-
-
---
--- Name: partners_partner_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-ALTER TABLE public.partners ALTER COLUMN partner_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.partners_partner_serial_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
-
-
---
--- Name: prewire; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.prewire (
- prewire_uuid bigint NOT NULL,
- wire_method text NOT NULL,
- finished boolean DEFAULT false NOT NULL,
- failed boolean DEFAULT false NOT NULL,
- buf bytea NOT NULL
-)
-PARTITION BY HASH (prewire_uuid);
-
-
---
--- Name: TABLE prewire; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.prewire IS 'pre-commit data for wire transfers we are about to execute';
-
-
---
--- Name: COLUMN prewire.finished; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.prewire.finished IS 'set to TRUE once bank confirmed receiving the wire transfer request';
-
-
---
--- Name: COLUMN prewire.failed; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.prewire.failed IS 'set to TRUE if the bank responded with a non-transient failure to our transfer request';
-
-
---
--- Name: COLUMN prewire.buf; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.prewire.buf IS 'serialized data to send to the bank to execute the wire transfer';
-
-
---
--- Name: prewire_default; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.prewire_default (
- prewire_uuid bigint NOT NULL,
- wire_method text NOT NULL,
- finished boolean DEFAULT false NOT NULL,
- failed boolean DEFAULT false NOT NULL,
- buf bytea NOT NULL
+ reserve_pub bytea NOT NULL,
+ purse_pub bytea NOT NULL,
+ merge_sig bytea NOT NULL,
+ merge_timestamp bigint NOT NULL,
+ CONSTRAINT purse_merges_merge_sig_check CHECK ((length(merge_sig) = 64)),
+ CONSTRAINT purse_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
+ CONSTRAINT purse_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32))
);
-ALTER TABLE ONLY public.prewire ATTACH PARTITION public.prewire_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.purse_merges ATTACH PARTITION exchange.purse_merges_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: prewire_prewire_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: purse_merges_purse_merge_request_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.prewire ALTER COLUMN prewire_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.prewire_prewire_uuid_seq
+ALTER TABLE exchange.purse_merges ALTER COLUMN purse_merge_request_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.purse_merges_purse_merge_request_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -8414,89 +7512,49 @@ ALTER TABLE public.prewire ALTER COLUMN prewire_uuid ADD GENERATED BY DEFAULT AS
--
--- Name: purse_deposits; Type: TABLE; Schema: public; Owner: -
+-- Name: purse_refunds; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.purse_deposits (
- purse_deposit_serial_id bigint NOT NULL,
- partner_serial_id bigint,
+CREATE TABLE exchange.purse_refunds (
+ purse_refunds_serial_id bigint NOT NULL,
purse_pub bytea NOT NULL,
- coin_pub bytea NOT NULL,
- amount_with_fee_val bigint NOT NULL,
- amount_with_fee_frac integer NOT NULL,
- coin_sig bytea NOT NULL,
- CONSTRAINT purse_deposits_coin_sig_check CHECK ((length(coin_sig) = 64)),
- CONSTRAINT purse_deposits_purse_pub_check CHECK ((length(purse_pub) = 32))
+ CONSTRAINT purse_refunds_purse_pub_check CHECK ((length(purse_pub) = 32))
)
PARTITION BY HASH (purse_pub);
--
--- Name: TABLE purse_deposits; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.purse_deposits IS 'Requests depositing coins into a purse';
-
-
---
--- Name: COLUMN purse_deposits.partner_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE purse_refunds; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_deposits.partner_serial_id IS 'identifies the partner exchange, NULL in case the target purse lives at this exchange';
+COMMENT ON TABLE exchange.purse_refunds IS 'Purses that were refunded due to expiration';
--
--- Name: COLUMN purse_deposits.purse_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_refunds.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_deposits.purse_pub IS 'Public key of the purse';
+COMMENT ON COLUMN exchange.purse_refunds.purse_pub IS 'Public key of the purse';
--
--- Name: COLUMN purse_deposits.coin_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: purse_refunds_default; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_deposits.coin_pub IS 'Public key of the coin being deposited';
-
-
---
--- Name: COLUMN purse_deposits.amount_with_fee_val; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.purse_deposits.amount_with_fee_val IS 'Total amount being deposited';
-
-
---
--- Name: COLUMN purse_deposits.coin_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.purse_deposits.coin_sig IS 'Signature of the coin affirming the deposit into the purse, of type TALER_SIGNATURE_PURSE_DEPOSIT';
-
-
---
--- Name: purse_deposits_default; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.purse_deposits_default (
- purse_deposit_serial_id bigint NOT NULL,
- partner_serial_id bigint,
+CREATE TABLE exchange.purse_refunds_default (
+ purse_refunds_serial_id bigint NOT NULL,
purse_pub bytea NOT NULL,
- coin_pub bytea NOT NULL,
- amount_with_fee_val bigint NOT NULL,
- amount_with_fee_frac integer NOT NULL,
- coin_sig bytea NOT NULL,
- CONSTRAINT purse_deposits_coin_sig_check CHECK ((length(coin_sig) = 64)),
- CONSTRAINT purse_deposits_purse_pub_check CHECK ((length(purse_pub) = 32))
+ CONSTRAINT purse_refunds_purse_pub_check CHECK ((length(purse_pub) = 32))
);
-ALTER TABLE ONLY public.purse_deposits ATTACH PARTITION public.purse_deposits_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.purse_refunds ATTACH PARTITION exchange.purse_refunds_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: purse_deposits_purse_deposit_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: purse_refunds_purse_refunds_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.purse_deposits ALTER COLUMN purse_deposit_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.purse_deposits_purse_deposit_serial_id_seq
+ALTER TABLE exchange.purse_refunds ALTER COLUMN purse_refunds_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.purse_refunds_purse_refunds_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -8506,183 +7564,147 @@ ALTER TABLE public.purse_deposits ALTER COLUMN purse_deposit_serial_id ADD GENER
--
--- Name: purse_merges; Type: TABLE; Schema: public; Owner: -
+-- Name: purse_requests; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.purse_merges (
- purse_merge_request_serial_id bigint NOT NULL,
- partner_serial_id bigint,
- reserve_pub bytea NOT NULL,
+CREATE TABLE exchange.purse_requests (
+ purse_requests_serial_id bigint NOT NULL,
purse_pub bytea NOT NULL,
- merge_sig bytea NOT NULL,
- merge_timestamp bigint NOT NULL,
- CONSTRAINT purse_merges_merge_sig_check CHECK ((length(merge_sig) = 64)),
- CONSTRAINT purse_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
- CONSTRAINT purse_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32))
+ merge_pub bytea NOT NULL,
+ purse_creation bigint NOT NULL,
+ purse_expiration bigint NOT NULL,
+ h_contract_terms bytea NOT NULL,
+ age_limit integer NOT NULL,
+ flags integer NOT NULL,
+ refunded boolean DEFAULT false NOT NULL,
+ finished boolean DEFAULT false NOT NULL,
+ in_reserve_quota boolean DEFAULT false NOT NULL,
+ amount_with_fee_val bigint NOT NULL,
+ amount_with_fee_frac integer NOT NULL,
+ purse_fee_val bigint NOT NULL,
+ purse_fee_frac integer NOT NULL,
+ balance_val bigint DEFAULT 0 NOT NULL,
+ balance_frac integer DEFAULT 0 NOT NULL,
+ purse_sig bytea NOT NULL,
+ CONSTRAINT purse_requests_h_contract_terms_check CHECK ((length(h_contract_terms) = 64)),
+ CONSTRAINT purse_requests_merge_pub_check CHECK ((length(merge_pub) = 32)),
+ CONSTRAINT purse_requests_purse_pub_check CHECK ((length(purse_pub) = 32)),
+ CONSTRAINT purse_requests_purse_sig_check CHECK ((length(purse_sig) = 64))
)
PARTITION BY HASH (purse_pub);
--
--- Name: TABLE purse_merges; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE purse_requests; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.purse_merges IS 'Merge requests where a purse-owner requested merging the purse into the account';
+COMMENT ON TABLE exchange.purse_requests IS 'Requests establishing purses, associating them with a contract but without a target reserve';
--
--- Name: COLUMN purse_merges.partner_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_merges.partner_serial_id IS 'identifies the partner exchange, NULL in case the target reserve lives at this exchange';
+COMMENT ON COLUMN exchange.purse_requests.purse_pub IS 'Public key of the purse';
--
--- Name: COLUMN purse_merges.reserve_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.purse_creation; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_merges.reserve_pub IS 'public key of the target reserve';
+COMMENT ON COLUMN exchange.purse_requests.purse_creation IS 'Local time when the purse was created. Determines applicable purse fees.';
--
--- Name: COLUMN purse_merges.purse_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.purse_expiration; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_merges.purse_pub IS 'public key of the purse';
-
-
---
--- Name: COLUMN purse_merges.merge_sig; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.purse_merges.merge_sig IS 'signature by the purse private key affirming the merge, of type TALER_SIGNATURE_WALLET_PURSE_MERGE';
-
-
---
--- Name: COLUMN purse_merges.merge_timestamp; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.purse_merges.merge_timestamp IS 'when was the merge message signed';
-
-
---
--- Name: purse_merges_default; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.purse_merges_default (
- purse_merge_request_serial_id bigint NOT NULL,
- partner_serial_id bigint,
- reserve_pub bytea NOT NULL,
- purse_pub bytea NOT NULL,
- merge_sig bytea NOT NULL,
- merge_timestamp bigint NOT NULL,
- CONSTRAINT purse_merges_merge_sig_check CHECK ((length(merge_sig) = 64)),
- CONSTRAINT purse_merges_purse_pub_check CHECK ((length(purse_pub) = 32)),
- CONSTRAINT purse_merges_reserve_pub_check CHECK ((length(reserve_pub) = 32))
-);
-ALTER TABLE ONLY public.purse_merges ATTACH PARTITION public.purse_merges_default FOR VALUES WITH (modulus 1, remainder 0);
+COMMENT ON COLUMN exchange.purse_requests.purse_expiration IS 'When the purse is set to expire';
--
--- Name: purse_merges_purse_merge_request_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.h_contract_terms; Type: COMMENT; Schema: exchange; Owner: -
--
-ALTER TABLE public.purse_merges ALTER COLUMN purse_merge_request_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.purse_merges_purse_merge_request_serial_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1
-);
+COMMENT ON COLUMN exchange.purse_requests.h_contract_terms IS 'Hash of the contract the parties are to agree to';
--
--- Name: purse_requests; Type: TABLE; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.flags; Type: COMMENT; Schema: exchange; Owner: -
--
-CREATE TABLE public.purse_requests (
- purse_requests_serial_id bigint NOT NULL,
- purse_pub bytea NOT NULL,
- merge_pub bytea NOT NULL,
- purse_expiration bigint NOT NULL,
- h_contract_terms bytea NOT NULL,
- age_limit integer NOT NULL,
- amount_with_fee_val bigint NOT NULL,
- amount_with_fee_frac integer NOT NULL,
- balance_val bigint DEFAULT 0 NOT NULL,
- balance_frac integer DEFAULT 0 NOT NULL,
- purse_sig bytea NOT NULL,
- CONSTRAINT purse_requests_h_contract_terms_check CHECK ((length(h_contract_terms) = 64)),
- CONSTRAINT purse_requests_merge_pub_check CHECK ((length(merge_pub) = 32)),
- CONSTRAINT purse_requests_purse_pub_check CHECK ((length(purse_pub) = 32)),
- CONSTRAINT purse_requests_purse_sig_check CHECK ((length(purse_sig) = 64))
-)
-PARTITION BY HASH (purse_pub);
+COMMENT ON COLUMN exchange.purse_requests.flags IS 'see the enum TALER_WalletAccountMergeFlags';
--
--- Name: TABLE purse_requests; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.refunded; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.purse_requests IS 'Requests establishing purses, associating them with a contract but without a target reserve';
+COMMENT ON COLUMN exchange.purse_requests.refunded IS 'set to TRUE if the purse could not be merged and thus all deposited coins were refunded';
--
--- Name: COLUMN purse_requests.purse_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.finished; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_requests.purse_pub IS 'Public key of the purse';
+COMMENT ON COLUMN exchange.purse_requests.finished IS 'set to TRUE once the purse has been merged (into reserve or wad) or the coins were refunded (transfer aborted)';
--
--- Name: COLUMN purse_requests.purse_expiration; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.in_reserve_quota; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_requests.purse_expiration IS 'When the purse is set to expire';
+COMMENT ON COLUMN exchange.purse_requests.in_reserve_quota IS 'set to TRUE if this purse currently counts against the number of free purses in the respective reserve';
--
--- Name: COLUMN purse_requests.h_contract_terms; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.amount_with_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_requests.h_contract_terms IS 'Hash of the contract the parties are to agree to';
+COMMENT ON COLUMN exchange.purse_requests.amount_with_fee_val IS 'Total amount expected to be in the purse';
--
--- Name: COLUMN purse_requests.amount_with_fee_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.purse_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_requests.amount_with_fee_val IS 'Total amount expected to be in the purse';
+COMMENT ON COLUMN exchange.purse_requests.purse_fee_val IS 'Purse fee the client agreed to pay from the reserve (accepted by the exchange at the time the purse was created). Zero if in_reserve_quota is TRUE.';
--
--- Name: COLUMN purse_requests.balance_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.balance_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_requests.balance_val IS 'Total amount actually in the purse';
+COMMENT ON COLUMN exchange.purse_requests.balance_val IS 'Total amount actually in the purse';
--
--- Name: COLUMN purse_requests.purse_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN purse_requests.purse_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.purse_requests.purse_sig IS 'Signature of the purse affirming the purse parameters, of type TALER_SIGNATURE_PURSE_REQUEST';
+COMMENT ON COLUMN exchange.purse_requests.purse_sig IS 'Signature of the purse affirming the purse parameters, of type TALER_SIGNATURE_PURSE_REQUEST';
--
--- Name: purse_requests_default; Type: TABLE; Schema: public; Owner: -
+-- Name: purse_requests_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.purse_requests_default (
+CREATE TABLE exchange.purse_requests_default (
purse_requests_serial_id bigint NOT NULL,
purse_pub bytea NOT NULL,
merge_pub bytea NOT NULL,
+ purse_creation bigint NOT NULL,
purse_expiration bigint NOT NULL,
h_contract_terms bytea NOT NULL,
age_limit integer NOT NULL,
+ flags integer NOT NULL,
+ refunded boolean DEFAULT false NOT NULL,
+ finished boolean DEFAULT false NOT NULL,
+ in_reserve_quota boolean DEFAULT false NOT NULL,
amount_with_fee_val bigint NOT NULL,
amount_with_fee_frac integer NOT NULL,
+ purse_fee_val bigint NOT NULL,
+ purse_fee_frac integer NOT NULL,
balance_val bigint DEFAULT 0 NOT NULL,
balance_frac integer DEFAULT 0 NOT NULL,
purse_sig bytea NOT NULL,
@@ -8691,15 +7713,15 @@ CREATE TABLE public.purse_requests_default (
CONSTRAINT purse_requests_purse_pub_check CHECK ((length(purse_pub) = 32)),
CONSTRAINT purse_requests_purse_sig_check CHECK ((length(purse_sig) = 64))
);
-ALTER TABLE ONLY public.purse_requests ATTACH PARTITION public.purse_requests_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.purse_requests ATTACH PARTITION exchange.purse_requests_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: purse_requests_purse_requests_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: purse_requests_purse_requests_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.purse_requests ALTER COLUMN purse_requests_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.purse_requests_purse_requests_serial_id_seq
+ALTER TABLE exchange.purse_requests ALTER COLUMN purse_requests_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.purse_requests_purse_requests_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -8709,10 +7731,10 @@ ALTER TABLE public.purse_requests ALTER COLUMN purse_requests_serial_id ADD GENE
--
--- Name: recoup; Type: TABLE; Schema: public; Owner: -
+-- Name: recoup; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.recoup (
+CREATE TABLE exchange.recoup (
recoup_uuid bigint NOT NULL,
coin_pub bytea NOT NULL,
coin_sig bytea NOT NULL,
@@ -8729,45 +7751,45 @@ PARTITION BY HASH (coin_pub);
--
--- Name: TABLE recoup; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE recoup; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.recoup IS 'Information about recoups that were executed between a coin and a reserve. In this type of recoup, the amount is credited back to the reserve from which the coin originated.';
+COMMENT ON TABLE exchange.recoup IS 'Information about recoups that were executed between a coin and a reserve. In this type of recoup, the amount is credited back to the reserve from which the coin originated.';
--
--- Name: COLUMN recoup.coin_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup.coin_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup.coin_pub IS 'Coin that is being debited in the recoup. Do not CASCADE ON DROP on the coin_pub, as we may keep the coin alive!';
+COMMENT ON COLUMN exchange.recoup.coin_pub IS 'Coin that is being debited in the recoup. Do not CASCADE ON DROP on the coin_pub, as we may keep the coin alive!';
--
--- Name: COLUMN recoup.coin_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup.coin_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup.coin_sig IS 'Signature by the coin affirming the recoup, of type TALER_SIGNATURE_WALLET_COIN_RECOUP';
+COMMENT ON COLUMN exchange.recoup.coin_sig IS 'Signature by the coin affirming the recoup, of type TALER_SIGNATURE_WALLET_COIN_RECOUP';
--
--- Name: COLUMN recoup.coin_blind; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup.coin_blind; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup.coin_blind IS 'Denomination blinding key used when creating the blinded coin from the planchet. Secret revealed during the recoup to provide the linkage between the coin and the withdraw operation.';
+COMMENT ON COLUMN exchange.recoup.coin_blind IS 'Denomination blinding key used when creating the blinded coin from the planchet. Secret revealed during the recoup to provide the linkage between the coin and the withdraw operation.';
--
--- Name: COLUMN recoup.reserve_out_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup.reserve_out_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup.reserve_out_serial_id IS 'Identifies the h_blind_ev of the recouped coin and provides the link to the credited reserve.';
+COMMENT ON COLUMN exchange.recoup.reserve_out_serial_id IS 'Identifies the h_blind_ev of the recouped coin and provides the link to the credited reserve.';
--
--- Name: recoup_by_reserve; Type: TABLE; Schema: public; Owner: -
+-- Name: recoup_by_reserve; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.recoup_by_reserve (
+CREATE TABLE exchange.recoup_by_reserve (
reserve_out_serial_id bigint NOT NULL,
coin_pub bytea,
CONSTRAINT recoup_by_reserve_coin_pub_check CHECK ((length(coin_pub) = 32))
@@ -8776,29 +7798,29 @@ PARTITION BY HASH (reserve_out_serial_id);
--
--- Name: TABLE recoup_by_reserve; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE recoup_by_reserve; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.recoup_by_reserve IS 'Information in this table is strictly redundant with that of recoup, but saved by a different primary key for fast lookups by reserve_out_serial_id.';
+COMMENT ON TABLE exchange.recoup_by_reserve IS 'Information in this table is strictly redundant with that of recoup, but saved by a different primary key for fast lookups by reserve_out_serial_id.';
--
--- Name: recoup_by_reserve_default; Type: TABLE; Schema: public; Owner: -
+-- Name: recoup_by_reserve_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.recoup_by_reserve_default (
+CREATE TABLE exchange.recoup_by_reserve_default (
reserve_out_serial_id bigint NOT NULL,
coin_pub bytea,
CONSTRAINT recoup_by_reserve_coin_pub_check CHECK ((length(coin_pub) = 32))
);
-ALTER TABLE ONLY public.recoup_by_reserve ATTACH PARTITION public.recoup_by_reserve_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.recoup_by_reserve ATTACH PARTITION exchange.recoup_by_reserve_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: recoup_default; Type: TABLE; Schema: public; Owner: -
+-- Name: recoup_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.recoup_default (
+CREATE TABLE exchange.recoup_default (
recoup_uuid bigint NOT NULL,
coin_pub bytea NOT NULL,
coin_sig bytea NOT NULL,
@@ -8811,15 +7833,15 @@ CREATE TABLE public.recoup_default (
CONSTRAINT recoup_coin_pub_check CHECK ((length(coin_pub) = 32)),
CONSTRAINT recoup_coin_sig_check CHECK ((length(coin_sig) = 64))
);
-ALTER TABLE ONLY public.recoup ATTACH PARTITION public.recoup_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.recoup ATTACH PARTITION exchange.recoup_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: recoup_recoup_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: recoup_recoup_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.recoup ALTER COLUMN recoup_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.recoup_recoup_uuid_seq
+ALTER TABLE exchange.recoup ALTER COLUMN recoup_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.recoup_recoup_uuid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -8829,10 +7851,10 @@ ALTER TABLE public.recoup ALTER COLUMN recoup_uuid ADD GENERATED BY DEFAULT AS I
--
--- Name: recoup_refresh; Type: TABLE; Schema: public; Owner: -
+-- Name: recoup_refresh; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.recoup_refresh (
+CREATE TABLE exchange.recoup_refresh (
recoup_refresh_uuid bigint NOT NULL,
coin_pub bytea NOT NULL,
known_coin_id bigint NOT NULL,
@@ -8850,45 +7872,45 @@ PARTITION BY HASH (coin_pub);
--
--- Name: TABLE recoup_refresh; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE recoup_refresh; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.recoup_refresh IS 'Table of coins that originated from a refresh operation and that were recouped. Links the (fresh) coin to the melted operation (and thus the old coin). A recoup on a refreshed coin credits the old coin and debits the fresh coin.';
+COMMENT ON TABLE exchange.recoup_refresh IS 'Table of coins that originated from a refresh operation and that were recouped. Links the (fresh) coin to the melted operation (and thus the old coin). A recoup on a refreshed coin credits the old coin and debits the fresh coin.';
--
--- Name: COLUMN recoup_refresh.coin_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup_refresh.coin_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup_refresh.coin_pub IS 'Refreshed coin of a revoked denomination where the residual value is credited to the old coin. Do not CASCADE ON DROP on the coin_pub, as we may keep the coin alive!';
+COMMENT ON COLUMN exchange.recoup_refresh.coin_pub IS 'Refreshed coin of a revoked denomination where the residual value is credited to the old coin. Do not CASCADE ON DROP on the coin_pub, as we may keep the coin alive!';
--
--- Name: COLUMN recoup_refresh.known_coin_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup_refresh.known_coin_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup_refresh.known_coin_id IS 'FIXME: (To be) used for garbage collection (in the future)';
+COMMENT ON COLUMN exchange.recoup_refresh.known_coin_id IS 'FIXME: (To be) used for garbage collection (in the future)';
--
--- Name: COLUMN recoup_refresh.coin_blind; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup_refresh.coin_blind; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup_refresh.coin_blind IS 'Denomination blinding key used when creating the blinded coin from the planchet. Secret revealed during the recoup to provide the linkage between the coin and the refresh operation.';
+COMMENT ON COLUMN exchange.recoup_refresh.coin_blind IS 'Denomination blinding key used when creating the blinded coin from the planchet. Secret revealed during the recoup to provide the linkage between the coin and the refresh operation.';
--
--- Name: COLUMN recoup_refresh.rrc_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN recoup_refresh.rrc_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.recoup_refresh.rrc_serial IS 'Link to the refresh operation. Also identifies the h_blind_ev of the recouped coin (as h_coin_ev).';
+COMMENT ON COLUMN exchange.recoup_refresh.rrc_serial IS 'Link to the refresh operation. Also identifies the h_blind_ev of the recouped coin (as h_coin_ev).';
--
--- Name: recoup_refresh_default; Type: TABLE; Schema: public; Owner: -
+-- Name: recoup_refresh_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.recoup_refresh_default (
+CREATE TABLE exchange.recoup_refresh_default (
recoup_refresh_uuid bigint NOT NULL,
coin_pub bytea NOT NULL,
known_coin_id bigint NOT NULL,
@@ -8902,15 +7924,15 @@ CREATE TABLE public.recoup_refresh_default (
CONSTRAINT recoup_refresh_coin_pub_check CHECK ((length(coin_pub) = 32)),
CONSTRAINT recoup_refresh_coin_sig_check CHECK ((length(coin_sig) = 64))
);
-ALTER TABLE ONLY public.recoup_refresh ATTACH PARTITION public.recoup_refresh_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.recoup_refresh ATTACH PARTITION exchange.recoup_refresh_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: recoup_refresh_recoup_refresh_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: recoup_refresh_recoup_refresh_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.recoup_refresh ALTER COLUMN recoup_refresh_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.recoup_refresh_recoup_refresh_uuid_seq
+ALTER TABLE exchange.recoup_refresh ALTER COLUMN recoup_refresh_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.recoup_refresh_recoup_refresh_uuid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -8920,10 +7942,10 @@ ALTER TABLE public.recoup_refresh ALTER COLUMN recoup_refresh_uuid ADD GENERATED
--
--- Name: refresh_commitments; Type: TABLE; Schema: public; Owner: -
+-- Name: refresh_commitments; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refresh_commitments (
+CREATE TABLE exchange.refresh_commitments (
melt_serial_id bigint NOT NULL,
rc bytea NOT NULL,
old_coin_pub bytea NOT NULL,
@@ -8938,38 +7960,38 @@ PARTITION BY HASH (rc);
--
--- Name: TABLE refresh_commitments; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE refresh_commitments; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.refresh_commitments IS 'Commitments made when melting coins and the gamma value chosen by the exchange.';
+COMMENT ON TABLE exchange.refresh_commitments IS 'Commitments made when melting coins and the gamma value chosen by the exchange.';
--
--- Name: COLUMN refresh_commitments.rc; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_commitments.rc; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_commitments.rc IS 'Commitment made by the client, hash over the various client inputs in the cut-and-choose protocol';
+COMMENT ON COLUMN exchange.refresh_commitments.rc IS 'Commitment made by the client, hash over the various client inputs in the cut-and-choose protocol';
--
--- Name: COLUMN refresh_commitments.old_coin_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_commitments.old_coin_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_commitments.old_coin_pub IS 'Coin being melted in the refresh process.';
+COMMENT ON COLUMN exchange.refresh_commitments.old_coin_pub IS 'Coin being melted in the refresh process.';
--
--- Name: COLUMN refresh_commitments.noreveal_index; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_commitments.noreveal_index; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_commitments.noreveal_index IS 'The gamma value chosen by the exchange in the cut-and-choose protocol';
+COMMENT ON COLUMN exchange.refresh_commitments.noreveal_index IS 'The gamma value chosen by the exchange in the cut-and-choose protocol';
--
--- Name: refresh_commitments_default; Type: TABLE; Schema: public; Owner: -
+-- Name: refresh_commitments_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refresh_commitments_default (
+CREATE TABLE exchange.refresh_commitments_default (
melt_serial_id bigint NOT NULL,
rc bytea NOT NULL,
old_coin_pub bytea NOT NULL,
@@ -8980,15 +8002,15 @@ CREATE TABLE public.refresh_commitments_default (
CONSTRAINT refresh_commitments_old_coin_sig_check CHECK ((length(old_coin_sig) = 64)),
CONSTRAINT refresh_commitments_rc_check CHECK ((length(rc) = 64))
);
-ALTER TABLE ONLY public.refresh_commitments ATTACH PARTITION public.refresh_commitments_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.refresh_commitments ATTACH PARTITION exchange.refresh_commitments_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: refresh_commitments_melt_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: refresh_commitments_melt_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.refresh_commitments ALTER COLUMN melt_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.refresh_commitments_melt_serial_id_seq
+ALTER TABLE exchange.refresh_commitments ALTER COLUMN melt_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.refresh_commitments_melt_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -8998,10 +8020,10 @@ ALTER TABLE public.refresh_commitments ALTER COLUMN melt_serial_id ADD GENERATED
--
--- Name: refresh_revealed_coins; Type: TABLE; Schema: public; Owner: -
+-- Name: refresh_revealed_coins; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refresh_revealed_coins (
+CREATE TABLE exchange.refresh_revealed_coins (
rrc_serial bigint NOT NULL,
melt_serial_id bigint NOT NULL,
freshcoin_index integer NOT NULL,
@@ -9018,66 +8040,66 @@ PARTITION BY HASH (melt_serial_id);
--
--- Name: TABLE refresh_revealed_coins; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE refresh_revealed_coins; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.refresh_revealed_coins IS 'Revelations about the new coins that are to be created during a melting session.';
+COMMENT ON TABLE exchange.refresh_revealed_coins IS 'Revelations about the new coins that are to be created during a melting session.';
--
--- Name: COLUMN refresh_revealed_coins.rrc_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.rrc_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.rrc_serial IS 'needed for exchange-auditor replication logic';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.rrc_serial IS 'needed for exchange-auditor replication logic';
--
--- Name: COLUMN refresh_revealed_coins.melt_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.melt_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.melt_serial_id IS 'Identifies the refresh commitment (rc) of the melt operation.';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.melt_serial_id IS 'Identifies the refresh commitment (rc) of the melt operation.';
--
--- Name: COLUMN refresh_revealed_coins.freshcoin_index; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.freshcoin_index; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.freshcoin_index IS 'index of the fresh coin being created (one melt operation may result in multiple fresh coins)';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.freshcoin_index IS 'index of the fresh coin being created (one melt operation may result in multiple fresh coins)';
--
--- Name: COLUMN refresh_revealed_coins.coin_ev; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.coin_ev; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.coin_ev IS 'envelope of the new coin to be signed';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.coin_ev IS 'envelope of the new coin to be signed';
--
--- Name: COLUMN refresh_revealed_coins.h_coin_ev; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.h_coin_ev; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.h_coin_ev IS 'hash of the envelope of the new coin to be signed (for lookups)';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.h_coin_ev IS 'hash of the envelope of the new coin to be signed (for lookups)';
--
--- Name: COLUMN refresh_revealed_coins.ev_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.ev_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.ev_sig IS 'exchange signature over the envelope';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.ev_sig IS 'exchange signature over the envelope';
--
--- Name: COLUMN refresh_revealed_coins.ewv; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_revealed_coins.ewv; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_revealed_coins.ewv IS 'exchange contributed values in the creation of the fresh coin (see /csr)';
+COMMENT ON COLUMN exchange.refresh_revealed_coins.ewv IS 'exchange contributed values in the creation of the fresh coin (see /csr)';
--
--- Name: refresh_revealed_coins_default; Type: TABLE; Schema: public; Owner: -
+-- Name: refresh_revealed_coins_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refresh_revealed_coins_default (
+CREATE TABLE exchange.refresh_revealed_coins_default (
rrc_serial bigint NOT NULL,
melt_serial_id bigint NOT NULL,
freshcoin_index integer NOT NULL,
@@ -9090,15 +8112,15 @@ CREATE TABLE public.refresh_revealed_coins_default (
CONSTRAINT refresh_revealed_coins_h_coin_ev_check CHECK ((length(h_coin_ev) = 64)),
CONSTRAINT refresh_revealed_coins_link_sig_check CHECK ((length(link_sig) = 64))
);
-ALTER TABLE ONLY public.refresh_revealed_coins ATTACH PARTITION public.refresh_revealed_coins_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.refresh_revealed_coins ATTACH PARTITION exchange.refresh_revealed_coins_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: refresh_revealed_coins_rrc_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: refresh_revealed_coins_rrc_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.refresh_revealed_coins ALTER COLUMN rrc_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.refresh_revealed_coins_rrc_serial_seq
+ALTER TABLE exchange.refresh_revealed_coins ALTER COLUMN rrc_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.refresh_revealed_coins_rrc_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9108,10 +8130,10 @@ ALTER TABLE public.refresh_revealed_coins ALTER COLUMN rrc_serial ADD GENERATED
--
--- Name: refresh_transfer_keys; Type: TABLE; Schema: public; Owner: -
+-- Name: refresh_transfer_keys; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refresh_transfer_keys (
+CREATE TABLE exchange.refresh_transfer_keys (
rtc_serial bigint NOT NULL,
melt_serial_id bigint NOT NULL,
transfer_pub bytea NOT NULL,
@@ -9122,60 +8144,60 @@ PARTITION BY HASH (melt_serial_id);
--
--- Name: TABLE refresh_transfer_keys; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE refresh_transfer_keys; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.refresh_transfer_keys IS 'Transfer keys of a refresh operation (the data revealed to the exchange).';
+COMMENT ON TABLE exchange.refresh_transfer_keys IS 'Transfer keys of a refresh operation (the data revealed to the exchange).';
--
--- Name: COLUMN refresh_transfer_keys.rtc_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_transfer_keys.rtc_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_transfer_keys.rtc_serial IS 'needed for exchange-auditor replication logic';
+COMMENT ON COLUMN exchange.refresh_transfer_keys.rtc_serial IS 'needed for exchange-auditor replication logic';
--
--- Name: COLUMN refresh_transfer_keys.melt_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_transfer_keys.melt_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_transfer_keys.melt_serial_id IS 'Identifies the refresh commitment (rc) of the operation.';
+COMMENT ON COLUMN exchange.refresh_transfer_keys.melt_serial_id IS 'Identifies the refresh commitment (rc) of the operation.';
--
--- Name: COLUMN refresh_transfer_keys.transfer_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_transfer_keys.transfer_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_transfer_keys.transfer_pub IS 'transfer public key for the gamma index';
+COMMENT ON COLUMN exchange.refresh_transfer_keys.transfer_pub IS 'transfer public key for the gamma index';
--
--- Name: COLUMN refresh_transfer_keys.transfer_privs; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refresh_transfer_keys.transfer_privs; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refresh_transfer_keys.transfer_privs IS 'array of TALER_CNC_KAPPA - 1 transfer private keys that have been revealed, with the gamma entry being skipped';
+COMMENT ON COLUMN exchange.refresh_transfer_keys.transfer_privs IS 'array of TALER_CNC_KAPPA - 1 transfer private keys that have been revealed, with the gamma entry being skipped';
--
--- Name: refresh_transfer_keys_default; Type: TABLE; Schema: public; Owner: -
+-- Name: refresh_transfer_keys_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refresh_transfer_keys_default (
+CREATE TABLE exchange.refresh_transfer_keys_default (
rtc_serial bigint NOT NULL,
melt_serial_id bigint NOT NULL,
transfer_pub bytea NOT NULL,
transfer_privs bytea NOT NULL,
CONSTRAINT refresh_transfer_keys_transfer_pub_check CHECK ((length(transfer_pub) = 32))
);
-ALTER TABLE ONLY public.refresh_transfer_keys ATTACH PARTITION public.refresh_transfer_keys_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.refresh_transfer_keys ATTACH PARTITION exchange.refresh_transfer_keys_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: refresh_transfer_keys_rtc_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: refresh_transfer_keys_rtc_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.refresh_transfer_keys ALTER COLUMN rtc_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.refresh_transfer_keys_rtc_serial_seq
+ALTER TABLE exchange.refresh_transfer_keys ALTER COLUMN rtc_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.refresh_transfer_keys_rtc_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9185,10 +8207,10 @@ ALTER TABLE public.refresh_transfer_keys ALTER COLUMN rtc_serial ADD GENERATED B
--
--- Name: refunds; Type: TABLE; Schema: public; Owner: -
+-- Name: refunds; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refunds (
+CREATE TABLE exchange.refunds (
refund_serial_id bigint NOT NULL,
coin_pub bytea NOT NULL,
deposit_serial_id bigint NOT NULL,
@@ -9203,31 +8225,31 @@ PARTITION BY HASH (coin_pub);
--
--- Name: TABLE refunds; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE refunds; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.refunds IS 'Data on coins that were refunded. Technically, refunds always apply against specific deposit operations involving a coin. The combination of coin_pub, merchant_pub, h_contract_terms and rtransaction_id MUST be unique, and we usually select by coin_pub so that one goes first.';
+COMMENT ON TABLE exchange.refunds IS 'Data on coins that were refunded. Technically, refunds always apply against specific deposit operations involving a coin. The combination of coin_pub, merchant_pub, h_contract_terms and rtransaction_id MUST be unique, and we usually select by coin_pub so that one goes first.';
--
--- Name: COLUMN refunds.deposit_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refunds.deposit_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refunds.deposit_serial_id IS 'Identifies ONLY the merchant_pub, h_contract_terms and coin_pub. Multiple deposits may match a refund, this only identifies one of them.';
+COMMENT ON COLUMN exchange.refunds.deposit_serial_id IS 'Identifies ONLY the merchant_pub, h_contract_terms and coin_pub. Multiple deposits may match a refund, this only identifies one of them.';
--
--- Name: COLUMN refunds.rtransaction_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN refunds.rtransaction_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.refunds.rtransaction_id IS 'used by the merchant to make refunds unique in case the same coin for the same deposit gets a subsequent (higher) refund';
+COMMENT ON COLUMN exchange.refunds.rtransaction_id IS 'used by the merchant to make refunds unique in case the same coin for the same deposit gets a subsequent (higher) refund';
--
--- Name: refunds_default; Type: TABLE; Schema: public; Owner: -
+-- Name: refunds_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.refunds_default (
+CREATE TABLE exchange.refunds_default (
refund_serial_id bigint NOT NULL,
coin_pub bytea NOT NULL,
deposit_serial_id bigint NOT NULL,
@@ -9238,15 +8260,15 @@ CREATE TABLE public.refunds_default (
CONSTRAINT refunds_coin_pub_check CHECK ((length(coin_pub) = 32)),
CONSTRAINT refunds_merchant_sig_check CHECK ((length(merchant_sig) = 64))
);
-ALTER TABLE ONLY public.refunds ATTACH PARTITION public.refunds_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.refunds ATTACH PARTITION exchange.refunds_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: refunds_refund_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: refunds_refund_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.refunds ALTER COLUMN refund_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.refunds_refund_serial_id_seq
+ALTER TABLE exchange.refunds ALTER COLUMN refund_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.refunds_refund_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9256,18 +8278,17 @@ ALTER TABLE public.refunds ALTER COLUMN refund_serial_id ADD GENERATED BY DEFAUL
--
--- Name: reserves; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves (
+CREATE TABLE exchange.reserves (
reserve_uuid bigint NOT NULL,
reserve_pub bytea NOT NULL,
- current_balance_val bigint NOT NULL,
- current_balance_frac integer NOT NULL,
+ current_balance_val bigint DEFAULT 0 NOT NULL,
+ current_balance_frac integer DEFAULT 0 NOT NULL,
purses_active bigint DEFAULT 0 NOT NULL,
purses_allowed bigint DEFAULT 0 NOT NULL,
- kyc_required boolean DEFAULT false NOT NULL,
- kyc_passed boolean DEFAULT false NOT NULL,
+ max_age integer DEFAULT 120 NOT NULL,
expiration_date bigint NOT NULL,
gc_date bigint NOT NULL,
CONSTRAINT reserves_reserve_pub_check CHECK ((length(reserve_pub) = 32))
@@ -9276,73 +8297,59 @@ PARTITION BY HASH (reserve_pub);
--
--- Name: TABLE reserves; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE reserves; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.reserves IS 'Summarizes the balance of a reserve. Updated when new funds are added or withdrawn.';
+COMMENT ON TABLE exchange.reserves IS 'Summarizes the balance of a reserve. Updated when new funds are added or withdrawn.';
--
--- Name: COLUMN reserves.reserve_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves.reserve_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.reserve_pub IS 'EdDSA public key of the reserve. Knowledge of the private key implies ownership over the balance.';
+COMMENT ON COLUMN exchange.reserves.reserve_pub IS 'EdDSA public key of the reserve. Knowledge of the private key implies ownership over the balance.';
--
--- Name: COLUMN reserves.current_balance_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves.current_balance_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.current_balance_val IS 'Current balance remaining with the reserve.';
+COMMENT ON COLUMN exchange.reserves.current_balance_val IS 'Current balance remaining with the reserve.';
--
--- Name: COLUMN reserves.purses_active; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves.purses_active; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.purses_active IS 'Number of purses that were created by this reserve that are not expired and not fully paid.';
+COMMENT ON COLUMN exchange.reserves.purses_active IS 'Number of purses that were created by this reserve that are not expired and not fully paid.';
--
--- Name: COLUMN reserves.purses_allowed; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves.purses_allowed; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.purses_allowed IS 'Number of purses that this reserve is allowed to have active at most.';
+COMMENT ON COLUMN exchange.reserves.purses_allowed IS 'Number of purses that this reserve is allowed to have active at most.';
--
--- Name: COLUMN reserves.kyc_required; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves.expiration_date; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.kyc_required IS 'True if a KYC check must have been passed before withdrawing from this reserve. Set to true once a reserve received a P2P payment.';
+COMMENT ON COLUMN exchange.reserves.expiration_date IS 'Used to trigger closing of reserves that have not been drained after some time';
--
--- Name: COLUMN reserves.kyc_passed; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves.gc_date; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.kyc_passed IS 'True once KYC was passed for this reserve. The KYC details are then available via the wire_targets table under the key of wire_target_h_payto which is to be derived from the reserve_pub and the base URL of this exchange.';
+COMMENT ON COLUMN exchange.reserves.gc_date IS 'Used to forget all information about a reserve during garbage collection';
--
--- Name: COLUMN reserves.expiration_date; Type: COMMENT; Schema: public; Owner: -
+-- Name: reserves_close; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves.expiration_date IS 'Used to trigger closing of reserves that have not been drained after some time';
-
-
---
--- Name: COLUMN reserves.gc_date; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON COLUMN public.reserves.gc_date IS 'Used to forget all information about a reserve during garbage collection';
-
-
---
--- Name: reserves_close; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.reserves_close (
+CREATE TABLE exchange.reserves_close (
close_uuid bigint NOT NULL,
reserve_pub bytea NOT NULL,
execution_date bigint NOT NULL,
@@ -9359,25 +8366,25 @@ PARTITION BY HASH (reserve_pub);
--
--- Name: TABLE reserves_close; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE reserves_close; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.reserves_close IS 'wire transfers executed by the reserve to close reserves';
+COMMENT ON TABLE exchange.reserves_close IS 'wire transfers executed by the reserve to close reserves';
--
--- Name: COLUMN reserves_close.wire_target_h_payto; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves_close.wire_target_h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves_close.wire_target_h_payto IS 'Identifies the credited bank account (and KYC status). Note that closing does not depend on KYC.';
+COMMENT ON COLUMN exchange.reserves_close.wire_target_h_payto IS 'Identifies the credited bank account (and KYC status). Note that closing does not depend on KYC.';
--
--- Name: reserves_close_close_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: reserves_close_close_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.reserves_close ALTER COLUMN close_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.reserves_close_close_uuid_seq
+ALTER TABLE exchange.reserves_close ALTER COLUMN close_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.reserves_close_close_uuid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9387,10 +8394,10 @@ ALTER TABLE public.reserves_close ALTER COLUMN close_uuid ADD GENERATED BY DEFAU
--
--- Name: reserves_close_default; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_close_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_close_default (
+CREATE TABLE exchange.reserves_close_default (
close_uuid bigint NOT NULL,
reserve_pub bytea NOT NULL,
execution_date bigint NOT NULL,
@@ -9403,34 +8410,33 @@ CREATE TABLE public.reserves_close_default (
CONSTRAINT reserves_close_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32)),
CONSTRAINT reserves_close_wtid_check CHECK ((length(wtid) = 32))
);
-ALTER TABLE ONLY public.reserves_close ATTACH PARTITION public.reserves_close_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.reserves_close ATTACH PARTITION exchange.reserves_close_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: reserves_default; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_default (
+CREATE TABLE exchange.reserves_default (
reserve_uuid bigint NOT NULL,
reserve_pub bytea NOT NULL,
- current_balance_val bigint NOT NULL,
- current_balance_frac integer NOT NULL,
+ current_balance_val bigint DEFAULT 0 NOT NULL,
+ current_balance_frac integer DEFAULT 0 NOT NULL,
purses_active bigint DEFAULT 0 NOT NULL,
purses_allowed bigint DEFAULT 0 NOT NULL,
- kyc_required boolean DEFAULT false NOT NULL,
- kyc_passed boolean DEFAULT false NOT NULL,
+ max_age integer DEFAULT 120 NOT NULL,
expiration_date bigint NOT NULL,
gc_date bigint NOT NULL,
CONSTRAINT reserves_reserve_pub_check CHECK ((length(reserve_pub) = 32))
);
-ALTER TABLE ONLY public.reserves ATTACH PARTITION public.reserves_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.reserves ATTACH PARTITION exchange.reserves_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: reserves_in; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_in; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_in (
+CREATE TABLE exchange.reserves_in (
reserve_in_serial_id bigint NOT NULL,
reserve_pub bytea NOT NULL,
wire_reference bigint NOT NULL,
@@ -9445,38 +8451,38 @@ PARTITION BY HASH (reserve_pub);
--
--- Name: TABLE reserves_in; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE reserves_in; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.reserves_in IS 'list of transfers of funds into the reserves, one per incoming wire transfer';
+COMMENT ON TABLE exchange.reserves_in IS 'list of transfers of funds into the reserves, one per incoming wire transfer';
--
--- Name: COLUMN reserves_in.reserve_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves_in.reserve_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves_in.reserve_pub IS 'Public key of the reserve. Private key signifies ownership of the remaining balance.';
+COMMENT ON COLUMN exchange.reserves_in.reserve_pub IS 'Public key of the reserve. Private key signifies ownership of the remaining balance.';
--
--- Name: COLUMN reserves_in.credit_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves_in.credit_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves_in.credit_val IS 'Amount that was transferred into the reserve';
+COMMENT ON COLUMN exchange.reserves_in.credit_val IS 'Amount that was transferred into the reserve';
--
--- Name: COLUMN reserves_in.wire_source_h_payto; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves_in.wire_source_h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves_in.wire_source_h_payto IS 'Identifies the debited bank account and KYC status';
+COMMENT ON COLUMN exchange.reserves_in.wire_source_h_payto IS 'Identifies the debited bank account and KYC status';
--
--- Name: reserves_in_default; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_in_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_in_default (
+CREATE TABLE exchange.reserves_in_default (
reserve_in_serial_id bigint NOT NULL,
reserve_pub bytea NOT NULL,
wire_reference bigint NOT NULL,
@@ -9487,15 +8493,15 @@ CREATE TABLE public.reserves_in_default (
execution_date bigint NOT NULL,
CONSTRAINT reserves_in_wire_source_h_payto_check CHECK ((length(wire_source_h_payto) = 32))
);
-ALTER TABLE ONLY public.reserves_in ATTACH PARTITION public.reserves_in_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.reserves_in ATTACH PARTITION exchange.reserves_in_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: reserves_in_reserve_in_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: reserves_in_reserve_in_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.reserves_in ALTER COLUMN reserve_in_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.reserves_in_reserve_in_serial_id_seq
+ALTER TABLE exchange.reserves_in ALTER COLUMN reserve_in_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.reserves_in_reserve_in_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9505,10 +8511,10 @@ ALTER TABLE public.reserves_in ALTER COLUMN reserve_in_serial_id ADD GENERATED B
--
--- Name: reserves_out; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_out; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_out (
+CREATE TABLE exchange.reserves_out (
reserve_out_serial_id bigint NOT NULL,
h_blind_ev bytea,
denominations_serial bigint NOT NULL,
@@ -9525,31 +8531,31 @@ PARTITION BY HASH (h_blind_ev);
--
--- Name: TABLE reserves_out; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE reserves_out; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.reserves_out IS 'Withdraw operations performed on reserves.';
+COMMENT ON TABLE exchange.reserves_out IS 'Withdraw operations performed on reserves.';
--
--- Name: COLUMN reserves_out.h_blind_ev; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves_out.h_blind_ev; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves_out.h_blind_ev IS 'Hash of the blinded coin, used as primary key here so that broken clients that use a non-random coin or blinding factor fail to withdraw (otherwise they would fail on deposit when the coin is not unique there).';
+COMMENT ON COLUMN exchange.reserves_out.h_blind_ev IS 'Hash of the blinded coin, used as primary key here so that broken clients that use a non-random coin or blinding factor fail to withdraw (otherwise they would fail on deposit when the coin is not unique there).';
--
--- Name: COLUMN reserves_out.denominations_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN reserves_out.denominations_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.reserves_out.denominations_serial IS 'We do not CASCADE ON DELETE here, we may keep the denomination data alive';
+COMMENT ON COLUMN exchange.reserves_out.denominations_serial IS 'We do not CASCADE ON DELETE here, we may keep the denomination data alive';
--
--- Name: reserves_out_by_reserve; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_out_by_reserve; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_out_by_reserve (
+CREATE TABLE exchange.reserves_out_by_reserve (
reserve_uuid bigint NOT NULL,
h_blind_ev bytea,
CONSTRAINT reserves_out_by_reserve_h_blind_ev_check CHECK ((length(h_blind_ev) = 64))
@@ -9558,29 +8564,29 @@ PARTITION BY HASH (reserve_uuid);
--
--- Name: TABLE reserves_out_by_reserve; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE reserves_out_by_reserve; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.reserves_out_by_reserve IS 'Information in this table is strictly redundant with that of reserves_out, but saved by a different primary key for fast lookups by reserve public key/uuid.';
+COMMENT ON TABLE exchange.reserves_out_by_reserve IS 'Information in this table is strictly redundant with that of reserves_out, but saved by a different primary key for fast lookups by reserve public key/uuid.';
--
--- Name: reserves_out_by_reserve_default; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_out_by_reserve_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_out_by_reserve_default (
+CREATE TABLE exchange.reserves_out_by_reserve_default (
reserve_uuid bigint NOT NULL,
h_blind_ev bytea,
CONSTRAINT reserves_out_by_reserve_h_blind_ev_check CHECK ((length(h_blind_ev) = 64))
);
-ALTER TABLE ONLY public.reserves_out_by_reserve ATTACH PARTITION public.reserves_out_by_reserve_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.reserves_out_by_reserve ATTACH PARTITION exchange.reserves_out_by_reserve_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: reserves_out_default; Type: TABLE; Schema: public; Owner: -
+-- Name: reserves_out_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.reserves_out_default (
+CREATE TABLE exchange.reserves_out_default (
reserve_out_serial_id bigint NOT NULL,
h_blind_ev bytea,
denominations_serial bigint NOT NULL,
@@ -9593,15 +8599,15 @@ CREATE TABLE public.reserves_out_default (
CONSTRAINT reserves_out_h_blind_ev_check CHECK ((length(h_blind_ev) = 64)),
CONSTRAINT reserves_out_reserve_sig_check CHECK ((length(reserve_sig) = 64))
);
-ALTER TABLE ONLY public.reserves_out ATTACH PARTITION public.reserves_out_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.reserves_out ATTACH PARTITION exchange.reserves_out_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: reserves_out_reserve_out_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: reserves_out_reserve_out_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.reserves_out ALTER COLUMN reserve_out_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.reserves_out_reserve_out_serial_id_seq
+ALTER TABLE exchange.reserves_out ALTER COLUMN reserve_out_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.reserves_out_reserve_out_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9611,11 +8617,11 @@ ALTER TABLE public.reserves_out ALTER COLUMN reserve_out_serial_id ADD GENERATED
--
--- Name: reserves_reserve_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: reserves_reserve_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.reserves ALTER COLUMN reserve_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.reserves_reserve_uuid_seq
+ALTER TABLE exchange.reserves ALTER COLUMN reserve_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.reserves_reserve_uuid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9625,10 +8631,10 @@ ALTER TABLE public.reserves ALTER COLUMN reserve_uuid ADD GENERATED BY DEFAULT A
--
--- Name: revolving_work_shards; Type: TABLE; Schema: public; Owner: -
+-- Name: revolving_work_shards; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE UNLOGGED TABLE public.revolving_work_shards (
+CREATE UNLOGGED TABLE exchange.revolving_work_shards (
shard_serial_id bigint NOT NULL,
last_attempt bigint NOT NULL,
start_row integer NOT NULL,
@@ -9639,60 +8645,60 @@ CREATE UNLOGGED TABLE public.revolving_work_shards (
--
--- Name: TABLE revolving_work_shards; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE revolving_work_shards; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.revolving_work_shards IS 'coordinates work between multiple processes working on the same job with partitions that need to be repeatedly processed; unlogged because on system crashes the locks represented by this table will have to be cleared anyway, typically using "taler-exchange-dbinit -s"';
+COMMENT ON TABLE exchange.revolving_work_shards IS 'coordinates work between multiple processes working on the same job with partitions that need to be repeatedly processed; unlogged because on system crashes the locks represented by this table will have to be cleared anyway, typically using "taler-exchange-dbinit -s"';
--
--- Name: COLUMN revolving_work_shards.shard_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN revolving_work_shards.shard_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.revolving_work_shards.shard_serial_id IS 'unique serial number identifying the shard';
+COMMENT ON COLUMN exchange.revolving_work_shards.shard_serial_id IS 'unique serial number identifying the shard';
--
--- Name: COLUMN revolving_work_shards.last_attempt; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN revolving_work_shards.last_attempt; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.revolving_work_shards.last_attempt IS 'last time a worker attempted to work on the shard';
+COMMENT ON COLUMN exchange.revolving_work_shards.last_attempt IS 'last time a worker attempted to work on the shard';
--
--- Name: COLUMN revolving_work_shards.start_row; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN revolving_work_shards.start_row; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.revolving_work_shards.start_row IS 'row at which the shard scope starts, inclusive';
+COMMENT ON COLUMN exchange.revolving_work_shards.start_row IS 'row at which the shard scope starts, inclusive';
--
--- Name: COLUMN revolving_work_shards.end_row; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN revolving_work_shards.end_row; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.revolving_work_shards.end_row IS 'row at which the shard scope ends, exclusive';
+COMMENT ON COLUMN exchange.revolving_work_shards.end_row IS 'row at which the shard scope ends, exclusive';
--
--- Name: COLUMN revolving_work_shards.active; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN revolving_work_shards.active; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.revolving_work_shards.active IS 'set to TRUE when a worker is active on the shard';
+COMMENT ON COLUMN exchange.revolving_work_shards.active IS 'set to TRUE when a worker is active on the shard';
--
--- Name: COLUMN revolving_work_shards.job_name; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN revolving_work_shards.job_name; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.revolving_work_shards.job_name IS 'unique name of the job the workers on this shard are performing';
+COMMENT ON COLUMN exchange.revolving_work_shards.job_name IS 'unique name of the job the workers on this shard are performing';
--
--- Name: revolving_work_shards_shard_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: revolving_work_shards_shard_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.revolving_work_shards ALTER COLUMN shard_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.revolving_work_shards_shard_serial_id_seq
+ALTER TABLE exchange.revolving_work_shards ALTER COLUMN shard_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.revolving_work_shards_shard_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9702,10 +8708,10 @@ ALTER TABLE public.revolving_work_shards ALTER COLUMN shard_serial_id ADD GENERA
--
--- Name: signkey_revocations; Type: TABLE; Schema: public; Owner: -
+-- Name: signkey_revocations; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.signkey_revocations (
+CREATE TABLE exchange.signkey_revocations (
signkey_revocations_serial_id bigint NOT NULL,
esk_serial bigint NOT NULL,
master_sig bytea NOT NULL,
@@ -9714,18 +8720,18 @@ CREATE TABLE public.signkey_revocations (
--
--- Name: TABLE signkey_revocations; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE signkey_revocations; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.signkey_revocations IS 'Table storing which online signing keys have been revoked';
+COMMENT ON TABLE exchange.signkey_revocations IS 'Table storing which online signing keys have been revoked';
--
--- Name: signkey_revocations_signkey_revocations_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: signkey_revocations_signkey_revocations_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.signkey_revocations ALTER COLUMN signkey_revocations_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.signkey_revocations_signkey_revocations_serial_id_seq
+ALTER TABLE exchange.signkey_revocations ALTER COLUMN signkey_revocations_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.signkey_revocations_signkey_revocations_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9735,10 +8741,10 @@ ALTER TABLE public.signkey_revocations ALTER COLUMN signkey_revocations_serial_i
--
--- Name: wad_in_entries; Type: TABLE; Schema: public; Owner: -
+-- Name: wad_in_entries; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wad_in_entries (
+CREATE TABLE exchange.wad_in_entries (
wad_in_entry_serial_id bigint NOT NULL,
wad_in_serial_id bigint,
reserve_pub bytea NOT NULL,
@@ -9764,94 +8770,94 @@ PARTITION BY HASH (purse_pub);
--
--- Name: TABLE wad_in_entries; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wad_in_entries; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wad_in_entries IS 'list of purses aggregated in a wad according to the sending exchange';
+COMMENT ON TABLE exchange.wad_in_entries IS 'list of purses aggregated in a wad according to the sending exchange';
--
--- Name: COLUMN wad_in_entries.wad_in_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.wad_in_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.wad_in_serial_id IS 'wad for which the given purse was included in the aggregation';
+COMMENT ON COLUMN exchange.wad_in_entries.wad_in_serial_id IS 'wad for which the given purse was included in the aggregation';
--
--- Name: COLUMN wad_in_entries.reserve_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.reserve_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.reserve_pub IS 'target account of the purse (must be at the local exchange)';
+COMMENT ON COLUMN exchange.wad_in_entries.reserve_pub IS 'target account of the purse (must be at the local exchange)';
--
--- Name: COLUMN wad_in_entries.purse_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.purse_pub IS 'public key of the purse that was merged';
+COMMENT ON COLUMN exchange.wad_in_entries.purse_pub IS 'public key of the purse that was merged';
--
--- Name: COLUMN wad_in_entries.h_contract; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.h_contract; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.h_contract IS 'hash of the contract terms of the purse';
+COMMENT ON COLUMN exchange.wad_in_entries.h_contract IS 'hash of the contract terms of the purse';
--
--- Name: COLUMN wad_in_entries.purse_expiration; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.purse_expiration; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.purse_expiration IS 'Time when the purse was set to expire';
+COMMENT ON COLUMN exchange.wad_in_entries.purse_expiration IS 'Time when the purse was set to expire';
--
--- Name: COLUMN wad_in_entries.merge_timestamp; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.merge_timestamp; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.merge_timestamp IS 'Time when the merge was approved';
+COMMENT ON COLUMN exchange.wad_in_entries.merge_timestamp IS 'Time when the merge was approved';
--
--- Name: COLUMN wad_in_entries.amount_with_fee_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.amount_with_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.amount_with_fee_val IS 'Total amount in the purse';
+COMMENT ON COLUMN exchange.wad_in_entries.amount_with_fee_val IS 'Total amount in the purse';
--
--- Name: COLUMN wad_in_entries.wad_fee_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.wad_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.wad_fee_val IS 'Total wad fees paid by the purse';
+COMMENT ON COLUMN exchange.wad_in_entries.wad_fee_val IS 'Total wad fees paid by the purse';
--
--- Name: COLUMN wad_in_entries.deposit_fees_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.deposit_fees_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.deposit_fees_val IS 'Total deposit fees paid when depositing coins into the purse';
+COMMENT ON COLUMN exchange.wad_in_entries.deposit_fees_val IS 'Total deposit fees paid when depositing coins into the purse';
--
--- Name: COLUMN wad_in_entries.reserve_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.reserve_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.reserve_sig IS 'Signature by the receiving reserve, of purpose TALER_SIGNATURE_ACCOUNT_MERGE';
+COMMENT ON COLUMN exchange.wad_in_entries.reserve_sig IS 'Signature by the receiving reserve, of purpose TALER_SIGNATURE_ACCOUNT_MERGE';
--
--- Name: COLUMN wad_in_entries.purse_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_in_entries.purse_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_in_entries.purse_sig IS 'Signature by the purse of purpose TALER_SIGNATURE_PURSE_MERGE';
+COMMENT ON COLUMN exchange.wad_in_entries.purse_sig IS 'Signature by the purse of purpose TALER_SIGNATURE_PURSE_MERGE';
--
--- Name: wad_in_entries_default; Type: TABLE; Schema: public; Owner: -
+-- Name: wad_in_entries_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wad_in_entries_default (
+CREATE TABLE exchange.wad_in_entries_default (
wad_in_entry_serial_id bigint NOT NULL,
wad_in_serial_id bigint,
reserve_pub bytea NOT NULL,
@@ -9873,15 +8879,15 @@ CREATE TABLE public.wad_in_entries_default (
CONSTRAINT wad_in_entries_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
CONSTRAINT wad_in_entries_reserve_sig_check CHECK ((length(reserve_sig) = 64))
);
-ALTER TABLE ONLY public.wad_in_entries ATTACH PARTITION public.wad_in_entries_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.wad_in_entries ATTACH PARTITION exchange.wad_in_entries_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: wad_in_entries_wad_in_entry_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: wad_in_entries_wad_in_entry_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.wad_in_entries ALTER COLUMN wad_in_entry_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wad_in_entries_wad_in_entry_serial_id_seq
+ALTER TABLE exchange.wad_in_entries ALTER COLUMN wad_in_entry_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wad_in_entries_wad_in_entry_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -9891,10 +8897,10 @@ ALTER TABLE public.wad_in_entries ALTER COLUMN wad_in_entry_serial_id ADD GENERA
--
--- Name: wad_out_entries; Type: TABLE; Schema: public; Owner: -
+-- Name: wad_out_entries; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wad_out_entries (
+CREATE TABLE exchange.wad_out_entries (
wad_out_entry_serial_id bigint NOT NULL,
wad_out_serial_id bigint,
reserve_pub bytea NOT NULL,
@@ -9920,94 +8926,94 @@ PARTITION BY HASH (purse_pub);
--
--- Name: TABLE wad_out_entries; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wad_out_entries; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wad_out_entries IS 'Purses combined into a wad';
+COMMENT ON TABLE exchange.wad_out_entries IS 'Purses combined into a wad';
--
--- Name: COLUMN wad_out_entries.wad_out_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.wad_out_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.wad_out_serial_id IS 'Wad the purse was part of';
+COMMENT ON COLUMN exchange.wad_out_entries.wad_out_serial_id IS 'Wad the purse was part of';
--
--- Name: COLUMN wad_out_entries.reserve_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.reserve_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.reserve_pub IS 'Target reserve for the purse';
+COMMENT ON COLUMN exchange.wad_out_entries.reserve_pub IS 'Target reserve for the purse';
--
--- Name: COLUMN wad_out_entries.purse_pub; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.purse_pub; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.purse_pub IS 'Public key of the purse';
+COMMENT ON COLUMN exchange.wad_out_entries.purse_pub IS 'Public key of the purse';
--
--- Name: COLUMN wad_out_entries.h_contract; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.h_contract; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.h_contract IS 'Hash of the contract associated with the purse';
+COMMENT ON COLUMN exchange.wad_out_entries.h_contract IS 'Hash of the contract associated with the purse';
--
--- Name: COLUMN wad_out_entries.purse_expiration; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.purse_expiration; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.purse_expiration IS 'Time when the purse expires';
+COMMENT ON COLUMN exchange.wad_out_entries.purse_expiration IS 'Time when the purse expires';
--
--- Name: COLUMN wad_out_entries.merge_timestamp; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.merge_timestamp; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.merge_timestamp IS 'Time when the merge was approved';
+COMMENT ON COLUMN exchange.wad_out_entries.merge_timestamp IS 'Time when the merge was approved';
--
--- Name: COLUMN wad_out_entries.amount_with_fee_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.amount_with_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.amount_with_fee_val IS 'Total amount in the purse';
+COMMENT ON COLUMN exchange.wad_out_entries.amount_with_fee_val IS 'Total amount in the purse';
--
--- Name: COLUMN wad_out_entries.wad_fee_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.wad_fee_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.wad_fee_val IS 'Wat fee charged to the purse';
+COMMENT ON COLUMN exchange.wad_out_entries.wad_fee_val IS 'Wat fee charged to the purse';
--
--- Name: COLUMN wad_out_entries.deposit_fees_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.deposit_fees_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.deposit_fees_val IS 'Total deposit fees charged to the purse';
+COMMENT ON COLUMN exchange.wad_out_entries.deposit_fees_val IS 'Total deposit fees charged to the purse';
--
--- Name: COLUMN wad_out_entries.reserve_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.reserve_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.reserve_sig IS 'Signature by the receiving reserve, of purpose TALER_SIGNATURE_ACCOUNT_MERGE';
+COMMENT ON COLUMN exchange.wad_out_entries.reserve_sig IS 'Signature by the receiving reserve, of purpose TALER_SIGNATURE_ACCOUNT_MERGE';
--
--- Name: COLUMN wad_out_entries.purse_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wad_out_entries.purse_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wad_out_entries.purse_sig IS 'Signature by the purse of purpose TALER_SIGNATURE_PURSE_MERGE';
+COMMENT ON COLUMN exchange.wad_out_entries.purse_sig IS 'Signature by the purse of purpose TALER_SIGNATURE_PURSE_MERGE';
--
--- Name: wad_out_entries_default; Type: TABLE; Schema: public; Owner: -
+-- Name: wad_out_entries_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wad_out_entries_default (
+CREATE TABLE exchange.wad_out_entries_default (
wad_out_entry_serial_id bigint NOT NULL,
wad_out_serial_id bigint,
reserve_pub bytea NOT NULL,
@@ -10029,15 +9035,15 @@ CREATE TABLE public.wad_out_entries_default (
CONSTRAINT wad_out_entries_reserve_pub_check CHECK ((length(reserve_pub) = 32)),
CONSTRAINT wad_out_entries_reserve_sig_check CHECK ((length(reserve_sig) = 64))
);
-ALTER TABLE ONLY public.wad_out_entries ATTACH PARTITION public.wad_out_entries_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.wad_out_entries ATTACH PARTITION exchange.wad_out_entries_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: wad_out_entries_wad_out_entry_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: wad_out_entries_wad_out_entry_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.wad_out_entries ALTER COLUMN wad_out_entry_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wad_out_entries_wad_out_entry_serial_id_seq
+ALTER TABLE exchange.wad_out_entries ALTER COLUMN wad_out_entry_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wad_out_entries_wad_out_entry_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10047,10 +9053,10 @@ ALTER TABLE public.wad_out_entries ALTER COLUMN wad_out_entry_serial_id ADD GENE
--
--- Name: wads_in; Type: TABLE; Schema: public; Owner: -
+-- Name: wads_in; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wads_in (
+CREATE TABLE exchange.wads_in (
wad_in_serial_id bigint NOT NULL,
wad_id bytea NOT NULL,
origin_exchange_url text NOT NULL,
@@ -10063,45 +9069,45 @@ PARTITION BY HASH (wad_id);
--
--- Name: TABLE wads_in; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wads_in; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wads_in IS 'Incoming exchange-to-exchange wad wire transfers';
+COMMENT ON TABLE exchange.wads_in IS 'Incoming exchange-to-exchange wad wire transfers';
--
--- Name: COLUMN wads_in.wad_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_in.wad_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_in.wad_id IS 'Unique identifier of the wad, part of the wire transfer subject';
+COMMENT ON COLUMN exchange.wads_in.wad_id IS 'Unique identifier of the wad, part of the wire transfer subject';
--
--- Name: COLUMN wads_in.origin_exchange_url; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_in.origin_exchange_url; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_in.origin_exchange_url IS 'Base URL of the originating URL, also part of the wire transfer subject';
+COMMENT ON COLUMN exchange.wads_in.origin_exchange_url IS 'Base URL of the originating URL, also part of the wire transfer subject';
--
--- Name: COLUMN wads_in.amount_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_in.amount_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_in.amount_val IS 'Actual amount that was received by our exchange';
+COMMENT ON COLUMN exchange.wads_in.amount_val IS 'Actual amount that was received by our exchange';
--
--- Name: COLUMN wads_in.arrival_time; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_in.arrival_time; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_in.arrival_time IS 'Time when the wad was received';
+COMMENT ON COLUMN exchange.wads_in.arrival_time IS 'Time when the wad was received';
--
--- Name: wads_in_default; Type: TABLE; Schema: public; Owner: -
+-- Name: wads_in_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wads_in_default (
+CREATE TABLE exchange.wads_in_default (
wad_in_serial_id bigint NOT NULL,
wad_id bytea NOT NULL,
origin_exchange_url text NOT NULL,
@@ -10110,15 +9116,15 @@ CREATE TABLE public.wads_in_default (
arrival_time bigint NOT NULL,
CONSTRAINT wads_in_wad_id_check CHECK ((length(wad_id) = 24))
);
-ALTER TABLE ONLY public.wads_in ATTACH PARTITION public.wads_in_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.wads_in ATTACH PARTITION exchange.wads_in_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: wads_in_wad_in_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: wads_in_wad_in_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.wads_in ALTER COLUMN wad_in_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wads_in_wad_in_serial_id_seq
+ALTER TABLE exchange.wads_in ALTER COLUMN wad_in_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wads_in_wad_in_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10128,10 +9134,10 @@ ALTER TABLE public.wads_in ALTER COLUMN wad_in_serial_id ADD GENERATED BY DEFAUL
--
--- Name: wads_out; Type: TABLE; Schema: public; Owner: -
+-- Name: wads_out; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wads_out (
+CREATE TABLE exchange.wads_out (
wad_out_serial_id bigint NOT NULL,
wad_id bytea NOT NULL,
partner_serial_id bigint NOT NULL,
@@ -10144,45 +9150,45 @@ PARTITION BY HASH (wad_id);
--
--- Name: TABLE wads_out; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wads_out; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wads_out IS 'Wire transfers made to another exchange to transfer purse funds';
+COMMENT ON TABLE exchange.wads_out IS 'Wire transfers made to another exchange to transfer purse funds';
--
--- Name: COLUMN wads_out.wad_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_out.wad_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_out.wad_id IS 'Unique identifier of the wad, part of the wire transfer subject';
+COMMENT ON COLUMN exchange.wads_out.wad_id IS 'Unique identifier of the wad, part of the wire transfer subject';
--
--- Name: COLUMN wads_out.partner_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_out.partner_serial_id; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_out.partner_serial_id IS 'target exchange of the wad';
+COMMENT ON COLUMN exchange.wads_out.partner_serial_id IS 'target exchange of the wad';
--
--- Name: COLUMN wads_out.amount_val; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_out.amount_val; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_out.amount_val IS 'Amount that was wired';
+COMMENT ON COLUMN exchange.wads_out.amount_val IS 'Amount that was wired';
--
--- Name: COLUMN wads_out.execution_time; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wads_out.execution_time; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wads_out.execution_time IS 'Time when the wire transfer was scheduled';
+COMMENT ON COLUMN exchange.wads_out.execution_time IS 'Time when the wire transfer was scheduled';
--
--- Name: wads_out_default; Type: TABLE; Schema: public; Owner: -
+-- Name: wads_out_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wads_out_default (
+CREATE TABLE exchange.wads_out_default (
wad_out_serial_id bigint NOT NULL,
wad_id bytea NOT NULL,
partner_serial_id bigint NOT NULL,
@@ -10191,15 +9197,15 @@ CREATE TABLE public.wads_out_default (
execution_time bigint NOT NULL,
CONSTRAINT wads_out_wad_id_check CHECK ((length(wad_id) = 24))
);
-ALTER TABLE ONLY public.wads_out ATTACH PARTITION public.wads_out_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.wads_out ATTACH PARTITION exchange.wads_out_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: wads_out_wad_out_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: wads_out_wad_out_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.wads_out ALTER COLUMN wad_out_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wads_out_wad_out_serial_id_seq
+ALTER TABLE exchange.wads_out ALTER COLUMN wad_out_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wads_out_wad_out_serial_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10209,10 +9215,10 @@ ALTER TABLE public.wads_out ALTER COLUMN wad_out_serial_id ADD GENERATED BY DEFA
--
--- Name: wire_accounts; Type: TABLE; Schema: public; Owner: -
+-- Name: wire_accounts; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wire_accounts (
+CREATE TABLE exchange.wire_accounts (
payto_uri character varying NOT NULL,
master_sig bytea,
is_active boolean NOT NULL,
@@ -10222,78 +9228,45 @@ CREATE TABLE public.wire_accounts (
--
--- Name: TABLE wire_accounts; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wire_accounts; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wire_accounts IS 'Table with current and historic bank accounts of the exchange. Entries never expire as we need to remember the last_change column indefinitely.';
+COMMENT ON TABLE exchange.wire_accounts IS 'Table with current and historic bank accounts of the exchange. Entries never expire as we need to remember the last_change column indefinitely.';
--
--- Name: COLUMN wire_accounts.payto_uri; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_accounts.payto_uri; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_accounts.payto_uri IS 'payto URI (RFC 8905) with the bank account of the exchange.';
+COMMENT ON COLUMN exchange.wire_accounts.payto_uri IS 'payto URI (RFC 8905) with the bank account of the exchange.';
--
--- Name: COLUMN wire_accounts.master_sig; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_accounts.master_sig; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_accounts.master_sig IS 'Signature of purpose TALER_SIGNATURE_MASTER_WIRE_DETAILS';
+COMMENT ON COLUMN exchange.wire_accounts.master_sig IS 'Signature of purpose TALER_SIGNATURE_MASTER_WIRE_DETAILS';
--
--- Name: COLUMN wire_accounts.is_active; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_accounts.is_active; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_accounts.is_active IS 'true if we are currently supporting the use of this account.';
+COMMENT ON COLUMN exchange.wire_accounts.is_active IS 'true if we are currently supporting the use of this account.';
--
--- Name: COLUMN wire_accounts.last_change; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_accounts.last_change; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_accounts.last_change IS 'Latest time when active status changed. Used to detect replays of old messages.';
+COMMENT ON COLUMN exchange.wire_accounts.last_change IS 'Latest time when active status changed. Used to detect replays of old messages.';
--
--- Name: wire_auditor_account_progress; Type: TABLE; Schema: public; Owner: -
+-- Name: wire_fee; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wire_auditor_account_progress (
- master_pub bytea NOT NULL,
- account_name text NOT NULL,
- last_wire_reserve_in_serial_id bigint DEFAULT 0 NOT NULL,
- last_wire_wire_out_serial_id bigint DEFAULT 0 NOT NULL,
- wire_in_off bigint NOT NULL,
- wire_out_off bigint NOT NULL
-);
-
-
---
--- Name: TABLE wire_auditor_account_progress; Type: COMMENT; Schema: public; Owner: -
---
-
-COMMENT ON TABLE public.wire_auditor_account_progress IS 'information as to which transactions the auditor has processed in the exchange database. Used for SELECTing the
- statements to process. The indices include the last serial ID from the respective tables that we have processed. Thus, we need to select those table entries that are strictly larger (and process in monotonically increasing order).';
-
-
---
--- Name: wire_auditor_progress; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.wire_auditor_progress (
- master_pub bytea NOT NULL,
- last_timestamp bigint NOT NULL,
- last_reserve_close_uuid bigint NOT NULL
-);
-
-
---
--- Name: wire_fee; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.wire_fee (
+CREATE TABLE exchange.wire_fee (
wire_fee_serial bigint NOT NULL,
wire_method character varying NOT NULL,
start_date bigint NOT NULL,
@@ -10310,25 +9283,25 @@ CREATE TABLE public.wire_fee (
--
--- Name: TABLE wire_fee; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wire_fee; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wire_fee IS 'list of the wire fees of this exchange, by date';
+COMMENT ON TABLE exchange.wire_fee IS 'list of the wire fees of this exchange, by date';
--
--- Name: COLUMN wire_fee.wire_fee_serial; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_fee.wire_fee_serial; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_fee.wire_fee_serial IS 'needed for exchange-auditor replication logic';
+COMMENT ON COLUMN exchange.wire_fee.wire_fee_serial IS 'needed for exchange-auditor replication logic';
--
--- Name: wire_fee_wire_fee_serial_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: wire_fee_wire_fee_serial_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.wire_fee ALTER COLUMN wire_fee_serial ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wire_fee_wire_fee_serial_seq
+ALTER TABLE exchange.wire_fee ALTER COLUMN wire_fee_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wire_fee_wire_fee_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10338,10 +9311,10 @@ ALTER TABLE public.wire_fee ALTER COLUMN wire_fee_serial ADD GENERATED BY DEFAUL
--
--- Name: wire_out; Type: TABLE; Schema: public; Owner: -
+-- Name: wire_out; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wire_out (
+CREATE TABLE exchange.wire_out (
wireout_uuid bigint NOT NULL,
execution_date bigint NOT NULL,
wtid_raw bytea NOT NULL,
@@ -10356,31 +9329,31 @@ PARTITION BY HASH (wtid_raw);
--
--- Name: TABLE wire_out; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wire_out; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wire_out IS 'wire transfers the exchange has executed';
+COMMENT ON TABLE exchange.wire_out IS 'wire transfers the exchange has executed';
--
--- Name: COLUMN wire_out.wire_target_h_payto; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_out.wire_target_h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_out.wire_target_h_payto IS 'Identifies the credited bank account and KYC status';
+COMMENT ON COLUMN exchange.wire_out.wire_target_h_payto IS 'Identifies the credited bank account and KYC status';
--
--- Name: COLUMN wire_out.exchange_account_section; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_out.exchange_account_section; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_out.exchange_account_section IS 'identifies the configuration section with the debit account of this payment';
+COMMENT ON COLUMN exchange.wire_out.exchange_account_section IS 'identifies the configuration section with the debit account of this payment';
--
--- Name: wire_out_default; Type: TABLE; Schema: public; Owner: -
+-- Name: wire_out_default; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wire_out_default (
+CREATE TABLE exchange.wire_out_default (
wireout_uuid bigint NOT NULL,
execution_date bigint NOT NULL,
wtid_raw bytea NOT NULL,
@@ -10391,15 +9364,15 @@ CREATE TABLE public.wire_out_default (
CONSTRAINT wire_out_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32)),
CONSTRAINT wire_out_wtid_raw_check CHECK ((length(wtid_raw) = 32))
);
-ALTER TABLE ONLY public.wire_out ATTACH PARTITION public.wire_out_default FOR VALUES WITH (modulus 1, remainder 0);
+ALTER TABLE ONLY exchange.wire_out ATTACH PARTITION exchange.wire_out_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: wire_out_wireout_uuid_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: wire_out_wireout_uuid_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-ALTER TABLE public.wire_out ALTER COLUMN wireout_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wire_out_wireout_uuid_seq
+ALTER TABLE exchange.wire_out ALTER COLUMN wireout_uuid ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wire_out_wireout_uuid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10409,76 +9382,200 @@ ALTER TABLE public.wire_out ALTER COLUMN wireout_uuid ADD GENERATED BY DEFAULT A
--
--- Name: wire_targets; Type: TABLE; Schema: public; Owner: -
+-- Name: wire_targets; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wire_targets (
+CREATE TABLE exchange.wire_targets (
wire_target_serial_id bigint NOT NULL,
wire_target_h_payto bytea NOT NULL,
payto_uri character varying NOT NULL,
- kyc_ok boolean DEFAULT false NOT NULL,
- external_id character varying,
CONSTRAINT wire_targets_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32))
)
PARTITION BY HASH (wire_target_h_payto);
--
--- Name: TABLE wire_targets; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE wire_targets; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON TABLE public.wire_targets IS 'All senders and recipients of money via the exchange';
+COMMENT ON TABLE exchange.wire_targets IS 'All senders and recipients of money via the exchange';
--
--- Name: COLUMN wire_targets.wire_target_h_payto; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_targets.wire_target_h_payto; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_targets.wire_target_h_payto IS 'Unsalted hash of payto_uri';
+COMMENT ON COLUMN exchange.wire_targets.wire_target_h_payto IS 'Unsalted hash of payto_uri';
--
--- Name: COLUMN wire_targets.payto_uri; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN wire_targets.payto_uri; Type: COMMENT; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_targets.payto_uri IS 'Can be a regular bank account, or also be a URI identifying a reserve-account (for P2P payments)';
+COMMENT ON COLUMN exchange.wire_targets.payto_uri IS 'Can be a regular bank account, or also be a URI identifying a reserve-account (for P2P payments)';
--
--- Name: COLUMN wire_targets.kyc_ok; Type: COMMENT; Schema: public; Owner: -
+-- Name: wire_targets_default; Type: TABLE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_targets.kyc_ok IS 'true if the KYC check was passed successfully';
+CREATE TABLE exchange.wire_targets_default (
+ wire_target_serial_id bigint NOT NULL,
+ wire_target_h_payto bytea NOT NULL,
+ payto_uri character varying NOT NULL,
+ CONSTRAINT wire_targets_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32))
+);
+ALTER TABLE ONLY exchange.wire_targets ATTACH PARTITION exchange.wire_targets_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: COLUMN wire_targets.external_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: wire_targets_wire_target_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
--
-COMMENT ON COLUMN public.wire_targets.external_id IS 'Name of the user that was used for OAuth 2.0-based legitimization';
+ALTER TABLE exchange.wire_targets ALTER COLUMN wire_target_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.wire_targets_wire_target_serial_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
--
--- Name: wire_targets_default; Type: TABLE; Schema: public; Owner: -
+-- Name: work_shards; Type: TABLE; Schema: exchange; Owner: -
--
-CREATE TABLE public.wire_targets_default (
- wire_target_serial_id bigint NOT NULL,
- wire_target_h_payto bytea NOT NULL,
+CREATE TABLE exchange.work_shards (
+ shard_serial_id bigint NOT NULL,
+ last_attempt bigint NOT NULL,
+ start_row bigint NOT NULL,
+ end_row bigint NOT NULL,
+ completed boolean DEFAULT false NOT NULL,
+ job_name character varying NOT NULL
+);
+
+
+--
+-- Name: TABLE work_shards; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON TABLE exchange.work_shards IS 'coordinates work between multiple processes working on the same job';
+
+
+--
+-- Name: COLUMN work_shards.shard_serial_id; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.work_shards.shard_serial_id IS 'unique serial number identifying the shard';
+
+
+--
+-- Name: COLUMN work_shards.last_attempt; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.work_shards.last_attempt IS 'last time a worker attempted to work on the shard';
+
+
+--
+-- Name: COLUMN work_shards.start_row; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.work_shards.start_row IS 'row at which the shard scope starts, inclusive';
+
+
+--
+-- Name: COLUMN work_shards.end_row; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.work_shards.end_row IS 'row at which the shard scope ends, exclusive';
+
+
+--
+-- Name: COLUMN work_shards.completed; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.work_shards.completed IS 'set to TRUE once the shard is finished by a worker';
+
+
+--
+-- Name: COLUMN work_shards.job_name; Type: COMMENT; Schema: exchange; Owner: -
+--
+
+COMMENT ON COLUMN exchange.work_shards.job_name IS 'unique name of the job the workers on this shard are performing';
+
+
+--
+-- Name: work_shards_shard_serial_id_seq; Type: SEQUENCE; Schema: exchange; Owner: -
+--
+
+ALTER TABLE exchange.work_shards ALTER COLUMN shard_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME exchange.work_shards_shard_serial_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
+
+
+--
+-- Name: merchant_accounts; Type: TABLE; Schema: merchant; Owner: -
+--
+
+CREATE TABLE merchant.merchant_accounts (
+ account_serial bigint NOT NULL,
+ merchant_serial bigint NOT NULL,
+ h_wire bytea NOT NULL,
+ salt bytea NOT NULL,
payto_uri character varying NOT NULL,
- kyc_ok boolean DEFAULT false NOT NULL,
- external_id character varying,
- CONSTRAINT wire_targets_wire_target_h_payto_check CHECK ((length(wire_target_h_payto) = 32))
+ active boolean NOT NULL,
+ CONSTRAINT merchant_accounts_h_wire_check CHECK ((length(h_wire) = 64)),
+ CONSTRAINT merchant_accounts_salt_check CHECK ((length(salt) = 16))
);
-ALTER TABLE ONLY public.wire_targets ATTACH PARTITION public.wire_targets_default FOR VALUES WITH (modulus 1, remainder 0);
--
--- Name: wire_targets_wire_target_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: TABLE merchant_accounts; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON TABLE merchant.merchant_accounts IS 'bank accounts of the instances';
+
+
+--
+-- Name: COLUMN merchant_accounts.h_wire; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_accounts.h_wire IS 'salted hash of payto_uri';
+
+
+--
+-- Name: COLUMN merchant_accounts.salt; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_accounts.salt IS 'salt used when hashing payto_uri into h_wire';
+
+
+--
+-- Name: COLUMN merchant_accounts.payto_uri; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_accounts.payto_uri IS 'payto URI of a merchant bank account';
+
+
+--
+-- Name: COLUMN merchant_accounts.active; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE public.wire_targets ALTER COLUMN wire_target_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.wire_targets_wire_target_serial_id_seq
+COMMENT ON COLUMN merchant.merchant_accounts.active IS 'true if we actively use this bank account, false if it is just kept around for older contracts to refer to';
+
+
+--
+-- Name: merchant_accounts_account_serial_seq; Type: SEQUENCE; Schema: merchant; Owner: -
+--
+
+ALTER TABLE merchant.merchant_accounts ALTER COLUMN account_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME merchant.merchant_accounts_account_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10488,74 +9585,209 @@ ALTER TABLE public.wire_targets ALTER COLUMN wire_target_serial_id ADD GENERATED
--
--- Name: work_shards; Type: TABLE; Schema: public; Owner: -
+-- Name: merchant_contract_terms; Type: TABLE; Schema: merchant; Owner: -
--
-CREATE TABLE public.work_shards (
- shard_serial_id bigint NOT NULL,
- last_attempt bigint NOT NULL,
- start_row bigint NOT NULL,
- end_row bigint NOT NULL,
- completed boolean DEFAULT false NOT NULL,
- job_name character varying NOT NULL
+CREATE TABLE merchant.merchant_contract_terms (
+ order_serial bigint NOT NULL,
+ merchant_serial bigint NOT NULL,
+ order_id character varying NOT NULL,
+ contract_terms bytea NOT NULL,
+ h_contract_terms bytea NOT NULL,
+ creation_time bigint NOT NULL,
+ pay_deadline bigint NOT NULL,
+ refund_deadline bigint NOT NULL,
+ paid boolean DEFAULT false NOT NULL,
+ wired boolean DEFAULT false NOT NULL,
+ fulfillment_url character varying,
+ session_id character varying DEFAULT ''::character varying NOT NULL,
+ claim_token bytea NOT NULL,
+ CONSTRAINT merchant_contract_terms_claim_token_check CHECK ((length(claim_token) = 16)),
+ CONSTRAINT merchant_contract_terms_h_contract_terms_check CHECK ((length(h_contract_terms) = 64))
);
--
--- Name: TABLE work_shards; Type: COMMENT; Schema: public; Owner: -
+-- Name: TABLE merchant_contract_terms; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON TABLE merchant.merchant_contract_terms IS 'Contracts are orders that have been claimed by a wallet';
+
+
+--
+-- Name: COLUMN merchant_contract_terms.merchant_serial; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_contract_terms.merchant_serial IS 'Identifies the instance offering the contract';
+
+
+--
+-- Name: COLUMN merchant_contract_terms.order_id; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_contract_terms.order_id IS 'Not a foreign key into merchant_orders because paid contracts persist after expiration';
+
+
+--
+-- Name: COLUMN merchant_contract_terms.contract_terms; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_contract_terms.contract_terms IS 'These contract terms include the wallet nonce';
+
+
+--
+-- Name: COLUMN merchant_contract_terms.h_contract_terms; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_contract_terms.h_contract_terms IS 'Hash over contract_terms';
+
+
+--
+-- Name: COLUMN merchant_contract_terms.pay_deadline; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON TABLE public.work_shards IS 'coordinates work between multiple processes working on the same job';
+COMMENT ON COLUMN merchant.merchant_contract_terms.pay_deadline IS 'How long is the offer valid. After this time, the order can be garbage collected';
--
--- Name: COLUMN work_shards.shard_serial_id; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN merchant_contract_terms.refund_deadline; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON COLUMN public.work_shards.shard_serial_id IS 'unique serial number identifying the shard';
+COMMENT ON COLUMN merchant.merchant_contract_terms.refund_deadline IS 'By what times do refunds have to be approved (useful to reject refund requests)';
--
--- Name: COLUMN work_shards.last_attempt; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN merchant_contract_terms.paid; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON COLUMN public.work_shards.last_attempt IS 'last time a worker attempted to work on the shard';
+COMMENT ON COLUMN merchant.merchant_contract_terms.paid IS 'true implies the customer paid for this contract; order should be DELETEd from merchant_orders once paid is set to release merchant_order_locks; paid remains true even if the payment was later refunded';
--
--- Name: COLUMN work_shards.start_row; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN merchant_contract_terms.wired; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON COLUMN public.work_shards.start_row IS 'row at which the shard scope starts, inclusive';
+COMMENT ON COLUMN merchant.merchant_contract_terms.wired IS 'true implies the exchange wired us the full amount for all non-refunded payments under this contract';
--
--- Name: COLUMN work_shards.end_row; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN merchant_contract_terms.fulfillment_url; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON COLUMN public.work_shards.end_row IS 'row at which the shard scope ends, exclusive';
+COMMENT ON COLUMN merchant.merchant_contract_terms.fulfillment_url IS 'also included in contract_terms, but we need it here to SELECT on it during repurchase detection; can be NULL if the contract has no fulfillment URL';
--
--- Name: COLUMN work_shards.completed; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN merchant_contract_terms.session_id; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON COLUMN public.work_shards.completed IS 'set to TRUE once the shard is finished by a worker';
+COMMENT ON COLUMN merchant.merchant_contract_terms.session_id IS 'last session_id from we confirmed the paying client to use, empty string for none';
--
--- Name: COLUMN work_shards.job_name; Type: COMMENT; Schema: public; Owner: -
+-- Name: COLUMN merchant_contract_terms.claim_token; Type: COMMENT; Schema: merchant; Owner: -
--
-COMMENT ON COLUMN public.work_shards.job_name IS 'unique name of the job the workers on this shard are performing';
+COMMENT ON COLUMN merchant.merchant_contract_terms.claim_token IS 'Token optionally used to access the status of the order. All zeros (not NULL) if not used';
--
--- Name: work_shards_shard_serial_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+-- Name: merchant_deposit_to_transfer; Type: TABLE; Schema: merchant; Owner: -
--
-ALTER TABLE public.work_shards ALTER COLUMN shard_serial_id ADD GENERATED BY DEFAULT AS IDENTITY (
- SEQUENCE NAME public.work_shards_shard_serial_id_seq
+CREATE TABLE merchant.merchant_deposit_to_transfer (
+ deposit_serial bigint NOT NULL,
+ coin_contribution_value_val bigint NOT NULL,
+ coin_contribution_value_frac integer NOT NULL,
+ credit_serial bigint NOT NULL,
+ execution_time bigint NOT NULL,
+ signkey_serial bigint NOT NULL,
+ exchange_sig bytea NOT NULL,
+ CONSTRAINT merchant_deposit_to_transfer_exchange_sig_check CHECK ((length(exchange_sig) = 64))
+);
+
+
+--
+-- Name: TABLE merchant_deposit_to_transfer; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON TABLE merchant.merchant_deposit_to_transfer IS 'Mapping of deposits to (possibly unconfirmed) wire transfers; NOTE: not used yet';
+
+
+--
+-- Name: COLUMN merchant_deposit_to_transfer.execution_time; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_deposit_to_transfer.execution_time IS 'Execution time as claimed by the exchange, roughly matches time seen by merchant';
+
+
+--
+-- Name: merchant_deposits; Type: TABLE; Schema: merchant; Owner: -
+--
+
+CREATE TABLE merchant.merchant_deposits (
+ deposit_serial bigint NOT NULL,
+ order_serial bigint,
+ deposit_timestamp bigint NOT NULL,
+ coin_pub bytea NOT NULL,
+ exchange_url character varying NOT NULL,
+ amount_with_fee_val bigint NOT NULL,
+ amount_with_fee_frac integer NOT NULL,
+ deposit_fee_val bigint NOT NULL,
+ deposit_fee_frac integer NOT NULL,
+ refund_fee_val bigint NOT NULL,
+ refund_fee_frac integer NOT NULL,
+ wire_fee_val bigint NOT NULL,
+ wire_fee_frac integer NOT NULL,
+ signkey_serial bigint NOT NULL,
+ exchange_sig bytea NOT NULL,
+ account_serial bigint NOT NULL,
+ CONSTRAINT merchant_deposits_coin_pub_check CHECK ((length(coin_pub) = 32)),
+ CONSTRAINT merchant_deposits_exchange_sig_check CHECK ((length(exchange_sig) = 64))
+);
+
+
+--
+-- Name: TABLE merchant_deposits; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON TABLE merchant.merchant_deposits IS 'Refunds approved by the merchant (backoffice) logic, excludes abort refunds';
+
+
+--
+-- Name: COLUMN merchant_deposits.deposit_timestamp; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_deposits.deposit_timestamp IS 'Time when the exchange generated the deposit confirmation';
+
+
+--
+-- Name: COLUMN merchant_deposits.wire_fee_val; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_deposits.wire_fee_val IS 'We MAY want to see if we should try to get this via merchant_exchange_wire_fees (not sure, may be too complicated with the date range, etc.)';
+
+
+--
+-- Name: COLUMN merchant_deposits.signkey_serial; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_deposits.signkey_serial IS 'Online signing key of the exchange on the deposit confirmation';
+
+
+--
+-- Name: COLUMN merchant_deposits.exchange_sig; Type: COMMENT; Schema: merchant; Owner: -
+--
+
+COMMENT ON COLUMN merchant.merchant_deposits.exchange_sig IS 'Signature of the exchange over the deposit confirmation';
+
+
+--
+-- Name: merchant_deposits_deposit_serial_seq; Type: SEQUENCE; Schema: merchant; Owner: -
+--
+
+ALTER TABLE merchant.merchant_deposits ALTER COLUMN deposit_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME merchant.merchant_deposits_deposit_serial_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -10565,5564 +9797,6106 @@ ALTER TABLE public.work_shards ALTER COLUMN shard_serial_id ADD GENERATED BY DEF
--
--- Name: app_bankaccount account_no; Type: DEFAULT; Schema: public; Owner: -
+-- Name: merchant_exchange_signing_keys; Type: TABLE; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.app_bankaccount ALTER COLUMN account_no SET DEFAULT nextval('public.app_bankaccount_account_no_seq'::regclass);
+CREATE TABLE merchant.merchant_exchange_signing_keys (
+ signkey_serial bigint NOT NULL,
+ master_pub bytea NOT NULL,
+ exchange_pub bytea NOT NULL,
+ start_date bigint NOT NULL,
+ expire_date bigint NOT NULL,
+ end_date bigint NOT NULL,
+ master_sig bytea NOT NULL,
+ CONSTRAINT merchant_exchange_signing_keys_exchange_pub_check CHECK ((length(exchange_pub) = 32)),
+ CONSTRAINT merchant_exchange_signing_keys_master_pub_check CHECK ((length(master_pub) = 32)),
+ CONSTRAINT merchant_exchange_signing_keys_master_sig_check CHECK ((length(master_sig) = 64))
+);
--
--- Name: app_banktransaction id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: TABLE merchant_exchange_signing_keys; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.app_banktransaction ALTER COLUMN id SET DEFAULT nextval('public.app_banktransaction_id_seq'::regclass);
+COMMENT ON TABLE merchant.merchant_exchange_signing_keys IS 'Here we store proofs of the exchange online signing keys being signed by the exchange master key';
--
--- Name: auditor_reserves auditor_reserves_rowid; Type: DEFAULT; Schema: public; Owner: -
+-- Name: COLUMN merchant_exchange_signing_keys.master_pub; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auditor_reserves ALTER COLUMN auditor_reserves_rowid SET DEFAULT nextval('public.auditor_reserves_auditor_reserves_rowid_seq'::regclass);
+COMMENT ON COLUMN merchant.merchant_exchange_signing_keys.master_pub IS 'Master public key of the exchange with these online signing keys';
--
--- Name: auth_group id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: merchant_exchange_signing_keys_signkey_serial_seq; Type: SEQUENCE; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auth_group ALTER COLUMN id SET DEFAULT nextval('public.auth_group_id_seq'::regclass);
+ALTER TABLE merchant.merchant_exchange_signing_keys ALTER COLUMN signkey_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME merchant.merchant_exchange_signing_keys_signkey_serial_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
--
--- Name: auth_group_permissions id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: merchant_exchange_wire_fees; Type: TABLE; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auth_group_permissions ALTER COLUMN id SET DEFAULT nextval('public.auth_group_permissions_id_seq'::regclass);
+CREATE TABLE merchant.merchant_exchange_wire_fees (
+ wirefee_serial bigint NOT NULL,
+ master_pub bytea NOT NULL,
+ h_wire_method bytea NOT NULL,
+ start_date bigint NOT NULL,
+ end_date bigint NOT NULL,
+ wire_fee_val bigint NOT NULL,
+ wire_fee_frac integer NOT NULL,
+ closing_fee_val bigint NOT NULL,
+ closing_fee_frac integer NOT NULL,
+ wad_fee_val bigint NOT NULL,
+ wad_fee_frac integer NOT NULL,
+ master_sig bytea NOT NULL,
+ CONSTRAINT merchant_exchange_wire_fees_h_wire_method_check CHECK ((length(h_wire_method) = 64)),
+ CONSTRAINT merchant_exchange_wire_fees_master_pub_check CHECK ((length(master_pub) = 32)),
+ CONSTRAINT merchant_exchange_wire_fees_master_sig_check CHECK ((length(master_sig) = 64))
+);
--
--- Name: auth_permission id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: TABLE merchant_exchange_wire_fees; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auth_permission ALTER COLUMN id SET DEFAULT nextval('public.auth_permission_id_seq'::regclass);
+COMMENT ON TABLE merchant.merchant_exchange_wire_fees IS 'Here we store proofs of the wire fee structure of the various exchanges';
--
--- Name: auth_user id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: COLUMN merchant_exchange_wire_fees.master_pub; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auth_user ALTER COLUMN id SET DEFAULT nextval('public.auth_user_id_seq'::regclass);
+COMMENT ON COLUMN merchant.merchant_exchange_wire_fees.master_pub IS 'Master public key of the exchange with these wire fees';
--
--- Name: auth_user_groups id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: merchant_exchange_wire_fees_wirefee_serial_seq; Type: SEQUENCE; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auth_user_groups ALTER COLUMN id SET DEFAULT nextval('public.auth_user_groups_id_seq'::regclass);
+ALTER TABLE merchant.merchant_exchange_wire_fees ALTER COLUMN wirefee_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME merchant.merchant_exchange_wire_fees_wirefee_serial_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
--
--- Name: auth_user_user_permissions id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: merchant_instances; Type: TABLE; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.auth_user_user_permissions ALTER COLUMN id SET DEFAULT nextval('public.auth_user_user_permissions_id_seq'::regclass);
+CREATE TABLE merchant.merchant_instances (
+ merchant_serial bigint NOT NULL,
+ merchant_pub bytea NOT NULL,
+ auth_hash bytea,
+ auth_salt bytea,
+ merchant_id character varying NOT NULL,
+ merchant_name character varying NOT NULL,
+ address bytea NOT NULL,
+ jurisdiction bytea NOT NULL,
+ default_max_deposit_fee_val bigint NOT NULL,
+ default_max_deposit_fee_frac integer NOT NULL,
+ default_max_wire_fee_val bigint NOT NULL,
+ default_max_wire_fee_frac integer NOT NULL,
+ default_wire_fee_amortization integer NOT NULL,
+ default_wire_transfer_delay bigint NOT NULL,
+ default_pay_delay bigint NOT NULL,
+ website character varying,
+ email character varying,
+ logo bytea,
+ CONSTRAINT merchant_instances_auth_hash_check CHECK ((length(auth_hash) = 64)),
+ CONSTRAINT merchant_instances_auth_salt_check CHECK ((length(auth_salt) = 32)),
+ CONSTRAINT merchant_instances_merchant_pub_check CHECK ((length(merchant_pub) = 32))
+);
--
--- Name: deposit_confirmations serial_id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: TABLE merchant_instances; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.deposit_confirmations ALTER COLUMN serial_id SET DEFAULT nextval('public.deposit_confirmations_serial_id_seq'::regclass);
+COMMENT ON TABLE merchant.merchant_instances IS 'all the instances supported by this backend';
--
--- Name: django_content_type id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.auth_hash; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.django_content_type ALTER COLUMN id SET DEFAULT nextval('public.django_content_type_id_seq'::regclass);
+COMMENT ON COLUMN merchant.merchant_instances.auth_hash IS 'hash used for merchant back office Authorization, NULL for no check';
--
--- Name: django_migrations id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.auth_salt; Type: COMMENT; Schema: merchant; Owner: -
--
-ALTER TABLE ONLY public.django_migrations ALTER COLUMN id SET DEFAULT nextval('public.django_migrations_id_seq'::regclass);
+COMMENT ON COLUMN merchant.merchant_instances.auth_salt IS 'salt to use when hashing Authorization header before comparing with auth_hash';
--
--- Data for Name: patches; Type: TABLE DATA; Schema: _v; Owner: -
+-- Name: COLUMN merchant_instances.merchant_id; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY _v.patches (patch_name, applied_tsz, applied_by, requires, conflicts) FROM stdin;
-exchange-0001 2022-05-02 20:31:57.856832+02 grothoff {} {}
-merchant-0001 2022-05-02 20:31:58.689509+02 grothoff {} {}
-auditor-0001 2022-05-02 20:31:59.197067+02 grothoff {} {}
-\.
+COMMENT ON COLUMN merchant.merchant_instances.merchant_id IS 'identifier of the merchant as used in the base URL (required)';
--
--- Data for Name: account_merges_default; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.merchant_name; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY public.account_merges_default (account_merge_request_serial_id, reserve_pub, reserve_sig, purse_pub) FROM stdin;
-\.
+COMMENT ON COLUMN merchant.merchant_instances.merchant_name IS 'legal name of the merchant as a simple string (required)';
--
--- Data for Name: aggregation_tracking_default; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.address; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY public.aggregation_tracking_default (aggregation_serial_id, deposit_serial_id, wtid_raw) FROM stdin;
-\.
+COMMENT ON COLUMN merchant.merchant_instances.address IS 'physical address of the merchant as a Location in JSON format (required)';
--
--- Data for Name: aggregation_transient_default; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.jurisdiction; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY public.aggregation_transient_default (amount_val, amount_frac, wire_target_h_payto, exchange_account_section, wtid_raw) FROM stdin;
-\.
+COMMENT ON COLUMN merchant.merchant_instances.jurisdiction IS 'jurisdiction of the merchant as a Location in JSON format (required)';
--
--- Data for Name: app_bankaccount; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.website; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY public.app_bankaccount (is_public, account_no, balance, user_id) FROM stdin;
-t 3 +TESTKUDOS:0 3
-t 4 +TESTKUDOS:0 4
-t 5 +TESTKUDOS:0 5
-t 6 +TESTKUDOS:0 6
-t 7 +TESTKUDOS:0 7
-t 8 +TESTKUDOS:0 8
-t 9 +TESTKUDOS:0 9
-f 10 +TESTKUDOS:0 10
-f 11 +TESTKUDOS:0 11
-f 12 +TESTKUDOS:90 12
-t 1 -TESTKUDOS:200 1
-f 13 +TESTKUDOS:82 13
-t 2 +TESTKUDOS:28 2
-\.
+COMMENT ON COLUMN merchant.merchant_instances.website IS 'merchant site URL';
--
--- Data for Name: app_banktransaction; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.email; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY public.app_banktransaction (id, amount, subject, date, cancelled, request_uid, credit_account_id, debit_account_id) FROM stdin;
-1 TESTKUDOS:100 Joining bonus 2022-05-02 20:32:08.901914+02 f 50d22041-64ce-4fc3-b2e2-572fe211f025 12 1
-2 TESTKUDOS:10 HFY3XJR5XH19TBKJ22ZMGHDVCQD1Z8A9DPRD9SDTB6PRD9KX96TG 2022-05-02 20:32:12.354897+02 f 0240d38f-c322-471e-b850-deb57e1b2391 2 12
-3 TESTKUDOS:100 Joining bonus 2022-05-02 20:32:19.074017+02 f 26e0c18e-5531-4e80-ac29-74187d58f57f 13 1
-4 TESTKUDOS:18 D4ANTKNHAJ99EKAHYB9VKFMKS7BRCFFK3XA662YPTEBG8K5WVY70 2022-05-02 20:32:19.767664+02 f 755ad4dc-948a-47fa-ae74-54806385660b 2 13
-\.
+COMMENT ON COLUMN merchant.merchant_instances.email IS 'email';
--
--- Data for Name: app_talerwithdrawoperation; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: COLUMN merchant_instances.logo; Type: COMMENT; Schema: merchant; Owner: -
--
-COPY public.app_talerwithdrawoperation (withdraw_id, amount, selection_done, confirmation_done, aborted, selected_reserve_pub, selected_exchange_account_id, withdraw_account_id) FROM stdin;
-9e47fcb3-2ae6-498f-b2b4-72b7fd4b5eed TESTKUDOS:10 t t f HFY3XJR5XH19TBKJ22ZMGHDVCQD1Z8A9DPRD9SDTB6PRD9KX96TG 2 12
-ac57842e-cc12-4560-a088-3ab3ef1f0f4a TESTKUDOS:18 t t f D4ANTKNHAJ99EKAHYB9VKFMKS7BRCFFK3XA662YPTEBG8K5WVY70 2 13
-\.
+COMMENT ON COLUMN merchant.merchant_instances.logo IS 'data image url';
--
--- Data for Name: auditor_balance_summary; Type: TABLE DATA; Schema: public; Owner: -
+-- Name: merchant_instances_merchant_serial_seq; Type: SEQUENCE; Schema: merchant; Owner: -
--
-COPY public.auditor_balance_summary (master_pub, denom_balance_val, denom_balance_frac, deposit_fee_balance_val, deposit_fee_balance_frac, melt_fee_balance_val, melt_fee_balance_frac, refund_fee_balance_val, refund_fee_balance_frac, risk_val, risk_frac, loss_val, loss_frac, irregular_recoup_val, irregular_recoup_frac) FROM stdin;
-\.
+ALTER TABLE merchant.merchant_instances ALTER COLUMN merchant_serial ADD GENERATED BY DEFAULT AS IDENTITY (
+ SEQUENCE NAME merchant.merchant_instances_merchant_serial_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1
+);
--
--- Data for Name: auditor_denom_sigs; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY public.auditor_denom_sigs (auditor_denom_serial, auditor_uuid, denominations_serial, auditor_sig) FROM stdin;
-1 1 9 \\x149f68b651c89fa37a4a1c3497d6001eb852d376d957c20efc04bbffc130540f3fb9c9e1de4f2f30962f09f79ab63b0797fd4b327cb7cfd63019a3a3a7d5e101
-2 1 139 \\x594297451bdc316f9f7801c2840f1ae5e99d541ae20c372b7c876761ec1877ad7c3d3fcd962ef2a7bc63069900afd0edb7cdc0f2cea782683760a40792aea10e
-3 1 198 \\xe3700d0f3894e1462b79c066f30432bd21662787497ae392a1016529d1f12d9f81a90ec8e07f3742381c553c03a9f2d01340d491f0595931575bf7e876188804
-4 1 372 \\xbfbaa63a569ea1ded26d36e296ea8df2942df9879773533005e33f3d038c122de3e66631797f6dd6a53b8d13a45fa18035ae760a7a07fe014d2016867764190e
-5 1 209 \\x2a6981ec250dff1dc0076a62046003249b561b1075188d8a3ac764438fcba6a3f4dcb8b82c9d68d241036d3af195de9c534d9b2200bd61fd9adbe0a8d283cc06
-6 1 221 \\x59f385979473c3fcb6ae37b72931deb66f986bfb3287ed2e3d5290edaa036c40f2fbdb5d5e341f350582e81dc2236fbf9ff7f6af2ff82a418afc6e77a9a1a406
-7 1 388 \\xd04d5ee6890dc30727b1a5294b6b64a41f4697e9ab8fdc01f212719a209251e7399566e3170aaf9135a1d9d100999353814df7f6ef9019de318ac4f1c5a64008
-8 1 422 \\x04686c83dd20231165c5c7ee4f18a6c7de5a811bcce5d8805226b45e8af8a98fad7ec6a9ac183418b0fb479657d047cbe04fdc55d268cb5c7c6418f8e86adc0f
-9 1 411 \\x6cecbb9205cda673598d3db01cb4104b3bd46d8dd596509acb3b3782186f7a905c046b5348451930b2f2005262ee34cb11a8d3cb15d65a44d2eab3e485a92701
-10 1 312 \\xcdf3fd8c2b0de883bd0bbd35533f1fe7b9cedd44656f679d50bb649be6e705a31d3b6b8830c77c11dbef226bd75093235532f47ef98748bca439d3281e56af09
-11 1 23 \\x9527d19dc5332df2ff5029795182496b3818da2fcfc9245be3c07ee83890a9380496f13bc3392c3b8621bf2d63c41a12624fe451ebf3fde2a051748c6b0bac0f
-12 1 267 \\xc0549b5eaedd9a978bd45f9b8769e6f39396c9560b7bcc1171dc45807e9f1f75c78f20e09fc7085eb093b428aae9a4703023ee836d8cf13c8928aead2922fc0c
-13 1 299 \\xc732094858c10f02cf61bfa44a9eb2c7de5d9ea81e92259dad0fec392a35a83ebf29ca24b913f1aff7a436644d2112c128789650267feaa8f772da07cc38830c
-14 1 343 \\x435404ad01c5e938a306257d7b4dbc65462a556c6de7d7b3cc3daca2904f6722f55ed36c3927c844db20beecfa268602d5beb70d156ff5b293a3fd54c07b9c0a
-15 1 77 \\x3298842fefbcacad27b61030d2173fadb52878f7b4b091d1dd2f22425ade36ef77cbfc6fd49a59ca5de755975fc89148609ac12b1950dd8a57d2b7cf5a97390d
-16 1 318 \\x7c1bc7b9416e579540f8b602db38c07de454977e0d79190c11b81fd761eddf76d0c0db0a4b4409fc486d45a74361157ee1eae50710d6994a9daf17717ef7aa0a
-17 1 391 \\x2b0a9edb9a903337e29a851f2b4ac2b07e82a358ba4065643aa778c8b7aeb955430aab6555e81e1a3e67e9570fa2fe20916f5503ce87330aee6124f21aa69403
-18 1 348 \\x38b9d783e277f1662d4e49b245abb3e552f015a8be2f59214bb9b5fecb996c09df9644ee5f47981d6e6e6dd3a809c7ac5132d727d6e460b4dec767efd9a4c80d
-19 1 360 \\x3896df088d81c084256982febcdb72eecf61060d9394581742670a554e8c2ab8eb28facd2f4d7354152680598812c6a0ee930a5b4eea6f9e237c0054c900040e
-20 1 34 \\x7aba15f0df2d174ca5b3ce60c13ab22088b142119405c6ac5f29c41cf4131a153787c7366235c552ad5e4191d3f7bb96058aa18971ab3770724fc9fcfc525d0a
-21 1 402 \\xe1664ba87e1a447f1908da2d3df9e188b9e0cd77cb041a33d88c23578a8102ef8ab6779bec68ef2b603e116d16d245c96e1d5577cf7d3b8fb38ac8c5d87b8500
-22 1 114 \\x22be2a0e3d15e05152e72826891243a5979b76a305698edcd834ca81e7e6562ef665b2cd5a08b41656d1887014d310834bbe96e5c01a08957d23a35e62adeb01
-23 1 287 \\x3d47a3b3948619db10f0eaa198a66d84d0c2db1e49376b48a6a6b0b94cb58abda478127fbec65b7e311dc348749d6efca074c2b01f8156437fb594a022797e0b
-24 1 413 \\x1a14c6ff3d709db89c31b1b4eeaf540d36eb229d4e364f1810e0bd25528f875a67ed5127020d4a4fcb722eee3195f4b550c53335351741b7d76205d068b40e07
-25 1 334 \\x8083994ea17bf385be258e38b6ee280dc154655c452a6ba24d453c1c1c7704a98015d938ced0ff40f1bb4cc1b10ee45b2fb3ec33bc66962ec6860fd5ae9a4b0a
-26 1 335 \\x2c3433aff168fae806af742d9b253af9ee1c2ed5600b50d8ff93d47a872c8dc352173b210098ce839b722e0aa9d3adfa1d31fb9ce6f5ce98c945e72b7cf3fa0c
-27 1 346 \\x49727fcdc441417e919cafd584a1e304a0478cea2e73fc6368120586d2f81364f92361fb513151a698d17aa0a6ee6d9fffaac915e23dfbeaf196cd02543ae002
-28 1 20 \\x0a340bcf243f4375fde678fa9ba77ebaf1bd57e9ff1da5ff1f26dbd8795262badf39ee6237b403c08cf252f4409e926abaf8b3a10b4b37ea0553e010015d5702
-29 1 95 \\x7288d06d9a9b420f179a2e5e293fbdd39c2abc6e3706e9f40cd6120c6144d5b88be5c000ceee6eb3d5f49b463430cba9b92d2b94940615287bb38a268f776008
-30 1 248 \\x4f78ac0c91353f9743325eb744a800b3903adc3b9b74cf18b195a1c73d5702353f646996546f0703ad726032225653d0126c78980b44e6bbb09a7550218c910d
-31 1 148 \\xf8dafeace7e85e4436e2561feb99e5b83d87dd830c506c4917dcdef79144253f3dbedd347a7536b55cc4b9a4d3ef64b2f9df5b0c6a603ef710f14632627a9906
-32 1 158 \\x9d0817360f2f350237cb98aa47c488b5579640ca7439f55eb35c11629e4f1471afaa9bd534902bf0a2318176d1860fb719b36cd174725884f1a0ae34180b7a04
-33 1 193 \\x76c7320573c51fa23d7b52d8be58581315671cb4549d6741ae87c9eaae3756b1e62c9952efb0b07439c0c1079736acbd9a0925c8de96a5827f86d7e494ef1701
-34 1 268 \\xf8bbb37fd21b22df3f580a73f63c4bdd24eb71da4234015f12b426e90cae7bb1695b3b3c4b31fe47c2562072c4e93de51304dc377bb0a42ca87e93c9bafd7c0e
-35 1 70 \\xfb26ab8b3d29ba3266f565943714f8edd2e5e55fe186dbe96d1997f018e59a2d7005a15dd27b00d3d871ddbddb52c7a55ca1cff3cb083362572dc4c0c9dbe806
-36 1 387 \\x82ca7d203df22ed1ac780db0b5779e6ca6db2b0b985958b66d2534d8c518e7267efacd122d3b8b3439b96d30c3b487b3aad55a690150ea981a609bca0f13470b
-37 1 120 \\xd3c92a6f1a505804ddb95a010e9d8fe4a193df475bb32ffc9461a4ac26d3414ae3a2008f51eaa6ab45cd8a288d00329dc8d3e51520b5b4951eeb0dad48051100
-38 1 394 \\x0409af586128157888fb7bee0e08ead256436611ea55a1a1a26dad1a00589496ad7c4ebca0f6bb4851bc6d3ec4a1079d8c489d81e1656bba04261e239c02920b
-39 1 146 \\xcad7ebc66936178f54c7032c0c7b21c6e05bcdb32134a82865f5a16820d746701b08633bfd107844328abe281b0796d59be6a960a43a049b06e25252091c6808
-40 1 194 \\x31a960d8528ed4a3dc9d420c54c3533ae939faf6ed73a2e68c6304272995a8ce740433334518880a83a3fbf82c34455025ba83e697dba486546a413b31a7e200
-41 1 256 \\x79e227dee8823d19f27b68a65e8c1a7eb8198bd01686f633d23efcf3a957571b76a79ac7385e068fcefffd6be7c1e64b66a6de2c573c516310dba8b9fcc51406
-42 1 295 \\xd3bc5f5f9474ab666a2de6f8213b8001ca75dfdb129f8ef49e84cb68a90cfdf3c7300cb6fb6d0b55e502903a32551e2b5e22f2281e81b7e845355d4550c1d707
-43 1 196 \\x20cd07075edeb81be4e5afbc9310110598a954349eac1b508fc538c5a68e0d08abbff0a8cab6977082bd5c98e6ca311d8fcbd0edce176794ffab40378a78d90c
-44 1 357 \\x718db20664f4b929ae6fafe8271e036b777621c82f5d196973106322c801451dd69d40afeed02264d3c7402c15a32a630b48ea638b6d20a10c51e39b17fe5804
-45 1 26 \\x8027437ca59254a9563c5d8b94987820cfd4fb6b786ebc1f767576e26cae165524234fa4dc6e3e2b8504ffb0cd192f2cb36a8c5493d5c8b20428fefba50d4207
-46 1 132 \\x3724028c01f31482d8a5f61e0e8f5de96c7297dcc63bc714846e3329a33a7cb3687585ccd2ba5a9a391ac60056b473b1bcb40f1d715edc6ee7e8d64809dcca05
-47 1 63 \\x91bdccd65e9656d97b99c0f87ba799269330a515abc95a7f6688f76af94e0edfac7c3b933280bf63ff0136ef0e405794978c71719a62022bb8b5371d6a498303
-48 1 367 \\xe18f6ac337a658f10a09436b428d4c817d00120baf1bdaeb364e964d976879af917ba670c44c74a67ecb683fab0b0dc5eeaca4c36668164c49205f95f7840f07
-49 1 184 \\x2eb1d54d3f4dd83a126d6dad3fdb7ae0ec1db6ad35088e13ae3969253003557cb983769cb83fdbd84402658c21548e54d72f09475394ed1f786ffe8942937301
-50 1 32 \\x2fba4c344ca9aebabee686c07044c632ae2d621b9127bb514a5a8a2a7e59b8b5164409bda701ffac11fb7e656e440aec4fa5f878d50838827e146a2e981d6f06
-51 1 316 \\x90635a819b62c217826c8916577f683bdfad82bc04f97e2978c88985ea440160e9e251a7e8944d8780d72097027a1ef9a599457ddf7bfdafbd0b4145eb43e405
-52 1 160 \\xcef5189f126a0f1eff621e3d836ac29a21f5933794e21d43ae7c0dc46a53aabd22eb8989d2c4caba2d2cca9043b55b6ce1776cd3eae96147e4d0233f58847108
-53 1 337 \\x189cdba36acca4461507f094c561cfae0e92463e16bdf0a50926a44266b8fa2df9ef88c8d6eac20be76dd3359e1737e14c23fc733b9225087e1aa91ee5073801
-54 1 15 \\x3f44a8762173bb08700576b42e942886f9cd82e301be3fc6a49c0929454e440260cdc8fa86cf3eca84dc6750443e7be0cba2c3a383d0e9648dd1b000c96d060a
-55 1 215 \\xfab9f5f11aa1d3875489ecd96ceba59438f0a91bbe272e417e6290575b1640ddf717973ea415adaba8b153813b75650436647ef0ff65ad1cf44be1e7881f1b00
-56 1 332 \\x13dfa221a589fbc6205619086dc0da979ef0c218bf230cf1e780b9805d18fa020cc7f3c587baba88e5c574fc390fff0bc44737c7ca04533f5b57d3db513a8a06
-57 1 52 \\xcd471e4c49c6658556dd37de42547be446ca49390b6a759823202497b3189ea98e500ddb7ed2c1469fa1383217c48277e43ed7ad93e1d3b25c6a0d72a47d510a
-58 1 416 \\x3b098f1d346b59f53c5a65986a4c0330cc14a96f429cf64a48f8078a3bfb98e47bdcb0f9f29432df27d5cdc7e4fa563b61eee01c0cc6c3b7d07b66aa07fdab02
-59 1 71 \\x593b06396a43ba696fb90cbb062018ffbeb1a7e8b78cf35abcbb35c0ba47deefdfb011908912a28680554254ac49f7546157225ec7d3d26ffae6c55e030ea700
-60 1 373 \\x5b1d66d6095222cdd7aba9cd3732bedd834a55964f2bcaa81eba5fe785ad48fc382f4f3ea9b5bf3c04beebb20009004ebd912ba2bd4a3cc23f8191173eadc402
-61 1 153 \\x57cba6840cd5d2a33e7c2bf12ac2bd5e7406b90d8b3d82e7b72fb03a30e426d9c4442e7ea892966397ff2a2aa44eeb0d8d2bc18aed4d95be1618848d27a0420e
-62 1 163 \\x56230a6e5357048c846828c1c4647edefe4a923a473e957477de092e5ef510e2433595d8036bb919a757947f6864406c78d8bac884f5e62fd6511cd262adbe01
-63 1 53 \\x5d971e5f86664e73564cc0cfc4f5664e84457d59b0f47f30e039e2b366fa52620860fb1d16d09a6eb8db1f2af170add41afdb7ede04ce4f2e2c4f6ffa3f92506
-64 1 89 \\x45d64fec9e08e791f6eb9fb4886361cea790c2622a5c287b4a5bba00e7cb2d1f1431ba3fbac87e4dfbee7540d3d6fc07453e0f56ad1b29319f4d1d3f8c8a5700
-65 1 74 \\x5120b81ee47db33f44973818cf83ea4075cd93ca4cd6fb3dd21f121dcc5c10ec7bc1e9d0bfb4928edce466e7abc4eeb9aef3d19922d0cbab7b7ff42dd355bb0d
-66 1 353 \\xa1aaeba1c66aaccf13df2ff395e8709f93caadc01d79dd25fc8d617184bc7a99c024b58549f0e66898d2b48395e94a5b87255e1ffa24e84b87d7b781c0632800
-67 1 24 \\xf5e6dcbe5f8a31aa2002d818d3f68b6d3e660a6668ea290c645d037c7c3aa2f0c2fafbe57fc19077a4a2747e1d5c26c2c7a051e3e8b7a010db43be0a06da0505
-68 1 185 \\xd39378a33ed8060b5cf097492c821408c297fe561a933fa966830eac2bfc6326e5bf9740f1fddaf60ff9364ebd790f52a699e2beaebff57af7be0878b54ccf0b
-69 1 342 \\x1cc6ba6a41acb5e2381bb030ad31661527b45f9e85ef40141d8f70ef23b73a40a795c1148e842b3b99320c20e9ded638aaeaa6891892f55d2b7bcfb566c4a607
-70 1 50 \\x9bc43f4bab2e1dc7b5adcc015f56519a57b4c9ceefaf45a9bfa8d1250b75d7de5d829764d94b8431e27642086fd8840c8b8f2fd34246ad35e68ef24b58f2a906
-71 1 66 \\x46dd0782ce85d25a4afd88ae0a3f68a5cf25b68e942c810d434f87108c421cea7bba504dfee47252b14a4be6728bf4adfc41c521e16f6cacd7da43484b735b0e
-72 1 30 \\xa06c869d2dbe56ea123b31e8f6279a82b9ab0c5acabf39ed513d2fb822dd2d81c35b6dcb9a8025afa691fca53b1577e4367815e08b549a3f390ebad38171a207
-73 1 364 \\x9d8573f27a5929875e7eb340af84298917ae3081ff7214253cf658d0b1ff43f18d555da5c9b43ccd9c092f837b6b3b5c5b1acde4e380f7b625a962c56116ac0f
-74 1 399 \\xddb98cd83d9c614537e59a93fd6df3241fe62ab3cb253381fba45ac459a14961f5a184a370d54dea7a43974bf473e22705d9080a7a54cb5b2ef526f090bba60f
-75 1 85 \\x9d72b94769c251a02f6fbde91e8250c30777660f5f61369daef1599b239f3e2653187b85fa91e086a187b5edf5be4b28627a55f5e2ab29dca76fc37c99c50e09
-76 1 385 \\x635154c7b41057b3100fb16ca1e7be679527efbba49f021a288935e6d628c9cd5c287c0626a16550361f60a310d951b45221fad0be3f2b393a1c426debf99d05
-77 1 260 \\xa7f32981140b56b6f84e551a49282384693bad9831c492cc8081504e5bbd9eb409aa6d01f17424a651d7598dda969073dc1ea3a7214fe964681502fda2bd2e07
-78 1 172 \\x0e8d44fd5342d9ae319de60b64903d598a8d3a2c301ae3b57ab8196c363b33527a39ae65a25f9525f6ceedbb26c666dac8d2bcb02a8380f5444c166ad1cc7e0e
-79 1 101 \\x46323d8936ecab0666abd7a4cd56e9453d425555cf400418a98a95e84bee237e0920f979e6646db96b95c581314d1e76ea51401316491ca3f1ffdd548ddd7002
-80 1 225 \\x6e38ff53c18125f0aadc982000184612d7297aa2658157d36d584fa9ddc17492c400784c444f24d5d95275985af26b830ecb09d6bbc605096cacbf622bccc504
-81 1 211 \\x37e7994eb165436bd03addf198b25e6830a8b686114803241f19988b3ce7d869fc5a8e3fdb233e5c857e075adbce91a1aea32c3b7632b4272858613e0905c40e
-82 1 54 \\xd0cdadd70b3d68e80d67bfce9255c4b0a3dfa4028ffd82fb748ce65b5fdcc495e6f5c81ad9864459462630beaa8ad1feda4a625b250a2b55496cbc3b310c790f
-83 1 200 \\xc0b6515b30807ad9b6bcd3fe8637f11723201b72090490fcbfae3b2d4bf25969654ba4db6453d7033130dbee1ce554d1836449019e70e80e4cf0385351d30e0c
-84 1 122 \\x53cf84b60765a81e8754aea39caf97e4986be59e76a56afebff5f06a95ba60a702085f0c850b0bf249f4501b4459f81b5eda5deb2bf0b668488b96761481e803
-85 1 327 \\x6e0a53a91acc8fda91946614dd63d4aaf0aa111b64e6fadaee097d1aae2005e675be11e854dad41fa315e2c3e9fee56c1864e0a1d871732b6a6caf6ccb500309
-86 1 79 \\xdd03bdb23089d9da37c0e02cc081d3d31e049849b708c796d7f8b20d618459e54194431beeca1ff5351dfb3c177f05dc1b8d5a11e2ad2fb8d90ae0ca393dd70c
-87 1 195 \\xe14680c91f825c8aab97f0c8c36ec89a5831e94241950c9cf8df7094e9b8d227d6aacc52a741f13ed7dd83b209c61b8f2b9d3eeefb0fdcf87ab163dc71c90009
-88 1 226 \\x561f3b002c7a8a2c5bad4dbffd31746c2fc1d9affbd833bcc952ed0ed1278c41696ada577af7e069faee24cfda01a5f8642db3257b517f72a3d94aca4e50f00f
-89 1 169 \\x43b66f8c4133102150ce3d1a719c20403c18aeb79ee16810b264ced218fb8aeb6bec9a62190e33d36f6960f90eb0498edc63d800a2c7ac8a2eef36b1f13d4a08
-90 1 117 \\xb2b4c69dcf3c66a1a7ef7337d0b3bf7e86fc58f9f24c3da2190cbb790bd86b5ab8f1592a4af109211d32c4f2c75ac32d803284d26b592597d8cedb0bcbd9eb06
-91 1 341 \\xb69ca1173ab063991b3a97cd29b954d13d2984cc957870580bf6cafcf8162ceac8b88c0f4fe5e767084fbaddb6244ed27d2a152c628ec3cd9464abc2f5a0a20b
-92 1 423 \\xed57edae62dc3a299963aa4b6960fb87c4e9e7a5e6df3fc13f610f3d76bccf4f496613770c5cffeb719d05b9caaa1769f740f74582ef8ac35dd47236fc69ee07
-93 1 219 \\x737ab08631d9b34ef14871515329506d42d4af2cef0a6175fc5c9b4bcde96c7cf7838913b890c7575c310822e30c00e9a9bd011739d39190a6c0a9efddb60400
-94 1 244 \\x73634b81e176b77d70a67be69f4d45064cda620c1da026646968d6577ca95473a72b9075024940724a210c1df3fe15f5587d9908ae272cb23eb167f7e408d504
-95 1 104 \\x4ca3effbcae3cd0c77eff0afd1552776cceb36c5ef2ac1aafb871e7fff199c97c9974876422f2934517432ec442ed1a767f7fc3bff9fb33043cec738cd536d04
-96 1 86 \\x214f6f9f96e165af8803fccd56f6e2329f2bd1b6baf300b86d98af98a7ae2f5365bc91c0d129e98401452fef4217c641fcc08f6b70df915dab84e99036e1f50f
-97 1 167 \\xaa23c2b403cfebc1348d575c89f921814eaf34f7e8d629cd6dc9925a571733401f0601080dcdab79397f2933d178ca6729c1b2c1a9d0cca416af35eaed4ea90f
-98 1 309 \\x609aa74b228d18c732657af8b85652d0f902771bea298f536254836101d659bbf969aba04e7a3e7143492c16966495aa671d3394d139b0ea39b086a808e0850a
-99 1 16 \\xa16db22a43b4e7815bfe2dd3bad2b01718af3db0096cce82cd70b5bad0855ebfd96850c82e806b0c29c2cc49bacbed3e2d2b4b7367e08867b4a0cca92ea93c0e
-100 1 150 \\xb7337cfb7370fa676c76301eaf952d74a30e0fdfe81ca9162a8c00bc13d4f999f93d7235df7819112e4237ee3967bbdcda1aac9e002ac70536bec45e833b340e
-101 1 359 \\xf931588292e70f5599e6326bf33adebfabe63a719349a4012e759de82e0db065d8822d023f6699693ac9cf2692225c17409c9706dcfe4677e34f296162404d04
-102 1 72 \\xa749155911ecae1367293fd16840826c84dcb82eb9ad7bf527a67bea058789b7837703672e5c16e4c17a01798a9de72162a49786bf03cf3de1a79ac21652450b
-103 1 49 \\x0ccd7cf3a98501c88c609fe6a780c048d976ed40656a12028174656a357e24844980ad3d54898511fabd8985747044e463501cc7352f94f8dbcd9860170eef0c
-104 1 281 \\xcfbb6118e55eed796c4cb6ae63eb1d2d6f8c185200b4299d03c52cc0490f17ef99430f1cabb7e5246c893d2d23e46808f04d6f6fc98e6ce56a106e0a01127807
-105 1 2 \\xb66a9b06f85b6e46b828bdd485cee98347048da63e2636b5baaf3a6e3e163a93ca4cbbc92db47f7ebb7cfaae1d315fd762b415822ddda60bb66b814c3ac0780d
-106 1 5 \\x42bcea7da19252ef7be76e2a23381e936654dbb91d96a301ba31f5d79244c1c03691f1cb92220ad6ae3644bb51f4bab57f3ec9aab9b2f1d3b2e76bc0a6c9920e
-107 1 231 \\xb4df160b6105ba575eceb3c297332d52e63a2092f151992ff5cb320e4502bef128ee58df5ba429ac1c885e818b87a547f452fcccdc0f24f9231093c1e2443b06
-108 1 142 \\xee558a14d48ef11d7db6742b92c6f11ef6914690a17303f69fbcfd2342765a60b3b38f301317871985a40bb66701f1f6a0e1a795b6c64ad81208085695157d0e
-109 1 83 \\x26542c789350350ef0952e21cb7bf6a97295f3d4116329750289d0f6d4fe976c70f22150c251433ec13cbedbd371fc1e0df1ac3862623579a76de11645cbdd05
-110 1 311 \\xd724231233533efb7b01aef49363b7c9f5c7f5f1a66dcf6a9c727761124f70b3907c5e0c61fb262e92e66cc64d15f2386d9ab21b1ca5366efe8b06d49ce8f004
-111 1 407 \\x43bfec64f57b86e4ddc6efdab6d228e749fa50f7eb682f024bfc076b034a5116795afd1f05f99868231ec35a5253f0447e5927434557161cfb8a9c53b5977304
-112 1 410 \\x9a72db1b1173c632dc1480edac552bba55e7cc1c7d46cf323bcc5413aabd50b58e4af940a5a82b51d976ae15a67c58f77a450e53b20d026adbe2454f0d5b0201
-113 1 149 \\x621f1931cf06ad5c227c0ae8c7c02138b0a3547be3541e5a7473c827ee49403275c1528d6994045664f80feed96f57fbb1f3dbe8eedfc6a3e6633cff3525d20a
-114 1 296 \\x0de29d596a2dc67dd3cbc8f64ab30fc15c215414658d327218d8def30b8f20922959901055d4e98b87087981b80c2fd0d613efef6037ceee78c06b1fbeec730b
-115 1 58 \\x8f3676a679aff4e0a27f729a917e5916fd8abe0df789dd93d0574a1ea020cc6da03143ac48d41eba11acefc38ce0ef1fb77436322be501f21778c5658a1fce00
-116 1 355 \\x3efbd9541496028f58a709d1880b5677cb5d0fdbd3e5f2d5a0cd070854ca83134c437b53b7c38f5d0961eae24dfcabc1caa4abd49e5013a5742dc0dd6cdc5309
-117 1 351 \\xff139c839384552911ed2faec23372d8c546107a3833db79698eeaff890fa53fda1f98b856b52bc057c529129aae355b78bfebdc3e56e7bda1beb9186ce88a0d
-118 1 80 \\x85daab785b66698d08d417cd27c09bcdb3f193f99195927e70401acd4218f2ba9a0df7e36535252d4aca660078be5c91723824faa96202ae97ef2569aeeca505
-119 1 222 \\x168840b52c8639e2cf0d6090394f34423dc49f52a4560138949ffec290699e74443d7bd677863c21d6d491c2ede4fb40b0e0f6c5bf9b80e7cf8b4747fae6f40b
-120 1 347 \\xcaf08ee861c817a649ec4fa635c140483553d6ccd5207aa98248ae62e0388baad4134770e80979ded3c2a584ecccf28da405159ff5e918ad2b7382e9d32d570d
-121 1 249 \\x75532c2571de2f27ea2c6a7de51c24818fea333f9e48353780ac771bf608b9e82c79fad71e5e410b05ccfb6eb648b511ca673bf5b63bdcdef51091d319e4660f
-122 1 284 \\x0ca010e872eb379794b1262f7b2ef303f477ef6371316dcfcdc1621d4bb8b6dd1a433fa563c7c600a1d6fd4683aee512fec7d2102eea8b353c122d7419139709
-123 1 286 \\x9670f062b0a3d5c5cf1ec9e7511b0d573a5f113468784853bf15b0e60402e7e6ea80b56e96879e504e8580b7d68e9e99929f20d19191618c14af06beb6ba8606
-124 1 420 \\xce4ea0dcceccbdde9f05a7c3da54a410a6379f6137b173a90340fb958e4ca5b76d2a517ff92d7f589e5983e1cb2ae88f641f274d15a9e8b293ebcff7f12ffc0a
-125 1 320 \\x1367df878f16df5265dd2820b60babdb712131de336bb0befda4b0950794a4b39dd5a0610d81431c98461687bd3ea78c3ab4f137a656f278fdace116e1df0608
-126 1 250 \\xc426f0195b8aa30c793f9bf8dde1edc8081cb69ae825db8b424eb144113959dbc0bf30a2c511c5ba8de4d864cf15d77d8ec37a323229ff6bacff467a4e16190f
-127 1 277 \\xc7e403382718076143a1b3d292a248b49c5271dd4dc3deddaf05f7ea9ed6eb1902193aed67ed0fa6f4b4024a029814c2f813d638ddcc2d04c14e5293edac1e0c
-128 1 155 \\xfb3c391673aadeb1d8b6f020937a8ef6ac9704d6169b2b826a69e26a4883148d7e207cb126930fe6896f74143fcb93b2d1cd58549872c762df900c3c8a6b0d02
-129 1 228 \\xa71ce1c39260b3affe3e7ecc2629c30311c27a10f1a7e265d6273450defbb7650724657637fcb6d7504a5c2ba2041dbee55d931436a5b618029289821b5a8504
-130 1 99 \\xceb82c2a023875b47519e0b870673beb2b8c34f0bb814465401356f461cc128afca2b73c6a67f0ec6088f9e714e35f0866b8650a50231b77fe6099654000620e
-131 1 238 \\x58195e59392facfbfe3d7c698972a8fa362dd25e85d4a1fb768c3111bb4e90e71bc5a183068a1f62e5e503a86117d61548b143c86f8615652a0b7a3543104602
-132 1 7 \\x2203f39731a3c9236e03209595eea7f6d464d4082b4c588abf7f85acfbcd3ca543f1aa3b0fb6b444cf890d62c354a8dc2e19246482ccdcc46a006c76ccb14b00
-133 1 161 \\xb49e78c4f37a82e94da2cc5dfc713e44c937443ab93037377242143b3acca5e4d2b9178d05e8be49ae3e58b1fc2e339981c112c4c5feea4b664474033483da04
-134 1 181 \\x71193500ffd275f4fd6b0417544adb6e37e3d74390ff00a295e74f9c35a6fbad44a6e9e5bc4dafd44b08a40f0361ed59d7555974a38f36a4e9c77c6a60df480e
-135 1 314 \\x191dfa87a1d0bb304b3a735af27ab31e6fcdb59ed130115b9aa27966695c9db4ab3c33fd0a1db6b0341a6bbeea6c6aac3dce907bf7e5b2fa37ee35fd72a9c205
-136 1 136 \\x88b55b8410d235eb55b71f7bcdeba324c967cdbcd949ae2f91e1cba59ee4970f4b4659b39b8ace8153b0e6aa6002fe0eaa54df4a0c5a65958b31471dec12d905
-137 1 247 \\x1bdac75ba0409bf1bcce1838a1a848b155173d6b97df0c0799b88431058b22ec98dd28cb1908d3efdde0c21aa103dce07a153e8d386328ab3d1914fdc38b740f
-138 1 131 \\x8670cf5c4b3bb2d0a529b830cb3392322763ba1f5073b8227db65a6b1a76dcde70084d6d38aaccc229d4f45a109bf086151c6ec58c29473de2fe162a1fdaa405
-139 1 370 \\x9485a6eba25ae92cc34c219ede33f923699f64409fa20fa25f785c69e0ca37a845be6b9081f04be5d3986bb5cb363fc04290b758f1d19b612d236b5bfe222206
-140 1 324 \\x7911e6b47ac43d174bfc812b27553e72d71c75e5d349009ee6fda5c252aabe089960321b365c4f3a938ff128e9f6972b120695810d516e89636c4e4461ed5f02
-141 1 179 \\xcc221b001d5d79e6c2c47ac933a4b2b6306a3c910cede34831a3b44260a1cd4844688a13af15df31ceb54e2c779c758b0244f4ba06fe1b169717625db9dfad01
-142 1 288 \\x3c92ea594c0b204d3600817b1a4cb21eecaf39d51a57da49c10d49276eeb445c026589e2ffc512aca1f8c5bf17d68dbb3af6ea68abb2b485568ae2376f35340a
-143 1 395 \\xf3ef4a654cb88b7d47f3a2d7df5299c8f973b3a11e178349fbf5e72a67845bcdf4a92a65d83392262db098f7fbe8f288898c821f0a9ec5384dd4a0e420d1b904
-144 1 73 \\xc8a403ac79e20c3e26a5a724ba379df5912fd0fdbe718950ad3615b264db7007fb5cc3541292e8134bef23865a36d15eada222618f7546a3445bbdca431a3608
-145 1 344 \\x159b796c992ad025bbb8434db9bf2dc4a14b39fc7d1d04fd5f882478365dc7d724a3ed0e8c42bd2142c741ae87b7ed5b0700e0796d73e78e0db30633b0ac6206
-146 1 212 \\x809277a2b58b72e8f6abd41813078616244913c6e5ad1c9fd38edd37f8543db6a12f4e3e144d1169842da5a895ceeeaa0b51e13569c895dd3829600d4bf2880c
-147 1 69 \\xf1864125bc7d12834fc9d45dfa145a857710aa3bf6f177c3208b30e3fc0b52fe4a906fbbe48964f44f8096f8118f4292d24dad6468fb1359237cea10e7f25501
-148 1 175 \\xa926b1855fbea9c1dca3ae43d9c0e9e9277bfd5d5818b08db5aed80ab9e81a787b868f1ee7c127cd13419b8ffc11abd32421fdc956a67b3842f5bfe40684f90b
-149 1 315 \\x1d21ea0f550ff62247bfa2db635222d6e2c09578baaf9bf59970517d3f9611ab638ca967ea8508fe6fa15d69190d1eccd2ed6c993ef37e5c2d242599ccdcc908
-150 1 298 \\x36932376d1c0b22eb2d2df0f3bfa4d97ac952304309766c90fb30137007214abedb7698e29f939a933a9109d043acf33823929959d4abb3ade5340af87838501
-151 1 300 \\x8d56195621f5ee4751eaf72d730dea8326a6440d36de94c4cc682b47298046ab087dabd506191c67db224095db5520523a0f0738626321745e0c167dd0937c09
-152 1 303 \\x7184a01d6631c937bc7c360913a2372a6e20a8bf9d40d49ef58d06cf2ec461220e85ddedfe5b2fd298538d4a00eaa4eb66c5a822bca6bc36caa7009346c7ad04
-153 1 203 \\xa289250bb8ef962ca7557ba1b8402e639f6b90d18b7c50b1457dd14ed309f2134aa008dc18ca878d9c74c510da635dda9a1626d96adec898a901d66772244d08
-154 1 241 \\xe76a97ef11d25922587edafa9971d650b78d1af252e176a17698861029be72e7cb44cd94a441921ce8d3a9b0382199d6e61afdc926efca856e59c4f55c31b10b
-155 1 39 \\xab28c8e644409d1cf9ebb15f8fc114041b174d1f0746eb8c776388a5e39b665f64e065b53f39c5e8052f73fb0635c0542224d99ed42d3ebd0857feb51e50110a
-156 1 270 \\x8cb9b273a28a2ae7c00eb509f1ab9299e6a0470278cc6890ed396d0f4b60b26410b6ce643d7cc3121089a6b235af40ed6188e2ac76ed4fec1670b7e84b9ad30d
-157 1 378 \\xdf2577c10ee60d69a6fd58c18259f4d74138ed114fda9d5561161143687f59dfaa1e533ac29d0f1da3fa5efc6c38132ab0b7981def8876782c6aab9af193900c
-158 1 383 \\x4da49ce5aca035d969a0b472276e04835753bcae11b6b3c35952b31217bfa75d1ab588c1e3a972ac4ee6f8fda47e9c63690cdd42f99577e9bcdec5fc1cdf410a
-159 1 273 \\xb163f80e7c9f04776ccaf34ec5a7c4e8b92952de30900300090266d894ccb3fa2c59433d921c4b3136837388dde32550a8d875868b1d544c5144827b802df201
-160 1 141 \\x123a7495b7f73e4dd93e06631618416e2fa5d105cbe7828acd8ad7809e36d484eb7a1aa02827e5df78eb0e0219db66989354757ac363e56ef23ce027b1587109
-161 1 408 \\xd176c6df475bae2a3c961d542dd6e6bf505cb763d75a0899050c03ddcb50756ff2920fe1dfd7320295e5574ff73378ab7f8d689d3f18fb44ec1ad47ba3c7fa0f
-162 1 272 \\x657f985b3b62be6fd247168fd28678c58041b5cf4916d8cda6c8535e8c0f4c89c9963b377ef732d4f5c3baf568c1336f67c513db82b0ab0a24c80489f1afc305
-163 1 271 \\x94672250e363c35c20bdda6545554dabf02e8d37fb7da6d010fd6f2b80f8183d33407d9ee361bbd837fa688fee1fc592c66f14e4ee2c6c29cfbbc25f9723d001
-164 1 229 \\xaec1639fe4ef372ceda92eedd8115fbf0902ba3dc7631fd7d0d6c1bbfc39cbf08855c40ba9a9d95255f312c2e2fe09865fbbbfe1441694af274593849fe5040b
-165 1 239 \\x9a92864d11d1356fb1f6a71f7037ce856aa1c75ba799813f90324fbc998a7881003b8e6b5fd1327d74c3475204d853bd67331cc84f0eaff95c0044937dd9c709
-166 1 57 \\xe8279886fdad2f04d93f4883f3e69a7049d0844a60eba4d8cbb0c551524b470b85a6299fef55c292d96ab6956f99a4244bd19e7b2b95c6907c70ec61b6409f0c
-167 1 94 \\x725db14eaabf89d3d40922bfa617047a42af1913c6b67bb4df9abb6e9f134c378f1729f4693dea0d6cbaf0db2bfd00157ebb3966096894156517caaf62f4db0a
-168 1 102 \\x839fa1e9c67e87694800eca29cea65d86765fea168a9285fe42dc8a31d7816de518306257cc1f5eb4e393110c29baf33034e6f3b141a49a348f8bb7c8ecd0309
-169 1 170 \\x8f4de9ec01940aa304cecf127c9c2edf293a4c5236bf1704496793707c3bd2967f6f82ddf8d32ca02e192df66159b893ad177bb603144de2c4a8601b0d101c01
-170 1 6 \\x30e07bc3b7bd16bf0e380754570b9c9c7b43826a08c2be87d7677e44931092872d7ea244e8a5dbdf286075e4c3d3d0ab9e78deec231ef39193bb44cd3959c501
-171 1 42 \\xf81812cf43fe624efa98530ccc5d4fca299f5613cf3b45af87e8798de4ab0a60a882b1c1e7548477a69c1d47af5b0a1760e2d99575066a61a2984528d1eaa206
-172 1 109 \\x0b35cb348f6103ad1a947e9cb707bda1e5778ab2cc0329deeae9fd038b5c44969346dc5a8f8c2c60df5c7d0a509d73e408a2e35894b9358636ec33dca1a67200
-173 1 192 \\x53a946b2a9ab57f7cac46cc7db39d014f6d1adcf44860afce85222b8bad2645f991d79be594c6306d91f81c9f7f5fcc75ecf225f9a7858d6f3872420ab5c9708
-174 1 4 \\x06849a5232622997d0e0ebc63f18eef870acbd305c025f031ee052c9104936fcb0bcb84bdfcfbb1314d4eafe05f73f64ad9a9caa3b7a45b3ed095f6fa107c103
-175 1 129 \\xef91f01b78876b72094ba06e786adfaf2d148e8a777e98ab44551757fcb87a92b4bdacb3443d42591d0fde3d19b4df870460ac9d86c9882605372112eea37e0e
-176 1 305 \\xf2f4c6396228a2dbf1f4a6eed01af07ce501bf1f31ba7a72e02b7f76cd81aaee78958610c467c8e680ddc0cba227d3b09da27a1b6acc282360b6fc14cb7eff0b
-177 1 133 \\xccb7df5a2dc7b4055c81a1e6ee12f91ea92533730783af98b07b3a4556eebf804a08c7fe3b4971b867254261105f86aeb1c21a3935411d3e6a41ed7ee6da9003
-178 1 59 \\x540aca17050fcb1a74f299739e03404a4cc34026c3b6163b246fb765d5004afcb86576d3d1b21c58857c53955391ab4ea4b27a209996b28947c4788fc0c82b04
-179 1 310 \\x160dcc0658e1d0d1106f0e312d40a0285d7308f74a13956afb7c1501339c091b9c4f279f7d55a0f958a07e61314ed527256cea00a9867d01f2dfc92e726dc307
-180 1 406 \\x5fc7be532317f9be346652c42735cf7f7ce5263324901c175738c9ac3eddaa4ae97652f80adf18cc58c8e5a8e1a9aa2a5ca7fba6fa8877df8ac47ba9c9f7ff0b
-181 1 266 \\xb2ec3b43370951f742f1cdd3694451dfc4715de1fe4771cf39e009ccf1e1c53c372a34062b71f8123c3b235263a94ba2a467eb705c2591c32888b07c7db5c008
-182 1 12 \\x99e47e057824a9dc2128ff70e012f2b810e72b3fc9e3338bbe31b2b3c3734cfd9dddb61f40b8817a1a5ed8ac04cfce5b54bf738794d5ebaf1ea100a4583fb601
-183 1 107 \\x1d724af9165c5f86e9c6b2ff5e44671dbc6f3621680d6c3d01f6d360f2697d571e5bd9d2bd60f880720cdc8721d9a8b4f74d3fde1330519c35dad4976a2e3206
-184 1 417 \\x01c6009147a711e2e2db74bc9706496b1615d3fc65d0975a2c0d50c33254ee3f58e3f0b8a41858304918a380b8abf7f16717da966dfa105dbb36c70332ace909
-185 1 159 \\xb25874f6f717dd45b3181bec28b836bfc2090a53332bc80084b8ef47086a95862286c07c76f30dfef97c4614437efed15bad18fa6486ce3b58cd7d342605fa06
-186 1 87 \\x620a8f5c5464999e878d93b3b26697b396493a9a92e20fbcb0a387cf08c36ccbef08ac3450928dd3e9da2bf1b8303ab09f74feed1b0b9810ec2067c6ef6b2705
-187 1 246 \\x7d46b0bcadd5fd64d31a04528367cca6fde64de8c38c244500b2ed293e7cd02a5128fe3f1f0ac2a9b4c924f7463dcf7251f79fff3426944852a77f6fd2404d04
-188 1 115 \\x05fcf0e090eedf39e6dda17ac0075c235998c13b27a003e9c6fa45229db66f765272a8730e0d6656847d7e1de3b4b9914a9e620fdb827668f6689410d32fcb0a
-189 1 96 \\xf38e8aa18ca335770345f2ab79bb8a37daa1610ff28efdd2f847389cd660ecf50c105637e845f9d115d97f263f79f7e4713d6b9a3e9d4a2cf4012017c7c18003
-190 1 313 \\x5ecc1f6f01efe5bc8f7c6d619d81f17b3db1e6a6b1e106ca51f6e1d38839a1d3c444cdc44b1c54bec475466e4cddfbde9519e065b764a841898432e162d04b08
-191 1 390 \\x83d6c127af7a6542e6a1eceb632b7db669c658d0e321d22f2558f18292712e43632d3d8fa42e37fbaabc57bc3286dac7202090a6d49167a99439574a8afc740c
-192 1 130 \\xd1228a9a9fe4f7bdccbc49663f64a7e2386d845ef33e0290871ea136555226eab90a35095dfd762bbfc592daa95e5182ea8ec91a4d51f6db7799a6945acfbb01
-193 1 126 \\xe3342f51e58fb911bd21b757fd23bfe1ebd6885b5eb4c86dbcab4a44ffb871ee1a472f4f083cba995c942289e30970cd63769e65aa08125d2d43d801b6256a02
-194 1 369 \\x03ba5a814e82a932058662cd09d0cb3562388966a997b9d98a1d867a0bba2712ab68aedd0190aa7aa6e920163b1594003e312331dee75880a4daf47490fb6507
-195 1 240 \\x5e997b1c43b432586115eda00cbfd702d4cb346e2e4dab0dbc3c95a939228bd338e9519a3a5bbeabab31175c63df667dcde84b891fa3aa4dde6de9470265000d
-196 1 90 \\x818f1ed04e736b53e75a178d384298c881200a1333c0420067f60f768a3bb50c160e159a94faa8ede7939da16d4943299d86ac5703419533ffde9938d94df70f
-197 1 389 \\xc23026e8e3049ac12fa368ab6c2902d109c64a9bc5d361ca40af36600c2f4b08d89951c7bc4c0c878e0ac4998da4abb39caa664e3cc309772b5cab0beaae8d01
-198 1 400 \\xd3a36880c78c562f348a9c127cdbee21c50f787d761eadadb53b1777b70c9bd05ad84f269f2270cdc34f979480c50e20c95ffc55892dfb09b107eb1f59a1ee01
-199 1 255 \\x94d920c56c061e183c280a87a4867096838770eff469d56e8f0d89eef97be66e6b7aa2b1e4abd39cf89ea9ebf6e044dbf657ef9723394265ab5376928b04b20c
-200 1 322 \\xdecebb7567c7833fc3a2cacdc78935434aeaf4b40c24671eadb0d2302c611daeb095d841ea08c5e3b4926af64785fb3d8b498a5752ce2a049a2ca118deb6780e
-201 1 319 \\x4c662c84e7bfce7b207df43ea94cca4386363a10fd5a08b9cb344a10ce15ea726927a72dbe9188be47957d74495e90c6c3beaf6e4b98fe70e91aad5a67958a03
-202 1 143 \\xe6644a45d77fc2ae37d34081464154207e89b82e2ebc8d31cc1c0903abc50725c33a4205c80b235af17f981e5f319b8fcb5e8192e49c0037fa6d74c6486e5d01
-203 1 307 \\x751e21fd5e281e28dc12263682eba9e80a647c170d7b02feb27eff3d7c84e946266cd17daaf3b2b19c54d080e3d7fccd0000eb3b7634e17669f746dd360cc50b
-204 1 60 \\xa3be50a3a074557be873a6af6e646d553f682dba582c7ea9de88c6b7f1be79f2350c02b0c979adf522c36d135b1f0d0412986004689ef045e699db35bfbe1606
-205 1 321 \\x896b8550f1605443ec355bef0ef880b1553d76f598432dfa8bc15b12869ac6a9e678f28a690b5e202894a79edb4a01b714449fe8fadfcff9cceaf7da53449c04
-206 1 291 \\xe8b23cab1bb7cb541cc21cf8631e3de55ab83a3bda43779a25333556baf58c1168ad362e647c0ad41f7fca56179d22f9d5aa919cb8b410402340b506c6644d0b
-207 1 127 \\x750ee5fc36aec8bba3af9fe1e7034c8cfd571d1db44ebfa2598a3574307bf7ee04f6d582319462be1e2828067aa08c2f504cc553de18a098e00d3173d9ac0e08
-208 1 17 \\x5b2435ee5cd7d8de8c36b4c81961c31efccef2ccf4829ddba660b3ba49be87965052a6997fc5cc4d477c81325ff686268c368285b874afd7f0db71483aa8d60f
-209 1 138 \\x472dc8038d00075632160c959aaf057173c14fa234eae471e010c1594c813ec0ffcc204b64ed0bd83824550e066a4bda58298365d9ef88c5b3f653ef62566003
-210 1 152 \\x0224f65b46fb690a8b693c37b471a652fb77acf2c2bf7920b6c11cfc98d49c83e187fcf2f2d3aa636d36a8cb5621bb07ac64fb60a9c89dd78fefcf06dbbb0a06
-211 1 325 \\xc7a90f187df9b2830f20a9f2134424de133563ba18e26b911e9352c167e3423d97886d59f325dc912dfb2ec0b99d2413013c6aeacda38bd9c8bed0038dd13a04
-212 1 140 \\x7e72f32ef9df1222522cac95934332f92822c1eed9795ea338f1f75003cf3e272e12c24033b9398d0814fa8c8874a388c826eef16e86b993401c617ede162509
-213 1 31 \\xabbcc159f592c163460df2c9f51850def0442ce0bc8db4f3b1360fa9e6e50dd040bfe42676ce2b827aeeb78a6d8437726ee09efaa24cf0915c5d9ad8b3285e09
-214 1 197 \\xba1b5409abe1d8d1389e6295473f6816edd8dd8601ecc96f963edb84a200ef2eac773b109b6550347c12b7b61da79199996b73f953bb8e6553a27cb98445be0c
-215 1 409 \\x88adb2ea0e02c479dc73415d6a665db42088fbcf1db77f5e98836f12a661c91db75f1acbcbc9b8043bc1d2fcbb9679b3e44673b10be91746ea3f21d512789209
-216 1 412 \\x84824b3e3019d4855464ae7649e9bc61b6e292d2fa625c315424c7c1fc1b023562e7812a8a26af923fc5240cc1dad0fd87185636c79679193044697aa61de004
-217 1 65 \\xdacc947e17e8dd0a485234cb2a62f2c7ce5fd9bb4eea2a13ff7a852af867ddda6b01b75414d37b585c540b9a7ebd9c8bad6fc1a4ca8d14be97754b7a522d4006
-218 1 147 \\xa42efe7e2bb10541fdc8e17c4afda4b31435e63d6a69ab0feaae644c0e3f7f85b8ec78b29d84e117caee4a52645b25931959e72c59a31029d3277258d090800c
-219 1 78 \\xb1aaca26a72eda44ba63b6e6c706a6fa973db4e2092f789f262e8690c2ea0a6ed805922f05cc5e3e6c4f1e6ac8c0e93c4be2ac562801ab51dc933b55497fc60e
-220 1 14 \\x46e2fc48cd5657f91f14d6d43f82e9932026c0f9229a60af48e28f7729a7dd87dc2ff71c365f0dc1a2f4b73725ef9728635c058a53b12b143a8bf4d02050750c
-221 1 67 \\x7a41fea491af6c58eddceb58bfde7224fdfe089e3d7ec3c87ef4290ccbb2ffb9df504f850aec654d1e7a967b98e41ebbea83b3385ca118e6d0e53062e3b03a0c
-222 1 33 \\xed53cb4869668291b1d638988bb85c8a509fbc52a6fbae6c831cc62cec3fc55543b0ed266d5ea4d6ec4b081226cb0769bf28ddd5d1e4265174e1f37bca395406
-223 1 254 \\x1de2c13c4a9b15c908f13eff6cf7b401d69fa6db3d887aa90dbec76a7963acf27b43305ff2f28ee78e3b0b31081fcc0420015a78b5ec3a62f645907121f2300b
-224 1 227 \\xdd7a0ba88dbc83839dd8af0c001842daef74c28765b879e674d9a5c576fa4b0ae7bbb742b6e48c3b20640e45ebd42d5113263a6f10eed4213bbaff102d81ec02
-225 1 361 \\x6f0d4ed9075b4463615b1443a6cfcffafd3eb314a13be92879044d019280b0990a54f1b3d1116e385851fd286755f5699abe80bbda105dae640c9262a4c7900c
-226 1 206 \\x7278b64bf297093df4e71877f32d20cc08ddf20da2895b17827b3f1ddfd015233da490d03b0fc0555f19288154696805116470e32d02a52bafbc6c84de556e01
-227 1 293 \\x4cf474e98eabf9a88db7d4087c0d9a6f9b335d455dbcd4814c0c3f7d90e615ad7b3aa03c6bcff659704203a62847cee15e671b784353f483e6f9c841ba62d60b
-228 1 84 \\x04b7f5f1f2fceab5b733c75c0ed15080cd7273951fa8978e4093ab79a437a9d000ff77175c74cd87d2e19ed7d196a36b4c267d748f5c7f687bd0f9f741d6010c
-229 1 396 \\xf3ec028db008d500726b7c6fa24da277de7546cc163826dd371ca858dc0b6d28cf31623278ce4b62f3faf4f9f2c48cb676692ca8ff8a9967310a43f2d59a4500
-230 1 317 \\x7d7bae62a5b1c869252d322f3546dc98eda32a88f956302e9b220463e6548952ac5d8007f5f505280d53a32b9be1feb034e61eb283d64f377367ad189fa06f04
-231 1 404 \\x7d2c15ce7a2fd14d3d7ba395652c19190ecd9c303bd5f4f7857f345e88299811cb2315d4e218a19af041b869a1e196a89de3dae18f49943153d3b2296dd4fd09
-232 1 223 \\xbfa301a330421878bab2e386fb7b91fb26de3115157581ec1d65bfd93682796ec25cbdee55d50a095e58fd9b8acc2c756820168095537337ee8f7e3a4937f707
-233 1 280 \\x834c3c879aeddc848ff17f293c3dfade1fe22cae10d4d9db0137688537cf5e48cf337c269214abbcde99abdfebd37a5a94d21f613d2450c874fa1c25aad1eb06
-234 1 202 \\x6efd96923bf10bcf272aebb80934972abdfae1e8bfdfbc9b1f8fd55ee08175ac67ec4d2d0ee520f690d27d4a7ca540d228d197f873b9b3708655b2f41f8b290e
-235 1 93 \\x5a5c8ad5c4d13be28cd40464569a48d4b3624833e5dd61a05009869257ec87fd86217610ec2ac5587bd604562e27b62d6cec364d662c09ef5786f9a2699b650a
-236 1 187 \\x856eccaa986d07b47c16430edafa4b340d68fafe19e4d295bc3a65bec0d043965175948dc165fe6de0a04d35cd27b1a4f397a4891ec34eff0a4ab0d5e0584a06
-237 1 214 \\x466067a5a54b43797a7046010db7f190945f41e93cf3a5bf3447cac4354ddaf8d1e76c2081c