dfinity / exchange-rate-canister

The exchange rate canister (XRC) makes use of the HTTP requests feature to provide exchange rates as a service to the IC.
Apache License 2.0
37 stars 10 forks source link

feat: Forex goes back when looking for rates, reports the actual timestamp for rates #133

Closed yotamhc closed 1 year ago

yotamhc commented 1 year ago

This PR adds the following:

  1. When looking up a forex rate, and no rates exist for the requested date, it will go back up to 4 days as the requested date may fall on a weekend or a holiday.
  2. The effective timestamp for which forex rates are reported are added to the QueriedExchangeRate struct and consequently later to the ExchangeRateMetadata struct, so the user can see what date the forex rates that were used are from.