refactor wallet history into a directive