# `ExWapp.AppState.Engine`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/appstate/engine.ex#L1)

Public façade for WhatsApp app-state sync.

This module is the stable entry point; the work lives in five modules, each
with one reason to change:

- `ExWapp.AppState.Engine.Builders` — build outgoing patch descriptions
  (contact, archive, pin, mute, delete, mark-read, clear-chat)
- `ExWapp.AppState.Engine.Codec` — encode/decode patches, mutation MACs,
  snapshot verification and the LTHash chain
- `ExWapp.AppState.Engine.Sync` — the IQ round-trips with the server, external
  blob download, and applying collection responses
- `ExWapp.AppState.Engine.Dispatch` — turn decoded mutations into contact and
  chat updates
- `ExWapp.AppState.Engine.State` — persist collection versions, hashes and
  mutation MACs

Reference: whatsmeow `appstate/encode.go`, `appstate/decode.go`, `appstate.go`.

The types for the shapes crossing this boundary (`patch_info`,
`mutation_info`, `hash_state`, `decoded_mutation`) are declared where they are
produced, in `Builders` and `Codec`.

# `all_collections`

# `apply_collection_response`

# `apply_collection_response`

# `apply_collection_response`

# `apply_outgoing_patch`

# `apply_outgoing_patch`

# `build_archive`

# `build_archive`

# `build_clear_chat`

# `build_clear_chat`

# `build_contact`

# `build_contact`

# `build_delete_chat`

# `build_delete_chat`

# `build_delete_contact`

# `build_mark_read`

# `build_mark_read`

# `build_mute`

# `build_mute`

# `build_pin`

# `decode_mutations`

# `decode_mutations`

# `decode_patch`

# `decode_patch`

# `dispatch_mutation`

# `dispatch_mutation`

# `dispatch_mutation`

# `encode_patch`

# `encode_patch`

# `fetch_collection`

# `fetch_collection`

# `get_collection_state`

# `persist_collection_state`

# `reset_collection_state`

# `send_mutation`

# `send_mutation`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
