summaryrefslogtreecommitdiff
path: root/core/api-wire.rst
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-05-09 20:01:02 +0200
committerChristian Grothoff <christian@grothoff.org>2021-05-09 20:01:02 +0200
commit7641ad6d2ab742e1b8305b9db59bcc24f317e77a (patch)
tree7800b3486503d4d811e7fa4c8ff677232a634b87 /core/api-wire.rst
parent3579cf06efb3dfe242179136e62abbb5ae51ce6a (diff)
downloaddocs-7641ad6d2ab742e1b8305b9db59bcc24f317e77a.tar.gz
docs-7641ad6d2ab742e1b8305b9db59bcc24f317e77a.tar.bz2
docs-7641ad6d2ab742e1b8305b9db59bcc24f317e77a.zip
extend wire gateway spec for wads
Diffstat (limited to 'core/api-wire.rst')
-rw-r--r--core/api-wire.rst51
1 files changed, 50 insertions, 1 deletions
diff --git a/core/api-wire.rst b/core/api-wire.rst
index fbf27469..e05aa848 100644
--- a/core/api-wire.rst
+++ b/core/api-wire.rst
@@ -175,7 +175,15 @@ Querying the transaction history
.. ts:def:: IncomingBankTransaction
- interface IncomingBankTransaction {
+ // Union discriminated by the "type" field.
+ type IncomingBankTransaction =
+ | IncomingReserveTransaction
+ | IncomingWadTransaction;
+
+ .. ts:def:: IncomingReserveTransaction
+
+ interface IncomingReserveTransaction {
+ type: "RESERVE";
// Opaque identifier of the returned record.
row_id: SafeUint64;
@@ -195,6 +203,47 @@ Querying the transaction history
// The reserve public key extracted from the transaction details.
reserve_pub: EddsaPublicKey;
+
+ // Set to 'true' if this wire transfer originates from
+ // a bank account with a partner bank that implies that
+ // the KYC has already been satisfied for this reserve
+ // because of it.
+ // FIXME: is this acceptable? Seems like users could
+ // easily be tricked into wiring funds to a reserve that
+ // they do NOT own, and then being held responsibe for
+ // the resulting account. So when setting this bit,
+ // we'd need at least a reserve_sig over the credit_account,
+ // which we do not get here... (DANGEROUS API).
+ // => need to discuss KYC more with real banks.
+ kyc_completed: boolean;
+ }
+
+ .. ts:def:: IncomingWadTransaction
+
+ interface IncomingWadTransaction {
+ type: "WAD";
+
+ // Opaque identifier of the returned record.
+ row_id: SafeUint64;
+
+ // Date of the transaction.
+ date: Timestamp;
+
+ // 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;
+
+ // Base URL of the exchange that originated the wad.
+ origin_exchange_url: string;
+
+ // The reserve public key extracted from the transaction details.
+ wad_id: WadId;
}