From cea6be598d3ad90e1e439ab05f1bfd695e900431 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 6 Mar 2017 22:08:51 +0000 Subject: [PATCH] bip-xchgrate: history bounds and "nearest" flag --- bip-xchgrate.mediawiki | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bip-xchgrate.mediawiki b/bip-xchgrate.mediawiki index fbf17cd9..d0cf7eea 100644 --- a/bip-xchgrate.mediawiki +++ b/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