From 2232210e46e0c597eb3f7b3d13e2b54455dc8111 Mon Sep 17 00:00:00 2001 From: MS Date: Tue, 20 Dec 2022 14:55:25 +0100 Subject: circuit API: define /config --- libeufin/api-sandbox.rst | 63 +++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/libeufin/api-sandbox.rst b/libeufin/api-sandbox.rst index 75b4bcf5..fff8119c 100644 --- a/libeufin/api-sandbox.rst +++ b/libeufin/api-sandbox.rst @@ -367,44 +367,47 @@ Cashouts .. _cashout-rates: -.. http:get:: /cashout-rates +.. http:get:: /config - Informs about the rates that apply to cashouts: - *loss* rate and *exchange* rate. - - The loss rate affects always negatively the amount - to cashout, and it is employed to discourage such - operation. It is applied to the amount expressed - in the circuit currency, and outputs a new amount - in the same currency. + **Response:** - The exchange rate is then the actual conversion rate - from the circuit's to the fiat currency. Therefore - it is applied to the amount expressed in the circuit - currency and outputs a new amount *in fiat currency*. + .. ts:def:: Config - The following calculation shows how to use those values. + interface Config { + // Name of this API, always "circuit". + name: string; + // API version in the form $n:$n:$n + version: string; + // Contains ratios and fees related to buying + // and selling the circuit currency. + ratios_and_fees: RatiosAndFees; + } - Given a wanted cashout amount of 10 units of the circuit - currency, a loss rate of 0.05, and an exchange rate of 0.9, - then the final amount in fiat currency that will be - transferred to the user's external bank account would be: - - (10 - (10 * 0.05)) * 0.9 = 8.55 + .. ts:def:: RatiosAndFees + + interface RatiosAndFees { + // Exchange rate to buy the circuit currency from fiat. + buy_at_ratio: float; + // Exchange rate to sell the circuit currency for fiat. + sell_at_ratio: float; + // Fee to subtract after applying the buy ratio. + buy_in_fee: float; + // Fee to subtract after applying the sell ratio. + sell_out_fee: float; + } - **Response:** - .. ts:def:: CashoutRates + Example. Given a circuit currency CC, a fiat currency FC, + a *sell_at_ratio* = 0.9 and *sell_out_fee* = 0.03, selling + 10 CC would result in the following FC: (10 * 0.9) - 0.03 + = 8.97 FC. On the other hand, given *buy_at_ratio* = 1.1 + and *buy_in_fee* = 0.01, a user wanting to spend 10 FC to + buy the CC would result in the following CC: (10 * 1.1) - + 0.01 = 10.99 CC. - interface CashoutRates { - - // A stringified float indicating the cashout loss rate. - loss_rate: string; - // A stringified float indicating the conversion rate - // from the circuit to the fiat currency. - exchange_rate: string; - } + .. note:: + the terms 'sell out' and 'cashout' may be used interchangeably. .. http:get:: /cashouts/$cashoutId -- cgit v1.2.3 From b770ea84ca5525723b5c2630d92cf6b440efbaef Mon Sep 17 00:00:00 2001 From: MS Date: Tue, 20 Dec 2022 17:09:29 +0100 Subject: access API include "403 Forbidden" when the user tries to withdraw beyond their debit limit. --- core/api-bank-access.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/api-bank-access.rst b/core/api-bank-access.rst index 82578391..8ac135cd 100644 --- a/core/api-bank-access.rst +++ b/core/api-bank-access.rst @@ -106,6 +106,8 @@ name and account password, at least in the GNU Taler demo bank implementation. taler_withdraw_uri: string; } + :http:statuscode:`403 Forbidden`: + The operation was rejected due to insufficient funds. .. http:get:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id} -- cgit v1.2.3 From 8e87d158d2de493a7e5445d126cb9e7c67743e8e Mon Sep 17 00:00:00 2001 From: priscilla Date: Wed, 21 Dec 2022 06:26:47 -0500 Subject: update --- core/api-merchant.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/api-merchant.rst b/core/api-merchant.rst index e4938f47..ff03795a 100644 --- a/core/api-merchant.rst +++ b/core/api-merchant.rst @@ -3201,8 +3201,8 @@ Using template interface UsingTemplateDetails { - // Subject of the template - subject?: string; + // Summary of the template + summary?: string; // The amount entered by the customer. amount?: Amount; -- cgit v1.2.3 From 8209c62ed5fc0c021b4e5cfdbdd9f49d7616a812 Mon Sep 17 00:00:00 2001 From: MS Date: Wed, 21 Dec 2022 15:28:20 +0100 Subject: remove obsolete note --- libeufin/nexus-tutorial.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libeufin/nexus-tutorial.rst b/libeufin/nexus-tutorial.rst index d2ec471d..1d50ad5f 100644 --- a/libeufin/nexus-tutorial.rst +++ b/libeufin/nexus-tutorial.rst @@ -312,11 +312,6 @@ The account name ``jrluser`` is the unique identifier of the account within the sandbox. The EBICS parameters identify the subscriber that should have access to the bank account via EBICS. -.. note:: - - Currently, the person (given human) name is not maintained by - the sandbox. It displays "Bank account owner's name" instead. - The account already has one transaction, the "Sign-up bonus" from the bank. Note that in the following examples we transition to using the ``bankaccount`` subcommand, because there is no need to rely on EBICS: -- cgit v1.2.3