Browse Source

bip-xchgrate: history bounds and "nearest" flag

master
Luke Dashjr 8 years ago
parent
commit
cea6be598d
  1. 4
      bip-xchgrate.mediawiki

4
bip-xchgrate.mediawiki

@ -130,11 +130,15 @@ Parameters:
* ''type'' - Type of exchange rate data being requested. May be "high", "low", "average", "typical", or any other arbitrary name. If omitted, the server may provide any rates it deems appropriate.
* ''from'' - POSIX timestamp the results should begin with.
* ''to'' - POSIX timestamp the results should end with. If omitted, the present time shall be used.
* ''nearest'' - If provided and true, indicates that only the nearest timestamp to "from" must be returned, and a range is not desired. ("to" should be omitted in this case.)
* ''ratedelta'', ''timedelta'' - If specified, the server may omit data where the rate or time has not changed since the last provided rate and time. If both are provided, either a significant rate change OR time change should trigger a new record in the results.
A result is provided for each currency-pair and timestamp record, in the same format as the current exchange rate request.
Records MUST be provided in chronological order, but only within the scope of the applicable currency-pair (ie, it is okay to send the full history for one currency-pair, and then the full history for the next; or to intermix them out of any given order).
If there is no exact record for the times specified by "from" and/or "to", a single record before "from" and/or after "to" should also be included.
This is not necessary when only the nearest record is requested, or when "to" is omitted (ie, ending at the most recent record).
Example:
Request: http://api.example.tld/?mode=history&cp=XBTUSD-ver4,2&type=typical&ratedelta=0.1&timedelta=10&from=1488759998&to=1488760090

Loading…
Cancel
Save