From 02abf3417b4584d7e21b48f5e3bcd819831122e9 Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Mon, 18 Mar 2024 21:30:38 +0900 Subject: [PATCH] update `protos` (#535) * update `protos` * c * f --- .changeset/friendly-taxis-learn.md | 5 + packages/status-js/src/client/chat.ts | 2 +- .../status-js/src/protos/chat-identity.proto | 7 +- .../status-js/src/protos/chat-identity_pb.ts | 19 +- .../status-js/src/protos/chat-message.proto | 167 +- .../status-js/src/protos/chat-message_pb.ts | 1400 +++++++++++++++- .../status-js/src/protos/communities.proto | 139 +- .../status-js/src/protos/communities_pb.ts | 1166 ++++++++++++- packages/status-js/src/protos/contact.proto | 28 + packages/status-js/src/protos/contact_pb.ts | 325 ++++ .../status-js/src/protos/emoji-reaction.proto | 2 +- .../status-js/src/protos/emoji-reaction_pb.ts | 3 +- packages/status-js/src/protos/enums.proto | 11 +- packages/status-js/src/protos/enums_pb.ts | 46 +- .../protos/membership-update-message.proto | 6 + .../protos/membership-update-message_pb.ts | 28 + .../src/protos/profile-showcase.proto | 130 ++ .../src/protos/profile-showcase_pb.ts | 1483 +++++++++++++++++ .../src/protos/protocol-message.proto | 21 +- .../src/protos/protocol-message_pb.ts | 115 +- .../src/protos/push-notifications.proto | 2 +- .../src/protos/push-notifications_pb.ts | 12 + packages/status-js/src/protos/shard.proto | 24 + packages/status-js/src/protos/shard_pb.ts | 214 +++ .../status-js/src/utils/validate-message.ts | 4 +- 25 files changed, 5242 insertions(+), 117 deletions(-) create mode 100644 .changeset/friendly-taxis-learn.md create mode 100644 packages/status-js/src/protos/contact.proto create mode 100644 packages/status-js/src/protos/contact_pb.ts create mode 100644 packages/status-js/src/protos/profile-showcase.proto create mode 100644 packages/status-js/src/protos/profile-showcase_pb.ts create mode 100644 packages/status-js/src/protos/shard.proto create mode 100644 packages/status-js/src/protos/shard_pb.ts diff --git a/.changeset/friendly-taxis-learn.md b/.changeset/friendly-taxis-learn.md new file mode 100644 index 00000000..dd904734 --- /dev/null +++ b/.changeset/friendly-taxis-learn.md @@ -0,0 +1,5 @@ +--- +'@status-im/js': minor +--- + +update `protos` diff --git a/packages/status-js/src/client/chat.ts b/packages/status-js/src/client/chat.ts index fd8dbcbb..ac073aa2 100644 --- a/packages/status-js/src/client/chat.ts +++ b/packages/status-js/src/client/chat.ts @@ -506,7 +506,7 @@ export class Chat { payload: { case: 'image', value: { - type: image.type, + format: image.format, payload: image.payload, }, }, diff --git a/packages/status-js/src/protos/chat-identity.proto b/packages/status-js/src/protos/chat-identity.proto index 91135c38..a66bb2a7 100644 --- a/packages/status-js/src/protos/chat-identity.proto +++ b/packages/status-js/src/protos/chat-identity.proto @@ -1,6 +1,7 @@ syntax = "proto3"; import "enums.proto"; +import "profile-showcase.proto"; // ChatIdentity represents the user defined identity associated with their public chat key message ChatIdentity { @@ -29,6 +30,8 @@ message ChatIdentity { // 0 - unknown // 1 - no messages uint32 first_message_timestamp = 9; + + ProfileShowcase profile_showcase = 10; } // ProfileImage represents data associated with a user's profile image @@ -41,8 +44,8 @@ message IdentityImage { // source_type signals the image payload source SourceType source_type = 2; - // image_type signals the image type and method of parsing the payload - ImageType image_type = 3; + // image_format signals the image format and method of parsing the payload + ImageFormat image_format = 3; // encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload repeated bytes encryption_keys = 4; diff --git a/packages/status-js/src/protos/chat-identity_pb.ts b/packages/status-js/src/protos/chat-identity_pb.ts index 26455585..d63655ef 100644 --- a/packages/status-js/src/protos/chat-identity_pb.ts +++ b/packages/status-js/src/protos/chat-identity_pb.ts @@ -12,7 +12,8 @@ import type { PlainMessage, } from '@bufbuild/protobuf' import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' -import { ImageType } from './enums_pb.js' +import { ProfileShowcase } from './profile-showcase_pb.js' +import { ImageFormat } from './enums_pb.js' /** * ChatIdentity represents the user defined identity associated with their public chat key @@ -79,6 +80,11 @@ export class ChatIdentity extends Message { */ firstMessageTimestamp = 0 + /** + * @generated from field: ProfileShowcase profile_showcase = 10; + */ + profileShowcase?: ProfileShowcase + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -123,6 +129,7 @@ export class ChatIdentity extends Message { kind: 'scalar', T: 13 /* ScalarType.UINT32 */, }, + { no: 10, name: 'profile_showcase', kind: 'message', T: ProfileShowcase }, ]) static fromBinary( @@ -176,11 +183,11 @@ export class IdentityImage extends Message { sourceType = IdentityImage_SourceType.UNKNOWN_SOURCE_TYPE /** - * image_type signals the image type and method of parsing the payload + * image_format signals the image format and method of parsing the payload * - * @generated from field: ImageType image_type = 3; + * @generated from field: ImageFormat image_format = 3; */ - imageType = ImageType.UNKNOWN_IMAGE_TYPE + imageFormat = ImageFormat.UNKNOWN_IMAGE_FORMAT /** * encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload @@ -213,9 +220,9 @@ export class IdentityImage extends Message { }, { no: 3, - name: 'image_type', + name: 'image_format', kind: 'enum', - T: proto3.getEnumType(ImageType), + T: proto3.getEnumType(ImageFormat), }, { no: 4, diff --git a/packages/status-js/src/protos/chat-message.proto b/packages/status-js/src/protos/chat-message.proto index 9c130eef..5531d9b2 100644 --- a/packages/status-js/src/protos/chat-message.proto +++ b/packages/status-js/src/protos/chat-message.proto @@ -1,6 +1,8 @@ syntax = "proto3"; import "enums.proto"; +import "contact.proto"; +import "shard.proto"; message StickerMessage { string hash = 1; @@ -9,7 +11,11 @@ message StickerMessage { message ImageMessage { bytes payload = 1; - ImageType type = 2; + ImageFormat format = 2; + string album_id = 3; + uint32 width = 4; + uint32 height = 5; + uint32 album_images_count = 6; } message AudioMessage { @@ -32,10 +38,14 @@ message EditMessage { string message_id = 4; // Grant for community edit messages - bytes grant = 5; + bytes grant = 5 [deprecated = true]; // The type of message (public/one-to-one/private-group-chat) MessageType message_type = 6; + + ChatMessage.ContentType content_type = 7; + repeated UnfurledLink unfurled_links = 8; + UnfurledStatusLinks unfurled_status_links = 9; } message DeleteMessage { @@ -45,18 +55,138 @@ message DeleteMessage { string message_id = 3; // Grant for community delete messages - bytes grant = 4; + bytes grant = 4 [deprecated = true]; // The type of message (public/one-to-one/private-group-chat) MessageType message_type = 5; + + string deleted_by = 6; } +message SyncDeleteForMeMessage { + uint64 clock = 1; + string message_id = 2; +} + +message DiscordMessage { + string id = 1; + string type = 2; + string timestamp = 3; + string timestampEdited = 4; + string content = 5; + DiscordMessageAuthor author = 6; + DiscordMessageReference reference = 7; + repeated DiscordMessageAttachment attachments = 8; +} + +message DiscordMessageAuthor { + string id = 1; + string name = 2; + string discriminator = 3; + string nickname = 4; + string avatarUrl = 5; + bytes avatarImagePayload = 6; + string localUrl = 7; +} + +message DiscordMessageReference { + string messageId = 1; + string channelId = 2; + string guildId = 3; +} + +message DiscordMessageAttachment { + string id = 1; + string messageId = 2; + string url = 3; + string fileName = 4; + uint64 fileSizeBytes = 5; + string contentType = 6; + bytes payload = 7; + string localUrl = 8; +} + +message BridgeMessage { + string bridgeName = 1; + string userName = 2; + string userAvatar = 3; + string userID = 4; + string content = 5; + string messageID = 6; + string parentMessageID = 7; +} + +message UnfurledLinkThumbnail { + bytes payload = 1; + uint32 width = 2; + uint32 height = 3; +} + +message UnfurledLink { + // A valid URL which uniquely identifies this link. + string url = 1; + // Website's title. + string title = 2; + // Description is sometimes available, but can be empty. Most mainstream + // websites provide this information. + string description = 3; + bytes thumbnail_payload = 4; + uint32 thumbnail_width = 5; + uint32 thumbnail_height = 6; + LinkType type = 7; + bytes favicon_payload = 8; + + enum LinkType { + LINK = 0; + IMAGE = 1; + } +} + +message UnfurledStatusContactLink { + bytes public_key = 1; + string display_name = 2; + string description = 3; + UnfurledLinkThumbnail icon = 4; +} + +message UnfurledStatusCommunityLink { + bytes community_id = 1; + string display_name = 2; + string description = 3; + uint32 members_count = 4; + string color = 5; + UnfurledLinkThumbnail icon = 7; + UnfurledLinkThumbnail banner = 8; +} + +message UnfurledStatusChannelLink { + string channel_uuid = 1; + string emoji = 2; + string display_name = 3; + string description = 4; + string color = 5; + UnfurledStatusCommunityLink community = 6; +} + +message UnfurledStatusLink { + string url = 1; + oneof payload { + UnfurledStatusContactLink contact = 2; + UnfurledStatusCommunityLink community = 3; + UnfurledStatusChannelLink channel = 4; + } +} + +// Create a wrapper around repeated property for proper unmarshalling +message UnfurledStatusLinks { + repeated UnfurledStatusLink unfurled_status_links = 1; +} message ChatMessage { // Lamport timestamp of the chat message uint64 clock = 1; - // Unix timestamps in milliseconds, currently not used as we use whisper as more reliable, but here - // so that we don't rely on it + // Unix timestamps in milliseconds, currently not used as we use whisper as + // more reliable, but here so that we don't rely on it uint64 timestamp = 2; // Text of the message string text = 3; @@ -67,7 +197,8 @@ message ChatMessage { // Chat id, this field is symmetric for public-chats and private group chats, // but asymmetric in case of one-to-ones, as the sender will use the chat-id // of the received, while the receiver will use the chat-id of the sender. - // Probably should be the concatenation of sender-pk & receiver-pk in alphabetical order + // Probably should be the concatenation of sender-pk & receiver-pk in + // alphabetical order string chat_id = 6; // The type of message (public/one-to-one/private-group-chat) @@ -80,14 +211,24 @@ message ChatMessage { ImageMessage image = 10; AudioMessage audio = 11; bytes community = 12; + DiscordMessage discord_message = 99; + BridgeMessage bridge_message = 100; } // Grant for community chat messages - bytes grant = 13; + bytes grant = 13 [deprecated = true]; // Message author's display name, introduced in version 1 string display_name = 14; + ContactRequestPropagatedState contact_request_propagated_state = 15; + + repeated UnfurledLink unfurled_links = 16; + + Shard shard = 17; + + UnfurledStatusLinks unfurled_status_links = 18; + enum ContentType { UNKNOWN_CONTENT_TYPE = 0; TEXT_PLAIN = 1; @@ -102,5 +243,17 @@ message ChatMessage { COMMUNITY = 9; // Only local SYSTEM_MESSAGE_GAP = 10; + CONTACT_REQUEST = 11; + DISCORD_MESSAGE = 12; + IDENTITY_VERIFICATION = 13; + // Only local + SYSTEM_MESSAGE_PINNED_MESSAGE = 14; + // Only local + SYSTEM_MESSAGE_MUTUAL_EVENT_SENT = 15; + // Only local + SYSTEM_MESSAGE_MUTUAL_EVENT_ACCEPTED = 16; + // Only local + SYSTEM_MESSAGE_MUTUAL_EVENT_REMOVED = 17; + BRIDGE_MESSAGE = 18; } } diff --git a/packages/status-js/src/protos/chat-message_pb.ts b/packages/status-js/src/protos/chat-message_pb.ts index 6f3467e4..aca4738f 100644 --- a/packages/status-js/src/protos/chat-message_pb.ts +++ b/packages/status-js/src/protos/chat-message_pb.ts @@ -12,7 +12,9 @@ import type { PlainMessage, } from '@bufbuild/protobuf' import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' -import { ImageType, MessageType } from './enums_pb.js' +import { ImageFormat, MessageType } from './enums_pb.js' +import { ContactRequestPropagatedState } from './contact_pb.js' +import { Shard } from './shard_pb.js' /** * @generated from message StickerMessage @@ -79,9 +81,29 @@ export class ImageMessage extends Message { payload = new Uint8Array(0) /** - * @generated from field: ImageType type = 2; + * @generated from field: ImageFormat format = 2; */ - type = ImageType.UNKNOWN_IMAGE_TYPE + format = ImageFormat.UNKNOWN_IMAGE_FORMAT + + /** + * @generated from field: string album_id = 3; + */ + albumId = '' + + /** + * @generated from field: uint32 width = 4; + */ + width = 0 + + /** + * @generated from field: uint32 height = 5; + */ + height = 0 + + /** + * @generated from field: uint32 album_images_count = 6; + */ + albumImagesCount = 0 constructor(data?: PartialMessage) { super() @@ -92,7 +114,16 @@ export class ImageMessage extends Message { static readonly typeName = 'ImageMessage' static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, - { no: 2, name: 'type', kind: 'enum', T: proto3.getEnumType(ImageType) }, + { no: 2, name: 'format', kind: 'enum', T: proto3.getEnumType(ImageFormat) }, + { no: 3, name: 'album_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'width', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { no: 5, name: 'height', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { + no: 6, + name: 'album_images_count', + kind: 'scalar', + T: 13 /* ScalarType.UINT32 */, + }, ]) static fromBinary( @@ -250,7 +281,8 @@ export class EditMessage extends Message { /** * Grant for community edit messages * - * @generated from field: bytes grant = 5; + * @generated from field: bytes grant = 5 [deprecated = true]; + * @deprecated */ grant = new Uint8Array(0) @@ -261,6 +293,21 @@ export class EditMessage extends Message { */ messageType = MessageType.UNKNOWN_MESSAGE_TYPE + /** + * @generated from field: ChatMessage.ContentType content_type = 7; + */ + contentType = ChatMessage_ContentType.UNKNOWN_CONTENT_TYPE + + /** + * @generated from field: repeated UnfurledLink unfurled_links = 8; + */ + unfurledLinks: UnfurledLink[] = [] + + /** + * @generated from field: UnfurledStatusLinks unfurled_status_links = 9; + */ + unfurledStatusLinks?: UnfurledStatusLinks + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -280,6 +327,25 @@ export class EditMessage extends Message { kind: 'enum', T: proto3.getEnumType(MessageType), }, + { + no: 7, + name: 'content_type', + kind: 'enum', + T: proto3.getEnumType(ChatMessage_ContentType), + }, + { + no: 8, + name: 'unfurled_links', + kind: 'message', + T: UnfurledLink, + repeated: true, + }, + { + no: 9, + name: 'unfurled_status_links', + kind: 'message', + T: UnfurledStatusLinks, + }, ]) static fromBinary( @@ -333,7 +399,8 @@ export class DeleteMessage extends Message { /** * Grant for community delete messages * - * @generated from field: bytes grant = 4; + * @generated from field: bytes grant = 4 [deprecated = true]; + * @deprecated */ grant = new Uint8Array(0) @@ -344,6 +411,11 @@ export class DeleteMessage extends Message { */ messageType = MessageType.UNKNOWN_MESSAGE_TYPE + /** + * @generated from field: string deleted_by = 6; + */ + deletedBy = '' + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -362,6 +434,7 @@ export class DeleteMessage extends Message { kind: 'enum', T: proto3.getEnumType(MessageType), }, + { no: 6, name: 'deleted_by', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, ]) static fromBinary( @@ -393,6 +466,1187 @@ export class DeleteMessage extends Message { } } +/** + * @generated from message SyncDeleteForMeMessage + */ +export class SyncDeleteForMeMessage extends Message { + /** + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * @generated from field: string message_id = 2; + */ + messageId = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'SyncDeleteForMeMessage' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: 'message_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): SyncDeleteForMeMessage { + return new SyncDeleteForMeMessage().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): SyncDeleteForMeMessage { + return new SyncDeleteForMeMessage().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): SyncDeleteForMeMessage { + return new SyncDeleteForMeMessage().fromJsonString(jsonString, options) + } + + static equals( + a: + | SyncDeleteForMeMessage + | PlainMessage + | undefined, + b: SyncDeleteForMeMessage | PlainMessage | undefined + ): boolean { + return proto3.util.equals(SyncDeleteForMeMessage, a, b) + } +} + +/** + * @generated from message DiscordMessage + */ +export class DiscordMessage extends Message { + /** + * @generated from field: string id = 1; + */ + id = '' + + /** + * @generated from field: string type = 2; + */ + type = '' + + /** + * @generated from field: string timestamp = 3; + */ + timestamp = '' + + /** + * @generated from field: string timestampEdited = 4; + */ + timestampEdited = '' + + /** + * @generated from field: string content = 5; + */ + content = '' + + /** + * @generated from field: DiscordMessageAuthor author = 6; + */ + author?: DiscordMessageAuthor + + /** + * @generated from field: DiscordMessageReference reference = 7; + */ + reference?: DiscordMessageReference + + /** + * @generated from field: repeated DiscordMessageAttachment attachments = 8; + */ + attachments: DiscordMessageAttachment[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'DiscordMessage' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'type', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'timestamp', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: 'timestampEdited', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 5, name: 'content', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'author', kind: 'message', T: DiscordMessageAuthor }, + { no: 7, name: 'reference', kind: 'message', T: DiscordMessageReference }, + { + no: 8, + name: 'attachments', + kind: 'message', + T: DiscordMessageAttachment, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): DiscordMessage { + return new DiscordMessage().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): DiscordMessage { + return new DiscordMessage().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): DiscordMessage { + return new DiscordMessage().fromJsonString(jsonString, options) + } + + static equals( + a: DiscordMessage | PlainMessage | undefined, + b: DiscordMessage | PlainMessage | undefined + ): boolean { + return proto3.util.equals(DiscordMessage, a, b) + } +} + +/** + * @generated from message DiscordMessageAuthor + */ +export class DiscordMessageAuthor extends Message { + /** + * @generated from field: string id = 1; + */ + id = '' + + /** + * @generated from field: string name = 2; + */ + name = '' + + /** + * @generated from field: string discriminator = 3; + */ + discriminator = '' + + /** + * @generated from field: string nickname = 4; + */ + nickname = '' + + /** + * @generated from field: string avatarUrl = 5; + */ + avatarUrl = '' + + /** + * @generated from field: bytes avatarImagePayload = 6; + */ + avatarImagePayload = new Uint8Array(0) + + /** + * @generated from field: string localUrl = 7; + */ + localUrl = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'DiscordMessageAuthor' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 3, + name: 'discriminator', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 4, name: 'nickname', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'avatarUrl', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 6, + name: 'avatarImagePayload', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { no: 7, name: 'localUrl', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): DiscordMessageAuthor { + return new DiscordMessageAuthor().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): DiscordMessageAuthor { + return new DiscordMessageAuthor().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): DiscordMessageAuthor { + return new DiscordMessageAuthor().fromJsonString(jsonString, options) + } + + static equals( + a: DiscordMessageAuthor | PlainMessage | undefined, + b: DiscordMessageAuthor | PlainMessage | undefined + ): boolean { + return proto3.util.equals(DiscordMessageAuthor, a, b) + } +} + +/** + * @generated from message DiscordMessageReference + */ +export class DiscordMessageReference extends Message { + /** + * @generated from field: string messageId = 1; + */ + messageId = '' + + /** + * @generated from field: string channelId = 2; + */ + channelId = '' + + /** + * @generated from field: string guildId = 3; + */ + guildId = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'DiscordMessageReference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'messageId', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'channelId', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'guildId', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): DiscordMessageReference { + return new DiscordMessageReference().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): DiscordMessageReference { + return new DiscordMessageReference().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): DiscordMessageReference { + return new DiscordMessageReference().fromJsonString(jsonString, options) + } + + static equals( + a: + | DiscordMessageReference + | PlainMessage + | undefined, + b: + | DiscordMessageReference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(DiscordMessageReference, a, b) + } +} + +/** + * @generated from message DiscordMessageAttachment + */ +export class DiscordMessageAttachment extends Message { + /** + * @generated from field: string id = 1; + */ + id = '' + + /** + * @generated from field: string messageId = 2; + */ + messageId = '' + + /** + * @generated from field: string url = 3; + */ + url = '' + + /** + * @generated from field: string fileName = 4; + */ + fileName = '' + + /** + * @generated from field: uint64 fileSizeBytes = 5; + */ + fileSizeBytes = protoInt64.zero + + /** + * @generated from field: string contentType = 6; + */ + contentType = '' + + /** + * @generated from field: bytes payload = 7; + */ + payload = new Uint8Array(0) + + /** + * @generated from field: string localUrl = 8; + */ + localUrl = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'DiscordMessageAttachment' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'messageId', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'fileName', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 5, + name: 'fileSizeBytes', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { + no: 6, + name: 'contentType', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 7, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 8, name: 'localUrl', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): DiscordMessageAttachment { + return new DiscordMessageAttachment().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): DiscordMessageAttachment { + return new DiscordMessageAttachment().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): DiscordMessageAttachment { + return new DiscordMessageAttachment().fromJsonString(jsonString, options) + } + + static equals( + a: + | DiscordMessageAttachment + | PlainMessage + | undefined, + b: + | DiscordMessageAttachment + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(DiscordMessageAttachment, a, b) + } +} + +/** + * @generated from message BridgeMessage + */ +export class BridgeMessage extends Message { + /** + * @generated from field: string bridgeName = 1; + */ + bridgeName = '' + + /** + * @generated from field: string userName = 2; + */ + userName = '' + + /** + * @generated from field: string userAvatar = 3; + */ + userAvatar = '' + + /** + * @generated from field: string userID = 4; + */ + userID = '' + + /** + * @generated from field: string content = 5; + */ + content = '' + + /** + * @generated from field: string messageID = 6; + */ + messageID = '' + + /** + * @generated from field: string parentMessageID = 7; + */ + parentMessageID = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'BridgeMessage' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'bridgeName', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'userName', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'userAvatar', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'userID', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'content', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'messageID', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 7, + name: 'parentMessageID', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): BridgeMessage { + return new BridgeMessage().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): BridgeMessage { + return new BridgeMessage().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): BridgeMessage { + return new BridgeMessage().fromJsonString(jsonString, options) + } + + static equals( + a: BridgeMessage | PlainMessage | undefined, + b: BridgeMessage | PlainMessage | undefined + ): boolean { + return proto3.util.equals(BridgeMessage, a, b) + } +} + +/** + * @generated from message UnfurledLinkThumbnail + */ +export class UnfurledLinkThumbnail extends Message { + /** + * @generated from field: bytes payload = 1; + */ + payload = new Uint8Array(0) + + /** + * @generated from field: uint32 width = 2; + */ + width = 0 + + /** + * @generated from field: uint32 height = 3; + */ + height = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledLinkThumbnail' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 2, name: 'width', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: 'height', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledLinkThumbnail { + return new UnfurledLinkThumbnail().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledLinkThumbnail { + return new UnfurledLinkThumbnail().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledLinkThumbnail { + return new UnfurledLinkThumbnail().fromJsonString(jsonString, options) + } + + static equals( + a: UnfurledLinkThumbnail | PlainMessage | undefined, + b: UnfurledLinkThumbnail | PlainMessage | undefined + ): boolean { + return proto3.util.equals(UnfurledLinkThumbnail, a, b) + } +} + +/** + * @generated from message UnfurledLink + */ +export class UnfurledLink extends Message { + /** + * A valid URL which uniquely identifies this link. + * + * @generated from field: string url = 1; + */ + url = '' + + /** + * Website's title. + * + * @generated from field: string title = 2; + */ + title = '' + + /** + * Description is sometimes available, but can be empty. Most mainstream + * websites provide this information. + * + * @generated from field: string description = 3; + */ + description = '' + + /** + * @generated from field: bytes thumbnail_payload = 4; + */ + thumbnailPayload = new Uint8Array(0) + + /** + * @generated from field: uint32 thumbnail_width = 5; + */ + thumbnailWidth = 0 + + /** + * @generated from field: uint32 thumbnail_height = 6; + */ + thumbnailHeight = 0 + + /** + * @generated from field: UnfurledLink.LinkType type = 7; + */ + type = UnfurledLink_LinkType.LINK + + /** + * @generated from field: bytes favicon_payload = 8; + */ + faviconPayload = new Uint8Array(0) + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledLink' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'title', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 3, + name: 'description', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 4, + name: 'thumbnail_payload', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { + no: 5, + name: 'thumbnail_width', + kind: 'scalar', + T: 13 /* ScalarType.UINT32 */, + }, + { + no: 6, + name: 'thumbnail_height', + kind: 'scalar', + T: 13 /* ScalarType.UINT32 */, + }, + { + no: 7, + name: 'type', + kind: 'enum', + T: proto3.getEnumType(UnfurledLink_LinkType), + }, + { + no: 8, + name: 'favicon_payload', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledLink { + return new UnfurledLink().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledLink { + return new UnfurledLink().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledLink { + return new UnfurledLink().fromJsonString(jsonString, options) + } + + static equals( + a: UnfurledLink | PlainMessage | undefined, + b: UnfurledLink | PlainMessage | undefined + ): boolean { + return proto3.util.equals(UnfurledLink, a, b) + } +} + +/** + * @generated from enum UnfurledLink.LinkType + */ +export enum UnfurledLink_LinkType { + /** + * @generated from enum value: LINK = 0; + */ + LINK = 0, + + /** + * @generated from enum value: IMAGE = 1; + */ + IMAGE = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(UnfurledLink_LinkType) +proto3.util.setEnumType(UnfurledLink_LinkType, 'UnfurledLink.LinkType', [ + { no: 0, name: 'LINK' }, + { no: 1, name: 'IMAGE' }, +]) + +/** + * @generated from message UnfurledStatusContactLink + */ +export class UnfurledStatusContactLink extends Message { + /** + * @generated from field: bytes public_key = 1; + */ + publicKey = new Uint8Array(0) + + /** + * @generated from field: string display_name = 2; + */ + displayName = '' + + /** + * @generated from field: string description = 3; + */ + description = '' + + /** + * @generated from field: UnfurledLinkThumbnail icon = 4; + */ + icon?: UnfurledLinkThumbnail + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledStatusContactLink' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'public_key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { + no: 2, + name: 'display_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 3, + name: 'description', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 4, name: 'icon', kind: 'message', T: UnfurledLinkThumbnail }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledStatusContactLink { + return new UnfurledStatusContactLink().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledStatusContactLink { + return new UnfurledStatusContactLink().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledStatusContactLink { + return new UnfurledStatusContactLink().fromJsonString(jsonString, options) + } + + static equals( + a: + | UnfurledStatusContactLink + | PlainMessage + | undefined, + b: + | UnfurledStatusContactLink + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(UnfurledStatusContactLink, a, b) + } +} + +/** + * @generated from message UnfurledStatusCommunityLink + */ +export class UnfurledStatusCommunityLink extends Message { + /** + * @generated from field: bytes community_id = 1; + */ + communityId = new Uint8Array(0) + + /** + * @generated from field: string display_name = 2; + */ + displayName = '' + + /** + * @generated from field: string description = 3; + */ + description = '' + + /** + * @generated from field: uint32 members_count = 4; + */ + membersCount = 0 + + /** + * @generated from field: string color = 5; + */ + color = '' + + /** + * @generated from field: UnfurledLinkThumbnail icon = 7; + */ + icon?: UnfurledLinkThumbnail + + /** + * @generated from field: UnfurledLinkThumbnail banner = 8; + */ + banner?: UnfurledLinkThumbnail + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledStatusCommunityLink' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { + no: 2, + name: 'display_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 3, + name: 'description', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 4, + name: 'members_count', + kind: 'scalar', + T: 13 /* ScalarType.UINT32 */, + }, + { no: 5, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 7, name: 'icon', kind: 'message', T: UnfurledLinkThumbnail }, + { no: 8, name: 'banner', kind: 'message', T: UnfurledLinkThumbnail }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledStatusCommunityLink { + return new UnfurledStatusCommunityLink().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledStatusCommunityLink { + return new UnfurledStatusCommunityLink().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledStatusCommunityLink { + return new UnfurledStatusCommunityLink().fromJsonString(jsonString, options) + } + + static equals( + a: + | UnfurledStatusCommunityLink + | PlainMessage + | undefined, + b: + | UnfurledStatusCommunityLink + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(UnfurledStatusCommunityLink, a, b) + } +} + +/** + * @generated from message UnfurledStatusChannelLink + */ +export class UnfurledStatusChannelLink extends Message { + /** + * @generated from field: string channel_uuid = 1; + */ + channelUuid = '' + + /** + * @generated from field: string emoji = 2; + */ + emoji = '' + + /** + * @generated from field: string display_name = 3; + */ + displayName = '' + + /** + * @generated from field: string description = 4; + */ + description = '' + + /** + * @generated from field: string color = 5; + */ + color = '' + + /** + * @generated from field: UnfurledStatusCommunityLink community = 6; + */ + community?: UnfurledStatusCommunityLink + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledStatusChannelLink' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'channel_uuid', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 2, name: 'emoji', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 3, + name: 'display_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 4, + name: 'description', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 5, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 6, + name: 'community', + kind: 'message', + T: UnfurledStatusCommunityLink, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledStatusChannelLink { + return new UnfurledStatusChannelLink().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledStatusChannelLink { + return new UnfurledStatusChannelLink().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledStatusChannelLink { + return new UnfurledStatusChannelLink().fromJsonString(jsonString, options) + } + + static equals( + a: + | UnfurledStatusChannelLink + | PlainMessage + | undefined, + b: + | UnfurledStatusChannelLink + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(UnfurledStatusChannelLink, a, b) + } +} + +/** + * @generated from message UnfurledStatusLink + */ +export class UnfurledStatusLink extends Message { + /** + * @generated from field: string url = 1; + */ + url = '' + + /** + * @generated from oneof UnfurledStatusLink.payload + */ + payload: + | { + /** + * @generated from field: UnfurledStatusContactLink contact = 2; + */ + value: UnfurledStatusContactLink + case: 'contact' + } + | { + /** + * @generated from field: UnfurledStatusCommunityLink community = 3; + */ + value: UnfurledStatusCommunityLink + case: 'community' + } + | { + /** + * @generated from field: UnfurledStatusChannelLink channel = 4; + */ + value: UnfurledStatusChannelLink + case: 'channel' + } + | { case: undefined; value?: undefined } = { case: undefined } + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledStatusLink' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'contact', + kind: 'message', + T: UnfurledStatusContactLink, + oneof: 'payload', + }, + { + no: 3, + name: 'community', + kind: 'message', + T: UnfurledStatusCommunityLink, + oneof: 'payload', + }, + { + no: 4, + name: 'channel', + kind: 'message', + T: UnfurledStatusChannelLink, + oneof: 'payload', + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledStatusLink { + return new UnfurledStatusLink().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledStatusLink { + return new UnfurledStatusLink().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledStatusLink { + return new UnfurledStatusLink().fromJsonString(jsonString, options) + } + + static equals( + a: UnfurledStatusLink | PlainMessage | undefined, + b: UnfurledStatusLink | PlainMessage | undefined + ): boolean { + return proto3.util.equals(UnfurledStatusLink, a, b) + } +} + +/** + * Create a wrapper around repeated property for proper unmarshalling + * + * @generated from message UnfurledStatusLinks + */ +export class UnfurledStatusLinks extends Message { + /** + * @generated from field: repeated UnfurledStatusLink unfurled_status_links = 1; + */ + unfurledStatusLinks: UnfurledStatusLink[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'UnfurledStatusLinks' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'unfurled_status_links', + kind: 'message', + T: UnfurledStatusLink, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): UnfurledStatusLinks { + return new UnfurledStatusLinks().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): UnfurledStatusLinks { + return new UnfurledStatusLinks().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): UnfurledStatusLinks { + return new UnfurledStatusLinks().fromJsonString(jsonString, options) + } + + static equals( + a: UnfurledStatusLinks | PlainMessage | undefined, + b: UnfurledStatusLinks | PlainMessage | undefined + ): boolean { + return proto3.util.equals(UnfurledStatusLinks, a, b) + } +} + /** * @generated from message ChatMessage */ @@ -405,8 +1659,8 @@ export class ChatMessage extends Message { clock = protoInt64.zero /** - * Unix timestamps in milliseconds, currently not used as we use whisper as more reliable, but here - * so that we don't rely on it + * Unix timestamps in milliseconds, currently not used as we use whisper as + * more reliable, but here so that we don't rely on it * * @generated from field: uint64 timestamp = 2; */ @@ -437,7 +1691,8 @@ export class ChatMessage extends Message { * Chat id, this field is symmetric for public-chats and private group chats, * but asymmetric in case of one-to-ones, as the sender will use the chat-id * of the received, while the receiver will use the chat-id of the sender. - * Probably should be the concatenation of sender-pk & receiver-pk in alphabetical order + * Probably should be the concatenation of sender-pk & receiver-pk in + * alphabetical order * * @generated from field: string chat_id = 6; */ @@ -489,12 +1744,27 @@ export class ChatMessage extends Message { value: Uint8Array case: 'community' } + | { + /** + * @generated from field: DiscordMessage discord_message = 99; + */ + value: DiscordMessage + case: 'discordMessage' + } + | { + /** + * @generated from field: BridgeMessage bridge_message = 100; + */ + value: BridgeMessage + case: 'bridgeMessage' + } | { case: undefined; value?: undefined } = { case: undefined } /** * Grant for community chat messages * - * @generated from field: bytes grant = 13; + * @generated from field: bytes grant = 13 [deprecated = true]; + * @deprecated */ grant = new Uint8Array(0) @@ -505,6 +1775,26 @@ export class ChatMessage extends Message { */ displayName = '' + /** + * @generated from field: ContactRequestPropagatedState contact_request_propagated_state = 15; + */ + contactRequestPropagatedState?: ContactRequestPropagatedState + + /** + * @generated from field: repeated UnfurledLink unfurled_links = 16; + */ + unfurledLinks: UnfurledLink[] = [] + + /** + * @generated from field: Shard shard = 17; + */ + shard?: Shard + + /** + * @generated from field: UnfurledStatusLinks unfurled_status_links = 18; + */ + unfurledStatusLinks?: UnfurledStatusLinks + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -564,6 +1854,20 @@ export class ChatMessage extends Message { T: 12 /* ScalarType.BYTES */, oneof: 'payload', }, + { + no: 99, + name: 'discord_message', + kind: 'message', + T: DiscordMessage, + oneof: 'payload', + }, + { + no: 100, + name: 'bridge_message', + kind: 'message', + T: BridgeMessage, + oneof: 'payload', + }, { no: 13, name: 'grant', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, { no: 14, @@ -571,6 +1875,26 @@ export class ChatMessage extends Message { kind: 'scalar', T: 9 /* ScalarType.STRING */, }, + { + no: 15, + name: 'contact_request_propagated_state', + kind: 'message', + T: ContactRequestPropagatedState, + }, + { + no: 16, + name: 'unfurled_links', + kind: 'message', + T: UnfurledLink, + repeated: true, + }, + { no: 17, name: 'shard', kind: 'message', T: Shard }, + { + no: 18, + name: 'unfurled_status_links', + kind: 'message', + T: UnfurledStatusLinks, + }, ]) static fromBinary( @@ -664,6 +1988,54 @@ export enum ChatMessage_ContentType { * @generated from enum value: SYSTEM_MESSAGE_GAP = 10; */ SYSTEM_MESSAGE_GAP = 10, + + /** + * @generated from enum value: CONTACT_REQUEST = 11; + */ + CONTACT_REQUEST = 11, + + /** + * @generated from enum value: DISCORD_MESSAGE = 12; + */ + DISCORD_MESSAGE = 12, + + /** + * @generated from enum value: IDENTITY_VERIFICATION = 13; + */ + IDENTITY_VERIFICATION = 13, + + /** + * Only local + * + * @generated from enum value: SYSTEM_MESSAGE_PINNED_MESSAGE = 14; + */ + SYSTEM_MESSAGE_PINNED_MESSAGE = 14, + + /** + * Only local + * + * @generated from enum value: SYSTEM_MESSAGE_MUTUAL_EVENT_SENT = 15; + */ + SYSTEM_MESSAGE_MUTUAL_EVENT_SENT = 15, + + /** + * Only local + * + * @generated from enum value: SYSTEM_MESSAGE_MUTUAL_EVENT_ACCEPTED = 16; + */ + SYSTEM_MESSAGE_MUTUAL_EVENT_ACCEPTED = 16, + + /** + * Only local + * + * @generated from enum value: SYSTEM_MESSAGE_MUTUAL_EVENT_REMOVED = 17; + */ + SYSTEM_MESSAGE_MUTUAL_EVENT_REMOVED = 17, + + /** + * @generated from enum value: BRIDGE_MESSAGE = 18; + */ + BRIDGE_MESSAGE = 18, } // Retrieve enum metadata with: proto3.getEnumType(ChatMessage_ContentType) proto3.util.setEnumType(ChatMessage_ContentType, 'ChatMessage.ContentType', [ @@ -678,4 +2050,12 @@ proto3.util.setEnumType(ChatMessage_ContentType, 'ChatMessage.ContentType', [ { no: 8, name: 'AUDIO' }, { no: 9, name: 'COMMUNITY' }, { no: 10, name: 'SYSTEM_MESSAGE_GAP' }, + { no: 11, name: 'CONTACT_REQUEST' }, + { no: 12, name: 'DISCORD_MESSAGE' }, + { no: 13, name: 'IDENTITY_VERIFICATION' }, + { no: 14, name: 'SYSTEM_MESSAGE_PINNED_MESSAGE' }, + { no: 15, name: 'SYSTEM_MESSAGE_MUTUAL_EVENT_SENT' }, + { no: 16, name: 'SYSTEM_MESSAGE_MUTUAL_EVENT_ACCEPTED' }, + { no: 17, name: 'SYSTEM_MESSAGE_MUTUAL_EVENT_REMOVED' }, + { no: 18, name: 'BRIDGE_MESSAGE' }, ]) diff --git a/packages/status-js/src/protos/communities.proto b/packages/status-js/src/protos/communities.proto index 0f7ecebe..bd320cd4 100644 --- a/packages/status-js/src/protos/communities.proto +++ b/packages/status-js/src/protos/communities.proto @@ -1,7 +1,8 @@ syntax = "proto3"; import "chat-identity.proto"; -import "url.proto"; +import "enums.proto"; +import "shard.proto"; message Grant { bytes community_id = 1; @@ -12,20 +13,41 @@ message Grant { message CommunityMember { enum Roles { - UNKNOWN_ROLE = 0; - ROLE_ALL = 1; - ROLE_MANAGE_USERS = 2; - ROLE_MODERATE_CONTENT = 3; + reserved 2, 3; + reserved "ROLE_MANAGE_USERS", "ROLE_MODERATE_CONTENT"; + ROLE_NONE = 0; + ROLE_OWNER = 1; + ROLE_ADMIN = 4; + ROLE_TOKEN_MASTER = 5; + } + enum ChannelRole { + // We make POSTER the first role to be the default one. + // This is for backwards compatibility. Older protobufs won't have this field and will default to 0. + CHANNEL_ROLE_POSTER = 0; + CHANNEL_ROLE_VIEWER = 1; } repeated Roles roles = 1; + repeated RevealedAccount revealed_accounts = 2 [deprecated = true]; + uint64 last_update_clock = 3; + ChannelRole channel_role = 4; +} + +message CommunityTokenMetadata { + map contract_addresses = 1; + string description = 2; + string image = 3; + CommunityTokenType tokenType = 4; + string symbol = 5; + string name = 6; + uint32 decimals = 7; } message CommunityPermissions { enum Access { UNKNOWN_ACCESS = 0; - NO_MEMBERSHIP = 1; - INVITATION_ONLY = 2; - ON_REQUEST = 3; + AUTO_ACCEPT = 1; + INVITATION_ONLY = 2 [deprecated = true]; + MANUAL_ACCEPT = 3; } bool ens_only = 1; @@ -34,20 +56,63 @@ message CommunityPermissions { Access access = 3; } +message TokenCriteria { + map contract_addresses = 1; + CommunityTokenType type = 2; + string symbol = 3; + string name = 4; + string amount = 5 [deprecated = true]; + repeated uint64 token_ids = 6; + string ens_pattern = 7; + uint64 decimals = 8; + string amountInWei = 9; +} + +message CommunityTokenPermission { + + enum Type { + UNKNOWN_TOKEN_PERMISSION = 0; + BECOME_ADMIN = 1; + BECOME_MEMBER = 2; + CAN_VIEW_CHANNEL = 3; + CAN_VIEW_AND_POST_CHANNEL = 4; + BECOME_TOKEN_MASTER = 5; + BECOME_TOKEN_OWNER = 6; + } + + string id = 1; + Type type = 2; + repeated TokenCriteria token_criteria = 3; + repeated string chat_ids = 4; + bool is_private = 5; +} + message CommunityDescription { uint64 clock = 1; map members = 2; CommunityPermissions permissions = 3; ChatIdentity identity = 5; map chats = 6; - repeated string ban_list = 7; + repeated string ban_list = 7 [deprecated = true]; map categories = 8; uint64 archive_magnetlink_clock = 9; CommunityAdminSettings admin_settings = 10; string intro_message = 11; string outro_message = 12; - bool encrypted = 13; + bool encrypted = 13 [deprecated=true]; repeated string tags = 14; + map token_permissions = 15; + repeated CommunityTokenMetadata community_tokens_metadata = 16; + uint64 active_members_count = 17; + string ID = 18; + mapbanned_members = 19; + + // key is hash ratchet key_id + seq_no + map privateData = 100; +} + +message CommunityBanInfo { + bool delete_all_messages = 1; } message CommunityAdminSettings { @@ -60,6 +125,7 @@ message CommunityChat { ChatIdentity identity = 3; string category_id = 4; int32 position = 5; + bool viewers_can_post_reactions = 6; } message CommunityCategory { @@ -68,11 +134,11 @@ message CommunityCategory { int32 position = 3; } -message CommunityInvitation { - bytes community_description = 1; - bytes grant = 2; - string chat_id = 3; - bytes public_key = 4; +message RevealedAccount { + string address = 1; + bytes signature = 2; + repeated uint64 chain_ids = 3; + bool isAirdropAddress = 4; } message CommunityRequestToJoin { @@ -81,6 +147,13 @@ message CommunityRequestToJoin { string chat_id = 3; bytes community_id = 4; string display_name = 5; + repeated RevealedAccount revealed_accounts = 6; +} + +message CommunityEditSharedAddresses { + uint64 clock = 1; + bytes community_id = 2; + repeated RevealedAccount revealed_accounts = 3; } message CommunityCancelRequestToJoin { @@ -91,6 +164,11 @@ message CommunityCancelRequestToJoin { string display_name = 5; } +message CommunityUserKicked { + uint64 clock = 1; + bytes community_id = 2; +} + message CommunityRequestToJoinResponse { uint64 clock = 1; CommunityDescription community = 2; @@ -98,6 +176,8 @@ message CommunityRequestToJoinResponse { bytes grant = 4; bytes community_id = 5; string magnet_uri = 6; + bytes protected_topic_private_key = 7; + Shard shard = 8; } message CommunityRequestToLeave { @@ -144,3 +224,32 @@ message WakuMessageArchiveIndexMetadata { message WakuMessageArchiveIndex { map archives = 1; } + +message CommunityPublicStorenodesInfo { + // Signature of the payload field + bytes signature = 1; + // Marshaled CommunityStorenodes + bytes payload = 2; +} + +message CommunityStorenodes { + uint64 clock = 1; + bytes community_id = 2; + repeated Storenode storenodes = 3; + uint64 chain_id = 4; +} + +message Storenode { + bytes community_id = 1; + string storenode_id = 2; + string name = 3; + string address = 4; + string fleet = 5; + uint32 version = 6; + bool removed = 7; + int64 deleted_at = 8; +} + +message CommunityReevaluatePermissionsRequest { + bytes community_id = 1; +} diff --git a/packages/status-js/src/protos/communities_pb.ts b/packages/status-js/src/protos/communities_pb.ts index d3a791a0..91b1d21a 100644 --- a/packages/status-js/src/protos/communities_pb.ts +++ b/packages/status-js/src/protos/communities_pb.ts @@ -12,7 +12,9 @@ import type { PlainMessage, } from '@bufbuild/protobuf' import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' +import { CommunityTokenType } from './enums_pb.js' import { ChatIdentity } from './chat-identity_pb.js' +import { Shard } from './shard_pb.js' /** * @generated from message Grant @@ -95,6 +97,22 @@ export class CommunityMember extends Message { */ roles: CommunityMember_Roles[] = [] + /** + * @generated from field: repeated RevealedAccount revealed_accounts = 2 [deprecated = true]; + * @deprecated + */ + revealedAccounts: RevealedAccount[] = [] + + /** + * @generated from field: uint64 last_update_clock = 3; + */ + lastUpdateClock = protoInt64.zero + + /** + * @generated from field: CommunityMember.ChannelRole channel_role = 4; + */ + channelRole = CommunityMember_ChannelRole.POSTER + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -110,6 +128,25 @@ export class CommunityMember extends Message { T: proto3.getEnumType(CommunityMember_Roles), repeated: true, }, + { + no: 2, + name: 'revealed_accounts', + kind: 'message', + T: RevealedAccount, + repeated: true, + }, + { + no: 3, + name: 'last_update_clock', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { + no: 4, + name: 'channel_role', + kind: 'enum', + T: proto3.getEnumType(CommunityMember_ChannelRole), + }, ]) static fromBinary( @@ -146,33 +183,164 @@ export class CommunityMember extends Message { */ export enum CommunityMember_Roles { /** - * @generated from enum value: UNKNOWN_ROLE = 0; + * @generated from enum value: ROLE_NONE = 0; */ - UNKNOWN_ROLE = 0, + ROLE_NONE = 0, /** - * @generated from enum value: ROLE_ALL = 1; + * @generated from enum value: ROLE_OWNER = 1; */ - ROLE_ALL = 1, + ROLE_OWNER = 1, /** - * @generated from enum value: ROLE_MANAGE_USERS = 2; + * @generated from enum value: ROLE_ADMIN = 4; */ - ROLE_MANAGE_USERS = 2, + ROLE_ADMIN = 4, /** - * @generated from enum value: ROLE_MODERATE_CONTENT = 3; + * @generated from enum value: ROLE_TOKEN_MASTER = 5; */ - ROLE_MODERATE_CONTENT = 3, + ROLE_TOKEN_MASTER = 5, } // Retrieve enum metadata with: proto3.getEnumType(CommunityMember_Roles) proto3.util.setEnumType(CommunityMember_Roles, 'CommunityMember.Roles', [ - { no: 0, name: 'UNKNOWN_ROLE' }, - { no: 1, name: 'ROLE_ALL' }, - { no: 2, name: 'ROLE_MANAGE_USERS' }, - { no: 3, name: 'ROLE_MODERATE_CONTENT' }, + { no: 0, name: 'ROLE_NONE' }, + { no: 1, name: 'ROLE_OWNER' }, + { no: 4, name: 'ROLE_ADMIN' }, + { no: 5, name: 'ROLE_TOKEN_MASTER' }, ]) +/** + * @generated from enum CommunityMember.ChannelRole + */ +export enum CommunityMember_ChannelRole { + /** + * We make POSTER the first role to be the default one. + * This is for backwards compatibility. Older protobufs won't have this field and will default to 0. + * + * @generated from enum value: CHANNEL_ROLE_POSTER = 0; + */ + POSTER = 0, + + /** + * @generated from enum value: CHANNEL_ROLE_VIEWER = 1; + */ + VIEWER = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(CommunityMember_ChannelRole) +proto3.util.setEnumType( + CommunityMember_ChannelRole, + 'CommunityMember.ChannelRole', + [ + { no: 0, name: 'CHANNEL_ROLE_POSTER' }, + { no: 1, name: 'CHANNEL_ROLE_VIEWER' }, + ] +) + +/** + * @generated from message CommunityTokenMetadata + */ +export class CommunityTokenMetadata extends Message { + /** + * @generated from field: map contract_addresses = 1; + */ + contractAddresses: { [key: string]: string } = {} + + /** + * @generated from field: string description = 2; + */ + description = '' + + /** + * @generated from field: string image = 3; + */ + image = '' + + /** + * @generated from field: CommunityTokenType tokenType = 4; + */ + tokenType = CommunityTokenType.UNKNOWN_TOKEN_TYPE + + /** + * @generated from field: string symbol = 5; + */ + symbol = '' + + /** + * @generated from field: string name = 6; + */ + name = '' + + /** + * @generated from field: uint32 decimals = 7; + */ + decimals = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityTokenMetadata' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'contract_addresses', + kind: 'map', + K: 4 /* ScalarType.UINT64 */, + V: { kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + }, + { + no: 2, + name: 'description', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 3, name: 'image', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: 'tokenType', + kind: 'enum', + T: proto3.getEnumType(CommunityTokenType), + }, + { no: 5, name: 'symbol', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 7, name: 'decimals', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityTokenMetadata { + return new CommunityTokenMetadata().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityTokenMetadata { + return new CommunityTokenMetadata().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityTokenMetadata { + return new CommunityTokenMetadata().fromJsonString(jsonString, options) + } + + static equals( + a: + | CommunityTokenMetadata + | PlainMessage + | undefined, + b: CommunityTokenMetadata | PlainMessage | undefined + ): boolean { + return proto3.util.equals(CommunityTokenMetadata, a, b) + } +} + /** * @generated from message CommunityPermissions */ @@ -251,19 +419,20 @@ export enum CommunityPermissions_Access { UNKNOWN_ACCESS = 0, /** - * @generated from enum value: NO_MEMBERSHIP = 1; + * @generated from enum value: AUTO_ACCEPT = 1; */ - NO_MEMBERSHIP = 1, + AUTO_ACCEPT = 1, /** - * @generated from enum value: INVITATION_ONLY = 2; + * @generated from enum value: INVITATION_ONLY = 2 [deprecated = true]; + * @deprecated */ INVITATION_ONLY = 2, /** - * @generated from enum value: ON_REQUEST = 3; + * @generated from enum value: MANUAL_ACCEPT = 3; */ - ON_REQUEST = 3, + MANUAL_ACCEPT = 3, } // Retrieve enum metadata with: proto3.getEnumType(CommunityPermissions_Access) proto3.util.setEnumType( @@ -271,9 +440,284 @@ proto3.util.setEnumType( 'CommunityPermissions.Access', [ { no: 0, name: 'UNKNOWN_ACCESS' }, - { no: 1, name: 'NO_MEMBERSHIP' }, + { no: 1, name: 'AUTO_ACCEPT' }, { no: 2, name: 'INVITATION_ONLY' }, - { no: 3, name: 'ON_REQUEST' }, + { no: 3, name: 'MANUAL_ACCEPT' }, + ] +) + +/** + * @generated from message TokenCriteria + */ +export class TokenCriteria extends Message { + /** + * @generated from field: map contract_addresses = 1; + */ + contractAddresses: { [key: string]: string } = {} + + /** + * @generated from field: CommunityTokenType type = 2; + */ + type = CommunityTokenType.UNKNOWN_TOKEN_TYPE + + /** + * @generated from field: string symbol = 3; + */ + symbol = '' + + /** + * @generated from field: string name = 4; + */ + name = '' + + /** + * @generated from field: string amount = 5 [deprecated = true]; + * @deprecated + */ + amount = '' + + /** + * @generated from field: repeated uint64 token_ids = 6; + */ + tokenIds: bigint[] = [] + + /** + * @generated from field: string ens_pattern = 7; + */ + ensPattern = '' + + /** + * @generated from field: uint64 decimals = 8; + */ + decimals = protoInt64.zero + + /** + * @generated from field: string amountInWei = 9; + */ + amountInWei = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'TokenCriteria' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'contract_addresses', + kind: 'map', + K: 4 /* ScalarType.UINT64 */, + V: { kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + }, + { + no: 2, + name: 'type', + kind: 'enum', + T: proto3.getEnumType(CommunityTokenType), + }, + { no: 3, name: 'symbol', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'amount', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 6, + name: 'token_ids', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + repeated: true, + }, + { + no: 7, + name: 'ens_pattern', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 8, name: 'decimals', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 9, + name: 'amountInWei', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): TokenCriteria { + return new TokenCriteria().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): TokenCriteria { + return new TokenCriteria().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): TokenCriteria { + return new TokenCriteria().fromJsonString(jsonString, options) + } + + static equals( + a: TokenCriteria | PlainMessage | undefined, + b: TokenCriteria | PlainMessage | undefined + ): boolean { + return proto3.util.equals(TokenCriteria, a, b) + } +} + +/** + * @generated from message CommunityTokenPermission + */ +export class CommunityTokenPermission extends Message { + /** + * @generated from field: string id = 1; + */ + id = '' + + /** + * @generated from field: CommunityTokenPermission.Type type = 2; + */ + type = CommunityTokenPermission_Type.UNKNOWN_TOKEN_PERMISSION + + /** + * @generated from field: repeated TokenCriteria token_criteria = 3; + */ + tokenCriteria: TokenCriteria[] = [] + + /** + * @generated from field: repeated string chat_ids = 4; + */ + chatIds: string[] = [] + + /** + * @generated from field: bool is_private = 5; + */ + isPrivate = false + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityTokenPermission' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'type', + kind: 'enum', + T: proto3.getEnumType(CommunityTokenPermission_Type), + }, + { + no: 3, + name: 'token_criteria', + kind: 'message', + T: TokenCriteria, + repeated: true, + }, + { + no: 4, + name: 'chat_ids', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + { no: 5, name: 'is_private', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityTokenPermission { + return new CommunityTokenPermission().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityTokenPermission { + return new CommunityTokenPermission().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityTokenPermission { + return new CommunityTokenPermission().fromJsonString(jsonString, options) + } + + static equals( + a: + | CommunityTokenPermission + | PlainMessage + | undefined, + b: + | CommunityTokenPermission + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(CommunityTokenPermission, a, b) + } +} + +/** + * @generated from enum CommunityTokenPermission.Type + */ +export enum CommunityTokenPermission_Type { + /** + * @generated from enum value: UNKNOWN_TOKEN_PERMISSION = 0; + */ + UNKNOWN_TOKEN_PERMISSION = 0, + + /** + * @generated from enum value: BECOME_ADMIN = 1; + */ + BECOME_ADMIN = 1, + + /** + * @generated from enum value: BECOME_MEMBER = 2; + */ + BECOME_MEMBER = 2, + + /** + * @generated from enum value: CAN_VIEW_CHANNEL = 3; + */ + CAN_VIEW_CHANNEL = 3, + + /** + * @generated from enum value: CAN_VIEW_AND_POST_CHANNEL = 4; + */ + CAN_VIEW_AND_POST_CHANNEL = 4, + + /** + * @generated from enum value: BECOME_TOKEN_MASTER = 5; + */ + BECOME_TOKEN_MASTER = 5, + + /** + * @generated from enum value: BECOME_TOKEN_OWNER = 6; + */ + BECOME_TOKEN_OWNER = 6, +} +// Retrieve enum metadata with: proto3.getEnumType(CommunityTokenPermission_Type) +proto3.util.setEnumType( + CommunityTokenPermission_Type, + 'CommunityTokenPermission.Type', + [ + { no: 0, name: 'UNKNOWN_TOKEN_PERMISSION' }, + { no: 1, name: 'BECOME_ADMIN' }, + { no: 2, name: 'BECOME_MEMBER' }, + { no: 3, name: 'CAN_VIEW_CHANNEL' }, + { no: 4, name: 'CAN_VIEW_AND_POST_CHANNEL' }, + { no: 5, name: 'BECOME_TOKEN_MASTER' }, + { no: 6, name: 'BECOME_TOKEN_OWNER' }, ] ) @@ -307,7 +751,8 @@ export class CommunityDescription extends Message { chats: { [key: string]: CommunityChat } = {} /** - * @generated from field: repeated string ban_list = 7; + * @generated from field: repeated string ban_list = 7 [deprecated = true]; + * @deprecated */ banList: string[] = [] @@ -337,7 +782,8 @@ export class CommunityDescription extends Message { outroMessage = '' /** - * @generated from field: bool encrypted = 13; + * @generated from field: bool encrypted = 13 [deprecated = true]; + * @deprecated */ encrypted = false @@ -346,6 +792,38 @@ export class CommunityDescription extends Message { */ tags: string[] = [] + /** + * @generated from field: map token_permissions = 15; + */ + tokenPermissions: { [key: string]: CommunityTokenPermission } = {} + + /** + * @generated from field: repeated CommunityTokenMetadata community_tokens_metadata = 16; + */ + communityTokensMetadata: CommunityTokenMetadata[] = [] + + /** + * @generated from field: uint64 active_members_count = 17; + */ + activeMembersCount = protoInt64.zero + + /** + * @generated from field: string ID = 18; + */ + ID = '' + + /** + * @generated from field: map banned_members = 19; + */ + bannedMembers: { [key: string]: CommunityBanInfo } = {} + + /** + * key is hash ratchet key_id + seq_no + * + * @generated from field: map privateData = 100; + */ + privateData: { [key: string]: Uint8Array } = {} + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -417,6 +895,41 @@ export class CommunityDescription extends Message { T: 9 /* ScalarType.STRING */, repeated: true, }, + { + no: 15, + name: 'token_permissions', + kind: 'map', + K: 9 /* ScalarType.STRING */, + V: { kind: 'message', T: CommunityTokenPermission }, + }, + { + no: 16, + name: 'community_tokens_metadata', + kind: 'message', + T: CommunityTokenMetadata, + repeated: true, + }, + { + no: 17, + name: 'active_members_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { no: 18, name: 'ID', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 19, + name: 'banned_members', + kind: 'map', + K: 9 /* ScalarType.STRING */, + V: { kind: 'message', T: CommunityBanInfo }, + }, + { + no: 100, + name: 'privateData', + kind: 'map', + K: 9 /* ScalarType.STRING */, + V: { kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + }, ]) static fromBinary( @@ -448,6 +961,60 @@ export class CommunityDescription extends Message { } } +/** + * @generated from message CommunityBanInfo + */ +export class CommunityBanInfo extends Message { + /** + * @generated from field: bool delete_all_messages = 1; + */ + deleteAllMessages = false + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityBanInfo' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'delete_all_messages', + kind: 'scalar', + T: 8 /* ScalarType.BOOL */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityBanInfo { + return new CommunityBanInfo().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityBanInfo { + return new CommunityBanInfo().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityBanInfo { + return new CommunityBanInfo().fromJsonString(jsonString, options) + } + + static equals( + a: CommunityBanInfo | PlainMessage | undefined, + b: CommunityBanInfo | PlainMessage | undefined + ): boolean { + return proto3.util.equals(CommunityBanInfo, a, b) + } +} + /** * @generated from message CommunityAdminSettings */ @@ -534,6 +1101,11 @@ export class CommunityChat extends Message { */ position = 0 + /** + * @generated from field: bool viewers_can_post_reactions = 6; + */ + viewersCanPostReactions = false + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -558,6 +1130,12 @@ export class CommunityChat extends Message { T: 9 /* ScalarType.STRING */, }, { no: 5, name: 'position', kind: 'scalar', T: 5 /* ScalarType.INT32 */ }, + { + no: 6, + name: 'viewers_can_post_reactions', + kind: 'scalar', + T: 8 /* ScalarType.BOOL */, + }, ]) static fromBinary( @@ -656,74 +1234,80 @@ export class CommunityCategory extends Message { } /** - * @generated from message CommunityInvitation + * @generated from message RevealedAccount */ -export class CommunityInvitation extends Message { +export class RevealedAccount extends Message { /** - * @generated from field: bytes community_description = 1; + * @generated from field: string address = 1; */ - communityDescription = new Uint8Array(0) + address = '' /** - * @generated from field: bytes grant = 2; + * @generated from field: bytes signature = 2; */ - grant = new Uint8Array(0) + signature = new Uint8Array(0) /** - * @generated from field: string chat_id = 3; + * @generated from field: repeated uint64 chain_ids = 3; */ - chatId = '' + chainIds: bigint[] = [] /** - * @generated from field: bytes public_key = 4; + * @generated from field: bool isAirdropAddress = 4; */ - publicKey = new Uint8Array(0) + isAirdropAddress = false - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) } static readonly runtime: typeof proto3 = proto3 - static readonly typeName = 'CommunityInvitation' + static readonly typeName = 'RevealedAccount' static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, { - no: 1, - name: 'community_description', + no: 3, + name: 'chain_ids', kind: 'scalar', - T: 12 /* ScalarType.BYTES */, + T: 4 /* ScalarType.UINT64 */, + repeated: true, + }, + { + no: 4, + name: 'isAirdropAddress', + kind: 'scalar', + T: 8 /* ScalarType.BOOL */, }, - { no: 2, name: 'grant', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, - { no: 3, name: 'chat_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, - { no: 4, name: 'public_key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, ]) static fromBinary( bytes: Uint8Array, options?: Partial - ): CommunityInvitation { - return new CommunityInvitation().fromBinary(bytes, options) + ): RevealedAccount { + return new RevealedAccount().fromBinary(bytes, options) } static fromJson( jsonValue: JsonValue, options?: Partial - ): CommunityInvitation { - return new CommunityInvitation().fromJson(jsonValue, options) + ): RevealedAccount { + return new RevealedAccount().fromJson(jsonValue, options) } static fromJsonString( jsonString: string, options?: Partial - ): CommunityInvitation { - return new CommunityInvitation().fromJsonString(jsonString, options) + ): RevealedAccount { + return new RevealedAccount().fromJsonString(jsonString, options) } static equals( - a: CommunityInvitation | PlainMessage | undefined, - b: CommunityInvitation | PlainMessage | undefined + a: RevealedAccount | PlainMessage | undefined, + b: RevealedAccount | PlainMessage | undefined ): boolean { - return proto3.util.equals(CommunityInvitation, a, b) + return proto3.util.equals(RevealedAccount, a, b) } } @@ -756,6 +1340,11 @@ export class CommunityRequestToJoin extends Message { */ displayName = '' + /** + * @generated from field: repeated RevealedAccount revealed_accounts = 6; + */ + revealedAccounts: RevealedAccount[] = [] + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -779,6 +1368,13 @@ export class CommunityRequestToJoin extends Message { kind: 'scalar', T: 9 /* ScalarType.STRING */, }, + { + no: 6, + name: 'revealed_accounts', + kind: 'message', + T: RevealedAccount, + repeated: true, + }, ]) static fromBinary( @@ -813,6 +1409,87 @@ export class CommunityRequestToJoin extends Message { } } +/** + * @generated from message CommunityEditSharedAddresses + */ +export class CommunityEditSharedAddresses extends Message { + /** + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * @generated from field: bytes community_id = 2; + */ + communityId = new Uint8Array(0) + + /** + * @generated from field: repeated RevealedAccount revealed_accounts = 3; + */ + revealedAccounts: RevealedAccount[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityEditSharedAddresses' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 2, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { + no: 3, + name: 'revealed_accounts', + kind: 'message', + T: RevealedAccount, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityEditSharedAddresses { + return new CommunityEditSharedAddresses().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityEditSharedAddresses { + return new CommunityEditSharedAddresses().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityEditSharedAddresses { + return new CommunityEditSharedAddresses().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | CommunityEditSharedAddresses + | PlainMessage + | undefined, + b: + | CommunityEditSharedAddresses + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(CommunityEditSharedAddresses, a, b) + } +} + /** * @generated from message CommunityCancelRequestToJoin */ @@ -905,6 +1582,66 @@ export class CommunityCancelRequestToJoin extends Message { + /** + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * @generated from field: bytes community_id = 2; + */ + communityId = new Uint8Array(0) + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityUserKicked' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 2, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityUserKicked { + return new CommunityUserKicked().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityUserKicked { + return new CommunityUserKicked().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityUserKicked { + return new CommunityUserKicked().fromJsonString(jsonString, options) + } + + static equals( + a: CommunityUserKicked | PlainMessage | undefined, + b: CommunityUserKicked | PlainMessage | undefined + ): boolean { + return proto3.util.equals(CommunityUserKicked, a, b) + } +} + /** * @generated from message CommunityRequestToJoinResponse */ @@ -939,6 +1676,16 @@ export class CommunityRequestToJoinResponse extends Message) { super() proto3.util.initPartial(data, this) @@ -958,6 +1705,13 @@ export class CommunityRequestToJoinResponse extends Message { return proto3.util.equals(WakuMessageArchiveIndex, a, b) } } + +/** + * @generated from message CommunityPublicStorenodesInfo + */ +export class CommunityPublicStorenodesInfo extends Message { + /** + * Signature of the payload field + * + * @generated from field: bytes signature = 1; + */ + signature = new Uint8Array(0) + + /** + * Marshaled CommunityStorenodes + * + * @generated from field: bytes payload = 2; + */ + payload = new Uint8Array(0) + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityPublicStorenodesInfo' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 2, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityPublicStorenodesInfo { + return new CommunityPublicStorenodesInfo().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityPublicStorenodesInfo { + return new CommunityPublicStorenodesInfo().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityPublicStorenodesInfo { + return new CommunityPublicStorenodesInfo().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | CommunityPublicStorenodesInfo + | PlainMessage + | undefined, + b: + | CommunityPublicStorenodesInfo + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(CommunityPublicStorenodesInfo, a, b) + } +} + +/** + * @generated from message CommunityStorenodes + */ +export class CommunityStorenodes extends Message { + /** + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * @generated from field: bytes community_id = 2; + */ + communityId = new Uint8Array(0) + + /** + * @generated from field: repeated Storenode storenodes = 3; + */ + storenodes: Storenode[] = [] + + /** + * @generated from field: uint64 chain_id = 4; + */ + chainId = protoInt64.zero + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityStorenodes' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 2, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { + no: 3, + name: 'storenodes', + kind: 'message', + T: Storenode, + repeated: true, + }, + { no: 4, name: 'chain_id', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityStorenodes { + return new CommunityStorenodes().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityStorenodes { + return new CommunityStorenodes().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityStorenodes { + return new CommunityStorenodes().fromJsonString(jsonString, options) + } + + static equals( + a: CommunityStorenodes | PlainMessage | undefined, + b: CommunityStorenodes | PlainMessage | undefined + ): boolean { + return proto3.util.equals(CommunityStorenodes, a, b) + } +} + +/** + * @generated from message Storenode + */ +export class Storenode extends Message { + /** + * @generated from field: bytes community_id = 1; + */ + communityId = new Uint8Array(0) + + /** + * @generated from field: string storenode_id = 2; + */ + storenodeId = '' + + /** + * @generated from field: string name = 3; + */ + name = '' + + /** + * @generated from field: string address = 4; + */ + address = '' + + /** + * @generated from field: string fleet = 5; + */ + fleet = '' + + /** + * @generated from field: uint32 version = 6; + */ + version = 0 + + /** + * @generated from field: bool removed = 7; + */ + removed = false + + /** + * @generated from field: int64 deleted_at = 8; + */ + deletedAt = protoInt64.zero + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'Storenode' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { + no: 2, + name: 'storenode_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 3, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'fleet', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'version', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { no: 7, name: 'removed', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, + { no: 8, name: 'deleted_at', kind: 'scalar', T: 3 /* ScalarType.INT64 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): Storenode { + return new Storenode().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): Storenode { + return new Storenode().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): Storenode { + return new Storenode().fromJsonString(jsonString, options) + } + + static equals( + a: Storenode | PlainMessage | undefined, + b: Storenode | PlainMessage | undefined + ): boolean { + return proto3.util.equals(Storenode, a, b) + } +} + +/** + * @generated from message CommunityReevaluatePermissionsRequest + */ +export class CommunityReevaluatePermissionsRequest extends Message { + /** + * @generated from field: bytes community_id = 1; + */ + communityId = new Uint8Array(0) + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityReevaluatePermissionsRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityReevaluatePermissionsRequest { + return new CommunityReevaluatePermissionsRequest().fromBinary( + bytes, + options + ) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityReevaluatePermissionsRequest { + return new CommunityReevaluatePermissionsRequest().fromJson( + jsonValue, + options + ) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityReevaluatePermissionsRequest { + return new CommunityReevaluatePermissionsRequest().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | CommunityReevaluatePermissionsRequest + | PlainMessage + | undefined, + b: + | CommunityReevaluatePermissionsRequest + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(CommunityReevaluatePermissionsRequest, a, b) + } +} diff --git a/packages/status-js/src/protos/contact.proto b/packages/status-js/src/protos/contact.proto new file mode 100644 index 00000000..21108328 --- /dev/null +++ b/packages/status-js/src/protos/contact.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +message ContactRequestPropagatedState { + uint64 local_clock = 1; + uint64 local_state = 2; + uint64 remote_clock = 3; + uint64 remote_state = 4; +} + +message ContactUpdate { + uint64 clock = 1; + string ens_name = 2; + string profile_image = 3; + string display_name = 4; + uint64 contact_request_clock = 5; + ContactRequestPropagatedState contact_request_propagated_state = 6; + string public_key = 7; +} + +message AcceptContactRequest { + string id = 1; + uint64 clock = 2; +} + +message RetractContactRequest { + string id = 1; + uint64 clock = 2; +} diff --git a/packages/status-js/src/protos/contact_pb.ts b/packages/status-js/src/protos/contact_pb.ts new file mode 100644 index 00000000..35189f0d --- /dev/null +++ b/packages/status-js/src/protos/contact_pb.ts @@ -0,0 +1,325 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file contact.proto (syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from '@bufbuild/protobuf' +import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' + +/** + * @generated from message ContactRequestPropagatedState + */ +export class ContactRequestPropagatedState extends Message { + /** + * @generated from field: uint64 local_clock = 1; + */ + localClock = protoInt64.zero + + /** + * @generated from field: uint64 local_state = 2; + */ + localState = protoInt64.zero + + /** + * @generated from field: uint64 remote_clock = 3; + */ + remoteClock = protoInt64.zero + + /** + * @generated from field: uint64 remote_state = 4; + */ + remoteState = protoInt64.zero + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ContactRequestPropagatedState' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'local_clock', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { + no: 2, + name: 'local_state', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { + no: 3, + name: 'remote_clock', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { + no: 4, + name: 'remote_state', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ContactRequestPropagatedState { + return new ContactRequestPropagatedState().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ContactRequestPropagatedState { + return new ContactRequestPropagatedState().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ContactRequestPropagatedState { + return new ContactRequestPropagatedState().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ContactRequestPropagatedState + | PlainMessage + | undefined, + b: + | ContactRequestPropagatedState + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ContactRequestPropagatedState, a, b) + } +} + +/** + * @generated from message ContactUpdate + */ +export class ContactUpdate extends Message { + /** + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * @generated from field: string ens_name = 2; + */ + ensName = '' + + /** + * @generated from field: string profile_image = 3; + */ + profileImage = '' + + /** + * @generated from field: string display_name = 4; + */ + displayName = '' + + /** + * @generated from field: uint64 contact_request_clock = 5; + */ + contactRequestClock = protoInt64.zero + + /** + * @generated from field: ContactRequestPropagatedState contact_request_propagated_state = 6; + */ + contactRequestPropagatedState?: ContactRequestPropagatedState + + /** + * @generated from field: string public_key = 7; + */ + publicKey = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ContactUpdate' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: 'ens_name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 3, + name: 'profile_image', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 4, + name: 'display_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 5, + name: 'contact_request_clock', + kind: 'scalar', + T: 4 /* ScalarType.UINT64 */, + }, + { + no: 6, + name: 'contact_request_propagated_state', + kind: 'message', + T: ContactRequestPropagatedState, + }, + { no: 7, name: 'public_key', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ContactUpdate { + return new ContactUpdate().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ContactUpdate { + return new ContactUpdate().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ContactUpdate { + return new ContactUpdate().fromJsonString(jsonString, options) + } + + static equals( + a: ContactUpdate | PlainMessage | undefined, + b: ContactUpdate | PlainMessage | undefined + ): boolean { + return proto3.util.equals(ContactUpdate, a, b) + } +} + +/** + * @generated from message AcceptContactRequest + */ +export class AcceptContactRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = '' + + /** + * @generated from field: uint64 clock = 2; + */ + clock = protoInt64.zero + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'AcceptContactRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): AcceptContactRequest { + return new AcceptContactRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): AcceptContactRequest { + return new AcceptContactRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): AcceptContactRequest { + return new AcceptContactRequest().fromJsonString(jsonString, options) + } + + static equals( + a: AcceptContactRequest | PlainMessage | undefined, + b: AcceptContactRequest | PlainMessage | undefined + ): boolean { + return proto3.util.equals(AcceptContactRequest, a, b) + } +} + +/** + * @generated from message RetractContactRequest + */ +export class RetractContactRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = '' + + /** + * @generated from field: uint64 clock = 2; + */ + clock = protoInt64.zero + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'RetractContactRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): RetractContactRequest { + return new RetractContactRequest().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): RetractContactRequest { + return new RetractContactRequest().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): RetractContactRequest { + return new RetractContactRequest().fromJsonString(jsonString, options) + } + + static equals( + a: RetractContactRequest | PlainMessage | undefined, + b: RetractContactRequest | PlainMessage | undefined + ): boolean { + return proto3.util.equals(RetractContactRequest, a, b) + } +} diff --git a/packages/status-js/src/protos/emoji-reaction.proto b/packages/status-js/src/protos/emoji-reaction.proto index f1652c73..6a9bb4a6 100644 --- a/packages/status-js/src/protos/emoji-reaction.proto +++ b/packages/status-js/src/protos/emoji-reaction.proto @@ -33,5 +33,5 @@ message EmojiReaction { bool retracted = 6; // Grant for organisation chat messages - bytes grant = 7; + bytes grant = 7 [deprecated = true]; } diff --git a/packages/status-js/src/protos/emoji-reaction_pb.ts b/packages/status-js/src/protos/emoji-reaction_pb.ts index ebc4a42f..486e6bb0 100644 --- a/packages/status-js/src/protos/emoji-reaction_pb.ts +++ b/packages/status-js/src/protos/emoji-reaction_pb.ts @@ -64,7 +64,8 @@ export class EmojiReaction extends Message { /** * Grant for organisation chat messages * - * @generated from field: bytes grant = 7; + * @generated from field: bytes grant = 7 [deprecated = true]; + * @deprecated */ grant = new Uint8Array(0) diff --git a/packages/status-js/src/protos/enums.proto b/packages/status-js/src/protos/enums.proto index b58762e0..3960e838 100644 --- a/packages/status-js/src/protos/enums.proto +++ b/packages/status-js/src/protos/enums.proto @@ -12,8 +12,8 @@ enum MessageType { SYSTEM_MESSAGE_GAP = 6; } -enum ImageType { - UNKNOWN_IMAGE_TYPE = 0; +enum ImageFormat { + UNKNOWN_IMAGE_FORMAT = 0; // Raster image files is payload data that can be read as a raster image PNG = 1; @@ -21,3 +21,10 @@ enum ImageType { WEBP = 3; GIF = 4; } + +enum CommunityTokenType { + UNKNOWN_TOKEN_TYPE = 0; + ERC20 = 1; + ERC721 = 2; + ENS = 3; +} diff --git a/packages/status-js/src/protos/enums_pb.ts b/packages/status-js/src/protos/enums_pb.ts index 3f24ff97..b83a1787 100644 --- a/packages/status-js/src/protos/enums_pb.ts +++ b/packages/status-js/src/protos/enums_pb.ts @@ -60,13 +60,13 @@ proto3.util.setEnumType(MessageType, 'MessageType', [ ]) /** - * @generated from enum ImageType + * @generated from enum ImageFormat */ -export enum ImageType { +export enum ImageFormat { /** - * @generated from enum value: UNKNOWN_IMAGE_TYPE = 0; + * @generated from enum value: UNKNOWN_IMAGE_FORMAT = 0; */ - UNKNOWN_IMAGE_TYPE = 0, + UNKNOWN_IMAGE_FORMAT = 0, /** * Raster image files is payload data that can be read as a raster image @@ -90,11 +90,43 @@ export enum ImageType { */ GIF = 4, } -// Retrieve enum metadata with: proto3.getEnumType(ImageType) -proto3.util.setEnumType(ImageType, 'ImageType', [ - { no: 0, name: 'UNKNOWN_IMAGE_TYPE' }, +// Retrieve enum metadata with: proto3.getEnumType(ImageFormat) +proto3.util.setEnumType(ImageFormat, 'ImageFormat', [ + { no: 0, name: 'UNKNOWN_IMAGE_FORMAT' }, { no: 1, name: 'PNG' }, { no: 2, name: 'JPEG' }, { no: 3, name: 'WEBP' }, { no: 4, name: 'GIF' }, ]) + +/** + * @generated from enum CommunityTokenType + */ +export enum CommunityTokenType { + /** + * @generated from enum value: UNKNOWN_TOKEN_TYPE = 0; + */ + UNKNOWN_TOKEN_TYPE = 0, + + /** + * @generated from enum value: ERC20 = 1; + */ + ERC20 = 1, + + /** + * @generated from enum value: ERC721 = 2; + */ + ERC721 = 2, + + /** + * @generated from enum value: ENS = 3; + */ + ENS = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(CommunityTokenType) +proto3.util.setEnumType(CommunityTokenType, 'CommunityTokenType', [ + { no: 0, name: 'UNKNOWN_TOKEN_TYPE' }, + { no: 1, name: 'ERC20' }, + { no: 2, name: 'ERC721' }, + { no: 3, name: 'ENS' }, +]) diff --git a/packages/status-js/src/protos/membership-update-message.proto b/packages/status-js/src/protos/membership-update-message.proto index 01aafebc..b8baee0c 100644 --- a/packages/status-js/src/protos/membership-update-message.proto +++ b/packages/status-js/src/protos/membership-update-message.proto @@ -12,6 +12,10 @@ message MembershipUpdateEvent { string name = 3; // The type of the event EventType type = 4; + // Color of the chat for the CHAT_CREATED/COLOR_CHANGED event types + string color = 5; + // Chat image + bytes image = 6; enum EventType { UNKNOWN = 0; @@ -22,6 +26,8 @@ message MembershipUpdateEvent { MEMBER_REMOVED = 5; ADMINS_ADDED = 6; ADMIN_REMOVED = 7; + COLOR_CHANGED = 8; + IMAGE_CHANGED = 9; } } diff --git a/packages/status-js/src/protos/membership-update-message_pb.ts b/packages/status-js/src/protos/membership-update-message_pb.ts index 6cef7bdd..6a3e3a60 100644 --- a/packages/status-js/src/protos/membership-update-message_pb.ts +++ b/packages/status-js/src/protos/membership-update-message_pb.ts @@ -47,6 +47,20 @@ export class MembershipUpdateEvent extends Message { */ type = MembershipUpdateEvent_EventType.UNKNOWN + /** + * Color of the chat for the CHAT_CREATED/COLOR_CHANGED event types + * + * @generated from field: string color = 5; + */ + color = '' + + /** + * Chat image + * + * @generated from field: bytes image = 6; + */ + image = new Uint8Array(0) + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -70,6 +84,8 @@ export class MembershipUpdateEvent extends Message { kind: 'enum', T: proto3.getEnumType(MembershipUpdateEvent_EventType), }, + { no: 5, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 6, name: 'image', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, ]) static fromBinary( @@ -144,6 +160,16 @@ export enum MembershipUpdateEvent_EventType { * @generated from enum value: ADMIN_REMOVED = 7; */ ADMIN_REMOVED = 7, + + /** + * @generated from enum value: COLOR_CHANGED = 8; + */ + COLOR_CHANGED = 8, + + /** + * @generated from enum value: IMAGE_CHANGED = 9; + */ + IMAGE_CHANGED = 9, } // Retrieve enum metadata with: proto3.getEnumType(MembershipUpdateEvent_EventType) proto3.util.setEnumType( @@ -158,6 +184,8 @@ proto3.util.setEnumType( { no: 5, name: 'MEMBER_REMOVED' }, { no: 6, name: 'ADMINS_ADDED' }, { no: 7, name: 'ADMIN_REMOVED' }, + { no: 8, name: 'COLOR_CHANGED' }, + { no: 9, name: 'IMAGE_CHANGED' }, ] ) diff --git a/packages/status-js/src/protos/profile-showcase.proto b/packages/status-js/src/protos/profile-showcase.proto new file mode 100644 index 00000000..28317387 --- /dev/null +++ b/packages/status-js/src/protos/profile-showcase.proto @@ -0,0 +1,130 @@ +syntax = "proto3"; + +// Profile showcase for a contact + +message ProfileShowcaseCommunity { + string community_id = 1; + uint32 order = 2; + bytes grant = 3; +} + +message ProfileShowcaseAccount { + string address = 1; + string name = 2; + string color_id = 3; + string emoji = 4; + uint32 order = 5; +} + +message ProfileShowcaseCollectible { + string uid = 1 [deprecated = true]; + uint32 order = 2; + string contract_address = 3; + string community_id = 4 [deprecated = true]; + uint64 chain_id = 5; + string token_id = 6; + string account_address = 7 [deprecated = true]; +} + +message ProfileShowcaseVerifiedToken { + string symbol = 1; + uint32 order = 2; +} + +message ProfileShowcaseUnverifiedToken { + string contract_address = 1; + uint32 order = 2; + uint64 chain_id = 3; + string community_id = 4 [deprecated = true]; +} + +message ProfileShowcaseSocialLink { + string url = 1; + uint32 order = 2; + string text = 3; +} + +message ProfileShowcaseEntries { + repeated ProfileShowcaseCommunity communities = 1; + repeated ProfileShowcaseAccount accounts = 2; + repeated ProfileShowcaseCollectible collectibles = 3; + repeated ProfileShowcaseVerifiedToken verified_tokens = 4; + repeated ProfileShowcaseUnverifiedToken unverified_tokens = 5; + repeated ProfileShowcaseSocialLink social_links = 6; +} + +message ProfileShowcaseEntriesEncrypted { + bytes encrypted_entries = 1; + repeated bytes encryption_keys = 2; +} + +message ProfileShowcase { + ProfileShowcaseEntries for_everyone = 1; + ProfileShowcaseEntriesEncrypted for_contacts = 2; + ProfileShowcaseEntriesEncrypted for_id_verified_contacts = 3; +} + +// Profile showcase preferences + +enum ProfileShowcaseVisibility { + PROFILE_SHOWCASE_VISIBILITY_NO_ONE = 0; + PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS = 1; + PROFILE_SHOWCASE_VISIBILITY_CONTACTS = 2; + PROFILE_SHOWCASE_VISIBILITY_EVERYONE = 3; +} + +message ProfileShowcaseCommunityPreference { + string community_id = 1; + ProfileShowcaseVisibility showcase_visibility = 2; + uint32 order = 3; +} + +message ProfileShowcaseAccountPreference { + string address = 1; + string name = 2 [deprecated = true]; + string color_id = 3 [deprecated = true]; + string emoji = 4 [deprecated = true]; + ProfileShowcaseVisibility showcase_visibility = 5; + uint32 order = 6; +} + +message ProfileShowcaseCollectiblePreference { + string contract_address = 1; + uint64 chain_id = 2; + string token_id = 3; + string community_id = 4 [deprecated = true]; + string account_address = 5 [deprecated = true]; + ProfileShowcaseVisibility showcase_visibility = 6; + uint32 order = 7; +} + +message ProfileShowcaseVerifiedTokenPreference { + string symbol = 1; + ProfileShowcaseVisibility showcase_visibility = 2; + uint32 order = 3; +} + +message ProfileShowcaseUnverifiedTokenPreference { + string contract_address = 1; + uint64 chain_id = 2; + string community_id = 3 [deprecated = true]; + ProfileShowcaseVisibility showcase_visibility = 4; + uint32 order = 5; +} + +message ProfileShowcaseSocialLinkPreference { + string url = 1; + string text = 2; + uint32 order = 3; + ProfileShowcaseVisibility showcase_visibility = 4; +} + +message SyncProfileShowcasePreferences { + uint64 clock = 1; + repeated ProfileShowcaseCommunityPreference communities = 2; + repeated ProfileShowcaseAccountPreference accounts = 3; + repeated ProfileShowcaseCollectiblePreference collectibles = 4; + repeated ProfileShowcaseVerifiedTokenPreference verified_tokens = 5; + repeated ProfileShowcaseUnverifiedTokenPreference unverified_tokens = 6; + repeated ProfileShowcaseSocialLinkPreference social_links = 7; +} diff --git a/packages/status-js/src/protos/profile-showcase_pb.ts b/packages/status-js/src/protos/profile-showcase_pb.ts new file mode 100644 index 00000000..661f9cc2 --- /dev/null +++ b/packages/status-js/src/protos/profile-showcase_pb.ts @@ -0,0 +1,1483 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file profile-showcase.proto (syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from '@bufbuild/protobuf' +import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' + +/** + * @generated from enum ProfileShowcaseVisibility + */ +export enum ProfileShowcaseVisibility { + /** + * @generated from enum value: PROFILE_SHOWCASE_VISIBILITY_NO_ONE = 0; + */ + NO_ONE = 0, + + /** + * @generated from enum value: PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS = 1; + */ + IDVERIFIED_CONTACTS = 1, + + /** + * @generated from enum value: PROFILE_SHOWCASE_VISIBILITY_CONTACTS = 2; + */ + CONTACTS = 2, + + /** + * @generated from enum value: PROFILE_SHOWCASE_VISIBILITY_EVERYONE = 3; + */ + EVERYONE = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(ProfileShowcaseVisibility) +proto3.util.setEnumType( + ProfileShowcaseVisibility, + 'ProfileShowcaseVisibility', + [ + { no: 0, name: 'PROFILE_SHOWCASE_VISIBILITY_NO_ONE' }, + { no: 1, name: 'PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS' }, + { no: 2, name: 'PROFILE_SHOWCASE_VISIBILITY_CONTACTS' }, + { no: 3, name: 'PROFILE_SHOWCASE_VISIBILITY_EVERYONE' }, + ] +) + +/** + * @generated from message ProfileShowcaseCommunity + */ +export class ProfileShowcaseCommunity extends Message { + /** + * @generated from field: string community_id = 1; + */ + communityId = '' + + /** + * @generated from field: uint32 order = 2; + */ + order = 0 + + /** + * @generated from field: bytes grant = 3; + */ + grant = new Uint8Array(0) + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseCommunity' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'community_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 2, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: 'grant', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseCommunity { + return new ProfileShowcaseCommunity().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseCommunity { + return new ProfileShowcaseCommunity().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseCommunity { + return new ProfileShowcaseCommunity().fromJsonString(jsonString, options) + } + + static equals( + a: + | ProfileShowcaseCommunity + | PlainMessage + | undefined, + b: + | ProfileShowcaseCommunity + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseCommunity, a, b) + } +} + +/** + * @generated from message ProfileShowcaseAccount + */ +export class ProfileShowcaseAccount extends Message { + /** + * @generated from field: string address = 1; + */ + address = '' + + /** + * @generated from field: string name = 2; + */ + name = '' + + /** + * @generated from field: string color_id = 3; + */ + colorId = '' + + /** + * @generated from field: string emoji = 4; + */ + emoji = '' + + /** + * @generated from field: uint32 order = 5; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseAccount' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'color_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'emoji', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 5, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseAccount { + return new ProfileShowcaseAccount().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseAccount { + return new ProfileShowcaseAccount().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseAccount { + return new ProfileShowcaseAccount().fromJsonString(jsonString, options) + } + + static equals( + a: + | ProfileShowcaseAccount + | PlainMessage + | undefined, + b: ProfileShowcaseAccount | PlainMessage | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseAccount, a, b) + } +} + +/** + * @generated from message ProfileShowcaseCollectible + */ +export class ProfileShowcaseCollectible extends Message { + /** + * @generated from field: string uid = 1 [deprecated = true]; + * @deprecated + */ + uid = '' + + /** + * @generated from field: uint32 order = 2; + */ + order = 0 + + /** + * @generated from field: string contract_address = 3; + */ + contractAddress = '' + + /** + * @generated from field: string community_id = 4 [deprecated = true]; + * @deprecated + */ + communityId = '' + + /** + * @generated from field: uint64 chain_id = 5; + */ + chainId = protoInt64.zero + + /** + * @generated from field: string token_id = 6; + */ + tokenId = '' + + /** + * @generated from field: string account_address = 7 [deprecated = true]; + * @deprecated + */ + accountAddress = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseCollectible' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'uid', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { + no: 3, + name: 'contract_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 4, + name: 'community_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 5, name: 'chain_id', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { no: 6, name: 'token_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 7, + name: 'account_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseCollectible { + return new ProfileShowcaseCollectible().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseCollectible { + return new ProfileShowcaseCollectible().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseCollectible { + return new ProfileShowcaseCollectible().fromJsonString(jsonString, options) + } + + static equals( + a: + | ProfileShowcaseCollectible + | PlainMessage + | undefined, + b: + | ProfileShowcaseCollectible + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseCollectible, a, b) + } +} + +/** + * @generated from message ProfileShowcaseVerifiedToken + */ +export class ProfileShowcaseVerifiedToken extends Message { + /** + * @generated from field: string symbol = 1; + */ + symbol = '' + + /** + * @generated from field: uint32 order = 2; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseVerifiedToken' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'symbol', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseVerifiedToken { + return new ProfileShowcaseVerifiedToken().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseVerifiedToken { + return new ProfileShowcaseVerifiedToken().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseVerifiedToken { + return new ProfileShowcaseVerifiedToken().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseVerifiedToken + | PlainMessage + | undefined, + b: + | ProfileShowcaseVerifiedToken + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseVerifiedToken, a, b) + } +} + +/** + * @generated from message ProfileShowcaseUnverifiedToken + */ +export class ProfileShowcaseUnverifiedToken extends Message { + /** + * @generated from field: string contract_address = 1; + */ + contractAddress = '' + + /** + * @generated from field: uint32 order = 2; + */ + order = 0 + + /** + * @generated from field: uint64 chain_id = 3; + */ + chainId = protoInt64.zero + + /** + * @generated from field: string community_id = 4 [deprecated = true]; + * @deprecated + */ + communityId = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseUnverifiedToken' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'contract_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 2, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: 'chain_id', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 4, + name: 'community_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseUnverifiedToken { + return new ProfileShowcaseUnverifiedToken().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseUnverifiedToken { + return new ProfileShowcaseUnverifiedToken().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseUnverifiedToken { + return new ProfileShowcaseUnverifiedToken().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseUnverifiedToken + | PlainMessage + | undefined, + b: + | ProfileShowcaseUnverifiedToken + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseUnverifiedToken, a, b) + } +} + +/** + * @generated from message ProfileShowcaseSocialLink + */ +export class ProfileShowcaseSocialLink extends Message { + /** + * @generated from field: string url = 1; + */ + url = '' + + /** + * @generated from field: uint32 order = 2; + */ + order = 0 + + /** + * @generated from field: string text = 3; + */ + text = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseSocialLink' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: 'text', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseSocialLink { + return new ProfileShowcaseSocialLink().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseSocialLink { + return new ProfileShowcaseSocialLink().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseSocialLink { + return new ProfileShowcaseSocialLink().fromJsonString(jsonString, options) + } + + static equals( + a: + | ProfileShowcaseSocialLink + | PlainMessage + | undefined, + b: + | ProfileShowcaseSocialLink + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseSocialLink, a, b) + } +} + +/** + * @generated from message ProfileShowcaseEntries + */ +export class ProfileShowcaseEntries extends Message { + /** + * @generated from field: repeated ProfileShowcaseCommunity communities = 1; + */ + communities: ProfileShowcaseCommunity[] = [] + + /** + * @generated from field: repeated ProfileShowcaseAccount accounts = 2; + */ + accounts: ProfileShowcaseAccount[] = [] + + /** + * @generated from field: repeated ProfileShowcaseCollectible collectibles = 3; + */ + collectibles: ProfileShowcaseCollectible[] = [] + + /** + * @generated from field: repeated ProfileShowcaseVerifiedToken verified_tokens = 4; + */ + verifiedTokens: ProfileShowcaseVerifiedToken[] = [] + + /** + * @generated from field: repeated ProfileShowcaseUnverifiedToken unverified_tokens = 5; + */ + unverifiedTokens: ProfileShowcaseUnverifiedToken[] = [] + + /** + * @generated from field: repeated ProfileShowcaseSocialLink social_links = 6; + */ + socialLinks: ProfileShowcaseSocialLink[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseEntries' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'communities', + kind: 'message', + T: ProfileShowcaseCommunity, + repeated: true, + }, + { + no: 2, + name: 'accounts', + kind: 'message', + T: ProfileShowcaseAccount, + repeated: true, + }, + { + no: 3, + name: 'collectibles', + kind: 'message', + T: ProfileShowcaseCollectible, + repeated: true, + }, + { + no: 4, + name: 'verified_tokens', + kind: 'message', + T: ProfileShowcaseVerifiedToken, + repeated: true, + }, + { + no: 5, + name: 'unverified_tokens', + kind: 'message', + T: ProfileShowcaseUnverifiedToken, + repeated: true, + }, + { + no: 6, + name: 'social_links', + kind: 'message', + T: ProfileShowcaseSocialLink, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseEntries { + return new ProfileShowcaseEntries().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseEntries { + return new ProfileShowcaseEntries().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseEntries { + return new ProfileShowcaseEntries().fromJsonString(jsonString, options) + } + + static equals( + a: + | ProfileShowcaseEntries + | PlainMessage + | undefined, + b: ProfileShowcaseEntries | PlainMessage | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseEntries, a, b) + } +} + +/** + * @generated from message ProfileShowcaseEntriesEncrypted + */ +export class ProfileShowcaseEntriesEncrypted extends Message { + /** + * @generated from field: bytes encrypted_entries = 1; + */ + encryptedEntries = new Uint8Array(0) + + /** + * @generated from field: repeated bytes encryption_keys = 2; + */ + encryptionKeys: Uint8Array[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseEntriesEncrypted' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'encrypted_entries', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { + no: 2, + name: 'encryption_keys', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseEntriesEncrypted { + return new ProfileShowcaseEntriesEncrypted().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseEntriesEncrypted { + return new ProfileShowcaseEntriesEncrypted().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseEntriesEncrypted { + return new ProfileShowcaseEntriesEncrypted().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseEntriesEncrypted + | PlainMessage + | undefined, + b: + | ProfileShowcaseEntriesEncrypted + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseEntriesEncrypted, a, b) + } +} + +/** + * @generated from message ProfileShowcase + */ +export class ProfileShowcase extends Message { + /** + * @generated from field: ProfileShowcaseEntries for_everyone = 1; + */ + forEveryone?: ProfileShowcaseEntries + + /** + * @generated from field: ProfileShowcaseEntriesEncrypted for_contacts = 2; + */ + forContacts?: ProfileShowcaseEntriesEncrypted + + /** + * @generated from field: ProfileShowcaseEntriesEncrypted for_id_verified_contacts = 3; + */ + forIdVerifiedContacts?: ProfileShowcaseEntriesEncrypted + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcase' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'for_everyone', kind: 'message', T: ProfileShowcaseEntries }, + { + no: 2, + name: 'for_contacts', + kind: 'message', + T: ProfileShowcaseEntriesEncrypted, + }, + { + no: 3, + name: 'for_id_verified_contacts', + kind: 'message', + T: ProfileShowcaseEntriesEncrypted, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcase { + return new ProfileShowcase().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcase { + return new ProfileShowcase().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcase { + return new ProfileShowcase().fromJsonString(jsonString, options) + } + + static equals( + a: ProfileShowcase | PlainMessage | undefined, + b: ProfileShowcase | PlainMessage | undefined + ): boolean { + return proto3.util.equals(ProfileShowcase, a, b) + } +} + +/** + * @generated from message ProfileShowcaseCommunityPreference + */ +export class ProfileShowcaseCommunityPreference extends Message { + /** + * @generated from field: string community_id = 1; + */ + communityId = '' + + /** + * @generated from field: ProfileShowcaseVisibility showcase_visibility = 2; + */ + showcaseVisibility = ProfileShowcaseVisibility.NO_ONE + + /** + * @generated from field: uint32 order = 3; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseCommunityPreference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'community_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 2, + name: 'showcase_visibility', + kind: 'enum', + T: proto3.getEnumType(ProfileShowcaseVisibility), + }, + { no: 3, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseCommunityPreference { + return new ProfileShowcaseCommunityPreference().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseCommunityPreference { + return new ProfileShowcaseCommunityPreference().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseCommunityPreference { + return new ProfileShowcaseCommunityPreference().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseCommunityPreference + | PlainMessage + | undefined, + b: + | ProfileShowcaseCommunityPreference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseCommunityPreference, a, b) + } +} + +/** + * @generated from message ProfileShowcaseAccountPreference + */ +export class ProfileShowcaseAccountPreference extends Message { + /** + * @generated from field: string address = 1; + */ + address = '' + + /** + * @generated from field: string name = 2 [deprecated = true]; + * @deprecated + */ + name = '' + + /** + * @generated from field: string color_id = 3 [deprecated = true]; + * @deprecated + */ + colorId = '' + + /** + * @generated from field: string emoji = 4 [deprecated = true]; + * @deprecated + */ + emoji = '' + + /** + * @generated from field: ProfileShowcaseVisibility showcase_visibility = 5; + */ + showcaseVisibility = ProfileShowcaseVisibility.NO_ONE + + /** + * @generated from field: uint32 order = 6; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseAccountPreference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'color_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'emoji', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 5, + name: 'showcase_visibility', + kind: 'enum', + T: proto3.getEnumType(ProfileShowcaseVisibility), + }, + { no: 6, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseAccountPreference { + return new ProfileShowcaseAccountPreference().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseAccountPreference { + return new ProfileShowcaseAccountPreference().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseAccountPreference { + return new ProfileShowcaseAccountPreference().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseAccountPreference + | PlainMessage + | undefined, + b: + | ProfileShowcaseAccountPreference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseAccountPreference, a, b) + } +} + +/** + * @generated from message ProfileShowcaseCollectiblePreference + */ +export class ProfileShowcaseCollectiblePreference extends Message { + /** + * @generated from field: string contract_address = 1; + */ + contractAddress = '' + + /** + * @generated from field: uint64 chain_id = 2; + */ + chainId = protoInt64.zero + + /** + * @generated from field: string token_id = 3; + */ + tokenId = '' + + /** + * @generated from field: string community_id = 4 [deprecated = true]; + * @deprecated + */ + communityId = '' + + /** + * @generated from field: string account_address = 5 [deprecated = true]; + * @deprecated + */ + accountAddress = '' + + /** + * @generated from field: ProfileShowcaseVisibility showcase_visibility = 6; + */ + showcaseVisibility = ProfileShowcaseVisibility.NO_ONE + + /** + * @generated from field: uint32 order = 7; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseCollectiblePreference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'contract_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 2, name: 'chain_id', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: 'token_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: 'community_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 5, + name: 'account_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 6, + name: 'showcase_visibility', + kind: 'enum', + T: proto3.getEnumType(ProfileShowcaseVisibility), + }, + { no: 7, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseCollectiblePreference { + return new ProfileShowcaseCollectiblePreference().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseCollectiblePreference { + return new ProfileShowcaseCollectiblePreference().fromJson( + jsonValue, + options + ) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseCollectiblePreference { + return new ProfileShowcaseCollectiblePreference().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseCollectiblePreference + | PlainMessage + | undefined, + b: + | ProfileShowcaseCollectiblePreference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseCollectiblePreference, a, b) + } +} + +/** + * @generated from message ProfileShowcaseVerifiedTokenPreference + */ +export class ProfileShowcaseVerifiedTokenPreference extends Message { + /** + * @generated from field: string symbol = 1; + */ + symbol = '' + + /** + * @generated from field: ProfileShowcaseVisibility showcase_visibility = 2; + */ + showcaseVisibility = ProfileShowcaseVisibility.NO_ONE + + /** + * @generated from field: uint32 order = 3; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseVerifiedTokenPreference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'symbol', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: 'showcase_visibility', + kind: 'enum', + T: proto3.getEnumType(ProfileShowcaseVisibility), + }, + { no: 3, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseVerifiedTokenPreference { + return new ProfileShowcaseVerifiedTokenPreference().fromBinary( + bytes, + options + ) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseVerifiedTokenPreference { + return new ProfileShowcaseVerifiedTokenPreference().fromJson( + jsonValue, + options + ) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseVerifiedTokenPreference { + return new ProfileShowcaseVerifiedTokenPreference().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseVerifiedTokenPreference + | PlainMessage + | undefined, + b: + | ProfileShowcaseVerifiedTokenPreference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseVerifiedTokenPreference, a, b) + } +} + +/** + * @generated from message ProfileShowcaseUnverifiedTokenPreference + */ +export class ProfileShowcaseUnverifiedTokenPreference extends Message { + /** + * @generated from field: string contract_address = 1; + */ + contractAddress = '' + + /** + * @generated from field: uint64 chain_id = 2; + */ + chainId = protoInt64.zero + + /** + * @generated from field: string community_id = 3 [deprecated = true]; + * @deprecated + */ + communityId = '' + + /** + * @generated from field: ProfileShowcaseVisibility showcase_visibility = 4; + */ + showcaseVisibility = ProfileShowcaseVisibility.NO_ONE + + /** + * @generated from field: uint32 order = 5; + */ + order = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseUnverifiedTokenPreference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'contract_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 2, name: 'chain_id', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 3, + name: 'community_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { + no: 4, + name: 'showcase_visibility', + kind: 'enum', + T: proto3.getEnumType(ProfileShowcaseVisibility), + }, + { no: 5, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseUnverifiedTokenPreference { + return new ProfileShowcaseUnverifiedTokenPreference().fromBinary( + bytes, + options + ) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseUnverifiedTokenPreference { + return new ProfileShowcaseUnverifiedTokenPreference().fromJson( + jsonValue, + options + ) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseUnverifiedTokenPreference { + return new ProfileShowcaseUnverifiedTokenPreference().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseUnverifiedTokenPreference + | PlainMessage + | undefined, + b: + | ProfileShowcaseUnverifiedTokenPreference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseUnverifiedTokenPreference, a, b) + } +} + +/** + * @generated from message ProfileShowcaseSocialLinkPreference + */ +export class ProfileShowcaseSocialLinkPreference extends Message { + /** + * @generated from field: string url = 1; + */ + url = '' + + /** + * @generated from field: string text = 2; + */ + text = '' + + /** + * @generated from field: uint32 order = 3; + */ + order = 0 + + /** + * @generated from field: ProfileShowcaseVisibility showcase_visibility = 4; + */ + showcaseVisibility = ProfileShowcaseVisibility.NO_ONE + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'ProfileShowcaseSocialLinkPreference' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 2, name: 'text', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'order', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { + no: 4, + name: 'showcase_visibility', + kind: 'enum', + T: proto3.getEnumType(ProfileShowcaseVisibility), + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): ProfileShowcaseSocialLinkPreference { + return new ProfileShowcaseSocialLinkPreference().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): ProfileShowcaseSocialLinkPreference { + return new ProfileShowcaseSocialLinkPreference().fromJson( + jsonValue, + options + ) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): ProfileShowcaseSocialLinkPreference { + return new ProfileShowcaseSocialLinkPreference().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | ProfileShowcaseSocialLinkPreference + | PlainMessage + | undefined, + b: + | ProfileShowcaseSocialLinkPreference + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(ProfileShowcaseSocialLinkPreference, a, b) + } +} + +/** + * @generated from message SyncProfileShowcasePreferences + */ +export class SyncProfileShowcasePreferences extends Message { + /** + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * @generated from field: repeated ProfileShowcaseCommunityPreference communities = 2; + */ + communities: ProfileShowcaseCommunityPreference[] = [] + + /** + * @generated from field: repeated ProfileShowcaseAccountPreference accounts = 3; + */ + accounts: ProfileShowcaseAccountPreference[] = [] + + /** + * @generated from field: repeated ProfileShowcaseCollectiblePreference collectibles = 4; + */ + collectibles: ProfileShowcaseCollectiblePreference[] = [] + + /** + * @generated from field: repeated ProfileShowcaseVerifiedTokenPreference verified_tokens = 5; + */ + verifiedTokens: ProfileShowcaseVerifiedTokenPreference[] = [] + + /** + * @generated from field: repeated ProfileShowcaseUnverifiedTokenPreference unverified_tokens = 6; + */ + unverifiedTokens: ProfileShowcaseUnverifiedTokenPreference[] = [] + + /** + * @generated from field: repeated ProfileShowcaseSocialLinkPreference social_links = 7; + */ + socialLinks: ProfileShowcaseSocialLinkPreference[] = [] + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'SyncProfileShowcasePreferences' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 2, + name: 'communities', + kind: 'message', + T: ProfileShowcaseCommunityPreference, + repeated: true, + }, + { + no: 3, + name: 'accounts', + kind: 'message', + T: ProfileShowcaseAccountPreference, + repeated: true, + }, + { + no: 4, + name: 'collectibles', + kind: 'message', + T: ProfileShowcaseCollectiblePreference, + repeated: true, + }, + { + no: 5, + name: 'verified_tokens', + kind: 'message', + T: ProfileShowcaseVerifiedTokenPreference, + repeated: true, + }, + { + no: 6, + name: 'unverified_tokens', + kind: 'message', + T: ProfileShowcaseUnverifiedTokenPreference, + repeated: true, + }, + { + no: 7, + name: 'social_links', + kind: 'message', + T: ProfileShowcaseSocialLinkPreference, + repeated: true, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): SyncProfileShowcasePreferences { + return new SyncProfileShowcasePreferences().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): SyncProfileShowcasePreferences { + return new SyncProfileShowcasePreferences().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): SyncProfileShowcasePreferences { + return new SyncProfileShowcasePreferences().fromJsonString( + jsonString, + options + ) + } + + static equals( + a: + | SyncProfileShowcasePreferences + | PlainMessage + | undefined, + b: + | SyncProfileShowcasePreferences + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(SyncProfileShowcasePreferences, a, b) + } +} diff --git a/packages/status-js/src/protos/protocol-message.proto b/packages/status-js/src/protos/protocol-message.proto index 50edd33e..c1a0a6ea 100644 --- a/packages/status-js/src/protos/protocol-message.proto +++ b/packages/status-js/src/protos/protocol-message.proto @@ -53,21 +53,32 @@ message X3DHHeader { // Hash Ratchet Header message HRHeader { - // community key ID - uint32 key_id = 1; - // Community message number for this key_id + // deprecated group key ID + uint32 deprecated_key_id = 1; + // group message number for this key_id uint32 seq_no = 2; - // Community ID + // group ID bytes group_id = 3; + // group key ID + bytes key_id = 4; + HRKeys keys = 5; +} + +message RekeyGroup { + uint64 timestamp = 2; + + map keys = 4; } message HRKeys { repeated HRKey keys = 1; + RekeyGroup rekey_group = 2; } message HRKey { - uint32 key_id = 1; + uint32 deprecated_key_id = 1; bytes key = 2; + uint64 timestamp = 3; } // Direct message value diff --git a/packages/status-js/src/protos/protocol-message_pb.ts b/packages/status-js/src/protos/protocol-message_pb.ts index 2d1b3d7a..558ffd78 100644 --- a/packages/status-js/src/protos/protocol-message_pb.ts +++ b/packages/status-js/src/protos/protocol-message_pb.ts @@ -423,26 +423,38 @@ export class X3DHHeader extends Message { */ export class HRHeader extends Message { /** - * community key ID + * deprecated group key ID * - * @generated from field: uint32 key_id = 1; + * @generated from field: uint32 deprecated_key_id = 1; */ - keyId = 0 + deprecatedKeyId = 0 /** - * Community message number for this key_id + * group message number for this key_id * * @generated from field: uint32 seq_no = 2; */ seqNo = 0 /** - * Community ID + * group ID * * @generated from field: bytes group_id = 3; */ groupId = new Uint8Array(0) + /** + * group key ID + * + * @generated from field: bytes key_id = 4; + */ + keyId = new Uint8Array(0) + + /** + * @generated from field: HRKeys keys = 5; + */ + keys?: HRKeys + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -451,9 +463,16 @@ export class HRHeader extends Message { static readonly runtime: typeof proto3 = proto3 static readonly typeName = 'HRHeader' static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: 'key_id', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { + no: 1, + name: 'deprecated_key_id', + kind: 'scalar', + T: 13 /* ScalarType.UINT32 */, + }, { no: 2, name: 'seq_no', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, { no: 3, name: 'group_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 4, name: 'key_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 5, name: 'keys', kind: 'message', T: HRKeys }, ]) static fromBinary( @@ -485,6 +504,67 @@ export class HRHeader extends Message { } } +/** + * @generated from message RekeyGroup + */ +export class RekeyGroup extends Message { + /** + * @generated from field: uint64 timestamp = 2; + */ + timestamp = protoInt64.zero + + /** + * @generated from field: map keys = 4; + */ + keys: { [key: number]: Uint8Array } = {} + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'RekeyGroup' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 2, name: 'timestamp', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 4, + name: 'keys', + kind: 'map', + K: 13 /* ScalarType.UINT32 */, + V: { kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): RekeyGroup { + return new RekeyGroup().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): RekeyGroup { + return new RekeyGroup().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): RekeyGroup { + return new RekeyGroup().fromJsonString(jsonString, options) + } + + static equals( + a: RekeyGroup | PlainMessage | undefined, + b: RekeyGroup | PlainMessage | undefined + ): boolean { + return proto3.util.equals(RekeyGroup, a, b) + } +} + /** * @generated from message HRKeys */ @@ -494,6 +574,11 @@ export class HRKeys extends Message { */ keys: HRKey[] = [] + /** + * @generated from field: RekeyGroup rekey_group = 2; + */ + rekeyGroup?: RekeyGroup + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -503,6 +588,7 @@ export class HRKeys extends Message { static readonly typeName = 'HRKeys' static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'keys', kind: 'message', T: HRKey, repeated: true }, + { no: 2, name: 'rekey_group', kind: 'message', T: RekeyGroup }, ]) static fromBinary( @@ -539,15 +625,20 @@ export class HRKeys extends Message { */ export class HRKey extends Message { /** - * @generated from field: uint32 key_id = 1; + * @generated from field: uint32 deprecated_key_id = 1; */ - keyId = 0 + deprecatedKeyId = 0 /** * @generated from field: bytes key = 2; */ key = new Uint8Array(0) + /** + * @generated from field: uint64 timestamp = 3; + */ + timestamp = protoInt64.zero + constructor(data?: PartialMessage) { super() proto3.util.initPartial(data, this) @@ -556,8 +647,14 @@ export class HRKey extends Message { static readonly runtime: typeof proto3 = proto3 static readonly typeName = 'HRKey' static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: 'key_id', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, + { + no: 1, + name: 'deprecated_key_id', + kind: 'scalar', + T: 13 /* ScalarType.UINT32 */, + }, { no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: 'timestamp', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, ]) static fromBinary( diff --git a/packages/status-js/src/protos/push-notifications.proto b/packages/status-js/src/protos/push-notifications.proto index fd713a0c..65e11dc9 100644 --- a/packages/status-js/src/protos/push-notifications.proto +++ b/packages/status-js/src/protos/push-notifications.proto @@ -1,7 +1,6 @@ syntax = "proto3"; import "chat-identity.proto"; -import "url.proto"; message PushNotificationRegistration { enum TokenType { @@ -23,6 +22,7 @@ message PushNotificationRegistration { string apn_topic = 12; bool block_mentions = 13; repeated bytes allowed_mentions_chat_list = 14; + repeated bytes muted_chat_list = 15; } message PushNotificationRegistrationResponse { diff --git a/packages/status-js/src/protos/push-notifications_pb.ts b/packages/status-js/src/protos/push-notifications_pb.ts index a24cd120..f7ac47aa 100644 --- a/packages/status-js/src/protos/push-notifications_pb.ts +++ b/packages/status-js/src/protos/push-notifications_pb.ts @@ -88,6 +88,11 @@ export class PushNotificationRegistration extends Message) { super() proto3.util.initPartial(data, this) @@ -158,6 +163,13 @@ export class PushNotificationRegistration extends Message 0, the signer must be verified through the community contract + uint64 chainId = 4; +} + +message CommunityPublicShardInfo { + // Signature of the payload field + bytes signature = 1; + // Marshaled PublicShardInfo + bytes payload = 2; +} diff --git a/packages/status-js/src/protos/shard_pb.ts b/packages/status-js/src/protos/shard_pb.ts new file mode 100644 index 00000000..8257ff39 --- /dev/null +++ b/packages/status-js/src/protos/shard_pb.ts @@ -0,0 +1,214 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file shard.proto (syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from '@bufbuild/protobuf' +import { Message, proto3, protoInt64 } from '@bufbuild/protobuf' + +/** + * @generated from message Shard + */ +export class Shard extends Message { + /** + * @generated from field: int32 cluster = 1; + */ + cluster = 0 + + /** + * @generated from field: int32 index = 2; + */ + index = 0 + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'Shard' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'cluster', kind: 'scalar', T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: 'index', kind: 'scalar', T: 5 /* ScalarType.INT32 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): Shard { + return new Shard().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): Shard { + return new Shard().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): Shard { + return new Shard().fromJsonString(jsonString, options) + } + + static equals( + a: Shard | PlainMessage | undefined, + b: Shard | PlainMessage | undefined + ): boolean { + return proto3.util.equals(Shard, a, b) + } +} + +/** + * @generated from message PublicShardInfo + */ +export class PublicShardInfo extends Message { + /** + * clock + * + * @generated from field: uint64 clock = 1; + */ + clock = protoInt64.zero + + /** + * community ID + * + * @generated from field: bytes community_id = 2; + */ + communityId = new Uint8Array(0) + + /** + * shard information + * + * @generated from field: Shard shard = 3; + */ + shard?: Shard + + /** + * if chainID > 0, the signer must be verified through the community contract + * + * @generated from field: uint64 chainId = 4; + */ + chainId = protoInt64.zero + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'PublicShardInfo' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + { + no: 2, + name: 'community_id', + kind: 'scalar', + T: 12 /* ScalarType.BYTES */, + }, + { no: 3, name: 'shard', kind: 'message', T: Shard }, + { no: 4, name: 'chainId', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): PublicShardInfo { + return new PublicShardInfo().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): PublicShardInfo { + return new PublicShardInfo().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): PublicShardInfo { + return new PublicShardInfo().fromJsonString(jsonString, options) + } + + static equals( + a: PublicShardInfo | PlainMessage | undefined, + b: PublicShardInfo | PlainMessage | undefined + ): boolean { + return proto3.util.equals(PublicShardInfo, a, b) + } +} + +/** + * @generated from message CommunityPublicShardInfo + */ +export class CommunityPublicShardInfo extends Message { + /** + * Signature of the payload field + * + * @generated from field: bytes signature = 1; + */ + signature = new Uint8Array(0) + + /** + * Marshaled PublicShardInfo + * + * @generated from field: bytes payload = 2; + */ + payload = new Uint8Array(0) + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'CommunityPublicShardInfo' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + { no: 2, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ }, + ]) + + static fromBinary( + bytes: Uint8Array, + options?: Partial + ): CommunityPublicShardInfo { + return new CommunityPublicShardInfo().fromBinary(bytes, options) + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial + ): CommunityPublicShardInfo { + return new CommunityPublicShardInfo().fromJson(jsonValue, options) + } + + static fromJsonString( + jsonString: string, + options?: Partial + ): CommunityPublicShardInfo { + return new CommunityPublicShardInfo().fromJsonString(jsonString, options) + } + + static equals( + a: + | CommunityPublicShardInfo + | PlainMessage + | undefined, + b: + | CommunityPublicShardInfo + | PlainMessage + | undefined + ): boolean { + return proto3.util.equals(CommunityPublicShardInfo, a, b) + } +} diff --git a/packages/status-js/src/utils/validate-message.ts b/packages/status-js/src/utils/validate-message.ts index 5e3b21bd..4931697e 100644 --- a/packages/status-js/src/utils/validate-message.ts +++ b/packages/status-js/src/utils/validate-message.ts @@ -2,7 +2,7 @@ import { AudioMessage_AudioType, ChatMessage_ContentType, } from '../protos/chat-message_pb' -import { ImageType, MessageType } from '../protos/enums_pb' +import { ImageFormat, MessageType } from '../protos/enums_pb' import type { AudioMessage, @@ -24,7 +24,7 @@ export function validateMessage(message: ChatMessage): boolean { // fixme? const payload = message.payload.value as ImageMessage - if (payload.type === ImageType.UNKNOWN_IMAGE_TYPE) { + if (payload.format === ImageFormat.UNKNOWN_IMAGE_FORMAT) { return false }