1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-05-19 12:08:05 +00:00

bip-xchgrate: Limit currency-pair token symbols, and give a little info with enumeration

This commit is contained in:
Luke Dashjr 2017-03-04 23:37:59 +00:00
parent 8eaad1803f
commit 019d922851

View File

@ -29,6 +29,8 @@ To be BIP <FIXME> compatible, servers MUST support at least one currency-pair co
All inquiries for bitcoin amounts MUST be specified in XBT, even if the presentation to the end user is in another unit. All inquiries for bitcoin amounts MUST be specified in XBT, even if the presentation to the end user is in another unit.
(FIXME: or should this be satoshis?) (FIXME: or should this be satoshis?)
Currency-pair tokens are arbitrary Strings no longer than 255 characters, which may include any ASCII [https://tools.ietf.org/html/rfc3986#section-2.3 RFC 3986 unreserved characters] (ie, alphanumerics and the hyphen, underscore, period, and tilde symbols).
Currency code(s) used herein are defined as such: Currency code(s) used herein are defined as such:
* All ISO 4217 codes are valid currency codes. * All ISO 4217 codes are valid currency codes.
@ -46,8 +48,12 @@ Parameters:
* ''alt'' - If provided, the server MAY limit the results to only currency-pairs describing currency rates compared to 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).
* ''locale'' - If provided, the server MAY limit the results to only currency-pairs supporting the given locale(s). * ''locale'' - If provided, the server MAY limit the results to only currency-pairs supporting the given locale(s).
There is only one result, which is a JSON Array of Strings, each representing a supported currency-pair. Each currency-pair will receive a separate result, a JSON Object, with the following information:
These Strings are arbitrarily decided by the server.
* ''cp'' - The currency-pair token.
* ''cc'' - The currency code for the primary currency.
* ''alt'' - The currency code for the secondary 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=== ===Currency-pair information===
@ -61,7 +67,7 @@ Each currency-pair will receive a separate result, a JSON Object, with the follo
* ''cp'' - The currency-pair token. * ''cp'' - The currency-pair token.
* ''cc'' - The currency code for the primary currency. * ''cc'' - The currency code for the primary currency.
* ''alt'' - The currency code for the secondary currency. * ''alt'' - The currency code for the secondary 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. * ''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. * ''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. * ''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. * ''digits'' - The type of digits to use for the primary currency's numbers. "arabic" should be used for common 0-9 digits.