Browse Source

bip-xchgrate: Use standard currency exchange base/quote terminology

master
Luke Dashjr 8 years ago
parent
commit
7a324fb947
  1. 18
      bip-xchgrate.mediawiki

18
bip-xchgrate.mediawiki

@ -37,22 +37,22 @@ Currency code(s) used herein are defined as such:
* XBT is defined as 100000000 satoshis (commonly known as 1 BTC).
* Strings longer than 3 characters may be used for currencies without an applicable code. (If a shorter code is desired despite this, it may be padded with space(s) to the left until it is 4 characters. Software MAY strip these spaces.)
Rate is defined as: <code>1 primaryCurrency = 1 secondaryCurrency / rate</code>
Rate is defined as: <code>1 quoteCurrency = 1 baseCurrency * rate</code>
===Enumerating supported currency-pair tokens===
Parameters:
* ''mode'' - Always "list" for this request.
* ''cc'' - If provided, the server MAY limit the results to only currency-pairs describing a currency with the given currency code(s).
* ''alt'' - If provided, the server MAY limit the results to only currency-pairs describing currency rates compared to the given currency code(s).
* ''quote'' - If provided, the server MAY limit the results to only currency-pairs describing a currency with the given currency code(s).
* ''base'' - If provided, the server MAY limit the results to only currency-pairs describing currency rates compared to the given currency code(s).
* ''locale'' - If provided, the server MAY limit the results to only currency-pairs supporting the given locale(s).
Each currency-pair will receive a separate result, a JSON Object, with the following information:
* ''cp'' - The currency-pair token.
* ''cc'' - The currency code for the primary currency.
* ''alt'' - The currency code for the secondary currency.
* ''quote'' - The currency code for the quote currency.
* ''base'' - The currency code for the base currency.
* ''desc'' - Optional description. For example, it could be "Based on Florida BTM prices." or any other short String that provides information useful to the user. SHOULD be shorter than 45 characters.
===Currency-pair information===
@ -65,12 +65,12 @@ Parameters:
Each currency-pair will receive a separate result, a JSON Object, with the following information:
* ''cp'' - The currency-pair token.
* ''cc'' - The currency code for the primary currency.
* ''alt'' - The currency code for the secondary currency.
* ''quote'' - The currency code for the quote currency.
* ''base'' - The currency code for the base currency.
* ''desc'' - Optional description. For example, it could be "Based on Florida BTM prices." or any other short String that provides information useful to the user. SHOULD be shorter than 45 characters.
* ''longdesc'' - Optional description, but may be longer and formatted using HTML.
* ''symbol'' - An Array of prefix and suffix for the primary currency. Each may be either a fixed String, an Array of two Strings (negative and positive), or null. Any positive or negative symbols must be included in this prefix/suffix; it MUST NOT be implied otherwise.
* ''digits'' - The type of digits to use for the primary currency's numbers. "arabic" should be used for common 0-9 digits.
* ''symbol'' - An Array of prefix and suffix for the quote currency. Each may be either a fixed String, an Array of two Strings (negative and positive), or null. Any positive or negative symbols must be included in this prefix/suffix; it MUST NOT be implied otherwise.
* ''digits'' - The type of digits to use for the quote currency's numbers. "arabic" should be used for common 0-9 digits.
* ''grouping'' - An Array alternating between Numbers representing a series of digits, and Strings used as delimiters. If terminated by a zero, the final grouping is to be repeated continually. For example, the common US locale thousands grouping would be <code>[3, ",", 0]</code>
* ''fraction_sep'' - A String to be placed between whole numbers and a fractional amount.
* ''fraction_digits'' - Array of absolute minimum (even for whole numbers) number of fractional digits, minimum fractional digits when a fraction exists, and maximum number of fractional digits when absolute precision is not demanded (below which is to be rounded in an implementation-dependent manner).

Loading…
Cancel
Save