github.com/status-im/status-go@v1.1.0/protocol/protobuf/communities.proto (about) 1 syntax = "proto3"; 2 3 option go_package = "./;protobuf"; 4 import "chat_identity.proto"; 5 import "enums.proto"; 6 import "shard.proto"; 7 8 package protobuf; 9 10 message Grant { 11 bytes community_id = 1; 12 bytes member_id = 2; 13 string chat_id = 3; 14 uint64 clock = 4; 15 uint64 expires = 5; 16 } 17 18 message CommunityMember { 19 enum Roles { 20 reserved 2, 3; 21 reserved "ROLE_MANAGE_USERS", "ROLE_MODERATE_CONTENT"; 22 ROLE_NONE = 0; 23 ROLE_OWNER = 1; 24 ROLE_ADMIN = 4; 25 ROLE_TOKEN_MASTER = 5; 26 } 27 enum ChannelRole { 28 // We make POSTER the first role to be the default one. 29 // This is for backwards compatibility. Older protobufs won't have this field and will default to 0. 30 CHANNEL_ROLE_POSTER = 0; 31 CHANNEL_ROLE_VIEWER = 1; 32 } 33 repeated Roles roles = 1; 34 repeated RevealedAccount revealed_accounts = 2 [deprecated = true]; 35 uint64 last_update_clock = 3; 36 ChannelRole channel_role = 4; 37 } 38 39 message CommunityTokenMetadata { 40 map<uint64, string> contract_addresses = 1; 41 string description = 2; 42 string image = 3; 43 CommunityTokenType tokenType = 4; 44 string symbol = 5; 45 string name = 6; 46 uint32 decimals = 7; 47 string version = 8; 48 } 49 50 message CommunityTokenAction { 51 enum ActionType { 52 UNKNOWN_ACTION_TYPE = 0; 53 AIRDROP = 1; 54 BURN = 2; 55 REMOTE_DESTRUCT = 3; 56 } 57 58 uint64 chain_id = 1; 59 string contract_address = 2; 60 ActionType action_type = 3; 61 } 62 63 message CommunityPermissions { 64 enum Access { 65 UNKNOWN_ACCESS = 0; 66 AUTO_ACCEPT = 1; 67 INVITATION_ONLY = 2 [deprecated = true]; 68 MANUAL_ACCEPT = 3; 69 } 70 71 bool ens_only = 1; 72 // 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 73 bool private = 2; 74 Access access = 3; 75 } 76 77 message TokenCriteria { 78 map<uint64, string> contract_addresses = 1; 79 CommunityTokenType type = 2; 80 string symbol = 3; 81 string name = 4; 82 string amount = 5 [deprecated = true]; 83 repeated uint64 token_ids = 6; 84 string ens_pattern = 7; 85 uint64 decimals = 8; 86 string amountInWei = 9; 87 } 88 89 message CommunityTokenPermission { 90 91 enum Type { 92 UNKNOWN_TOKEN_PERMISSION = 0; 93 BECOME_ADMIN = 1; 94 BECOME_MEMBER = 2; 95 CAN_VIEW_CHANNEL = 3; 96 CAN_VIEW_AND_POST_CHANNEL = 4; 97 BECOME_TOKEN_MASTER = 5; 98 BECOME_TOKEN_OWNER = 6; 99 } 100 101 string id = 1; 102 Type type = 2; 103 repeated TokenCriteria token_criteria = 3; 104 repeated string chat_ids = 4; 105 bool is_private = 5; 106 } 107 108 message CommunityDescription { 109 uint64 clock = 1; 110 map<string,CommunityMember> members = 2; 111 CommunityPermissions permissions = 3; 112 ChatIdentity identity = 5; 113 map<string,CommunityChat> chats = 6; 114 repeated string ban_list = 7 [deprecated = true]; 115 map<string,CommunityCategory> categories = 8; 116 uint64 archive_magnetlink_clock = 9; 117 CommunityAdminSettings admin_settings = 10; 118 string intro_message = 11; 119 string outro_message = 12; 120 bool encrypted = 13 [deprecated=true]; 121 repeated string tags = 14; 122 map<string, CommunityTokenPermission> token_permissions = 15; 123 repeated CommunityTokenMetadata community_tokens_metadata = 16; 124 uint64 active_members_count = 17; 125 string ID = 18; 126 map<string,CommunityBanInfo>banned_members = 19; 127 // request to resend revealed addresses 128 uint64 resend_accounts_clock = 20; 129 // key is hash ratchet key_id + seq_no 130 map<string, bytes> privateData = 100; 131 } 132 133 message CommunityBanInfo { 134 bool delete_all_messages = 1; 135 } 136 137 message CommunityAdminSettings { 138 bool pin_message_all_members_enabled = 1; 139 } 140 141 message CommunityChat { 142 map<string,CommunityMember> members = 1; 143 CommunityPermissions permissions = 2; 144 ChatIdentity identity = 3; 145 string category_id = 4; 146 int32 position = 5; 147 bool viewers_can_post_reactions = 6; 148 bool hide_if_permissions_not_met = 7; 149 CommunityBloomFilter members_list = 8; 150 } 151 152 message CommunityBloomFilter { 153 bytes data = 1; 154 uint64 m = 2; 155 uint64 k = 3; 156 } 157 158 message CommunityCategory { 159 string category_id = 1; 160 string name = 2; 161 int32 position = 3; 162 } 163 164 message RevealedAccount { 165 string address = 1; 166 bytes signature = 2; 167 repeated uint64 chain_ids = 3; 168 bool isAirdropAddress = 4; 169 } 170 171 message CommunityRequestToJoin { 172 uint64 clock = 1; 173 string ens_name = 2; 174 string chat_id = 3; 175 bytes community_id = 4; 176 string display_name = 5; 177 repeated RevealedAccount revealed_accounts = 6; 178 uint32 customization_color = 7; 179 } 180 181 message CommunityEditSharedAddresses { 182 uint64 clock = 1; 183 bytes community_id = 2; 184 repeated RevealedAccount revealed_accounts = 3; 185 } 186 187 message CommunityCancelRequestToJoin { 188 uint64 clock = 1; 189 string ens_name = 2; 190 string chat_id = 3; 191 bytes community_id = 4; 192 string display_name = 5; 193 uint32 customization_color = 6; 194 } 195 196 message CommunityUserKicked { 197 uint64 clock = 1; 198 bytes community_id = 2; 199 } 200 201 message CommunityRequestToJoinResponse { 202 uint64 clock = 1; 203 CommunityDescription community = 2; 204 bool accepted = 3; 205 bytes grant = 4; 206 bytes community_id = 5; 207 string magnet_uri = 6; 208 bytes protected_topic_private_key = 7; 209 Shard shard = 8; 210 } 211 212 message CommunityRequestToLeave { 213 uint64 clock = 1; 214 bytes community_id = 2; 215 } 216 217 message CommunityMessageArchiveMagnetlink { 218 uint64 clock = 1; 219 string magnet_uri = 2; 220 } 221 222 message WakuMessage { 223 bytes sig = 1; 224 uint64 timestamp = 2; 225 bytes topic = 3; 226 bytes payload = 4; 227 bytes padding = 5; 228 bytes hash = 6; 229 string thirdPartyId = 7; 230 } 231 232 message WakuMessageArchiveMetadata { 233 uint32 version = 1; 234 uint64 from = 2; 235 uint64 to = 3; 236 repeated bytes contentTopic = 4; 237 } 238 239 message WakuMessageArchive { 240 uint32 version = 1; 241 WakuMessageArchiveMetadata metadata = 2; 242 repeated WakuMessage messages = 3; 243 } 244 245 message WakuMessageArchiveIndexMetadata { 246 uint32 version = 1; 247 WakuMessageArchiveMetadata metadata = 2; 248 uint64 offset = 3; 249 uint64 size = 4; 250 uint64 padding = 5; 251 } 252 253 message WakuMessageArchiveIndex { 254 map<string, WakuMessageArchiveIndexMetadata> archives = 1; 255 } 256 257 message CommunityPublicStorenodesInfo { 258 // Signature of the payload field 259 bytes signature = 1; 260 // Marshaled CommunityStorenodes 261 bytes payload = 2; 262 } 263 264 message CommunityStorenodes { 265 uint64 clock = 1; 266 bytes community_id = 2; 267 repeated Storenode storenodes = 3; 268 uint64 chain_id = 4; 269 } 270 271 message Storenode { 272 bytes community_id = 1; 273 string storenode_id = 2; 274 string name = 3; 275 string address = 4; 276 string fleet = 5; 277 uint32 version = 6; 278 bool removed = 7; 279 int64 deleted_at = 8; 280 } 281 282 message CommunityReevaluatePermissionsRequest { 283 bytes community_id = 1; 284 } 285 286 message DeleteCommunityMemberMessage { 287 string id = 1; 288 string chat_id = 2; 289 } 290 291 message DeleteCommunityMemberMessages { 292 uint64 clock = 1; 293 bytes community_id = 2; 294 string member_id = 3; 295 repeated DeleteCommunityMemberMessage messages = 4; 296 } 297 298 message CommunityUpdateGrant { 299 uint64 timestamp = 1; 300 bytes community_id = 2; 301 map<uint32, bytes> grants = 3; 302 } 303 304 message CommunityEncryptionKeysRequest { 305 bytes community_id = 1; 306 repeated string chat_ids = 2; 307 } 308 309 message CommunitySharedAddressesRequest { 310 bytes community_id = 1; 311 } 312 313 message CommunitySharedAddressesResponse { 314 bytes community_id = 1; 315 repeated RevealedAccount revealed_accounts = 3; 316 }