get-history-incoming.rst (4963B)
1 .. http:get:: /history/incoming 2 3 Return a list of transactions made from or to the exchange. 4 5 Incoming transactions must contain a valid reserve public key. If a bank 6 transaction does not conform to the right syntax, the wire gateway must not 7 report it to the exchange, and send funds back to the sender if possible. 8 9 **Request:** 10 11 :query limit: *Optional.* 12 At most return the given number of results. Negative for descending by ``row_id``, positive for ascending by ``row_id``. Defaults to ``-20``. Since protocol **v2**. 13 :query offset: *Optional.* 14 Starting ``row_id`` for :ref:`pagination <row-id-pagination>`. Since protocol **v2**. 15 :query timeout_ms: *Optional.* 16 Timeout in milliseconds, for :ref:`long-polling <long-polling>`, to wait for at least one element to be shown. Only useful if *limit* is positive. Since protocol **v2**. 17 :query delta: *Optional.* 18 Deprecated in protocol **v2**. Use *limit* instead. 19 :query start: *Optional.* 20 Deprecated in protocol **v2**. Use *offset* instead. 21 :query long_poll_ms: *Optional.* 22 Deprecated in protocol **v2**. Use *timeout_ms* instead. 23 24 **Response:** 25 26 :http:statuscode:`200 OK`: 27 JSON object of type `IncomingHistory`. 28 :http:statuscode:`204 No content`: 29 There are not transactions to report (under the given filter). 30 :http:statuscode:`400 Bad request`: 31 Request malformed. The bank replies with an `ErrorDetail` object. 32 :http:statuscode:`401 Unauthorized`: 33 Authentication failed, likely the credentials are wrong. 34 :http:statuscode:`404 Not found`: 35 The endpoint is wrong or the user name is unknown. The bank replies with an `ErrorDetail` object. 36 37 **Details:** 38 39 .. ts:def:: IncomingHistory 40 41 interface IncomingHistory { 42 // Array of incoming transactions. 43 incoming_transactions: IncomingBankTransaction[]; 44 45 // Full payto URI to identify the receiver of funds. 46 // This must be one of the exchange's bank accounts. 47 // Credit account is shared by all incoming transactions 48 // as per the nature of the request. 49 credit_account: string; 50 } 51 52 .. ts:def:: IncomingBankTransaction 53 54 // Union discriminated by the "type" field. 55 type IncomingBankTransaction = 56 | IncomingKycAuthTransaction 57 | IncomingReserveTransaction 58 | IncomingWadTransaction; 59 60 .. ts:def:: IncomingKycAuthTransaction 61 62 // Since protocol **v1**. 63 interface IncomingKycAuthTransaction { 64 type: "KYCAUTH"; 65 66 // Opaque identifier of the returned record. 67 row_id: SafeUint64; 68 69 // Date of the transaction. 70 date: Timestamp; 71 72 // Amount received before credit_fee. 73 amount: Amount; 74 75 // Fee paid by the creditor. 76 // If not null, creditor actually received amount - credit_fee 77 // @since **v3** 78 credit_fee?: Amount; 79 80 // Full payto URI to identify the sender of funds. 81 debit_account: string; 82 83 // The account public key extracted from the transaction details. 84 account_pub: EddsaPublicKey; 85 86 // The authorization public key used for mapping 87 // @since **v5** 88 authorization_pub?: EddsaPublicKey; 89 90 // Signature of the account public key using the authorization private key 91 // @since **v5** 92 authorization_sig?: EddsaSignature; 93 } 94 95 .. ts:def:: IncomingReserveTransaction 96 97 interface IncomingReserveTransaction { 98 type: "RESERVE"; 99 100 // Opaque identifier of the returned record. 101 row_id: SafeUint64; 102 103 // Date of the transaction. 104 date: Timestamp; 105 106 // Amount received before credit_fee. 107 amount: Amount; 108 109 // Fee payed by the creditor. 110 // If not null, creditor actually received amount - 111 // @since **v3** 112 credit_fee?: Amount; 113 114 // Full payto URI to identify the sender of funds. 115 debit_account: string; 116 117 // The reserve public key extracted from the transaction details. 118 reserve_pub: EddsaPublicKey; 119 120 // The authorization public key used for mapping 121 // @since **v5** 122 authorization_pub?: EddsaPublicKey; 123 124 // Signature of the reserve public key using the authorization private key 125 // @since **v5** 126 authorization_sig?: EddsaSignature; 127 } 128 129 .. ts:def:: IncomingWadTransaction 130 131 interface IncomingWadTransaction { 132 type: "WAD"; 133 134 // Opaque identifier of the returned record. 135 row_id: SafeUint64; 136 137 // Date of the transaction. 138 date: Timestamp; 139 140 // Amount received before credit_fee. 141 amount: Amount; 142 143 // Fee payed by the creditor. 144 // If not null, creditor actually received amount - credit_fee 145 // @since **v3** 146 credit_fee?: Amount; 147 148 // Full payto URI to identify the sender of funds. 149 debit_account: string; 150 151 // Base URL of the exchange that originated the wad. 152 origin_exchange_url: string; 153 154 // The reserve public key extracted from the transaction details. 155 wad_id: WadId; 156 }