taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

check-deposit.rst (2183B)


      1 .. ts:op:: checkDeposit
      2 
      3   Check whether a deposit of the given amount to the given target
      4   account is possible with the funds in the wallet, and calculate the
      5   associated fees, without creating a deposit transaction.
      6 
      7   **Request:**
      8 
      9   The request body must be a `CheckDepositRequest` object.
     10 
     11   **Response:**
     12 
     13   On success, the result is a `CheckDepositResponse` object.
     14 
     15   **Side effects:**
     16 
     17   May refresh the key material of the exchanges holding the selected
     18   coins over the network, including exchange record updates and
     19   notifications.
     20 
     21   **Expected errors:**
     22 
     23   The caller can handle the following errors inline:
     24   ``GENERIC_PAYTO_URI_MALFORMED``, ``WALLET_NO_SUITABLE_EXCHANGE``,
     25   ``WALLET_DEPOSIT_GROUP_INSUFFICIENT_BALANCE``.
     26 
     27   **Details:**
     28 
     29   ``totalDepositCost`` is the total cost to the wallet: the
     30   contributions of the selected coins plus the cost of refreshing any
     31   change.  ``effectiveDepositAmount`` is the amount expected to be
     32   wired to the destination account (not considering aggregation).
     33 
     34 .. ts:def:: CheckDepositRequest
     35 
     36   interface CheckDepositRequest {
     37     // Payto URI to identify the (bank) account that the exchange will
     38     // wire the money to.
     39     depositPaytoUri: string;
     40 
     41     // Instructed amount used for deposit coin selection.  The response
     42     // reports the resulting wallet cost and destination amount, which
     43     // can differ because of fees and refresh change.
     44     amount: AmountString;
     45 
     46     // Restrict the deposit to a certain scope.
     47     restrictScope?: ScopeInfo;
     48 
     49     progressToken?: string;
     50   }
     51 
     52 .. ts:def:: CheckDepositResponse
     53 
     54   interface CheckDepositResponse {
     55     totalDepositCost: AmountString;
     56     effectiveDepositAmount: AmountString;
     57     fees: DepositGroupFees;
     58 
     59     kycSoftLimit?: AmountString;
     60     kycHardLimit?: AmountString;
     61 
     62     // Base URL of exchanges that would likely require soft KYC.
     63     kycExchanges?: string[];
     64   }
     65 
     66 .. ts:def:: DepositGroupFees
     67 
     68   interface DepositGroupFees {
     69     // Deposit fees of the selected coins.
     70     coin: AmountString;
     71 
     72     // Wire fees of the involved exchanges.
     73     wire: AmountString;
     74 
     75     // Cost of refreshing change from the selected coins.
     76     refresh: AmountString;
     77   }