summaryrefslogtreecommitdiff
path: root/core/api-bank-integration.rst
diff options
context:
space:
mode:
authorAntoine A <>2023-11-22 13:44:31 +0000
committerAntoine A <>2023-11-23 23:50:29 +0000
commit73a50ce167c1b1edef50329c11592db7a6732083 (patch)
tree93c976663df230ceaf32604eb8709c12b0fd59f3 /core/api-bank-integration.rst
parente80df0caed7fe98be0888e7d94ae31559de79f84 (diff)
downloaddocs-73a50ce167c1b1edef50329c11592db7a6732083.tar.gz
docs-73a50ce167c1b1edef50329c11592db7a6732083.tar.bz2
docs-73a50ce167c1b1edef50329c11592db7a6732083.zip
Fix withdrawal API securitydev/antoine/fix_withdrawal
Diffstat (limited to 'core/api-bank-integration.rst')
-rw-r--r--core/api-bank-integration.rst60
1 files changed, 44 insertions, 16 deletions
diff --git a/core/api-bank-integration.rst b/core/api-bank-integration.rst
index ef2f7e02..9d8e1b91 100644
--- a/core/api-bank-integration.rst
+++ b/core/api-bank-integration.rst
@@ -74,9 +74,11 @@ for the withdrawal operation (the ``WITHDRAWAL_ID``) to interact with the withdr
:query long_poll_ms:
*Optional.* If specified, the bank will wait up to ``long_poll_ms``
- milliseconds for completion of the transfer before sending the HTTP
+ milliseconds for operationt state to be different from ``old_state`` before sending the HTTP
response. A client must never rely on this behavior, as the bank may
return a response immediately.
+ :query old_state:
+ *Optional.* Default to "pending".
**Response:**
@@ -91,17 +93,12 @@ for the withdrawal operation (the ``WITHDRAWAL_ID``) to interact with the withdr
.. ts:def:: BankWithdrawalOperationStatus
export class BankWithdrawalOperationStatus {
- // Indicates whether the withdrawal was aborted.
- aborted: boolean;
-
- // Has the wallet selected parameters for the withdrawal operation
- // (exchange and reserve public key) and successfully sent it
- // to the bank?
- selection_done: boolean;
-
- // The transfer has been confirmed and registered by the bank.
- // Does not guarantee that the funds have arrived at the exchange already.
- transfer_done: boolean;
+ // Current status of the operation
+ // pending: the operation is pending parameters selection (exchange and reserve public key)
+ // selected: the operations has been selected and is pending confirmation
+ // aborted: the operation has been aborted
+ // confirmed: the transfer has been confirmed and registered by the bank
+ status: "pending" | "selected" | "aborted" | "confirmed";
// Amount that will be withdrawn with this operation
// (raw amount without fee considerations).
@@ -121,6 +118,29 @@ for the withdrawal operation (the ``WITHDRAWAL_ID``) to interact with the withdr
// Wire transfer types supported by the bank.
wire_types: string[];
+
+ // Reserve public key selected by the exchange,
+ // only non-null if ``status`` is ``selected`` or ``confirmed``.
+ selected_reserve_pub?: string;
+
+ // Exchange account selected by the wallet
+ // only non-null if ``status`` is ``selected`` or ``confirmed``.
+ selected_exchange_account?: string;
+
+ // Deprecated field use ``status`` instead
+ // Indicates whether the withdrawal was aborted.
+ aborted: boolean;
+
+ // Deprecated field use ``status`` instead
+ // Has the wallet selected parameters for the withdrawal operation
+ // (exchange and reserve public key) and successfully sent it
+ // to the bank?
+ selection_done: boolean;
+
+ // Deprecated field use ``status`` instead
+ // The transfer has been confirmed and registered by the bank.
+ // Does not guarantee that the funds have arrived at the exchange already.
+ transfer_done: boolean;
}
.. http:post:: /withdrawal-operation/$WITHDRAWAL_ID
@@ -156,14 +176,22 @@ for the withdrawal operation (the ``WITHDRAWAL_ID``) to interact with the withdr
.. ts:def:: BankWithdrawalOperationPostResponse
interface BankWithdrawalOperationPostResponse {
- // The transfer has been confirmed and registered by the bank.
- // Does not guarantee that the funds have arrived at the exchange already.
- transfer_done: boolean;
+ // Current status of the operation
+ // pending: the operation is pending parameters selection (exchange and reserve public key)
+ // selected: the operations has been selected and is pending confirmation
+ // aborted: the operation has been aborted
+ // confirmed: the transfer has been confirmed and registered by the bank
+ status: "selected" | "aborted" | "confirmed";
// URL that the user needs to navigate to in order to
// complete some final confirmation (e.g. 2FA).
//
- // Only applicable when ``transfer_done`` is ``false``.
+ // Only applicable when ``status`` is ``selected``.
// It may contain withdrawal operation id
confirm_transfer_url?: string;
+
+ // Deprecated field use ``status`` instead
+ // The transfer has been confirmed and registered by the bank.
+ // Does not guarantee that the funds have arrived at the exchange already.
+ transfer_done: boolean;
}