Overview
waproto contains the Protocol Buffers definitions for all WhatsApp message types. It’s auto-generated from whatsapp.proto using prost and provides strongly-typed Rust structs for working with WhatsApp’s binary protocol.
Structure
Usage
All protobuf types are under thewaproto::whatsapp module:
Key Message Types
Core Message Types
Message
The main message container used for all WhatsApp messages.MessageKey
Identifies a specific message in a conversation.Media Messages
ImageMessage
VideoMessage
AudioMessage
DocumentMessage
StickerMessage
Rich Content Messages
ExtendedTextMessage
Text with formatting, links, and quoted messages.InteractiveMessage
Buttons, lists, and other interactive elements.ButtonsMessage
ListMessage
Encryption Messages
SenderKeyDistributionMessage
Used for group message encryption.PreKeySignalMessage
Used for establishing 1:1 encryption.System & Protocol Messages
ProtocolMessage
For protocol-level operations.DELETE- Delete message for everyoneREVOKE- Revoke sent messageEPHEMERAL_SETTING- Ephemeral message setting
ReactionMessage
EditMessage
AI & Bot Messages
AiRichResponseMessage
BotFeedbackMessage
Metadata & Context
MessageContextInfo
ContextInfo
Quoted messages, mentions, and forwarding info.Device & Identity Types
ADV Messages
Account Device Verification messages.Signal Protocol Structures
Handshake & Connection Types
HandshakeMessage
Used during initial connection handshake.ClientPayload
Device and client information during pairing.History Sync Types
HistorySyncNotification
HistorySync
Media Reference Types
ExternalBlobReference
References to uploaded media files.App State Types
SyncActionValue
App state synchronization actions.Enums
waproto includes many enum types (as i32 values with const definitions):Serde Support
All generated types includeserde::Serialize and serde::Deserialize:
Code Generation
The protobuf code is auto-generated but checked into version control. To regenerate:build.rs which uses prost-build to compile whatsapp.proto into whatsapp.rs.
Usage Examples
Constructing Messages
Pattern Matching
Media Downloads
See Media Handling for complete examples.WhatsApp Version
The protobuf definitions are based on:Relationship with wacore
wacore provides utilities for working with waproto messages:proto_helpers- Conversion between protobuf and internal typesdownload-Downloadabletrait for media messagesupload- Media encryption for uploadmessages- Message encryption/decryptionsend- Message building and sending