             return { $0.isPending }
         case .complete:
             return { !$0.isPending }
-        }
-    }
-}
+        case .text(let text):
+            return { transaction in
+                if transaction.hash.contains(text) {
+                    return true
+                }
+                if let address = transaction.toAddress, address.contains(text) {
+                    if address.contains(text) {
+                        return true
+                    }
+                }
+                return false
+            }
+        }
+    }
+}
+
+extension SearchFilterType : Equatable {}
+
+func ==(lhs: SearchFilterType, rhs: SearchFilterType) -> Bool {
+    switch (lhs, rhs) {
+    case (.sent, .sent):
+        return true
+    case (.received, .received):
+        return true
+    case (.pending, .pending):
+        return true
+    case (.complete, .complete):
+        return true
+    case (.text(_), .text(_)):
+        return true
+    default:
+        return false
+    }
+}
+
 
 typealias TransactionFilter = (Transaction) -> Bool
 

    private func setData() {
        backgroundColor = .whiteTint
        searchBar.backgroundImage = UIImage()
        searchBar.showsScopeBar = true
        cancel.setTitle(S.Button.cancel, for: .normal)
        cancel.tap = { [weak self] in
            self?.searchBar.resignFirstResponder()
            self?.didCancel?()
        }

}

extension SearchHeaderView : UISearchBarDelegate {
    func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
        let filter: SearchFilterType = .text(searchText)
        if let index = filters.index(of: filter) {
            filters.remove(at: index)
        }
        if searchText != "" {
            filters.append(filter)
        }
    }
}
