Build a simplified transaction history screen that fetches data from a mock API, supports pull-to-refresh, and implements local search filtering.
Model API responses as api_responses, a list of transaction lists. Each transaction has id, description, and status. The function performs the initial fetch, processes actions such as search:<query> and refresh, and returns the visible transaction list after each state change. Search matches description or status, case-insensitively. Refresh replaces the current data with the next mock response while preserving the active query.
Input: transaction_history(api_responses, actions).
Output: A list of visible transaction-list snapshots, including the initial fetch.
def transaction_history(api_responses, actions):