check-peer-push-debit-v2.rst (1361B)
1 .. ts:op:: checkPeerPushDebitV2 2 3 Check if initiating a peer push payment is possible based on the 4 funds in the wallet. 5 6 **Request:** 7 8 The request body must be a `CheckPeerPushDebitRequest` object. 9 10 **Response:** 11 12 On success, the result is a `CheckPeerPushDebitResponse` object, a 13 discriminated union on the ``type`` field: ``"ok"`` 14 (`CheckPeerPushDebitOkResponse`) carries the reviewed amounts and a 15 quote for :ts:op:`initiatePeerPushDebit`; 16 ``"insufficient-balance"`` 17 (`CheckPeerPushDebitInsufficientBalanceResponse`) explains why the 18 wallet cannot cover the payment. 19 20 **Side effects:** 21 22 May refresh the selected exchange's key material over the network. 23 24 **Expected errors:** 25 26 The caller can handle the following errors inline: 27 ``WALLET_CORE_API_BAD_REQUEST``. 28 29 An insufficient balance (including the case where no exchange can 30 serve the payment) is not reported as an error but via the typed 31 ``"insufficient-balance"`` result. 32 33 .. ts:def:: CheckPeerPushDebitResponse 34 35 type CheckPeerPushDebitResponse = 36 | CheckPeerPushDebitOkResponse 37 | CheckPeerPushDebitInsufficientBalanceResponse; 38 39 .. ts:def:: CheckPeerPushDebitInsufficientBalanceResponse 40 41 interface CheckPeerPushDebitInsufficientBalanceResponse { 42 type: "insufficient-balance"; 43 44 insufficientBalanceDetails: PaymentInsufficientBalanceDetails; 45 }