summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-10-19 12:36:31 +0200
committerFlorian Dold <florian@dold.me>2023-10-19 12:36:31 +0200
commit14fc31f083a4cbb1ae110f9d243d5faf6a9569c1 (patch)
tree5d1f6ab29bad471cb8fcd6b0af8b46a47358fde0 /core
parent7b75d09335c11d9defc15d59fb516053f45f4aa8 (diff)
downloaddocs-14fc31f083a4cbb1ae110f9d243d5faf6a9569c1.tar.gz
docs-14fc31f083a4cbb1ae110f9d243d5faf6a9569c1.tar.bz2
docs-14fc31f083a4cbb1ae110f9d243d5faf6a9569c1.zip
corebank: move optional conversion rate info to /config
Diffstat (limited to 'core')
-rw-r--r--core/api-corebank.rst63
1 files changed, 17 insertions, 46 deletions
diff --git a/core/api-corebank.rst b/core/api-corebank.rst
index 86288540..84dc0765 100644
--- a/core/api-corebank.rst
+++ b/core/api-corebank.rst
@@ -86,6 +86,23 @@ Config
// Only applicable if have_cashout=true.
fiat_currency?: CurrencySpecification;
+ // Extra conversion rate information.
+ // Only present if conversion is supported and the server opts in
+ // to report the static conversion rate.
+ conversion_info?: {
+ // Exchange rate to buy the local currency from the external one
+ buy_at_ratio: DecimalNumber;
+
+ // Exchange rate to sell the local currency for the external one
+ sell_at_ratio: DecimalNumber;
+
+ // Fee to subtract after applying the buy ratio.
+ buy_in_fee: DecimalNumber;
+
+ // Fee to subtract after applying the sell ratio.
+ sell_out_fee: DecimalNumber;
+ }
+
}
@@ -901,52 +918,6 @@ Cashouts
Aborted cashout operations will also not be found.
-Conversion rates
-----------------
-
-..
- FIXME: throughout API docs and implementations, the following names
- are used interchangeably: local, regional, internal currency. As well
- these: external, fiat, currency. Style should tend to use only one.
-
-.. http:get:: /conversion-rates
-
- This call shows the current conversion rates between the local and the
- external currency. The external currency is the one mentioned in the
- *fiat_currency* field of `Config`.
-
- **Response:**
-
- :http:statuscode:`200 OK`: `ConversionRatesResponse`.
-
- :http:statuscode:`404 Not Found`: the bank doesn't provide any conversion service.
-
- .. ts:def:: ConversionRatesResponse
-
- interface ConversionRatesResponse {
-
- // Exchange rate to buy the local currency from the external one
- buy_at_ratio: DecimalNumber;
-
- // Exchange rate to sell the local currency for the external one
- sell_at_ratio: DecimalNumber;
-
- // Fee to subtract after applying the buy ratio.
- buy_in_fee: DecimalNumber;
-
- // Fee to subtract after applying the sell ratio.
- sell_out_fee: DecimalNumber;
- }
-
- For example, given a local currency LC, a fiat currency FC,
- a *sell_at_ratio* = 0.9 and *sell_out_fee* = 0.03, selling
- 10 LC 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 LC would result in the following LC: (10 * 1.1) -
- 0.01 = 10.99 LC.
-
-
Monitor
-------