/** * ConversationCustomMetadata — protobuf schema matching convos-ios * Stored in XMTP group's appData field (max 8KB). * * Encoding: protobuf → optional DEFLATE compress → base64url */ export interface EncryptedImageRef { url: string; salt: Uint8Array; nonce: Uint8Array; } export interface ConversationProfile { inboxId: string; name?: string; image?: string; encryptedImage?: EncryptedImageRef; } export interface AgentDmInfo { originConversationId?: string; } export interface ConversationCustomMetadata { tag: string; profiles: ConversationProfile[]; expiresAtUnix?: number; imageEncryptionKey?: Uint8Array; encryptedGroupImage?: EncryptedImageRef; emoji?: string; agentDm?: AgentDmInfo; participationMode?: number; spaceUrl?: string; } /** * Parse appData string into ConversationCustomMetadata. * Returns empty metadata if appData is empty or invalid. */ export declare function parseAppData(appData: string): ConversationCustomMetadata; /** * Parse appData for read-modify-write operations that must preserve the invite * tag. Empty appData is allowed, but invalid/non-empty appData throws so callers * don't accidentally write back metadata with an empty tag. */ export declare function parseAppDataForWrite(appData: string): ConversationCustomMetadata; /** * Serialize ConversationCustomMetadata to an appData string. * Throws if result exceeds 8KB. */ export declare function serializeAppData(metadata: ConversationCustomMetadata): string; /** * Upsert a profile in the metadata. If a profile with the same inboxId exists, * it is updated. Otherwise, a new profile is added. */ export declare function upsertProfile(metadata: ConversationCustomMetadata, profile: ConversationProfile): ConversationCustomMetadata; /** * Remove a profile from the metadata by inbox ID. */ export declare function removeProfile(metadata: ConversationCustomMetadata, inboxId: string): ConversationCustomMetadata; /** * Get a profile by inbox ID. */ export declare function getProfile(metadata: ConversationCustomMetadata, inboxId: string): ConversationProfile | undefined;