Contents

checkDeposit#

Check whether a deposit of the given amount to the given target account is possible with the funds in the wallet, and calculate the associated fees, without creating a deposit transaction.

Request:

The request body must be a CheckDepositRequest object.

Response:

On success, the result is a CheckDepositResponse object.

Side effects:

May refresh the key material of the exchanges holding the selected coins over the network, including exchange record updates and notifications.

Expected errors:

The caller can handle the following errors inline: GENERIC_PAYTO_URI_MALFORMED, WALLET_NO_SUITABLE_EXCHANGE, WALLET_DEPOSIT_GROUP_INSUFFICIENT_BALANCE.

Details:

totalDepositCost is the total cost to the wallet: the contributions of the selected coins plus the cost of refreshing any change. effectiveDepositAmount is the amount expected to be wired to the destination account (not considering aggregation).

interface CheckDepositRequest {
  // Payto URI to identify the (bank) account that the exchange will
  // wire the money to.
  depositPaytoUri: string;

  // Instructed amount used for deposit coin selection.  The response
  // reports the resulting wallet cost and destination amount, which
  // can differ because of fees and refresh change.
  amount: AmountString;

  // Restrict the deposit to a certain scope.
  restrictScope?: ScopeInfo;

  progressToken?: string;
}
interface CheckDepositResponse {
  totalDepositCost: AmountString;
  effectiveDepositAmount: AmountString;
  fees: DepositGroupFees;

  kycSoftLimit?: AmountString;
  kycHardLimit?: AmountString;

  // Base URL of exchanges that would likely require soft KYC.
  kycExchanges?: string[];
}
interface DepositGroupFees {
  // Deposit fees of the selected coins.
  coin: AmountString;

  // Wire fees of the involved exchanges.
  wire: AmountString;

  // Cost of refreshing change from the selected coins.
  refresh: AmountString;
}