api-auditor.rst (79023B)
1 .. 2 This file is part of GNU TALER. 3 Copyright (C) 2018-2024 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 2.1, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 16 @author Christian Grothoff 17 18 ============================ 19 The Auditor RESTful JSON API 20 ============================ 21 22 The API specified here follows the :ref:`general conventions <http-common>` 23 for all details not specified in the individual requests. 24 The `glossary <https://docs.taler.net/taler-developer-manual.html#developer-glossary>`_ 25 defines all specific terms used in this section. 26 27 .. contents:: Table of Contents 28 :local: 29 30 .. _authentication: 31 32 -------------- 33 Authentication 34 -------------- 35 36 Each auditor instance has separate authentication settings for the private API resources 37 of that instance. 38 39 Currently, the API supports two main authentication methods: 40 41 * ``external``: With this method, no checks are done by the auditor backend. 42 Instead, a reverse proxy / API gateway must do all authentication/authorization checks. 43 * ``token``: With this method, the client must provide a ``Authorization: Bearer $TOKEN`` 44 header, where ``$TOKEN`` is a secret authentication token configured for the instance which must begin with the RFC 8959 prefix. 45 46 .. _auditor-version: 47 48 ------------------------- 49 Obtaining Auditor Version 50 ------------------------- 51 52 This endpoint is used by merchants to obtain a list of all exchanges audited by 53 this auditor. This may be required for the merchant to perform the required 54 know-your-customer (KYC) registration before issuing contracts. 55 56 .. http:get:: /config 57 58 Get the protocol version and some meta data about the auditor. 59 This specification corresponds to ``current`` protocol being version **v2**. 60 61 **Response:** 62 63 :http:statuscode:`200 OK`: 64 The auditor responds with an `AuditorVersion`_ object. This request should 65 virtually always be successful. 66 67 **Details:** 68 69 .. _AuditorVersion: 70 .. code-block:: tsref 71 72 interface AuditorVersion { 73 // libtool-style representation of the Taler protocol version, see 74 // https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning 75 // The format is "current:revision:age". Note that the auditor 76 // protocol is versioned independently of the exchange's protocol. 77 version: string; 78 79 // URN of the implementation (needed to interpret 'revision' in version). 80 // @since v0, may become mandatory in the future. 81 implementation?: string; 82 83 // Return which currency this auditor is auditing for. 84 currency: string; 85 86 // EdDSA master public key of the auditor. 87 auditor_public_key: EddsaPublicKey; 88 89 // EdDSA master public key of the exchange. 90 // Added in protocol v1. 91 exchange_master_public_key: EddsaPublicKey; 92 } 93 94 .. note:: 95 96 This endpoint is still experimental (and is not yet implemented at the 97 time of this writing). 98 99 100 .. _deposit-confirmation: 101 102 --------------------- 103 Deposit Confirmations 104 --------------------- 105 106 Merchants should probabilistically submit some of the deposit 107 confirmations they receive from the exchange to auditors to ensure 108 that the exchange does not lie about recording deposit confirmations 109 with the exchange. Participating in this scheme ensures that in case 110 an exchange runs into financial trouble to pay its obligations, the 111 merchants that did participate in detecting the bad behavior can be 112 paid out first. 113 114 .. http:put:: /deposit-confirmation 115 116 Submits a `DepositConfirmation` to the exchange. Should succeed 117 unless the signature provided is invalid or the exchange is not 118 audited by this auditor. 119 120 **Response:** 121 122 :http:statuscode:`200 Ok`: 123 The auditor responds with a `DepositAudited` object. 124 This request should virtually always be successful. 125 :http:statuscode:`403 Forbidden`: 126 The signature on the deposit confirmation is invalid. 127 :http:statuscode:`410 Gone`: 128 The public key used to sign the deposit confirmation 129 was revoked. 130 131 **Details:** 132 133 .. ts:def:: DepositAudited 134 135 interface DepositAudited { 136 // TODO: maybe change to ``204 No content`` instead? 137 } 138 139 .. ts:def:: DepositConfirmation 140 141 interface DepositConfirmation { 142 143 // Hash over the contract for which this deposit is made. 144 h_contract_terms: HashCode; 145 146 // Hash over the extensions. 147 h_extensions: HashCode; 148 149 // Hash over the wiring information of the merchant. 150 h_wire: HashCode; 151 152 // Time when the deposit confirmation confirmation was generated. 153 timestamp: Timestamp; 154 155 // How much time does the merchant have to issue a refund 156 // request? Zero if refunds are not allowed. 157 refund_deadline: Timestamp; 158 159 // By what time does the exchange have to wire the funds? 160 wire_deadline: Timestamp; 161 162 // Amount to be deposited, excluding fee. Calculated from the 163 // amount with fee and the fee from the deposit request. 164 amount_without_fee: Amount; 165 166 // Array of public keys of the deposited coins. 167 coin_pubs: EddsaPublicKey[]; 168 169 // Array of deposit signatures of the deposited coins. 170 // Must have the same length as ``coin_pubs``. 171 coin_sigs: EddsaSignature[]; 172 173 // The Merchant's public key. Allows the merchant to later refund 174 // the transaction or to inquire about the wire transfer identifier. 175 merchant_pub: EddsaPublicKey; 176 177 // Signature from the exchange of type 178 // ``TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT``. 179 exchange_sig: EddsaSignature; 180 181 // Public signing key from the exchange matching ``exchange_sig``. 182 exchange_pub: EddsaPublicKey; 183 184 // Master public key of the exchange corresponding to ``master_sig``. 185 // Identifies the exchange this is about. 186 // @deprecated since v1 (now ignored, global per auditor) 187 master_pub: EddsaPublicKey; 188 189 // When does the validity of the exchange_pub end? 190 ep_start: Timestamp; 191 192 // When will the exchange stop using the signing key? 193 ep_expire: Timestamp; 194 195 // When does the validity of the exchange_pub end? 196 ep_end: Timestamp; 197 198 // Exchange master signature over ``exchange_sig``. 199 master_sig: EddsaSignature; 200 } 201 202 .. note:: 203 204 This endpoint is still experimental (and is not yet implemented at the 205 time of this writing). A key open question is whether the auditor 206 should sign the response information. 207 208 209 .. _auditor-monitoring-spa-api: 210 211 -------------- 212 Monitoring API 213 -------------- 214 215 The following entries specify how to access the results of an audit. 216 217 For most endpoints, rows may be marked as 'suppressed' to not send them again 218 upon subsequent GET requests. To do this, a 219 :ts:type:`GenericAuditorMonitorPatchRequest` object is used in the respective 220 PATCH request. 221 222 **Details:** 223 224 .. ts:def:: GenericAuditorMonitorPatchRequest 225 226 interface GenericAuditorMonitorPatchRequest { 227 228 // If true, subsequent GET requests will not return this element by default 229 suppressed : boolean; 230 231 } 232 233 234 .. _fee-time-inconsistency-list: 235 236 Fee Time Inconsistencies 237 ------------------------ 238 239 This section highlights cases where validity periods associated with wire fees 240 the exchange may charge merchants are invalid. This usually means that the 241 validity periods given for the same type of fee are overlapping and it is thus 242 unclear which fee really applies. This is a sign of a serious 243 misconfiguration or data corruption as usually the exchange logic should 244 prevent such a fee configuration from being accepted. 245 246 .. http:get:: /monitoring/fee-time-inconsistency 247 248 Get a list of fee time inconsistencies stored by the auditor. 249 250 The following query parameters are optional, and can be used to customise the response: 251 252 **Request:** 253 254 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 255 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 256 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 257 258 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 259 260 **Response:** 261 262 :http:statuscode:`200 OK`: 263 The auditor responds with a top level array of :ts:type:`FeeTimeInconsistency` objects. If no elements could be found, an empty array is returned 264 265 **Details:** 266 267 .. ts:def:: FeeTimeInconsistency 268 269 interface FeeTimeInconsistency { 270 271 // Row ID of the fee in the exchange database. 272 row_id : Integer; 273 274 // Specifies the wire method for which the fee is inconsistent. 275 type : string; 276 277 // Gives the start date of the inconsistent fee. 278 time : Timestamp; 279 280 // Human readable description of the problem. 281 diagnostic : string; 282 283 // True if this diagnostic was suppressed. 284 suppressed : boolean; 285 286 } 287 288 .. note:: 289 290 This endpoint is still experimental. The endpoint will be further developed as needed. 291 292 .. http:patch:: /monitoring/fee-time-inconsistency/$SERIAL_ID 293 294 This endpoint is used to suppress selected elements of fee time 295 inconsistencies. Updates the 'suppressed' field of a fee time inconsistency 296 element with row ID ``$SERIAL_ID``. 297 298 **Request:** 299 300 The body must be a `GenericAuditorMonitorPatchRequest`. 301 302 **Response:** 303 304 :http:statuscode:`204 No Content`: 305 The element has been updated. 306 307 .. note:: 308 309 This endpoint is still experimental. The endpoint will be further developed as needed. 310 311 .. _emergency-list: 312 313 Emergencies 314 ----------- 315 316 This endpoint is used to obtain a list of emergencies. 317 318 Emergencies are errors where the total value of coins deposited (of a 319 particular denomination) exceeds the total value that the exchange remembers 320 issuing. This usually means that the private keys of the exchange were 321 compromised (stolen or factored) and subsequently used to sign coins off the 322 books. If this happens, all coins of the respective denomination that the 323 exchange has redeemed so far may have been created by the attacker, and the 324 exchange would have to refund all of the outstanding coins from ordinary 325 users. Thus, the risk exposure is the amount of coins in circulation for a 326 particular denomination and the maximum loss for the exchange from this type 327 of compromise. 328 329 The difference between emergencies and emergencies by count is how the auditor 330 detected the problem: by comparing amounts, or by counting coins. 331 Theroretically, counting coins should always detect an issue first, but given 332 the importance of emergencies, the auditor checks both total amounts and total 333 numbers of coins (they may differ as coins may be partially deposited). 334 335 .. http:get:: /monitoring/emergency 336 337 Get a list of emergencies stored by the auditor. 338 339 The following query parameters are optional, and can be used to customise the response: 340 341 **Request:** 342 343 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 344 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 345 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 346 347 348 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 349 350 **Response:** 351 352 :http:statuscode:`200 OK`: 353 The auditor responds with a top level array of :ts:type:`Emergency` objects. If no elements could be found, an empty array is returned 354 355 **Details:** 356 357 .. ts:def:: Emergency 358 359 interface Emergency { 360 361 // Unique row identifier 362 row_id : Integer; 363 364 // Hash of denomination public key 365 denompub_h : HashCode; 366 367 // What is the total value of all coins of this denomination that 368 // were put into circulation (and thus the maximum loss the 369 // exchange may experience due to this emergency). 370 denom_risk : Amount; 371 372 // What is the loss we have experienced so far (that 373 // is, the amount deposited in excess of the amount 374 // we issued). 375 denom_loss : Amount; 376 377 // When did the exchange start issuing coins in this the denomination. 378 deposit_start : Timestamp; 379 380 // When does the deposit period end for coins of this denomination. 381 deposit_end : Timestamp; 382 383 // What is the value of an individual coin of this denomination. 384 value : Amount; 385 386 // True if this diagnostic was suppressed. 387 suppressed : boolean; 388 389 } 390 391 .. note:: 392 393 This endpoint is still experimental. The endpoint will be further developed as needed. 394 395 .. http:patch:: /monitoring/emergency/$SERIAL_ID 396 397 This endpoint is used to suppress select elements of emergencies. 398 Update the 'suppressed' field of an emergency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 399 400 **Response:** 401 402 :http:statuscode:`204 No Content`: 403 The element has been updated. 404 405 .. note:: 406 407 This endpoint is still experimental. The endpoint will be further developed as needed. 408 409 .. _emergency-by-count-list: 410 411 Emergencies By Count 412 -------------------- 413 414 This endpoint is used to obtain a list of emergencies by count. 415 416 Emergencies are errors where more coins were deposited than the 417 exchange remembers issuing. This usually means that the private keys 418 of the exchange were compromised (stolen or factored) and subsequently 419 used to sign coins off the books. If this happens, all coins of the 420 respective denomination that the exchange has redeemed so far may have 421 been created by the attacker, and the exchange would have to refund 422 all of the outstanding coins from ordinary users. Thus, the risk 423 exposure is the amount of coins in circulation for a particular 424 denomination and the maximum loss for the exchange from this type of 425 compromise. 426 427 Emergencies "by count" are cases where this type of money printing was 428 detected simply by counting the number of coins the exchange officially put 429 into circulation and comparing it to the number of coins that were redeemed. 430 If the number of redeemed coins is higher than the number of issued coins, the 431 auditor reports an emergency-by-count. 432 433 .. http:get:: /monitoring/emergency-by-count 434 435 Get a list of emergencies by count stored by the auditor. 436 437 The following query parameters are optional, and can be used to customise the response: 438 439 **Request:** 440 441 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 442 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 443 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 444 445 446 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 447 448 **Response:** 449 450 :http:statuscode:`200 OK`: 451 The auditor responds with a top level array of :ts:type:`EmergencyByCount` objects. 452 453 **Details:** 454 455 .. ts:def:: EmergencyByCount 456 457 interface EmergencyByCount { 458 459 // Row ID of the fee in the exchange database. 460 row_id : Integer; 461 462 // Hash of the public denomination key to which the 463 // emergency applies. 464 denompub_h : HashCode; 465 466 // Number of coins the exchange officially issued of this 467 // denomination. 468 num_issued : Integer; 469 470 // Number of coins that were redeemed. 471 num_known : Integer; 472 473 // What is the total value of all coins of this denomination that 474 // were put into circulation (and thus the maximum loss the 475 // exchange may experience due to this emergency). 476 risk : Amount; 477 478 // When did the exchange start issuing coins in this the denomination. 479 start : Timestamp; 480 481 // When does the deposit period end for coins of this denomination. 482 deposit_end : Timestamp; 483 484 // What is the value of an individual coin of this denomination. 485 value : Amount; 486 487 // True if this diagnostic was suppressed. 488 suppressed : boolean; 489 490 } 491 492 .. note:: 493 494 This endpoint is still experimental. The endpoint will be further developed as needed. 495 496 .. http:patch:: /monitoring/emergency-by-count/$SERIAL_ID 497 498 This endpoint is used to suppress select elements of emergencies by count. 499 Update the 'suppressed' field of an emergency by count element with row ID 500 ``$SERIAL_ID``, according to :ts:type:`GenericAuditorMonitorPatchRequest`, 501 stored by the auditor. 502 503 **Request:** 504 505 The body must be a `GenericAuditorMonitorPatchRequest`. 506 507 **Response:** 508 509 :http:statuscode:`204 No Content`: 510 The element has been updated. 511 512 .. note:: 513 514 This endpoint is still experimental. The endpoint will be further developed as needed. 515 516 517 .. _row-inconsistency-list: 518 519 Row Inconsistencies 520 ------------------- 521 522 This section highlights inconsistencies in a specific row of a specific table 523 of the exchange. Row inconsistencies are reported from different sources, and 524 largely point to some kind of data corruption (or bug). Nothing is implied 525 about the seriousness of the inconsistency. Most inconsistencies are detected 526 if some signature fails to validate. The affected table is noted in the 527 'table' field. A description of the nature of the inconsistency is noted in 528 'diagnostic'. 529 530 .. http:get:: /monitoring/row-inconsistency 531 532 Get a list of row inconsistencies stored by the auditor. 533 534 The following query parameters are optional, and can be used to customise the response: 535 536 **Request:** 537 538 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 539 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 540 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 541 542 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 543 544 **Response:** 545 546 :http:statuscode:`200 OK`: 547 The auditor responds with a top level array of :ts:type:`RowInconsistency` objects. 548 549 **Details:** 550 551 .. ts:def:: RowInconsistency 552 553 interface RowInconsistency { 554 555 // Number of the affected row. 556 row_id : Integer; 557 558 // Name of the affected exchange table. 559 row_table : string; 560 561 // Human-readable diagnostic about what went wrong. 562 diagnostic : string; 563 564 // True if this diagnostic was suppressed. 565 suppressed : boolean; 566 567 } 568 569 .. note:: 570 571 This endpoint is still experimental. The endpoint will be further developed as needed. 572 573 574 .. http:patch:: /monitoring/row-inconsistency/$SERIAL_ID 575 576 This endpoint is used to suppress select elements of row inconsistencies. 577 Update the 'suppressed' field of a row inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 578 579 **Response:** 580 581 :http:statuscode:`204 No Content`: 582 The element has been updated. 583 584 .. note:: 585 586 This endpoint is still experimental. The endpoint will be further developed as needed. 587 588 .. _reserve-in-inconsistency-list: 589 590 Reserve In Inconsistencies 591 -------------------------- 592 593 This section lists cases where the exchange's and auditor's expectation of 594 amounts transferred into a reserve differs. Basically, the exchange database 595 states that a certain reserve was credited for a certain amount via a wire 596 transfer, but the auditor disagrees about this basic fact. This may result in 597 either a customer loosing funds (by being issued less digital cash than they 598 should be) or the exchange loosing funds (by issuing a customer more digital 599 cash than they should be). 600 601 .. http:get:: /monitoring/reserve-in-inconsistency 602 603 Get a list of reserve in inconsistencies stored by the auditor. 604 605 The following query parameters are optional, and can be used to customise the response: 606 607 **Request:** 608 609 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 610 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 611 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 612 613 614 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 615 616 **Response:** 617 618 :http:statuscode:`200 OK`: 619 The auditor responds with a top level array of :ts:type:`ReserveInInconsistency` objects. 620 621 **Details:** 622 623 .. ts:def:: ReserveInInconsistency 624 625 interface ReserveInInconsistency { 626 627 // Unique row identifier 628 row_id : Integer; 629 630 // Amount the exchange expects to be in the reserve 631 amount_exchange_expected : Amount; 632 633 // Amount deposited into the reserve 634 amount_wired : Amount; 635 636 // Public key of the reserve 637 reserve_pub : EddsaPublicKey; 638 639 // Time of the deposit 640 timestamp : Timestamp; 641 642 // Account associated with the reserve 643 account : string; 644 645 // Human readable diagnostic of the problem 646 diagnostic : string; 647 648 // True if this diagnostic was suppressed. 649 suppressed : boolean; 650 651 } 652 653 .. note:: 654 655 This endpoint is still experimental. The endpoint will be further developed as needed. 656 657 658 659 660 .. http:patch:: /monitoring/reserve-in-inconsistency/$SERIAL_ID 661 662 This endpoint is used to suppress select elements of reserve in inconsistencies. 663 Update the 'suppressed' field of a reserve in inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 664 665 **Response:** 666 667 :http:statuscode:`204 No Content`: 668 The element has been updated. 669 670 .. note:: 671 672 This endpoint is still experimental. The endpoint will be further developed as needed. 673 674 675 .. _purse-not-closed-inconsistencies-list: 676 677 Purse Not Closed Inconsistencies 678 -------------------------------- 679 680 This section highlights cases, in which either payer or payee did not finish 681 their part of a P2P payment. This caused a purse --– which may contain some 682 money --- to reach its expiration date. However, the exchange failed to 683 properly expire the purse, which means the payer did not get their money back. 684 The cause is usually that the **taler-exchange-expire** helper is not running 685 properly. 686 687 688 .. http:get:: /monitoring/purse-not-closed-inconsistencies 689 690 Get a list of purse not closed inconsistencies stored by the auditor. 691 692 The following query parameters are optional, and can be used to customise the response: 693 694 **Request:** 695 696 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 697 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 698 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 699 700 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 701 702 **Response:** 703 704 :http:statuscode:`200 OK`: 705 The auditor responds with a top level array of :ts:type:`PurseNotClosedInconsistencies` objects. 706 707 708 709 **Details:** 710 711 .. ts:def:: PurseNotClosedInconsistencies 712 713 interface PurseNotClosedInconsistencies { 714 715 // Unique row identifier. 716 row_id : Integer; 717 718 // Public key of the affected purse 719 purse_pub : EddsaPublicKey; 720 721 // Amount still in the purse, which should have been refunded 722 amount : Amount; 723 724 // When the purse expired 725 expiration_date : Timestamp; 726 727 // True if this diagnostic was suppressed. 728 suppressed : boolean; 729 730 } 731 732 .. note:: 733 734 This endpoint is still experimental. The endpoint will be further developed as needed. 735 736 737 .. http:patch:: /monitoring/purse-not-closed-inconsistencies/$SERIAL_ID 738 739 This endpoint is used to suppress select elements of purse not closed 740 inconsistencies. Update the 'suppressed' field of a purse not closed 741 inconsistencies element with row ID ``$SERIAL_ID``, according to 742 :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 743 744 **Response:** 745 746 :http:statuscode:`204 No Content`: 747 The element has been updated. 748 749 .. note:: 750 751 This endpoint is still experimental. The endpoint will be further developed as needed. 752 753 754 Early Aggregations 755 ------------------ 756 757 .. _early-aggregation-list: 758 759 760 This endpoint returns cases in which wire transfers are encountered before their 761 justifications. This can be harmless, if the justifications appear shortly afterwards. 762 763 .. http:get:: /monitoring/early-aggregation 764 765 Get a list of early aggregations. 766 @since protocol **v2**. 767 768 The following query parameters are optional, and can be used to customise the response: 769 770 **Request:** 771 772 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 773 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 774 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 775 776 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 777 778 **Response:** 779 780 :http:statuscode:`200 OK`: 781 The auditor responds with a top level array of :ts:type:`GetEarlyAggregationResponse` objects. 782 783 **Details:** 784 785 .. ts:def:: GetEarlyAggregationResponse 786 787 interface GetEarlyAggregationResponse { 788 789 // Array of aggregations lacking a justification. 790 early_aggregations: EarlyAggregationEntry[]; 791 792 } 793 794 .. ts:def:: EarlyAggregationEntry 795 796 interface EarlyAggregationEntry { 797 798 // Unique row identifier in the auditor table 799 row_id : Integer; 800 801 // Row identifier in the exchange's batch deposit table 802 batch_deposit_serial_id : Integer; 803 804 // Row identifier in the exchange's tracking table 805 tracking_serial_id : Integer; 806 807 // Amount that was aggregated early. 808 balance : Amount; 809 810 // True if this diagnostic was suppressed. 811 suppressed : boolean; 812 813 } 814 815 .. note:: 816 817 This endpoint is still experimental. The endpoint will be further developed as needed. 818 819 820 821 Pending Deposits 822 ---------------- 823 824 .. _pending-deposits-list: 825 826 This endpoint returns cases in which deposits are pending, that is an 827 expected wire transfer for a given deposit was not yet found even though 828 it is past the wire deadline. 829 This can be harmless, if the wire transfers appear shortly afterwards. 830 831 .. http:get:: /monitoring/pending-deposits 832 833 Get a list of pending deposits. 834 @since protocol **v2**. 835 836 The following query parameters are optional, and can be used to customise the response: 837 838 **Request:** 839 840 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 841 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 842 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 843 844 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 845 846 **Response:** 847 848 :http:statuscode:`200 OK`: 849 The auditor responds with a top level array of :ts:type:`GetPendingDepositsResponse` objects. 850 851 **Details:** 852 853 .. ts:def:: GetPendingDepositsResponse 854 855 interface GetPendingDepositsResponse { 856 857 // Array of pending deposits. 858 pending_deposits: PendingDepositEntry[]; 859 860 } 861 862 .. ts:def:: PendingDepositEntry 863 864 interface PendingDepositEntry { 865 866 // Unique row identifier in the auditor table 867 row_id : Integer; 868 869 // Row identifier in the exchange's batch deposit table 870 batch_deposit_serial_id : Integer; 871 872 // Amount that was aggregated early. 873 total_amount : Amount; 874 875 // Hash of the bank account that should have received the funds. 876 h_wire : HashCode; 877 878 // When was the deadline for the transfer. 879 deadline : Timestamp; 880 881 // True if this diagnostic was suppressed. 882 suppressed : boolean; 883 884 } 885 886 .. note:: 887 888 This endpoint is still experimental. The endpoint will be further developed as needed. 889 890 891 892 893 894 895 .. _reserve-not-closed-inconsistency-list: 896 897 Reserve Not Closed Inconsistencies 898 ---------------------------------- 899 900 This section highlights cases, in which reserves were not closed, despite being expired. 901 As a result, customers that wired funds to the exchange and then failed to withdraw them 902 are not getting their money back. The cause is usually that the **taler-exchange-closer** 903 process is not running properly. 904 905 .. http:get:: /monitoring/reserve-not-closed-inconsistency 906 907 Get a list of reserve not closed inconsistencies stored by the auditor. 908 909 The following query parameters are optional, and can be used to customise the response: 910 911 **Request:** 912 913 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 914 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 915 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 916 917 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 918 919 **Response:** 920 921 :http:statuscode:`200 OK`: 922 The auditor responds with a top level array of :ts:type:`ReserveNotClosedInconsistency` objects. 923 924 925 926 **Details:** 927 928 .. ts:def:: ReserveNotClosedInconsistency 929 930 interface ReserveNotClosedInconsistency { 931 932 // Unique row identifier 933 row_id : Integer; 934 935 // Public key of the reserve 936 reserve_pub : EddsaPublicKey; 937 938 // Amount still in the reserve at the time of expiration 939 balance : Amount; 940 941 // Date the reserve expired 942 expiration_time : Timestamp; 943 944 // Human readable string describing the problem 945 diagnostic : string; 946 947 // True if this diagnostic was suppressed. 948 suppressed : boolean; 949 950 } 951 952 .. note:: 953 954 This endpoint is still experimental. The endpoint will be further developed as needed. 955 956 957 958 959 .. http:patch:: /monitoring/reserve-not-closed-inconsistency/$SERIAL_ID 960 961 This endpoint is used to suppress select elements of reserve not closed 962 inconsistencies. Update the 'suppressed' field of a reserve not closed 963 inconsistency element with row ID ``$SERIAL_ID``, according to 964 :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 965 966 **Response:** 967 968 :http:statuscode:`204 No Content`: 969 The element has been updated. 970 971 .. note:: 972 973 This endpoint is still experimental. The endpoint will be further developed as needed. 974 975 976 977 978 .. _reserve-balance-insufficient-inconsistency-list: 979 980 Reserve Balance Insufficient Inconsistencies 981 -------------------------------------------- 982 983 This section highlights cases where more coins were withdrawn from a 984 reserve than the reserve contained funding for. This is a serious 985 compromise resulting in proportional financial losses to the exchange. 986 987 .. http:get:: /monitoring/reserve-balance-insufficient-inconsistency 988 989 Get a list of reserve balance insufficient inconsistencies stored by the auditor. 990 991 The following query parameters are optional, and can be used to customise the response: 992 993 **Request:** 994 995 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 996 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 997 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 998 999 1000 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1001 1002 **Response:** 1003 1004 :http:statuscode:`200 OK`: 1005 The auditor responds with a top level array of :ts:type:`ReserveBalanceInsufficientInconsistency` objects. 1006 1007 1008 1009 **Details:** 1010 1011 .. ts:def:: ReserveBalanceInsufficientInconsistency 1012 1013 interface ReserveBalanceInsufficientInconsistency { 1014 1015 // Unique row identifier 1016 row_id : Integer; 1017 1018 // Public key of the affected reserve 1019 reserve_pub : EddsaPublicKey; 1020 1021 // Whether this inconsistency is profitable for the exchange 1022 inconsistency_gain : boolean; 1023 1024 // Amount possibly lost or gained by the exchange 1025 inconsistency_amount : Amount; 1026 1027 // True if this diagnostic was suppressed. 1028 suppressed : boolean; 1029 1030 } 1031 1032 .. note:: 1033 1034 This endpoint is still experimental. The endpoint will be further developed as needed. 1035 1036 1037 1038 1039 1040 .. http:patch:: /monitoring/reserve-balance-insufficient-inconsistency/$SERIAL_ID 1041 1042 This endpoint is used to suppress select elements of reserve balance insufficient 1043 inconsistencies. Update the 'suppressed' field of a reserve balance 1044 insufficient inconsistency element with row ID ``$SERIAL_ID``, according to 1045 :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1046 1047 **Response:** 1048 1049 :http:statuscode:`204 No Content`: 1050 The element has been updated. 1051 1052 .. note:: 1053 1054 This endpoint is still experimental. The endpoint will be further developed as needed. 1055 1056 1057 .. _invalid-signature-losses-list: 1058 1059 Invalid Signature Losses 1060 ------------------------ 1061 1062 This section lists operations that the exchange performed, but for which the 1063 signatures provided are invalid. Hence the operations are invalid and the 1064 amount involved could be a loss for the exchange (as the involved parties 1065 could successfully dispute the resulting transactions). 1066 1067 .. http:get:: /monitoring/bad-sig-losses 1068 1069 Get a list of invalid signature losses stored by the auditor. 1070 1071 The following query parameters are optional, and can be used to customise the response: 1072 1073 **Request:** 1074 1075 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1076 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1077 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1078 :query operation: A string. If specified, only returns eligible rows with this :ts:type:`BadSigLosses`.operation value. The default value is NULL which means to not filter by operation. 1079 :query op_spec_pub: An EddsaPublicKey (in base32 encoding). If given, use its value to only return rows with this :ts:type:`BadSigLosses`.operation_specific_pub value. The default value is NULL. 1080 1081 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1082 1083 **Response:** 1084 1085 :http:statuscode:`200 OK`: 1086 The auditor responds with a top level array of :ts:type:`BadSigLosses` objects. 1087 1088 **Details:** 1089 1090 .. ts:def:: BadSigLosses 1091 1092 interface BadSigLosses { 1093 1094 // Unique row identifier 1095 row_id : Integer; 1096 1097 // Operation performed, even though a signature was invalid 1098 operation : string; 1099 1100 // Amount considered lost by the exchange 1101 loss : Amount; 1102 1103 // Public key associated with an operation 1104 operation_specific_pub : EddsaPublicKey; 1105 1106 // True if this diagnostic was suppressed. 1107 suppressed : boolean; 1108 1109 } 1110 1111 .. note:: 1112 1113 This endpoint is still experimental. The endpoint will be further developed as needed. 1114 1115 1116 .. http:patch:: /monitoring/bad-sig-losses/$SERIAL_ID 1117 1118 This endpoint is used to suppress select elements of bad sig losses. Update the 1119 'suppressed' field of a bad sig losses element with row ID ``$SERIAL_ID``, 1120 according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the 1121 auditor. 1122 1123 **Response:** 1124 1125 :http:statuscode:`204 No Content`: 1126 The element has been updated. 1127 1128 .. note:: 1129 1130 This endpoint is still experimental. The endpoint will be further developed as needed. 1131 1132 1133 .. _coin-inconsistency-list: 1134 1135 Coin Inconsistencies 1136 -------------------- 1137 1138 This section lists cases where the exchange made arithmetic errors found when 1139 looking at the transaction history of a coin. The totals sum up the differences 1140 in amounts that matter for profit/loss calculations of the exchange. When an 1141 exchange merely shifted money from customers to merchants (or vice versa) without 1142 any effects on its own balance, those entries are excluded from the total. 1143 1144 .. http:get:: /monitoring/coin-inconsistency 1145 1146 Get a list of coin inconsistencies stored by the auditor. 1147 1148 The following query parameters are optional, and can be used to customise the response: 1149 1150 **Request:** 1151 1152 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1153 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1154 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1155 1156 1157 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1158 1159 **Response:** 1160 1161 :http:statuscode:`200 OK`: 1162 The auditor responds with a top level array of :ts:type:`CoinInconsistency` objects. 1163 1164 **Details:** 1165 1166 .. ts:def:: CoinInconsistency 1167 1168 interface CoinInconsistency { 1169 1170 // Unique row identifier 1171 row_id : Integer; 1172 1173 // The operation performed by the exchange 1174 operation : string; 1175 1176 // Total the exchange calculated 1177 exchange_amount : Amount; 1178 1179 // Total the auditor calculated 1180 auditor_amount : Amount; 1181 1182 // Public key of the coin in question 1183 coin_pub : EddsaPublicKey; 1184 1185 // Whether this arithmetic error was profitable for the exchange 1186 profitable : boolean; 1187 1188 // True if this diagnostic was suppressed. 1189 suppressed : boolean; 1190 1191 } 1192 1193 .. note:: 1194 1195 This endpoint is still experimental. The endpoint will be further developed as needed. 1196 1197 1198 .. http:patch:: /monitoring/coin-inconsistency/$SERIAL_ID 1199 1200 This endpoint is used to suppress select elements of coin inconsistencies. 1201 Update the 'suppressed' field of a coin inconsistency element with row ID 1202 ``$SERIAL_ID``, according to :ts:type:`GenericAuditorMonitorPatchRequest`, 1203 stored by the auditor. 1204 1205 **Response:** 1206 1207 :http:statuscode:`204 No Content`: 1208 The element has been updated. 1209 1210 .. note:: 1211 1212 This endpoint is still experimental. The endpoint will be further developed as needed. 1213 1214 1215 1216 1217 .. _denominations-without-signatures-list: 1218 1219 Denominations Without Signatures 1220 -------------------------------- 1221 1222 This section highlights denomination keys that lack a proper 1223 signature from the **taler-auditor-offline** tool. This may be 1224 legitimate, say in case where the auditor's involvement in the 1225 exchange business is ending and a new auditor is responsible for 1226 future denominations. So this must be read with a keen eye on the 1227 business situation. 1228 1229 .. http:get:: /monitoring/denominations-without-sigs 1230 1231 Get a list of denominations without signatures stored by the auditor. 1232 1233 The following query parameters are optional, and can be used to customise the response: 1234 1235 **Request:** 1236 1237 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1238 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1239 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1240 1241 1242 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1243 1244 **Response:** 1245 1246 :http:statuscode:`200 OK`: 1247 The auditor responds with a top level array of :ts:type:`DenominationsWithoutSigs` objects. 1248 1249 1250 1251 **Details:** 1252 1253 .. ts:def:: DenominationsWithoutSigs 1254 1255 interface DenominationsWithoutSigs { 1256 1257 // Unique row identifier 1258 row_id : Integer; 1259 1260 // Hash of the denomination public key 1261 denompub_h : HashCode; 1262 1263 // Value of each coin of the denomination that lacks 1264 // the auditor's signature. 1265 value : Amount; 1266 1267 // From when the denomination key in question is valid 1268 start_time : Timestamp; 1269 1270 // When the denomination key in question expires 1271 end_time : Timestamp; 1272 1273 // True if this diagnostic was suppressed. 1274 suppressed : boolean; 1275 1276 } 1277 1278 .. note:: 1279 1280 This endpoint is still experimental. The endpoint will be further developed as needed. 1281 1282 1283 1284 .. http:patch:: /monitoring/denominations-without-sigs/$SERIAL_ID 1285 1286 This endpoint is used to suppress select elements of denominations without sigs. 1287 Update the 'suppressed' field of a denominations without signatures element 1288 with row ID ``$SERIAL_ID``, according to 1289 :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1290 1291 **Response:** 1292 1293 :http:statuscode:`204 No Content`: 1294 The element has been updated. 1295 1296 .. note:: 1297 1298 This endpoint is still experimental. The endpoint will be further developed as needed. 1299 1300 1301 .. _misattribution-in-inconsistency-list: 1302 1303 Misattribution In Inconsistencies 1304 --------------------------------- 1305 1306 This section lists cases where the sender account record of an incoming wire 1307 transfer differs between the exchange and the bank. This may cause funds to 1308 be sent to the wrong account should the reserve be closed with a remaining 1309 balance, as that balance would be credited to the original account. 1310 1311 .. http:get:: /monitoring/misattribution-in-inconsistency 1312 1313 Get a list of misattribution in inconsistencies stored by the auditor. 1314 1315 The following query parameters are optional, and can be used to customise the response: 1316 1317 **Request:** 1318 1319 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1320 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1321 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1322 1323 1324 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1325 1326 **Response:** 1327 1328 :http:statuscode:`200 OK`: 1329 The auditor responds with a top level array of :ts:type:`MisattributionInInconsistency` objects. 1330 1331 1332 1333 **Details:** 1334 1335 .. ts:def:: MisattributionInInconsistency 1336 1337 interface MisattributionInInconsistency { 1338 1339 // Unique row identifier in the exchange database. 1340 row_id : Integer; 1341 1342 // Amount of money sent to the wrong account 1343 amount : Amount; 1344 1345 // Row of the transaction in the bank database as 1346 // returned by the bank revenue API. 1347 bank_row : Integer; 1348 1349 // Public key of the affected reserve 1350 reserve_pub : EddsaPublicKey; 1351 1352 // True if this diagnostic was suppressed. 1353 suppressed : boolean; 1354 1355 } 1356 1357 .. note:: 1358 1359 This endpoint is still experimental. The endpoint will be further developed as needed. 1360 1361 1362 1363 .. http:patch:: /monitoring/misattribution-in-inconsistency/$SERIAL_ID 1364 1365 This endpoint is used to suppress select elements of misattribution in 1366 inconsistencies. Update the 'suppressed' field of an misattribution in 1367 inconsistency element with row ID ``$SERIAL_ID``, according to 1368 :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1369 1370 **Response:** 1371 1372 :http:statuscode:`204 No Content`: 1373 The element has been updated. 1374 1375 .. note:: 1376 1377 This endpoint is still experimental. The endpoint will be further developed as needed. 1378 1379 1380 1381 .. _deposit-confirmations-list: 1382 1383 Deposit Confirmations 1384 --------------------- 1385 1386 This section contains a list of deposits confirmations that an exchange 1387 provided to merchants but *failed* to store in its own database. This is 1388 indicative of potential fraud by the exchange operator, as the exchange should 1389 only issue deposit confirmations after storing the respective deposit records 1390 in its database. Not storing the deposit data means that the exchange would 1391 not pay the merchant (pocketing the money) or allow the customer to 1392 double-spend the money (which is naturally also not good). 1393 1394 Note that entries could appear in this list also because the exchange database 1395 replication is delayed. Hence, entries that are only a few seconds old might 1396 not be indicative of an actual problem. If entries in this list are more than 1397 a few seconds old, the first thing to check is whether or not the database 1398 replication from the exchange is working properly. 1399 1400 .. http:get:: /monitoring/deposit-confirmations 1401 1402 Get a list of deposit confirmations stored by the auditor. 1403 1404 The following query parameters are optional, and can be used to customise the response: 1405 1406 **Request:** 1407 1408 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1409 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1410 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1411 1412 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1413 1414 **Response:** 1415 1416 :http:statuscode:`200 OK`: 1417 The auditor responds with a top level array of :ts:type:`DepositConfirmations` objects. 1418 1419 **Details:** 1420 1421 .. ts:def:: DepositConfirmations 1422 1423 interface DepositConfirmations { 1424 1425 // Row id in the exchange database 1426 deposit_confirmation_serial_id : Integer; 1427 1428 // Hash over the contract for which this deposit is made. 1429 h_contract_terms : HashCode; 1430 1431 // Hash over the policy concerning this deposit 1432 h_policy : HashCode; 1433 1434 // Hash over the wiring information of the merchant. 1435 h_wire : HashCode; 1436 1437 // Time when the deposit confirmation confirmation was generated. 1438 exchange_timestamp : Timestamp; 1439 1440 // How much time does the merchant have to issue a refund 1441 // request? Zero if refunds are not allowed. 1442 refund_deadline : Timestamp; 1443 1444 // By what time does the exchange have to wire the funds? 1445 wire_deadline : Timestamp; 1446 1447 // Amount to be deposited, excluding fee. Calculated from the 1448 // amount with fee and the fee from the deposit request. 1449 total_without_fee : Amount; 1450 1451 // Array of public keys of the deposited coins. 1452 coin_pubs : EddsaPublicKey[]; 1453 1454 // Array of deposit signatures of the deposited coins. 1455 // Must have the same length as coin_pubs. 1456 coin_sigs : EddsaSignature[]; 1457 1458 // The Merchant's public key. Allows the merchant to later refund 1459 // the transaction or to inquire about the wire transfer identifier. 1460 merchant_pub : EddsaPublicKey; 1461 1462 // Signature from the exchange of type 1463 // TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT. 1464 exchange_sig : EddsaSignature; 1465 1466 // Public signing key from the exchange matching exchange_sig. 1467 exchange_pub : EddsaPublicKey; 1468 1469 // Exchange master signature over exchange_sig. 1470 master_sig : EddsaSignature; 1471 1472 // True if this diagnostic was suppressed. 1473 suppressed : boolean; 1474 1475 } 1476 1477 .. note:: 1478 1479 This endpoint is still experimental. The endpoint will be further developed as needed. 1480 1481 1482 .. http:patch:: /monitoring/deposit-confirmations/$SERIAL_ID 1483 1484 This endpoint is used to suppress select elements of deposit confirmations. 1485 Update the 'suppressed' field of an deposit confirmations element with 1486 row ID ``$SERIAL_ID``, according to 1487 :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1488 1489 **Response:** 1490 1491 :http:statuscode:`204 No Content`: 1492 The element has been updated. 1493 1494 .. note:: 1495 1496 This endpoint is still experimental. The endpoint will be further developed as needed. 1497 1498 1499 .. _denomination-key-validity-withdraw-inconsistency-list: 1500 1501 Denomination Key Validity Withdraw Inconsistencies 1502 -------------------------------------------------- 1503 1504 This section highlights cases, where denomination keys were used to sign coins 1505 withdrawn from a reserve before the denomination was valid or after it was 1506 already expired for signing. This doesn't exactly imply any financial loss 1507 for anyone, it is mostly weird and may have affected the fees the customer 1508 paid. 1509 1510 .. http:get:: /monitoring/denomination-key-validity-withdraw-inconsistency 1511 1512 Get a list of denomination key validity withdraw inconsistencies stored by the auditor. 1513 The following query parameters are optional, and can be used to customise the response: 1514 1515 **Request:** 1516 1517 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1518 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1519 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1520 1521 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1522 1523 **Response:** 1524 1525 :http:statuscode:`200 OK`: 1526 The auditor responds with a top level array of :ts:type:`DenominationKeyValidityWithdrawInconsistency` objects. If no elements could be found, an empty array is returned 1527 1528 1529 **Details:** 1530 1531 .. ts:def:: DenominationKeyValidityWithdrawInconsistency 1532 1533 interface DenominationKeyValidityWithdrawInconsistency { 1534 1535 // Unique row identifier 1536 row_id : Integer; 1537 1538 // When the withdrawal took place 1539 execution_date : Timestamp; 1540 1541 // Public key of the reserve affected 1542 reserve_pub : EddsaPublicKey; 1543 1544 // Hash of the denomination public key involved in the withdrawal 1545 denompub_h : HashCode; 1546 1547 // True if this diagnostic was suppressed. 1548 suppressed : boolean; 1549 1550 } 1551 1552 .. note:: 1553 1554 This endpoint is still experimental. The endpoint will be further developed as needed. 1555 1556 .. http:patch:: /monitoring/denomination-key-validity-withdraw-inconsistency/$SERIAL_ID 1557 1558 This endpoint is used to suppress select elements of denomination key validity withdraw inconsistencies. 1559 Update the 'suppressed' field of a denomination key validity withdraw inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1560 1561 **Response:** 1562 1563 :http:statuscode:`204 No Content`: 1564 The element has been updated. 1565 1566 .. note:: 1567 1568 This endpoint is still experimental. The endpoint will be further developed as needed. 1569 1570 .. _amount-arithmetic-inconsistency-list: 1571 1572 Amount Arithmetic Inconsistencies 1573 --------------------------------- 1574 1575 This endpoint is used to obtain a list of amount arithmetic inconsistencies. 1576 1577 This section lists cases where the arithmetic of the exchange involving 1578 amounts disagrees with the arithmetic of the auditor. Disagreements imply 1579 that either the exchange made a loss (sending out too much money), or screwed 1580 a customer (and thus at least needs to fix the financial damage done to the 1581 customer). The profitable column is set to true if the arithmetic problem was 1582 be determined to be profitable for the exchange, false if the problem resulted 1583 in a net loss for the exchange. 1584 1585 1586 .. http:get:: /monitoring/amount-arithmetic-inconsistency 1587 1588 Get a list of amount arithmetic inconsistencies stored by the auditor. 1589 1590 The following query parameters are optional, and can be used to customise the response: 1591 1592 **Request:** 1593 1594 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1595 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1596 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1597 1598 1599 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1600 1601 **Response:** 1602 1603 :http:statuscode:`200 OK`: 1604 The auditor responds with a top level array of :ts:type:`AmountArithmeticInconsistency` objects. If no elements could be found, an empty array is returned 1605 1606 1607 1608 **Details:** 1609 1610 .. ts:def:: AmountArithmeticInconsistency 1611 1612 interface AmountArithmeticInconsistency { 1613 1614 // Unique row identifier 1615 row_id : Integer; 1616 1617 // Name of the arithmetic operation performed 1618 operation : string; 1619 1620 // Amount according to the exchange 1621 exchange_amount : Amount; 1622 1623 // Amount according to the auditor 1624 auditor_amount : Amount; 1625 1626 // Whether the miscalculation is profitable for the exchange 1627 profitable : boolean; 1628 1629 // True if this diagnostic was suppressed. 1630 suppressed : boolean; 1631 1632 } 1633 1634 .. note:: 1635 1636 This endpoint is still experimental. The endpoint will be further developed as needed. 1637 1638 1639 .. http:patch:: /monitoring/amount-arithmetic-inconsistency/$SERIAL_ID 1640 1641 This endpoint is used to suppress select elements of amount arithmetic inconsistencies. Update the 'suppressed' field of an amount arithmetic inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1642 1643 **Response:** 1644 1645 :http:statuscode:`204 No Content`: 1646 The element has been updated. 1647 1648 .. note:: 1649 1650 This endpoint is still experimental. The endpoint will be further developed as needed. 1651 1652 1653 .. _wire-format-inconsistency-list: 1654 1655 Wire Format Inconsistencies 1656 --------------------------- 1657 1658 This section highlights cases where the wire transfer subject 1659 was used more than once and is thus not unique. This indicates 1660 a problem with the bank's implementation of the revenue API, as 1661 the bank is supposed to warrant uniqueness of wire transfer 1662 subjects exposed via the revenue API (and bounce non-unique 1663 transfers). 1664 1665 .. http:get:: /monitoring/wire-format-inconsistency 1666 1667 Get a list of wire format inconsistencies stored by the auditor. 1668 1669 The following query parameters are optional, and can be used to customise the response: 1670 1671 **Request:** 1672 1673 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1674 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1675 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1676 1677 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1678 1679 **Response:** 1680 1681 :http:statuscode:`200 OK`: 1682 The auditor responds with a top level array of :ts:type:`WireFormatInconsistency` objects. If no elements could be found, an empty array is returned 1683 1684 1685 **Details:** 1686 1687 .. ts:def:: WireFormatInconsistency 1688 1689 interface WireFormatInconsistency { 1690 1691 // Unique row identifier 1692 row_id : Integer; 1693 1694 // Amount that was part of the wire 1695 amount : Amount; 1696 1697 // Offset of the duplicate wire transfer subject 1698 // in the bank database according to the revenue API. 1699 wire_offset : Integer; 1700 1701 // True if this diagnostic was suppressed. 1702 diagnostic : string; 1703 1704 // True if this diagnostic was suppressed. 1705 suppressed : boolean; 1706 1707 1708 } 1709 1710 .. note:: 1711 1712 This endpoint is still experimental. The endpoint will be further developed as needed. 1713 1714 1715 1716 1717 .. http:patch:: /monitoring/wire-format-inconsistency/$SERIAL_ID 1718 1719 This endpoint is used to suppress select elements of wire format inconsistencies. 1720 Update the 'suppressed' field of a wire format inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1721 1722 **Response:** 1723 1724 :http:statuscode:`204 No Content`: 1725 The element has been updated. 1726 1727 .. note:: 1728 1729 This endpoint is still experimental. The endpoint will be further developed as needed. 1730 1731 1732 .. _closure-lags-list: 1733 1734 Closure Lags 1735 ------------ 1736 1737 This endpoint is used to obtain a list of closure lags. 1738 1739 A closure lag happens if a reserve should have closed a reserve and 1740 wired (remaining) funds back to the originating account, but did not 1741 do so on time. Significant lag may be indicative of fraud, while 1742 moderate lag is indicative that the systems may be too slow to handle the 1743 load. Small amounts of lag can occur in normal operation. 1744 1745 If closure lag is experienced, the administrator should check that 1746 the **taler-exchange-closer** component is operating correctly. 1747 1748 1749 .. http:get:: /monitoring/closure-lags 1750 1751 Get a list of closure lags stored by the auditor. 1752 1753 The following query parameters are optional, and can be used to customise the response: 1754 1755 **Request:** 1756 1757 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1758 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1759 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1760 1761 1762 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1763 1764 **Response:** 1765 1766 :http:statuscode:`200 OK`: 1767 The auditor responds with a top level array of :ts:type:`ClosureLags` objects. If no elements could be found, an empty array is returned 1768 1769 1770 1771 **Details:** 1772 1773 .. ts:def:: ClosureLags 1774 1775 interface ClosureLags { 1776 1777 // Unique row identifier 1778 row_id : Integer; 1779 1780 // Amount of money left in the reserve 1781 amount : Amount; 1782 1783 // When should the reserve have been closed 1784 deadline : Timestamp; 1785 1786 // The wire transfer identifier 1787 wtid : HashCode; 1788 1789 // Full payto:// URI (RFC 8905) of the account that 1790 // should have been credited. 1791 account : string; 1792 1793 // True if this diagnostic was suppressed. 1794 suppressed : boolean; 1795 1796 } 1797 1798 .. note:: 1799 1800 This endpoint is still experimental. The endpoint will be further developed as needed. 1801 1802 1803 .. http:patch:: /monitoring/closure-lags/$SERIAL_ID 1804 1805 This endpoint is used to suppress select elements of closure lags. 1806 Update the 'suppressed' field of a closure lags element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1807 1808 **Response:** 1809 1810 :http:statuscode:`204 No Content`: 1811 The element has been updated. 1812 1813 .. note:: 1814 1815 This endpoint is still experimental. The endpoint will be further developed as needed. 1816 1817 1818 1819 1820 .. _wire-out-inconsistency-list: 1821 1822 Wire Out Inconsistencies 1823 ------------------------ 1824 1825 This section highlights cases where the exchange wired a different amount to a 1826 destimation account than the auditor expected. 1827 1828 .. http:get:: /monitoring/wire-out-inconsistency 1829 1830 Get a list of wire out inconsistencies stored by the auditor. 1831 1832 The following query parameters are optional, and can be used to customise the response: 1833 1834 **Request:** 1835 1836 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1837 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1838 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1839 1840 1841 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1842 1843 **Response:** 1844 1845 :http:statuscode:`200 OK`: 1846 The auditor responds with a top level array of :ts:type:`WireOutInconsistency` objects. If no elements could be found, an empty array is returned 1847 1848 1849 1850 **Details:** 1851 1852 .. ts:def:: WireOutInconsistency 1853 1854 interface WireOutInconsistency { 1855 1856 // Unique row identifier 1857 row_id : Integer; 1858 1859 // Account money was wired to 1860 destination_account : string; 1861 1862 // How much was suppossed to be wired according to the auditor. 1863 expected : Amount; 1864 1865 // The amount the exchange claims to have wired. 1866 claimed : Amount; 1867 1868 // True if this diagnostic was suppressed. 1869 suppressed : boolean; 1870 1871 } 1872 1873 .. note:: 1874 1875 This endpoint is still experimental. The endpoint will be further developed as needed. 1876 1877 1878 1879 1880 1881 .. http:patch:: /monitoring/wire-out-inconsistency/$SERIAL_ID 1882 1883 This endpoint is used to suppress select elements of wire out inconsistencies. 1884 Update the 'suppressed' field of a wire out inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1885 1886 **Response:** 1887 1888 :http:statuscode:`204 No Content`: 1889 The element has been updated. 1890 1891 .. note:: 1892 1893 This endpoint is still experimental. The endpoint will be further developed as needed. 1894 1895 1896 .. _reserve-balance-summary-wrong-inconsistency-list: 1897 1898 Reserve Balance Summary Wrong Inconsistencies 1899 --------------------------------------------- 1900 1901 This section highlights cases, where the exchange's and auditors' 1902 expectation of the amount of money left in a reserve differs. 1903 1904 .. http:get:: /monitoring/reserve-balance-summary-wrong-inconsistency 1905 1906 Get a list of reserve balance summary wrong inconsistencies stored by the auditor. 1907 1908 The following query parameters are optional, and can be used to customise the response: 1909 1910 **Request:** 1911 1912 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1913 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1914 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1915 1916 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1917 1918 **Response:** 1919 1920 :http:statuscode:`200 OK`: 1921 The auditor responds with a top level array of :ts:type:`ReserveBalanceSummaryWrongInconsistency` objects. If no elements could be found, an empty array is returned 1922 1923 **Details:** 1924 1925 .. ts:def:: ReserveBalanceSummaryWrongInconsistency 1926 1927 interface ReserveBalanceSummaryWrongInconsistency { 1928 1929 // Unique row identifier 1930 row_id : Integer; 1931 1932 // Public key of the reserve affected 1933 reserve_pub : EddsaPublicKey; 1934 1935 // Amount of summary the exchange calculated 1936 exchange_amount : Amount; 1937 1938 // Amount of summary the auditor calculated 1939 auditor_amount : Amount; 1940 1941 // True if this diagnostic was suppressed. 1942 suppressed : boolean; 1943 1944 } 1945 1946 .. note:: 1947 1948 This endpoint is still experimental. The endpoint will be further developed as needed. 1949 1950 .. http:patch:: /monitoring/reserve-balance-summary-wrong-inconsistency/$SERIAL_ID 1951 1952 This endpoint is used to suppress select elements of reserve balance summary wrong inconsistencies. 1953 Update the 'suppressed' field of a reserve balance summary wrong inconsistency element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 1954 1955 **Response:** 1956 1957 :http:statuscode:`204 No Content`: 1958 The element has been updated. 1959 1960 .. note:: 1961 1962 This endpoint is still experimental. The endpoint will be further developed as needed. 1963 1964 1965 .. _row-minor-inconsistencies-list: 1966 1967 Row Minor Inconsistencies 1968 ------------------------- 1969 1970 The section highlights inconsistencies where a row in an exchange table has a 1971 value that is does not satisfy expectations (such as a malformed 1972 signature). These are cause for concern, but not necessarily point to a 1973 monetary loss (yet). 1974 1975 .. http:get:: /monitoring/row-minor-inconsistencies 1976 1977 Get a list of row minor inconsistencies stored by the auditor. 1978 1979 The following query parameters are optional, and can be used to customise the response: 1980 1981 **Request:** 1982 1983 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 1984 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 1985 :query return_suppressed: A boolean. If true, returns all eligible rows, otherwise only returns eligible rows that are not suppressed. The default value is false. 1986 1987 With the default settings, the endpoint returns at most the 20 latest elements that are not suppressed. 1988 1989 **Response:** 1990 1991 :http:statuscode:`200 OK`: 1992 The auditor responds with a top level array of :ts:type:`RowMinorInconsistencies` objects. If no elements could be found, an empty array is returned 1993 1994 **Details:** 1995 1996 .. ts:def:: RowMinorInconsistencies 1997 1998 interface RowMinorInconsistencies { 1999 2000 // Number of the row in the affected table 2001 row_id : Integer; 2002 2003 // The row number in the affected table 2004 row_table : Integer; 2005 2006 // Human readable string describing the problem 2007 diagnostic : string; 2008 2009 // True if this diagnostic was suppressed. 2010 suppressed : boolean; 2011 2012 } 2013 2014 .. note:: 2015 2016 This endpoint is still experimental. The endpoint will be further developed as needed. 2017 2018 .. http:patch:: /monitoring/row-minor-inconsistencies/$SERIAL_ID 2019 2020 This endpoint is used to suppress select elements of row minor inconsistencies. 2021 Update the 'suppressed' field of a row minor inconsistencies element with row_id $SERIAL_ID, according to :ts:type:`GenericAuditorMonitorPatchRequest`, stored by the auditor. 2022 2023 **Response:** 2024 2025 :http:statuscode:`204 No Content`: 2026 The element has been updated. 2027 2028 .. note:: 2029 2030 This endpoint is still experimental. The endpoint will be further developed as needed. 2031 2032 2033 ------------------------- 2034 Monitoring Auditor Status 2035 ------------------------- 2036 2037 The following entries specify how to access information the auditor keeps to 2038 properly perform audits. These tables do not contain inconsistencies, instead 2039 they store information about balances, reserves, purses etc. Values in these 2040 tables should not differ from their respective exchanges' version. 2041 2042 .. _balances-list: 2043 2044 Balances 2045 -------- 2046 2047 Returns the various balances the auditor tracks for the exchange, such as 2048 coins in circulation, fees earned, losses experienced, etc. 2049 2050 .. http:get:: /monitoring/balances 2051 2052 Get a list of balances stored by the auditor. 2053 2054 The following query parameters are optional, and can be used to customise the response: 2055 2056 **Request:** 2057 2058 :query balance_key: a string identifying a balance. If specified, only returns the balance with this exact key. The default value is NULL. 2059 2060 **Response:** 2061 2062 :http:statuscode:`200 OK`: 2063 The auditor responds with a top level array of :ts:type:`Balances` objects. If no elements could be found, an empty array is returned 2064 2065 **Details:** 2066 2067 .. ts:def:: Balances 2068 2069 interface Balances { 2070 2071 // String identifying a balance 2072 balance_key : string; 2073 2074 // Amount of the balance 2075 balance_value : Amount; 2076 2077 } 2078 2079 2080 .. _historic-denomination-revenue-list: 2081 2082 Historic Denomination Revenue 2083 ----------------------------- 2084 2085 This endpoint is used to obtain a list of historic denomination revenue, that 2086 is the profits and losses an exchange has made from coins of a particular 2087 denomination where the denomination is past its (deposit) expiration and thus 2088 all values are final. 2089 2090 .. http:get:: /monitoring/historic-denomination-revenue 2091 2092 Get a list of historic denomination revenue stored by the auditor. 2093 2094 The following query parameters are optional, and can be used to customise the response: 2095 2096 **Request:** 2097 2098 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 2099 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 2100 2101 With the default settings, the endpoint returns at most the 20 latest elements. 2102 2103 **Response:** 2104 2105 :http:statuscode:`200 OK`: 2106 The auditor responds with a top level array of :ts:type:`HistoricDenominationRevenue` objects. If no elements could be found, an empty array is returned 2107 2108 **Details:** 2109 2110 .. ts:def:: HistoricDenominationRevenue 2111 2112 interface HistoricDenominationRevenue { 2113 2114 // Unique row identifier 2115 row_id : Integer; 2116 2117 // Hash code of the denomination public key involved 2118 denom_pub_hash : HashCode; 2119 2120 // Time when the denomination expired and thus the revenue 2121 // was computed. 2122 revenue_timestamp : Timestamp; 2123 2124 // Total fee revenue the exchange earned from coins of this 2125 // denomination. 2126 revenue_balance : Amount; 2127 2128 // Total losses the exchange experienced from this denomination 2129 // (this basically only happens if someone was able to forge 2130 // denomination signatures). So non-zero values are indicative 2131 // of a serious problem. 2132 loss_balance : Amount; 2133 2134 } 2135 2136 .. note:: 2137 2138 This endpoint is still experimental. The endpoint will be further developed as needed. 2139 2140 .. _denomination-pending-list: 2141 2142 Denomination Pending 2143 -------------------- 2144 2145 This endpoint is used to obtain a list of balances for denominations that are still 2146 active, that is coins may still be deposited (or possibly even withdrawn) and thus 2147 the amounts given are not final. 2148 2149 .. http:get:: /monitoring/denomination-pending 2150 2151 Get a list of denomination pending stored by the auditor. 2152 2153 The following query parameters are optional, and can be used to customise the response: 2154 2155 **Request:** 2156 2157 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 2158 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 2159 2160 With the default settings, the endpoint returns at most the 20 latest elements. 2161 2162 **Response:** 2163 2164 :http:statuscode:`200 OK`: 2165 The auditor responds with a top level array of :ts:type:`DenominationPending` objects. If no elements could be found, an empty array is returned 2166 2167 **Details:** 2168 2169 .. ts:def:: DenominationPending 2170 2171 interface DenominationPending { 2172 2173 // Unique row identifier 2174 row_id : Integer; 2175 2176 // Hash of the denomination public key 2177 denom_pub_hash : HashCode; 2178 2179 // Total value of coins remaining in circulation (excluding 2180 // the value of coins that were recouped, those are always 2181 // just under recoup_loss). 2182 denom_balance : Amount; 2183 2184 // Total value of coins redeemed that exceeds the amount we 2185 // put into circulation. Basically, this value grows if we 2186 // wanted to reduce denom_balance (because a coin was deposited) 2187 // but we could not because the denom_balance was already zero. 2188 denom_loss : Amount; 2189 2190 // Total number of coins of this denomination that were 2191 // put into circulation. 2192 num_issued : Integer; 2193 2194 // Total value of the coins put into circulation. 2195 denom_risk : Amount; 2196 2197 // Losses the exchange had from this denomination due to coins 2198 // that were recouped (after the denomination was revoked). 2199 recoup_loss : Amount; 2200 2201 } 2202 2203 .. note:: 2204 2205 This endpoint is still experimental. The endpoint will be further developed as needed. 2206 2207 2208 .. _historic-reserve-summary-list: 2209 2210 Historic Reserve Summary 2211 ------------------------ 2212 2213 This section summarizes historic profits an exchange 2214 made from reserves and associated reserve-specific 2215 fees. 2216 2217 .. http:get:: /monitoring/historic-reserve-summary 2218 2219 Get a list of historic reserve summary stored by the auditor. 2220 2221 The following query parameters are optional, and can be used to customise the response: 2222 2223 **Request:** 2224 2225 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 2226 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 2227 2228 With the default settings, the endpoint returns at most the 20 latest elements. 2229 2230 **Response:** 2231 2232 :http:statuscode:`200 OK`: 2233 The auditor responds with a top level array of :ts:type:`HistoricReserveSummary` objects. If no elements could be found, an empty array is returned 2234 2235 **Details:** 2236 2237 .. ts:def:: HistoricReserveSummary 2238 2239 interface HistoricReserveSummary { 2240 2241 // Unique row identifier 2242 row_id : Integer; 2243 2244 // From when the summary starts 2245 start_date : Timestamp; 2246 2247 // When the summary ends 2248 end_date : Timestamp; 2249 2250 // Profits the exchange charged for the reserve 2251 reserve_profits : Amount; 2252 2253 } 2254 2255 .. note:: 2256 2257 This endpoint is still experimental. The endpoint will be further developed as needed. 2258 2259 2260 .. _reserves-list: 2261 2262 2263 Reserves 2264 -------- 2265 2266 This endpoint is used to obtain a list of open reserves that the auditor is 2267 currently tracking balances for. 2268 2269 .. http:get:: /monitoring/reserves 2270 2271 Get a list of reserves stored by the auditor. 2272 2273 The following query parameters are optional, and can be used to customise the response: 2274 2275 **Request:** 2276 2277 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 2278 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 2279 2280 2281 With the default settings, the endpoint returns at most the 20 latest elements. 2282 2283 **Response:** 2284 2285 :http:statuscode:`200 OK`: 2286 The auditor responds with a top level array of :ts:type:`Reserves` objects. If no elements could be found, an empty array is returned 2287 2288 2289 **Details:** 2290 2291 .. ts:def:: Reserves 2292 2293 interface Reserves { 2294 2295 // Unique row identifier 2296 auditor_reserves_rowid : Integer; 2297 2298 // Public key of the reserve 2299 reserve_pub : EddsaPublicKey; 2300 2301 // Amount in the balance 2302 reserve_balance : Amount; 2303 2304 // Reserve losses are incurred if (a) a reserve is 2305 // incorrectly credited from a recoup for a non-revoked 2306 // coin, or (b) if the exchange allowed more digital cash 2307 // to be withdrawn from a reserve than the balance of the 2308 // reserve should have permitted. FIXME: We may want to 2309 // distinguish these two cases in the future. 2310 reserve_loss : Amount; 2311 2312 // Amount earned by charging withdraw fees 2313 withdraw_fee_balance : Amount; 2314 2315 // Amount earned by charging a closing fee on the reserve 2316 close_fee_balance : Amount; 2317 2318 // Total purse fees earned from this reserve 2319 purse_fee_balance : Amount; 2320 2321 // Total reserve open fees earned from the reserve 2322 open_fee_balance : Amount; 2323 2324 // Total reserve history fees earned from this reserve 2325 history_fee_balance : Amount; 2326 2327 // When the purse expires 2328 expiration_date : Timestamp; 2329 2330 // Who created the account 2331 origin_account : string; 2332 2333 } 2334 2335 .. note:: 2336 2337 This endpoint is still experimental. The endpoint will be further developed as needed. 2338 2339 2340 .. _purses-list: 2341 2342 Purses 2343 ------ 2344 2345 This endpoint is used to obtain information about open purses. 2346 2347 .. http:get:: /monitoring/purses 2348 2349 Get a list of purses stored by the auditor. 2350 2351 The following query parameters are optional, and can be used to customise the response: 2352 2353 **Request:** 2354 2355 :query limit: A signed integer, indicating how many elements relative to the offset query parameter should be returned. The default value is -20. 2356 :query offset: An unsigned integer, indicating from which row onward to return elements. The default value is INT_MAX. 2357 2358 With the default settings, the endpoint returns at most the 20 latest elements. 2359 2360 **Response:** 2361 2362 :http:statuscode:`200 OK`: 2363 The auditor responds with a top level array of :ts:type:`Purses` objects. If no elements could be found, an empty array is returned 2364 2365 **Details:** 2366 2367 .. ts:def:: Purses 2368 2369 interface Purses { 2370 2371 // Unique row identifier 2372 auditor_purses_rowid : Integer; 2373 2374 // Public key of the purse 2375 purse_pub : EddsaPublicKey; 2376 2377 // Amount currently stored in the purse 2378 balance : Amount; 2379 2380 // Amount the purse is intended for / the maximum amount that can be in the purse 2381 target : Amount; 2382 2383 // When the purse expires 2384 expiration_date : Timestamp; 2385 2386 } 2387 2388 .. note:: 2389 2390 This endpoint is still experimental. The endpoint will be further developed as needed. 2391 2392 .. _progress-list: 2393 2394 Progress 2395 -------- 2396 2397 This section contains information about the auditing progress an auditor has made. 2398 2399 .. http:get:: /monitoring/progress 2400 2401 Get the progress stored by the auditor. 2402 2403 **Request:** 2404 2405 :query progress_key: a string identifying a progress point. If specified, only returns the element with this exact key. The default value is NULL. 2406 2407 2408 **Response:** 2409 2410 :http:statuscode:`200 OK`: 2411 The auditor responds with a top level array of :ts:type:`Progress` objects. If no elements could be found, an empty array is returned 2412 2413 **Details:** 2414 2415 .. ts:def:: Progress 2416 2417 interface Progress { 2418 2419 // Key associated with a given progress point 2420 progress_key: string; 2421 2422 // How much of the exchanges data has been processed so far 2423 progress_offset: Integer; 2424 2425 } 2426 2427 ---------- 2428 Complaints 2429 ---------- 2430 2431 This endpoint is used by the wallet or merchants to submit proof of 2432 misbehavior of an exchange to the auditor. 2433 2434 .. note:: 2435 2436 To be designed and implemented. 2437 2438 .. http:put:: /complain 2439 2440 Complain about misbehavior to the auditor.