Service class for managing currency exchange related operations.

Hierarchy

  • ApiService
    • CurrencyExchangeService

Methods

  • Requests an fxRate creation.

    Parameters

    Returns Promise<FxRate>

    A promise that resolves to the created fxRate.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    currencyExchangeService.createQuote(request)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error creating fxRate`);
    });
  • Retrieves an fxRate.

    Parameters

    • quoteId: string

      The id of the fxRate.

    Returns Promise<FxRate>

    A promise that resolves to the created fxRate.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    currencyExchangeService.getQuote(quoteId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching fxRate`);
    });
  • Retrieves the singleton instance of the CurrencyExchangeService class.

    Returns CurrencyExchangeService

    The singleton instance of the CurrencyExchangeService class.

    Function

    Static

    Example

    // Usage:
    const currencyExchangeService = CurrencyExchangeService.getInstance();