Class ExchangeService

java.lang.Object
io.meeds.deeds.service.ExchangeService

@Component public class ExchangeService extends Object
  • Constructor Details

    • ExchangeService

      public ExchangeService()
  • Method Details

    • getExchangeRates

      public List<MeedPrice> getExchangeRates(Currency currency, LocalDate fromDate, LocalDate toDate)
      Retrieves list of MeedPrice from selected date until a dedicated date
      Parameters:
      currency - Currency
      fromDate - LocalDate
      toDate - LocalDate
      Returns:
      List of MeedPrice for selected dates
    • getExchangeRate

      public BigDecimal getExchangeRate(Currency currency)
    • computeTodayCurrencyExchangeRate

      public void computeTodayCurrencyExchangeRate()
    • computeRates

      @PostConstruct public void computeRates()
      Compute and store EURO Currency Exchange rate from first date when MEED Contract has been created until today
    • computeMeedExchangeRate

      public void computeMeedExchangeRate()
      Compute and store MEED Token Exchange rates from first date when MEED Contract has been created until today
    • getMeedUsdPrice

      public BigDecimal getMeedUsdPrice()
    • computeCurrencyExchangeRate

      protected void computeCurrencyExchangeRate()
    • executeQuery

      protected String executeQuery(String url, String body)
    • newURLConnection

      protected HttpsURLConnection newURLConnection(String url) throws IOException
      Throws:
      IOException
    • firstMeedTokenDate

      protected LocalDate firstMeedTokenDate()