Amarula.Protocol.Auth.Types (amarula v0.1.0)
View SourceAuthentication types and data structures for WhatsApp protocol.
This module defines the core types used throughout the authentication system, including credentials, session state, and device information.
Summary
Types
@type account_settings() :: %{ unarchive_chats: boolean() | nil, default_disappearing_mode: map() | nil, disappearing_mode_duration: integer() | nil, display_name: String.t() | nil, link_previews: boolean() | nil, business_verified: boolean() | nil, mark_read_on_return: boolean() | nil, call_add_to_contacts: boolean() | nil, pin_invite_to_parent: boolean() | nil, ephemeral_expiration: integer() | nil, ephemeral_setting_timestamp: integer() | nil }
@type authentication_creds() :: %{ registration_id: integer(), signed_pre_key: key_pair(), signed_identity_key: key_pair(), signed_pre_key_id: integer(), signed_pre_key_signature: binary(), noise_key: key_pair(), pairing_ephemeral_key_pair: key_pair(), adv_secret_key: String.t(), me: contact() | nil, account: map() | nil, signal_identities: [signal_identity()] | nil, my_app_state_key_id: String.t() | nil, first_unuploaded_pre_key_id: integer(), next_pre_key_id: integer(), last_account_sync_timestamp: integer() | nil, platform: String.t() | nil, processed_history_messages: [map()], account_sync_counter: integer(), account_settings: account_settings(), registered: boolean(), pairing_code: String.t() | nil, last_prop_hash: String.t() | nil, routing_info: binary() | nil, additional_data: map() | nil }
@type authentication_state() :: %{creds: authentication_creds(), keys: module()}
@type client_payload() :: %{ connect_type: atom(), connect_reason: atom(), user_agent: user_agent(), web_info: web_info() | nil, passive: boolean() | nil, pull: boolean() | nil, username: integer() | nil, device: integer() | nil, lid_db_migrated: boolean() | nil, companion: device_props() | nil }
@type connection_state() ::
:connecting | :open | :closed | :connecting_qr | :open_unpaired | :pairing
@type socket_config() :: %{ wa_web_socket_url: String.t(), connect_timeout_ms: integer(), logger: module(), keep_alive_interval_ms: integer(), browser: [String.t()], version: [String.t()], country_code: String.t(), sync_full_history: boolean(), print_qr_in_terminal: boolean(), default_query_timeout_ms: integer(), qr_timeout: integer(), mobile: boolean() }
@type web_info() :: %{web_sub_platform: atom()}