From 6036cea5f598620ac4b6e9553d84bef2aa93ad7c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 11 Jul 2020 14:02:31 +0530 Subject: wallet-core API docs --- taler-wallet.rst | 110 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 86 insertions(+), 24 deletions(-) (limited to 'taler-wallet.rst') diff --git a/taler-wallet.rst b/taler-wallet.rst index 8d348efc..35210cb5 100644 --- a/taler-wallet.rst +++ b/taler-wallet.rst @@ -137,9 +137,9 @@ Transactions Transactions are all operations or events that are affecting the balance. -:name: ``"getTransactions"`` -:description: Get a list of past and pending transactions. -:request: +:Name: ``"getTransactions"`` +:Description: Get a list of past and pending transactions. +:Request: .. ts:def:: TransactionsRequest interface TransactionsRequest { @@ -149,7 +149,7 @@ Transactions are all operations or events that are affecting the balance. // if present, results will be limited to transactions related to the given search string search?: string; } -:response: +:Response: .. ts:def:: TransactionsResponse interface TransactionsResponse { @@ -382,15 +382,15 @@ Transactions are all operations or events that are affecting the balance. Refunds ------- -:name: ``"applyRefund"`` -:description: Process a refund from a ``taler://refund`` URI. -:request: +:Name: ``"applyRefund"`` +:Description: Process a refund from a ``taler://refund`` URI. +:Request: .. ts:def:: WalletApplyRefundRequest interface WalletApplyRefundRequest { talerRefundUri: string; } -:response: +:Response: .. ts:def:: WalletApplyRefundResponse interface WalletApplyRefundResponse { @@ -401,12 +401,12 @@ Refunds Exchange Management: List Exchanges ----------------------------------- -:name: ``"listExchanges"`` -:description: +:Name: ``"listExchanges"`` +:Description: List all exchanges. -:cli: +:CLI: ``taler-wallet-cli exchanges list`` -:response: +:Response: .. ts:def:: ExchangesListRespose interface ExchangesListRespose { @@ -424,38 +424,100 @@ Exchange Management: List Exchanges Exchange Management: Add Exchange --------------------------------- -:name: ``"addExchange"`` -:description: +:Name: ``"addExchange"`` +:Description: Add an exchange. -:cli: +:CLI: ``taler-wallet-cli exchanges add $URL`` -:request: +:Request: .. ts:def:: ExchangeAddRequest interface ExchangeAddRequest { exchangeBaseUrl: string; } -:response: +:Response: + On success, the response is an empty object. + +Exchange Management: Get Terms of Service +----------------------------------------- + +:Name: ``"getExchangeTos"`` +:Description: + Get the exchange's current ToS and which version of the ToS (if any) + the user has accepted. +:CLI: + ``taler-wallet-cli exchanges tos $URL`` +:Request: + .. ts:def:: ExchangeGetTosRequest + + interface ExchangeGetTosRequest { + exchangeBaseUrl: string; + } +:Response: + .. ts:def:: ExchangeGetTosResult + + export interface GetExchangeTosResult { + // Markdown version of the current ToS. + tos: string; + + // Version tag of the current ToS. + currentEtag: string; + + // Version tag of the last ToS that the user has accepted, + // if any. + acceptedEtag: string | undefined; + } + +Exchange Management: Set Accepted Terms of Service Version +---------------------------------------------------------- + +:Name: ``"setExchangeTosAccepted"`` +:Description: + Store that the user has accepted a version of the exchange's ToS. +:CLI: + ``taler-wallet-cli exchanges accept-tos $URL $ETAG`` +:Request: + .. ts:def:: ExchangeSetTosAccepted + + interface ExchangeGetTosRequest { + exchangeBaseUrl: string; + acceptedEtag: string; + } +:Response: On success, the response is an empty object. Withdrawal: Get Manual Withdrawal Info -------------------------------------- -:name: ``"getWithdrawalDetailsForAmount"`` -:description: +:Name: ``"getWithdrawalDetailsForAmount"`` +:Description: Get information about fees and exchange for a manual withdrawal of a given amount. -:cli: +:CLI: ``taler-wallet-cli advanced manual-withdrawal-details $URL $AMOUNT`` -:request: +:Request: .. ts:def:: GetManualWithdrawalDetailsRequest interface ExchangeAddRequest { exchangeBaseUrl: string; amount: string; } -:response: - An ``ExchangeWithdrawDetails`` object (to be documented, see `here - `__). +:Response: + .. ts:def:: ManualWithdrawalDetails + + export interface ManualWithdrawalDetails { + // Did the user accept the current version of the exchange's + // terms of service? + tosAccepted: boolean; + + // Amount that the user will transfer to the exchange. + rawAmount: AmountString; + + // Amount that will be added to the user's wallet balance. + effectiveAmount: AmountString; + + // Ways to pay the exchange. + paytoUris: string[]; + } Integration Tests ================= -- cgit v1.2.3