commit 0099ed3132bcebcc69ac88e6b5423e51ad484aa7
parent b4e52efc5360b0ed4168fbf1bf9c147cb9d839b9
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 16 Jul 2024 13:49:52 +0200
also spec API for testing
Diffstat:
1 file changed, 60 insertions(+), 5 deletions(-)
diff --git a/core/api-bank-wire.rst b/core/api-bank-wire.rst
@@ -285,10 +285,6 @@ Querying the transaction history
// Amount transferred.
amount: Amount;
- // Payto URI to identify the receiver of funds.
- // This must be one of the exchange's bank accounts.
- credit_account: string;
-
// Payto URI to identify the sender of funds.
debit_account: string;
@@ -421,7 +417,7 @@ exposed by bank gateways in production.
// Account (as payto URI) that makes the wire transfer to the exchange.
// Usually this account must be created by the test harness before this API is
- // used. An exception is the "exchange-fakebank", where any debit account can be
+ // used. An exception is the "fakebank", where any debit account can be
// specified, as it is automatically created.
debit_account: string;
}
@@ -460,6 +456,65 @@ exposed by bank gateways in production.
}
+
+.. _twg-admin-add-kycauth:
+
+.. http:post:: /admin/add-kycauth
+
+ Simulate a transfer from a customer to the exchange. This API is *not*
+ idempotent since it's only used in testing.
+
+ **Request:**
+
+ .. ts:def:: AddKycauthRequest
+
+ interface AddKycauthRequest {
+ // Amount to transfer.
+ amount: Amount;
+
+ // Account public key that is included in the wire transfer details
+ // to associate this key with the originating bank account.
+ account_pub: EddsaPublicKey;
+
+ // Account (as payto URI) that makes the wire transfer to the exchange.
+ // Usually this account must be created by the test harness before this API is
+ // used. An exception is the "fakebank", where any debit account can be
+ // specified, as it is automatically created.
+ debit_account: string;
+ }
+
+ **Response:**
+
+ :http:statuscode:`200 OK`:
+ The request has been correctly handled, so the funds have been transferred to
+ the recipient's account. The body is a `AddKycauthResponse`.
+ :http:statuscode:`400 Bad request`:
+ The request is malformed. The bank replies with an `ErrorDetail` object.
+ :http:statuscode:`401 Unauthorized`:
+ Authentication failed, likely the credentials are wrong.
+ :http:statuscode:`404 Not found`:
+ The endpoint is wrong or the user name is unknown. The bank replies with an `ErrorDetail` object.
+
+ **Details:**
+
+ .. ts:def:: AddKycauthResponse
+
+ interface AddKycauthResponse {
+ // Timestamp that indicates when the wire transfer will be executed.
+ // In cases where the wire transfer gateway is unable to know when
+ // the wire transfer will be executed, the time at which the request
+ // has been received and stored will be returned.
+ // The purpose of this field is for debugging (humans trying to find
+ // the transaction) as well as for taxation (determining which
+ // time period a transaction belongs to).
+ timestamp: Timestamp;
+
+ // Opaque ID of the wire transfer initiation performed by the bank.
+ // It is different from the /history endpoints row_id.
+ row_id: SafeUint64;
+ }
+
+
Security Considerations
=======================