From 81655daf19f3739127cb78d6553cfaf48640e46a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 18 May 2021 20:01:39 +0200 Subject: more detailed 401 error --- core/api-exchange.rst | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'core/api-exchange.rst') diff --git a/core/api-exchange.rst b/core/api-exchange.rst index 23365ef8..06f76582 100644 --- a/core/api-exchange.rst +++ b/core/api-exchange.rst @@ -2672,11 +2672,8 @@ Wallet-to-wallet transfers purse deposits before the expiration deadline. The response will include a `PurseDepositAccepted` object. :http:statuscode:`401 Unauthorized`: - A coin signature is invalid. - FIXME: add message that tells the client - which coin signature(s) were valid. ErrorDetail is not enough - to identify the problematic coin. - This response comes with a standard `ErrorDetail` response. + A coin signature is invalid. The response will + include a `PurseDepositSignatureErrorDetail` :http:statuscode:`403 Forbidden`: The server is denying the operation as a purse with a different contract or total amount already exists. @@ -2916,6 +2913,33 @@ Wallet-to-wallet transfers } + .. ts:def:: PurseDepositSignatureErrorDetail + + interface PurseDepositSignatureErrorDetail { + // Taler error code, summarizing the problem. + // Note that for problems about specific + // coins, the 'coin_error_map' should be consulted. + // The 'coin_error_map' will be empty if the + // 'purse_sig' was invalid. In this case, + // the coins will not even have been checked by + // the exchange. + code: number; + + // Human-readable description of the error, i.e. "invalid siganture". + hint?: string; + + // Total amount contributed by the current request. + // Note that some coins may have been successfully + // deposited into the purse, so the total amount + // from these coins is listed here. + total_amount_contributed: Amount; + + // Public keys of coins that could not be deposited + // into the purse, mapped to the coin's histories. + coin_error_map: EddsaPublicKey -> ErrorDetail[]; + } + + .. http:POST:: /purses/$PURSE_PUB/merge Merge purse with account, adding the value of the purse into -- cgit v1.2.3