2020-11-18 09:16:51 +00:00
syntax = "proto3" ;
2021-08-06 15:40:23 +00:00
option go_package = "./;protobuf" ;
2020-11-18 09:16:51 +00:00
import "chat_identity.proto" ;
2023-03-02 16:19:19 +00:00
import "enums.proto" ;
2023-10-12 19:21:49 +00:00
import "shard.proto" ;
2020-11-18 09:16:51 +00:00
package protobuf ;
message Grant {
bytes community_id = 1 ;
bytes member_id = 2 ;
string chat_id = 3 ;
uint64 clock = 4 ;
2024-04-17 14:53:51 +00:00
uint64 expires = 5 ;
2020-11-18 09:16:51 +00:00
}
message CommunityMember {
2021-01-11 10:32:51 +00:00
enum Roles {
2023-08-16 10:14:53 +00:00
reserved 2 , 3 ;
reserved "ROLE_MANAGE_USERS" , "ROLE_MODERATE_CONTENT" ;
2023-06-14 14:15:46 +00:00
ROLE_NONE = 0 ;
ROLE_OWNER = 1 ;
ROLE_ADMIN = 4 ;
2023-07-26 16:01:19 +00:00
ROLE_TOKEN_MASTER = 5 ;
2021-01-11 10:32:51 +00:00
}
2024-03-01 17:15:38 +00:00
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 ;
}
2021-01-11 10:32:51 +00:00
repeated Roles roles = 1 ;
2023-08-16 10:14:53 +00:00
repeated RevealedAccount revealed_accounts = 2 [ deprecated = true ] ;
2023-07-10 14:11:37 +00:00
uint64 last_update_clock = 3 ;
2024-03-01 17:15:38 +00:00
ChannelRole channel_role = 4 ;
2020-11-18 09:16:51 +00:00
}
2023-02-20 11:57:33 +00:00
message CommunityTokenMetadata {
map < uint64 , string > contract_addresses = 1 ;
string description = 2 ;
string image = 3 ;
CommunityTokenType tokenType = 4 ;
string symbol = 5 ;
2023-03-07 14:29:16 +00:00
string name = 6 ;
2023-06-14 07:47:54 +00:00
uint32 decimals = 7 ;
2024-07-02 11:34:18 +00:00
string version = 8 ;
2023-02-20 11:57:33 +00:00
}
2024-05-24 10:34:36 +00:00
message CommunityTokenAction {
enum ActionType {
UNKNOWN_ACTION_TYPE = 0 ;
AIRDROP = 1 ;
BURN = 2 ;
REMOTE_DESTRUCT = 3 ;
}
uint64 chain_id = 1 ;
string contract_address = 2 ;
ActionType action_type = 3 ;
}
2020-11-18 09:16:51 +00:00
message CommunityPermissions {
enum Access {
UNKNOWN_ACCESS = 0 ;
2023-10-25 13:03:26 +00:00
AUTO_ACCEPT = 1 ;
INVITATION_ONLY = 2 [ deprecated = true ] ;
MANUAL_ACCEPT = 3 ;
2020-11-18 09:16:51 +00:00
}
bool ens_only = 1 ;
// https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md is a candidate for the algorithm to be used in case we want to have private communityal chats, lighter than pairwise encryption using the DR, less secure, but more efficient for large number of participants
bool private = 2 ;
Access access = 3 ;
}
2023-03-02 16:27:48 +00:00
message TokenCriteria {
map < uint64 , string > contract_addresses = 1 ;
CommunityTokenType type = 2 ;
string symbol = 3 ;
string name = 4 ;
2024-02-13 10:23:11 +00:00
string amount = 5 [ deprecated = true ] ;
2023-03-02 16:27:48 +00:00
repeated uint64 token_ids = 6 ;
string ens_pattern = 7 ;
2023-03-16 14:17:23 +00:00
uint64 decimals = 8 ;
2024-02-13 10:23:11 +00:00
string amountInWei = 9 ;
2023-03-02 16:27:48 +00:00
}
message CommunityTokenPermission {
enum Type {
UNKNOWN_TOKEN_PERMISSION = 0 ;
BECOME_ADMIN = 1 ;
BECOME_MEMBER = 2 ;
2023-06-08 08:43:00 +00:00
CAN_VIEW_CHANNEL = 3 ;
CAN_VIEW_AND_POST_CHANNEL = 4 ;
2023-08-04 10:28:46 +00:00
BECOME_TOKEN_MASTER = 5 ;
2023-08-18 15:29:44 +00:00
BECOME_TOKEN_OWNER = 6 ;
2023-03-02 16:27:48 +00:00
}
string id = 1 ;
Type type = 2 ;
repeated TokenCriteria token_criteria = 3 ;
repeated string chat_ids = 4 ;
bool is_private = 5 ;
}
2020-11-18 09:16:51 +00:00
message CommunityDescription {
uint64 clock = 1 ;
map < string , CommunityMember > members = 2 ;
CommunityPermissions permissions = 3 ;
ChatIdentity identity = 5 ;
map < string , CommunityChat > chats = 6 ;
2024-02-22 10:25:13 +00:00
repeated string ban_list = 7 [ deprecated = true ] ;
2021-05-23 13:34:17 +00:00
map < string , CommunityCategory > categories = 8 ;
2022-03-21 14:18:36 +00:00
uint64 archive_magnetlink_clock = 9 ;
2022-05-10 14:21:38 +00:00
CommunityAdminSettings admin_settings = 10 ;
2022-05-24 19:20:13 +00:00
string intro_message = 11 ;
string outro_message = 12 ;
2023-10-11 15:10:10 +00:00
bool encrypted = 13 [ deprecated = true ] ;
2022-06-24 13:40:12 +00:00
repeated string tags = 14 ;
2023-03-02 16:27:48 +00:00
map < string , CommunityTokenPermission > token_permissions = 15 ;
2023-02-20 11:57:33 +00:00
repeated CommunityTokenMetadata community_tokens_metadata = 16 ;
2023-03-28 14:40:00 +00:00
uint64 active_members_count = 17 ;
2023-07-05 17:35:22 +00:00
string ID = 18 ;
2024-02-22 10:25:13 +00:00
map < string , CommunityBanInfo > banned_members = 19 ;
2024-07-05 08:38:12 +00:00
// request to resend revealed addresses
uint64 resend_accounts_clock = 20 ;
2023-11-29 17:21:21 +00:00
// key is hash ratchet key_id + seq_no
map < string , bytes > privateData = 100 ;
2022-05-10 14:21:38 +00:00
}
2024-02-22 10:25:13 +00:00
message CommunityBanInfo {
bool delete_all_messages = 1 ;
}
2022-05-10 14:21:38 +00:00
message CommunityAdminSettings {
bool pin_message_all_members_enabled = 1 ;
2020-11-18 09:16:51 +00:00
}
message CommunityChat {
map < string , CommunityMember > members = 1 ;
CommunityPermissions permissions = 2 ;
ChatIdentity identity = 3 ;
2021-05-23 13:34:17 +00:00
string category_id = 4 ;
int32 position = 5 ;
2024-03-01 17:15:38 +00:00
bool viewers_can_post_reactions = 6 ;
2024-02-28 11:48:37 +00:00
bool hide_if_permissions_not_met = 7 ;
2024-06-27 15:29:03 +00:00
CommunityBloomFilter members_list = 8 ;
}
message CommunityBloomFilter {
bytes data = 1 ;
uint64 m = 2 ;
uint64 k = 3 ;
2021-05-23 13:34:17 +00:00
}
message CommunityCategory {
string category_id = 1 ;
string name = 2 ;
int32 position = 3 ;
2020-11-18 09:16:51 +00:00
}
2023-06-06 18:33:09 +00:00
message RevealedAccount {
string address = 1 ;
bytes signature = 2 ;
repeated uint64 chain_ids = 3 ;
2023-07-14 17:33:47 +00:00
bool isAirdropAddress = 4 ;
2023-06-06 18:33:09 +00:00
}
2021-01-11 10:32:51 +00:00
message CommunityRequestToJoin {
uint64 clock = 1 ;
string ens_name = 2 ;
string chat_id = 3 ;
bytes community_id = 4 ;
2022-06-22 18:02:44 +00:00
string display_name = 5 ;
2023-06-06 18:33:09 +00:00
repeated RevealedAccount revealed_accounts = 6 ;
2024-04-03 14:49:57 +00:00
uint32 customization_color = 7 ;
2020-11-18 09:16:51 +00:00
}
2023-08-18 11:39:59 +00:00
message CommunityEditSharedAddresses {
2023-07-10 14:11:37 +00:00
uint64 clock = 1 ;
bytes community_id = 2 ;
repeated RevealedAccount revealed_accounts = 3 ;
}
2022-10-28 08:41:20 +00:00
message CommunityCancelRequestToJoin {
uint64 clock = 1 ;
string ens_name = 2 ;
string chat_id = 3 ;
bytes community_id = 4 ;
string display_name = 5 ;
2024-04-03 14:49:57 +00:00
uint32 customization_color = 6 ;
2022-10-28 08:41:20 +00:00
}
2024-01-23 16:56:51 +00:00
message CommunityUserKicked {
uint64 clock = 1 ;
bytes community_id = 2 ;
}
2021-01-11 10:32:51 +00:00
message CommunityRequestToJoinResponse {
uint64 clock = 1 ;
2024-09-25 18:47:06 +00:00
CommunityDescription community = 2 [ deprecated = true ] ;
2021-01-11 10:32:51 +00:00
bool accepted = 3 ;
bytes grant = 4 ;
2022-07-01 13:54:02 +00:00
bytes community_id = 5 ;
2022-12-09 14:26:12 +00:00
string magnet_uri = 6 ;
2023-10-12 19:21:49 +00:00
bytes protected_topic_private_key = 7 ;
Shard shard = 8 ;
2024-09-25 18:47:06 +00:00
// CommunityDescription protocol message with owner signature
bytes community_description_protocol_message = 9 ;
2020-11-18 09:16:51 +00:00
}
2022-03-21 14:18:36 +00:00
2022-08-22 10:10:31 +00:00
message CommunityRequestToLeave {
uint64 clock = 1 ;
bytes community_id = 2 ;
}
2022-03-21 14:18:36 +00:00
message CommunityMessageArchiveMagnetlink {
uint64 clock = 1 ;
string magnet_uri = 2 ;
}
message WakuMessage {
bytes sig = 1 ;
uint64 timestamp = 2 ;
bytes topic = 3 ;
bytes payload = 4 ;
bytes padding = 5 ;
bytes hash = 6 ;
2022-09-28 12:45:34 +00:00
string thirdPartyId = 7 ;
2022-03-21 14:18:36 +00:00
}
message WakuMessageArchiveMetadata {
uint32 version = 1 ;
uint64 from = 2 ;
uint64 to = 3 ;
repeated bytes contentTopic = 4 ;
}
message WakuMessageArchive {
uint32 version = 1 ;
WakuMessageArchiveMetadata metadata = 2 ;
repeated WakuMessage messages = 3 ;
}
message WakuMessageArchiveIndexMetadata {
uint32 version = 1 ;
WakuMessageArchiveMetadata metadata = 2 ;
uint64 offset = 3 ;
uint64 size = 4 ;
uint64 padding = 5 ;
}
message WakuMessageArchiveIndex {
map < string , WakuMessageArchiveIndexMetadata > archives = 1 ;
}
2024-02-20 15:49:39 +00:00
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 ;
}
2024-03-06 08:33:52 +00:00
message CommunityReevaluatePermissionsRequest {
bytes community_id = 1 ;
}
2024-03-19 19:44:49 +00:00
message DeleteCommunityMemberMessage {
string id = 1 ;
string chat_id = 2 ;
}
message DeleteCommunityMemberMessages {
uint64 clock = 1 ;
bytes community_id = 2 ;
string member_id = 3 ;
repeated DeleteCommunityMemberMessage messages = 4 ;
2024-04-17 14:53:51 +00:00
}
message CommunityUpdateGrant {
uint64 timestamp = 1 ;
bytes community_id = 2 ;
map < uint32 , bytes > grants = 3 ;
}
2024-05-10 08:04:46 +00:00
message CommunityEncryptionKeysRequest {
bytes community_id = 1 ;
2024-07-04 15:54:48 +00:00
repeated string chat_ids = 2 ;
2024-05-10 08:04:46 +00:00
}
2024-06-14 17:32:55 +00:00
message CommunitySharedAddressesRequest {
bytes community_id = 1 ;
}
message CommunitySharedAddressesResponse {
bytes community_id = 1 ;
repeated RevealedAccount revealed_accounts = 3 ;
}