Skip to content

Commit cea6be5

Browse files
committed
bip-xchgrate: history bounds and "nearest" flag
1 parent 43aa6f8 commit cea6be5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bip-xchgrate.mediawiki

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,15 @@ Parameters:
130130
* ''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.
131131
* ''from'' - POSIX timestamp the results should begin with.
132132
* ''to'' - POSIX timestamp the results should end with. If omitted, the present time shall be used.
133+
* ''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.)
133134
* ''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.
134135
135136
A result is provided for each currency-pair and timestamp record, in the same format as the current exchange rate request.
136137
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).
137138
139+
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.
140+
This is not necessary when only the nearest record is requested, or when "to" is omitted (ie, ending at the most recent record).
141+
138142
Example:
139143
140144
Request: http://api.example.tld/?mode=history&cp=XBTUSD-ver4,2&type=typical&ratedelta=0.1&timedelta=10&from=1488759998&to=1488760090

0 commit comments

Comments
 (0)