Expand description
Raw FFI bindings to libxmtp_ffi — the XMTP messaging protocol static library.
All types and functions are auto-generated by bindgen
from the C header xmtp_ffi.h produced by cbindgen. Do not edit manually.
§Build
The build script (build.rs) automatically:
- Downloads the pre-built static library from GitHub Releases (or uses a local path).
- Runs
bindgenon the includedxmtp_ffi.hheader. - Configures the linker to link the static library + system dependencies.
For local development, set XMTP_FFI_DIR to point at the xmtp-ffi crate root
(e.g. ../xmtp-ffi) — it must contain include/xmtp_ffi.h and a built static lib.
Structs§
- Xmtp
FfiApi Stats - MLS API call statistics (request counts).
- Xmtp
FfiArchive Options - Options for device sync archive operations.
- Xmtp
FfiAuth Handle - Xmtp
FfiAvailable Archive List - Xmtp
FfiClient - Xmtp
FfiClient Options - Options for creating a client. All string fields are borrowed (not freed by this library).
- Xmtp
FfiConsent Record - A consent record exposed to C.
- Xmtp
FfiConversation - Xmtp
FfiConversation Debug Info - Conversation debug info (epoch, fork status, commit logs, cursors).
- Xmtp
FfiConversation List - Xmtp
FfiCreate Group Options - Options for creating a new group conversation.
- Xmtp
FfiCursor - A single cursor entry (originator + sequence).
- Xmtp
FfiDisappearing Settings - Options for message disappearing settings.
- Xmtp
FfiEnriched Message - An enriched (decoded) message exposed to C. Contains metadata + the original encoded content bytes for upper-layer decoding.
- Xmtp
FfiEnriched Message List - Xmtp
FfiGroup Member List - Xmtp
FfiGroup Metadata - Group metadata (creator + conversation type).
- Xmtp
FfiGroup Permissions - Group permissions (policy type + policy set).
- Xmtp
FfiHmac Key - A single HMAC key (42-byte key + epoch).
- Xmtp
FfiHmac KeyMap - Xmtp
FfiIdentity Stats - Identity API call statistics (request counts).
- Xmtp
FfiInbox State List - Xmtp
FfiInbox Update Count - Inbox update count entry (inbox_id → count).
- Xmtp
FfiInbox Update Count List - Xmtp
FfiKey Package Status - Key package status for an installation.
- Xmtp
FfiKey Package Status List - Xmtp
FfiLast Read Time Entry - Last-read-time entry (inbox_id → timestamp_ns).
- Xmtp
FfiLast Read Time List - Xmtp
FfiList Conversations Options - Options for listing conversations.
- Xmtp
FfiList Messages Options - Options for listing messages.
- Xmtp
FfiMessage - Xmtp
FfiMessage List - Xmtp
FfiPermission Policy Set - Permission policy set for a conversation.
- Xmtp
FfiPreference Update - A preference update exposed to C.
- Xmtp
FfiSend Opts - Options for sending a message.
- Xmtp
FfiSignature Request - Xmtp
FfiStream Handle
Enums§
- Xmtp
FfiConsent Entity Type - Consent entity type.
- Xmtp
FfiConsent State - Consent state for an entity.
- Xmtp
FfiConversation Type - Conversation type.
- Xmtp
FfiDelivery Status - Message delivery status.
- Xmtp
FfiGroup Permissions Preset - Group permissions preset.
- Xmtp
FfiMessage Kind - Message kind.
- Xmtp
FfiPermission Policy - Permission policy value.
- Xmtp
FfiPreference Update Kind - Preference update kind.
Functions§
- xmtp_
auth_ ⚠handle_ create - Create a new gateway auth handle. Caller must free with
xmtp_auth_handle_free. - xmtp_
auth_ ⚠handle_ free - xmtp_
auth_ ⚠handle_ id - Get the unique ID of an auth handle.
- xmtp_
auth_ ⚠handle_ set - Set a credential on an auth handle.
nameis an optional HTTP header name (null = “authorization”).valueis the header value (required).expires_at_secondsis the Unix timestamp when the credential expires. - xmtp_
available_ ⚠archive_ exported_ at_ ns - Get the exported_at_ns at index.
- xmtp_
available_ ⚠archive_ list_ free - Free an available archive list.
- xmtp_
available_ ⚠archive_ list_ len - xmtp_
available_ ⚠archive_ pin - Get the pin string at index. Returns a borrowed pointer; do NOT free.
- xmtp_
client_ ⚠account_ identifier - Get the account identifier string used to create this client.
Caller must free with
xmtp_free_string. - xmtp_
client_ ⚠add_ identifier_ signature_ request - Create a signature request to add a new identifier.
Caller must free with
xmtp_signature_request_free. - xmtp_
client_ ⚠api_ aggregate_ statistics - Get aggregate statistics as a debug string. Caller must free with
xmtp_free_string. - xmtp_
client_ ⚠api_ identity_ statistics - Get identity API call statistics. Writes to
out. - xmtp_
client_ ⚠api_ statistics - Get MLS API call statistics. Writes to
out. - xmtp_
client_ ⚠app_ version - Get the app version string set during client creation.
Returns null if no app version was set. Caller must free with
xmtp_free_string. - xmtp_
client_ ⚠apply_ signature_ request - Apply a signature request to the client.
- xmtp_
client_ ⚠can_ message - Check which identifiers can receive messages.
identifiersis an array of C strings,kindsis a parallel array of identifier kinds. Results are written toout_results(1 = can message, 0 = cannot). - xmtp_
client_ ⚠change_ recovery_ identifier_ signature_ request - Create a signature request to change the recovery identifier.
Caller must free with
xmtp_signature_request_free. - xmtp_
client_ ⚠clear_ all_ statistics - Clear all API call statistics.
- xmtp_
client_ ⚠create - Create a new XMTP client. Caller must free with
xmtp_client_free. - xmtp_
client_ ⚠create_ dm - Find or create a DM by identifier. Caller must free result with
xmtp_conversation_free. - xmtp_
client_ ⚠create_ dm_ by_ inbox_ id - Create a DM by target inbox ID. Caller must free result with
xmtp_conversation_free. - xmtp_
client_ ⚠create_ group - Create a new group conversation, optionally adding members by inbox ID.
Pass null/0 for
member_inbox_ids/member_countto create an empty group. Caller must free result withxmtp_conversation_free. - xmtp_
client_ ⚠create_ group_ by_ identity - Create a new group, adding members by identity (address/passkey).
identifiersandkindsare parallel arrays of lengthcount. Caller must free result withxmtp_conversation_free. - xmtp_
client_ ⚠create_ group_ optimistic - Create a group without syncing members (optimistic / offline-capable).
Caller must free with
xmtp_conversation_free. - xmtp_
client_ ⚠create_ inbox_ signature_ request - Create an inbox registration signature request (if needed).
Returns null via
outif no signature is needed. Caller must free withxmtp_signature_request_free. - xmtp_
client_ ⚠delete_ message_ by_ id - Delete a message by its hex-encoded ID. Returns the number of deleted rows.
- xmtp_
client_ ⚠fetch_ inbox_ states - Fetch inbox states for multiple inbox IDs.
inbox_idsis a null-terminated array of C strings withcountelements. Returns an opaqueFfiInboxStateListviaout. Caller must free withxmtp_inbox_state_list_free. - xmtp_
client_ ⚠fetch_ inbox_ updates_ count - Fetch the number of identity updates for multiple inbox IDs.
Caller must free the result with
xmtp_inbox_update_count_list_free. - xmtp_
client_ ⚠fetch_ key_ package_ statuses - Fetch key package statuses for a list of installation IDs (hex-encoded).
Caller must free with
xmtp_key_package_status_list_free. - xmtp_
client_ ⚠fetch_ own_ inbox_ updates_ count - Fetch the number of identity updates for the client’s own inbox.
- xmtp_
client_ ⚠find_ dm_ by_ inbox_ id - Find or create a DM by inbox ID. Caller must free result with
xmtp_conversation_free. - xmtp_
client_ ⚠free - xmtp_
client_ ⚠get_ consent_ state - Get consent state for a single entity. Result written to
out_state. - xmtp_
client_ ⚠get_ conversation_ by_ id - Get a conversation by hex-encoded group ID.
Caller must free result with
xmtp_conversation_free. - xmtp_
client_ ⚠get_ enriched_ message_ by_ id - Get an enriched (decoded) message by its hex-encoded ID.
Caller must free with
xmtp_enriched_message_list_free(single-item list). - xmtp_
client_ ⚠get_ inbox_ id_ by_ identifier - Look up an inbox ID by account identifier using the client’s connection.
identifier_kind: 0 = Ethereum, 1 = Passkey. Returns null if not found. Caller must free withxmtp_free_string. - xmtp_
client_ ⚠get_ message_ by_ id - Get a message by its hex-encoded ID. Caller must free with
xmtp_message_free. - xmtp_
client_ ⚠hmac_ keys - Get HMAC keys for all conversations (including duplicate DMs).
Returns a map via
out. Caller must free withxmtp_hmac_key_map_free. - xmtp_
client_ ⚠inbox_ id - Get the client’s inbox ID. Caller must free with
xmtp_free_string. - xmtp_
client_ ⚠inbox_ state - Get the inbox state for this client as a single-element list.
Caller must free with
xmtp_inbox_state_list_free. - xmtp_
client_ ⚠installation_ id - Get the client’s installation ID (hex). Caller must free with
xmtp_free_string. - xmtp_
client_ ⚠installation_ id_ bytes - Get the client’s installation ID as raw bytes.
Writes length to
out_len. Caller must free withxmtp_free_bytes. - xmtp_
client_ ⚠is_ registered - Check if the client identity is registered. Returns 1 = yes, 0 = no, -1 = error.
- xmtp_
client_ ⚠list_ conversations - List conversations. Caller must free result with
xmtp_conversation_list_free. - xmtp_
client_ ⚠process_ streamed_ welcome_ message - Process a raw welcome message received via push notification.
Returns a list of conversation handles. Caller must free with
xmtp_conversation_list_free. - xmtp_
client_ ⚠reconnect_ db - Reconnect to the database.
- xmtp_
client_ ⚠register_ identity - Register the client identity with an optional signature request.
Pass null for
sig_reqif no external signature is needed. - xmtp_
client_ ⚠release_ db_ connection - Release the database connection pool.
- xmtp_
client_ ⚠revoke_ all_ other_ installations - Create a signature request to revoke all other installations.
Returns null via
outif there are no other installations. Caller must free withxmtp_signature_request_free. - xmtp_
client_ ⚠revoke_ identifier_ signature_ request - Create a signature request to revoke an identifier.
Caller must free with
xmtp_signature_request_free. - xmtp_
client_ ⚠revoke_ installations_ signature_ request - Create a signature request to revoke specific installations by their IDs.
installation_idsis an array of byte arrays, eachid_lenbytes long. Caller must free withxmtp_signature_request_free. - xmtp_
client_ ⚠set_ consent_ states - Set consent states for multiple entities.
entity_types: 0 = GroupId, 1 = InboxId.states: 0 = Unknown, 1 = Allowed, 2 = Denied. - xmtp_
client_ ⚠sign_ with_ installation_ key - Sign text with the client’s installation key.
Writes signature bytes to
outand length toout_len. Caller must freeoutwithxmtp_free_bytes. - xmtp_
client_ ⚠sync_ all - Sync all conversations, optionally filtering by consent states.
consent_statesis a parallel array of consent state values (0=Unknown, 1=Allowed, 2=Denied). Pass null and 0 to sync all. - xmtp_
client_ ⚠sync_ preferences - Sync preferences (device sync groups only).
- xmtp_
client_ ⚠sync_ welcomes - Sync welcomes (process new group invitations).
- xmtp_
client_ ⚠verify_ signed_ with_ installation_ key - Verify a signature produced by
xmtp_client_sign_with_installation_key. Returns 0 on success (valid), -1 on error (invalid or bad args). - xmtp_
conversation_ ⚠add_ members - Add members by inbox IDs.
- xmtp_
conversation_ ⚠add_ members_ by_ identity - Add members by external identifiers (address/passkey).
identifiersandkindsare parallel arrays of lengthcount. - xmtp_
conversation_ ⚠added_ by_ inbox_ id - xmtp_
conversation_ ⚠app_ data - xmtp_
conversation_ ⚠consent_ state - Get conversation consent state. Writes to
out_state(0=Unknown, 1=Allowed, 2=Denied). - xmtp_
conversation_ ⚠count_ messages - Count messages matching the given filter options.
Pass null for
optsto count all messages. - xmtp_
conversation_ ⚠created_ at_ ns - Get the conversation created-at timestamp in nanoseconds.
- xmtp_
conversation_ ⚠debug_ info - Get debug info for this conversation.
Caller must free string fields with
xmtp_free_string. - xmtp_
conversation_ ⚠debug_ info_ free - Free a conversation debug info struct (its string fields and cursor array).
- xmtp_
conversation_ ⚠disappearing_ settings - Get the current message disappearing settings.
Returns 0 on success (writes to
out), -1 if not set or on error. - xmtp_
conversation_ ⚠dm_ peer_ inbox_ id - Get the DM peer’s inbox ID. Caller must free with
xmtp_free_string. Returns null if not a DM or on error. - xmtp_
conversation_ ⚠duplicate_ dms - Find duplicate DM conversations for this DM.
Returns a conversation list. Caller must free with
xmtp_conversation_list_free. - xmtp_
conversation_ ⚠free - xmtp_
conversation_ ⚠group_ description - xmtp_
conversation_ ⚠group_ image_ url - xmtp_
conversation_ ⚠group_ metadata - Get the full group metadata (creator inbox ID + conversation type).
Caller must free with
xmtp_group_metadata_free. - xmtp_
conversation_ ⚠group_ name - xmtp_
conversation_ ⚠group_ permissions - Get the group permissions (policy type + full policy set).
Caller must free with
xmtp_group_permissions_free. - xmtp_
conversation_ ⚠hmac_ keys - Get HMAC keys for this conversation (including duplicate DMs).
Returns a map via
out. Caller must free withxmtp_hmac_key_map_free. - xmtp_
conversation_ ⚠id - Get the conversation’s hex-encoded group ID. Caller must free with
xmtp_free_string. - xmtp_
conversation_ ⚠is_ active - Check if the conversation is active. Returns 1=active, 0=inactive, -1=error.
- xmtp_
conversation_ ⚠is_ admin - xmtp_
conversation_ ⚠is_ disappearing_ enabled - Check if message disappearing is enabled. Returns 1=enabled, 0=disabled, -1=error.
- xmtp_
conversation_ ⚠is_ super_ admin - xmtp_
conversation_ ⚠last_ read_ times - Get per-inbox last read times for a conversation.
Caller must free with
xmtp_last_read_time_list_free. - xmtp_
conversation_ ⚠leave - Leave the group.
- xmtp_
conversation_ ⚠list_ admins - xmtp_
conversation_ ⚠list_ enriched_ messages - List enriched (decoded) messages for a conversation.
Fetches both enriched metadata and raw content bytes in a single call.
Caller must free with
xmtp_enriched_message_list_free. - xmtp_
conversation_ ⚠list_ free - xmtp_
conversation_ ⚠list_ get - Get a conversation from a list by index. Caller must free with
xmtp_conversation_free. - xmtp_
conversation_ ⚠list_ is_ commit_ log_ forked - Get the commit log fork status for a conversation list item. Returns -1=unknown/error, 0=not forked, 1=forked.
- xmtp_
conversation_ ⚠list_ last_ message - Get the last message for a conversation list item as an opaque FfiMessage handle.
Returns 0 on success (writes to
out), -1 on error or if no last message exists. Caller must free withxmtp_message_free. - xmtp_
conversation_ ⚠list_ last_ message_ sent_ at_ ns - Get the sent_at_ns of the last message for a conversation list item. Returns 0 if no last message exists, or -1 on error.
- xmtp_
conversation_ ⚠list_ len - xmtp_
conversation_ ⚠list_ members - List group members. Caller must free with
xmtp_group_member_list_free. - xmtp_
conversation_ ⚠list_ messages - List messages in this conversation. Caller must free with
xmtp_message_list_free. - xmtp_
conversation_ ⚠list_ super_ admins - xmtp_
conversation_ ⚠membership_ state - Get the membership state of the current user in this conversation. 0=Allowed, 1=Rejected, 2=Pending, 3=Restored, 4=PendingRemove, -1=error.
- xmtp_
conversation_ ⚠paused_ for_ version - Check if the conversation is paused for a version upgrade.
Writes the version string to
outif paused, or null if not paused. Caller must freeoutwithxmtp_free_string. Returns 0 on success, -1 on error. - xmtp_
conversation_ ⚠prepare_ message - Prepare a message for later publishing (optimistic send workflow).
Stores the message locally without publishing. Returns message ID (hex) via
out_id. Caller must freeout_idwithxmtp_free_string. - xmtp_
conversation_ ⚠process_ streamed_ group_ message - Process a raw group message received via push notification.
Returns a list of stored messages. Caller must free with
xmtp_message_list_free. - xmtp_
conversation_ ⚠publish_ messages - Publish all queued (unpublished) messages in this conversation.
- xmtp_
conversation_ ⚠publish_ stored_ message - Publish a previously prepared message by its hex-encoded ID.
- xmtp_
conversation_ ⚠remove_ disappearing_ settings - Remove (disable) message disappearing settings for this conversation.
- xmtp_
conversation_ ⚠remove_ members - Remove members by inbox IDs.
- xmtp_
conversation_ ⚠remove_ members_ by_ identity - Remove members by external identifiers (address/passkey).
- xmtp_
conversation_ ⚠send - Send raw encoded content bytes. Returns the message ID (hex) via
out_id. Caller must freeout_idwithxmtp_free_string. Pass null foroptsto use defaults (should_push = true). - xmtp_
conversation_ ⚠send_ optimistic - Send raw encoded content bytes optimistically (returns immediately, publishes in background).
Returns the message ID (hex) via
out_id. Caller must free withxmtp_free_string. - xmtp_
conversation_ ⚠stream_ messages - Stream messages for a single conversation. Callback receives owned
*mut FfiMessage. - xmtp_
conversation_ ⚠sync - Sync this conversation with the network.
- xmtp_
conversation_ ⚠type - Get the conversation type. Returns
FfiConversationTypevalue, or -1 on error. - xmtp_
conversation_ ⚠update_ admin_ list - Add/remove admin or super admin.
action: 0=AddAdmin, 1=RemoveAdmin, 2=AddSuperAdmin, 3=RemoveSuperAdmin. - xmtp_
conversation_ ⚠update_ app_ data - xmtp_
conversation_ ⚠update_ consent_ state - Update conversation consent state.
- xmtp_
conversation_ ⚠update_ disappearing_ settings - Update the message disappearing settings for this conversation.
- xmtp_
conversation_ ⚠update_ group_ description - xmtp_
conversation_ ⚠update_ group_ image_ url - xmtp_
conversation_ ⚠update_ group_ name - xmtp_
conversation_ ⚠update_ permission_ policy - Update a permission policy on this conversation.
update_type: 1=AddMember, 2=RemoveMember, 3=AddAdmin, 4=RemoveAdmin, 5=UpdateMetadata.policy: 1=Allow, 2=Deny, 3=AdminOnly, 4=SuperAdminOnly.metadata_field_name: Only used when update_type=5 (e.g. “group_name”). Pass null otherwise. - xmtp_
device_ ⚠sync_ archive_ metadata - Read metadata from an archive file without loading its full contents.
out_elementsis a bitmask: bit 0 = Messages, bit 1 = Consent.out_start_ns/out_end_nsare 0 if not set. All output pointers are nullable. - xmtp_
device_ ⚠sync_ create_ archive - Export an archive to a local file.
keymust be at least 32 bytes (encryption key). - xmtp_
device_ ⚠sync_ import_ archive - Import a previously exported archive from a file.
keymust be at least 32 bytes (encryption key). - xmtp_
device_ ⚠sync_ list_ available_ archives - List archives available for import in the sync group.
days_cutofflimits how far back to look. Caller must free withxmtp_available_archive_list_free. - xmtp_
device_ ⚠sync_ process_ archive - Process a sync archive matching the given pin.
Pass null for
pinto process the latest archive. - xmtp_
device_ ⚠sync_ send_ archive - Send a sync archive to the sync group with the given pin.
- xmtp_
device_ ⚠sync_ send_ request - Send a device sync request to retrieve records from another installation.
- xmtp_
device_ ⚠sync_ sync_ all - Manually sync all device sync groups. Writes the number of synced/eligible groups to the output pointers.
- xmtp_
enriched_ ⚠message_ list_ free - Free an enriched message list (including owned strings and content bytes).
- xmtp_
enriched_ ⚠message_ list_ get - xmtp_
enriched_ ⚠message_ list_ len - xmtp_
free_ ⚠bytes - Free a byte buffer previously returned by this library.
- xmtp_
free_ ⚠string - Free a string previously returned by this library.
- xmtp_
free_ ⚠string_ array - Free a string array returned by this library.
- xmtp_
generate_ ⚠inbox_ id - Generate an inbox ID from an identifier. Caller must free with
xmtp_free_string.noncedefaults to 1 if 0 is passed. - xmtp_
get_ ⚠inbox_ id_ for_ identifier - Get the inbox ID for an identifier by querying the network.
api_urlis the gRPC host,is_securecontrols TLS. Writes the inbox ID toout(caller must free withxmtp_free_string). Writes null tooutif no inbox ID is found. - xmtp_
group_ ⚠member_ account_ identifiers - Get member account identifiers at index.
Returns a borrowed pointer to the internal string array. Do NOT free individual strings.
Use
out_countto get the number of identifiers. - xmtp_
group_ ⚠member_ consent_ state - Get member consent state at index: 0=Unknown, 1=Allowed, 2=Denied, -1=error.
- xmtp_
group_ ⚠member_ inbox_ id - Get member inbox ID at index. Caller must free with
xmtp_free_string. - xmtp_
group_ ⚠member_ installation_ ids - Get member installation IDs (hex) at index. Returns a borrowed pointer to the internal string array.
- xmtp_
group_ ⚠member_ list_ free - Free a group member list.
- xmtp_
group_ ⚠member_ list_ len - xmtp_
group_ ⚠member_ permission_ level - Get member permission level at index: 0=Member, 1=Admin, 2=SuperAdmin, -1=error.
- xmtp_
group_ ⚠metadata_ free - Free a group metadata struct.
- xmtp_
group_ ⚠permissions_ free - xmtp_
hmac_ ⚠key_ map_ free - Free an HMAC key map (including all owned data).
- xmtp_
hmac_ ⚠key_ map_ group_ id - Get the group ID (hex) at index. Returns a borrowed pointer; do NOT free.
- xmtp_
hmac_ ⚠key_ map_ keys - Get the HMAC keys at index. Writes count to
out_count. Returns a borrowed pointer to the key array; do NOT free individual keys. - xmtp_
hmac_ ⚠key_ map_ len - Get the number of entries in an HMAC key map.
- xmtp_
inbox_ ⚠state_ identifiers - Get identifiers array at index. Returns a borrowed pointer; do NOT free.
- xmtp_
inbox_ ⚠state_ inbox_ id - Get inbox ID at index. Caller must free with
xmtp_free_string. - xmtp_
inbox_ ⚠state_ installation_ ids - Get installation IDs (hex) at index. Returns a borrowed pointer; do NOT free.
- xmtp_
inbox_ ⚠state_ list_ free - Free an inbox state list.
- xmtp_
inbox_ ⚠state_ list_ len - xmtp_
inbox_ ⚠state_ recovery_ identifier - Get recovery identifier at index. Caller must free with
xmtp_free_string. - xmtp_
inbox_ ⚠update_ count_ list_ free - Free an inbox update count list.
- xmtp_
inbox_ ⚠update_ count_ list_ get - xmtp_
inbox_ ⚠update_ count_ list_ len - xmtp_
init_ ⚠logger - Initialize the tracing logger. Call at most once.
levelis a C string like “debug”, “info”, “warn”, “error”, or “off”. Pass null for default (“info”). Returns 0 on success. - xmtp_
is_ ⚠address_ authorized - Check whether an Ethereum address belongs to an inbox. Returns 1 = authorized, 0 = not authorized. Sets last error on failure.
- xmtp_
is_ ⚠installation_ authorized - Check whether an installation (by its public key bytes) belongs to an inbox. Returns 1 = authorized, 0 = not authorized. Sets last error on failure.
- xmtp_
key_ ⚠package_ status_ list_ free - Free a key package status list.
- xmtp_
key_ ⚠package_ status_ list_ get - xmtp_
key_ ⚠package_ status_ list_ len - xmtp_
last_ ⚠error_ length - Get the length of the last error message (including NUL terminator). Returns 0 if no error.
- xmtp_
last_ ⚠error_ message - Copy the last error message into
buf. Returns bytes written (excluding NUL), or -1 ifbufis null or too small. - xmtp_
last_ ⚠read_ time_ list_ free - xmtp_
last_ ⚠read_ time_ list_ get - xmtp_
last_ ⚠read_ time_ list_ len - xmtp_
libxmtp_ ⚠version - Get the libxmtp version string. Caller must free with
xmtp_free_string. - xmtp_
message_ ⚠content_ bytes - Get raw decrypted content bytes at index. Writes length to
out_len. The returned pointer is borrowed from the list — do NOT free it. - xmtp_
message_ ⚠delivery_ status - Get delivery status at index: 0=Unpublished, 1=Published, 2=Failed, -1=error.
- xmtp_
message_ ⚠free - xmtp_
message_ ⚠id - Get message ID (hex) at index. Caller must free with
xmtp_free_string. - xmtp_
message_ ⚠kind - Get message kind at index: 0=Application, 1=MembershipChange, -1=error.
- xmtp_
message_ ⚠list_ free - xmtp_
message_ ⚠list_ len - xmtp_
message_ ⚠sender_ inbox_ id - Get sender inbox ID at index. Caller must free with
xmtp_free_string. - xmtp_
message_ ⚠sent_ at_ ns - Get sent-at timestamp (ns) at index.
- xmtp_
signature_ ⚠request_ add_ ecdsa - Add an ECDSA signature to the request.
- xmtp_
signature_ ⚠request_ add_ passkey - Add a passkey signature to the request. All four byte arrays are required and must not be null.
- xmtp_
signature_ ⚠request_ add_ scw - Add a smart contract wallet (SCW) signature to the request.
account_addressis the EVM account address (hex string).chain_idis the EVM chain ID (e.g. 1 for mainnet).block_numberis optional; pass 0 to omit. - xmtp_
signature_ ⚠request_ free - xmtp_
signature_ ⚠request_ text - Get the human-readable signature text. Caller must free with
xmtp_free_string. - xmtp_
single_ ⚠message_ content_ bytes - Get raw content bytes from a single message handle. The returned pointer is borrowed — valid only while the message handle is alive.
- xmtp_
single_ ⚠message_ group_ id - Get the group ID (hex) from a single message handle.
Caller must free with
xmtp_free_string. - xmtp_
single_ ⚠message_ id - Get the message ID (hex) from a single message handle.
Caller must free with
xmtp_free_string. - xmtp_
single_ ⚠message_ sender_ inbox_ id - Get the sender inbox ID from a single message handle.
Caller must free with
xmtp_free_string. - xmtp_
single_ ⚠message_ sent_ at_ ns - Get the sent-at timestamp (ns) from a single message handle.
- xmtp_
stream_ ⚠all_ messages - Stream all messages across conversations. Callback receives owned
*mut FfiMessage.consent_states/consent_states_count: optional filter (null/0 = all). - xmtp_
stream_ ⚠consent - Stream consent state changes. Callback receives a borrowed array of consent records
(
*const FfiConsentRecord) — valid only during the callback invocation. - xmtp_
stream_ ⚠conversations - Stream new conversations. Callback receives owned
*mut FfiConversation(caller must free).on_close(error, ctx): null error = normal close; non-null = borrowed error string. Caller must end withxmtp_stream_endand free withxmtp_stream_free. - xmtp_
stream_ ⚠end - Signal a stream to stop. Does NOT free the handle — call
xmtp_stream_freeafterwards. Safe to call multiple times. - xmtp_
stream_ ⚠free - Free a stream handle. Must be called after
xmtp_stream_end. Calling this on an active (non-ended) stream will also end it. - xmtp_
stream_ ⚠is_ closed - Check if a stream has finished. Returns 1 if closed, 0 if active.
- xmtp_
stream_ ⚠message_ deletions - Stream message deletion events. Callback receives a borrowed hex message ID
(
*const c_char) — valid only during the callback invocation. Now includeson_closefor API consistency with other stream functions. - xmtp_
stream_ ⚠preferences - Stream preference updates (consent changes + HMAC key rotations).
Callback receives a borrowed array (
*const FfiPreferenceUpdate) — valid only during callback. - xmtp_
verify_ ⚠signed_ with_ public_ key - Verify a signature produced by
sign_with_installation_keyusing an arbitrary public key. Does not require a client handle.signature_bytesmust be exactly 64 bytes,public_keymust be exactly 32 bytes.
Type Aliases§
- Xmtp
FnConsent Callback - Callback for consent stream events.
recordsis borrowed — valid only during the callback invocation. - Xmtp
FnConversation Callback - Callback for conversation stream events.
- Xmtp
FnMessage Callback - Callback for message stream events.
- Xmtp
FnMessage Deletion Callback - Callback for message deletion stream events.
message_idis a borrowed hex string — valid only during the callback. - Xmtp
FnPreference Callback - Callback for preference stream events.
updatesis borrowed — valid only during the callback invocation.