Home Manual Reference Source Repository

src/plugins/easycurrency/resolvers/CurrencyResolver.js

  1. /**
  2. * Provides information about available currencies.
  3. * This is an abstract class which resolvers should extend from.
  4. * @public
  5. */
  6. export default class CurrencyResolver {
  7. /**
  8. * List the available currencies.
  9. * @return {String[]}
  10. * @throws {Error} - CurrencyResolver should implement listCurrencyCodes
  11. */
  12. async listCurrencyCodes() {
  13. throw Error('CurrencyResolver should implement listCurrencyCodes');
  14. }
  15.  
  16.  
  17. /**
  18. * Get conversion rate for a specific currency pair.
  19. * @param {String} from
  20. * @param {String} to
  21. * @return {Number}
  22. * @throws {Error} - CurrencyResolver should implement getConversionRate
  23. */
  24. async getConversionRate(from, to) {
  25. throw Error('CurrencyResolver should implement getConversionRate');
  26. }
  27. }