Service class for managing transaction history related operations.

Hierarchy

  • ApiService
    • TransactionHistoryService

Methods

  • Retrieves a specific user transaction by ID.

    Parameters

    • transactionId: string

      The ID of the transaction to be retrieved.

    Returns Promise<Transaction>

    A promise that resolves to the specified user transaction.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transactionHistoryService.getTransaction(transactionId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching transaction history.`);
    });
  • Retrieves a list of user transactions by accountId.

    Parameters

    Returns Promise<TransactionList>

    A promise that resolves to a transactions list.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transactionHistoryService.getTransactionHistory({accountId})
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching transaction history.`);
    });
  • Retrieves the singleton instance of the TransactionHistoryService class.

    Returns TransactionHistoryService

    The singleton instance of the TransactionHistoryService class.

    Function

    Static

    Example

    // Usage:
    const transactionHistoryService = TransactionHistoryService.getInstance();