github.com/status-im/status-go@v1.1.0/protocol/protobuf/pairing.proto (about) 1 syntax = "proto3"; 2 3 import "chat_identity.proto"; 4 import "sync_settings.proto"; 5 import 'application_metadata_message.proto'; 6 import 'communities.proto'; 7 import 'profile_showcase.proto'; 8 9 option go_package = "./;protobuf"; 10 package protobuf; 11 12 /* `FetchingBackedUpDataDetails` is used to describe how many messages a single backup data structure consists of */ 13 message FetchingBackedUpDataDetails { 14 uint32 data_number = 1; 15 uint32 total_number = 2; 16 } 17 18 message Backup { 19 uint64 clock = 1; 20 string id = 2; 21 22 /* this is what we already had */ 23 repeated SyncInstallationContactV2 contacts = 3; 24 repeated SyncInstallationCommunity communities = 4; 25 /* newly added details to be backed up to and fetched from waku */ 26 FetchingBackedUpDataDetails contactsDetails = 5; 27 FetchingBackedUpDataDetails communitiesDetails = 6; 28 BackedUpProfile profile = 7; 29 FetchingBackedUpDataDetails profileDetails = 8; 30 SyncSetting setting = 9; 31 FetchingBackedUpDataDetails settingsDetails = 10; 32 SyncKeypair keypair = 11; 33 FetchingBackedUpDataDetails keypairDetails = 12; 34 SyncAccount watchOnlyAccount = 13; 35 FetchingBackedUpDataDetails watchOnlyAccountDetails = 14; 36 repeated SyncChat chats = 15; 37 FetchingBackedUpDataDetails chatsDetails = 16; 38 } 39 40 message MultiAccount { 41 string name = 1; 42 int64 timestamp = 2; 43 string identicon = 3; 44 repeated ColorHash color_hash = 4; 45 int64 color_id = 5; 46 string keycard_pairing = 6; 47 string key_uid = 7; 48 repeated IdentityImage images = 8; 49 string customization_color = 9; 50 uint64 customization_color_clock = 10; 51 52 message ColorHash { 53 repeated int64 index = 1; 54 } 55 56 message IdentityImage { 57 string key_uid = 1; 58 string name = 2; 59 bytes payload = 3; 60 int64 width = 4; 61 int64 height = 5; 62 int64 filesize = 6; 63 int64 resize_target = 7; 64 uint64 clock = 8; 65 } 66 } 67 68 message LocalPairingPayload { 69 repeated Key keys = 1; 70 MultiAccount multiaccount = 2; 71 string password = 3; 72 string chatKey = 4; 73 string keycardPairings = 5; 74 75 message Key { 76 string name = 1; 77 bytes data = 2; 78 } 79 } 80 81 message LocalPairingPeerHello { 82 int32 pairing_version = 1; 83 bytes peer_id = 2; 84 string device_name = 3; 85 string device_type = 4; 86 bytes signature = 5; 87 } 88 89 message SyncPairInstallation { 90 uint64 clock = 1; 91 string installation_id = 2; 92 string device_type = 3; 93 string name = 4; 94 // following fields used for local pairing 95 uint32 version = 5; 96 } 97 98 message SyncInstallationContactV2 { 99 uint64 last_updated_locally = 1; 100 string id = 2; 101 string profile_image = 3; 102 string ens_name = 4; 103 uint64 last_updated = 5; 104 repeated string system_tags = 6; 105 string local_nickname = 7; 106 bool added = 9; 107 bool blocked = 10; 108 bool muted = 11; 109 bool removed = 12; 110 bool has_added_us = 13; 111 int64 verification_status = 14; 112 int64 trust_status = 15; 113 int64 contact_request_local_state = 16; 114 int64 contact_request_local_clock = 17; 115 int64 contact_request_remote_state = 18; 116 int64 contact_request_remote_clock = 19; 117 string display_name = 20; 118 uint32 customization_color = 21; 119 } 120 121 message SyncInstallationAccount { 122 uint64 clock = 1; 123 string profile_image = 2; 124 uint64 last_updated = 3; 125 } 126 127 message SyncInstallationCommunity { 128 uint64 clock = 1; 129 bytes id = 2; 130 // Don't sync private_key because we want to have only one control node 131 bytes private_key = 3 [deprecated = true]; 132 bytes description = 4; 133 bool joined = 5; 134 bool verified = 6; 135 bool muted = 7; 136 repeated SyncCommunityRequestsToJoin requests_to_join = 8; 137 SyncCommunitySettings settings = 9; 138 bool encrypted = 10; 139 bool spectated = 11; 140 // Kept for backward compatibility 141 bytes encryption_keys_v1 = 12 [deprecated = true]; 142 SyncCommunityControlNode control_node = 13; 143 int64 joined_at = 14; 144 int64 last_opened_at = 15; 145 repeated bytes encryption_keys_v2 = 16; 146 } 147 148 message SyncCommunityRequestsToJoin { 149 bytes id = 1; 150 string public_key = 2; 151 uint64 clock = 3; 152 string ens_name = 4; 153 string chat_id = 5; 154 bytes community_id = 6; 155 uint64 state = 7; 156 repeated RevealedAccount revealed_accounts = 8; 157 uint32 customization_color = 9; 158 bool share_future_addresses = 10; 159 } 160 161 message SyncCommunityControlNode { 162 // Lamport timestamp of control node change 163 uint64 clock = 1; 164 165 // The device id of the control node 166 // Empty if there is no control node 167 string installation_id = 2; 168 } 169 170 message SyncChat { 171 string id = 1; 172 uint32 chat_type = 2; 173 string name = 3; 174 repeated MembershipUpdateEvents membershipUpdateEvents = 4; 175 bool active = 5; 176 uint64 clock = 6; 177 bool muted = 7; 178 } 179 180 message MembershipUpdateEvents { 181 uint64 clock = 1; 182 uint32 type = 2; 183 repeated string members = 3; 184 string name = 4; 185 bytes signature = 5; 186 string chat_id = 6; 187 string from = 7; 188 bytes raw_payload = 8; 189 string color = 9; 190 bytes image = 10; 191 } 192 193 message SyncChatRemoved { 194 uint64 clock = 1; 195 string id = 2; 196 } 197 198 message SyncChatMessagesRead { 199 uint64 clock = 1; 200 string id = 2; 201 } 202 203 message SyncActivityCenterRead { 204 uint64 clock = 1; 205 repeated bytes ids = 2; 206 } 207 208 message SyncActivityCenterAccepted { 209 uint64 clock = 1; 210 repeated bytes ids = 2; 211 } 212 213 message SyncActivityCenterDismissed { 214 uint64 clock = 1; 215 repeated bytes ids = 2; 216 } 217 218 message SyncActivityCenterDeleted { 219 uint64 clock = 1; 220 repeated bytes ids = 2; 221 } 222 223 message SyncActivityCenterUnread { 224 uint64 clock = 1; 225 repeated bytes ids = 2; 226 } 227 228 message SyncActivityCenterCommunityRequestDecision { 229 uint64 clock = 1; 230 bytes id = 2; 231 uint32 membership_status = 3; 232 enum community_request_decision { 233 ACCEPTED = 0; 234 DECLINED = 1; 235 } 236 community_request_decision decision = 4; 237 } 238 239 message SyncBookmark { 240 uint64 clock = 1; 241 string url = 2; 242 string name = 3; 243 string image_url = 4; 244 bool removed = 5; 245 uint64 deleted_at = 6; 246 } 247 248 message SyncEnsUsernameDetail { 249 uint64 clock = 1; 250 string username = 2; 251 uint64 chain_id = 3; 252 bool removed = 4; 253 } 254 255 message SyncClearHistory { 256 string chat_id = 1; 257 uint64 cleared_at = 2; 258 } 259 260 message SyncProfilePicture { 261 string name = 1; 262 bytes payload = 2; 263 uint32 width = 3; 264 uint32 height = 4; 265 uint32 file_size = 5; 266 uint32 resize_target = 6; 267 uint64 clock = 7; 268 } 269 270 message SyncProfilePictures { 271 string key_uid = 1; 272 repeated SyncProfilePicture pictures = 2; 273 } 274 275 message SyncAccount { 276 uint64 clock = 1; 277 bytes address = 2; 278 string key_uid = 3; 279 bytes public_key = 4; 280 string path = 5; 281 string name = 6; 282 string color_id = 7; 283 string emoji = 8; 284 bool wallet = 9; 285 bool chat = 10; 286 bool hidden = 11; 287 bool removed = 12; 288 int64 position = 13; 289 string prodPreferredChainIDs = 14; 290 string testPreferredChainIDs = 15; 291 string operable = 16; 292 } 293 294 message SyncKeypair { 295 uint64 clock = 1; 296 string key_uid = 2; 297 string name = 3; 298 string type = 4; 299 string derived_from = 5; 300 uint64 last_used_derivation_index = 6; 301 string synced_from = 7; 302 repeated SyncAccount accounts = 8; 303 repeated SyncKeycard keycards = 9; 304 bool removed = 10; 305 bytes keycard_pairings = 11; 306 } 307 308 // this message is used for syncing accounts positions only, for syncing any other info consider 309 // `SyncAccount` or `SyncKeypair` message 310 message SyncAccountsPositions { 311 uint64 clock = 1; 312 repeated SyncAccount accounts = 2; 313 } 314 315 message SyncSavedAddress { 316 reserved 3; 317 reserved 4; 318 bytes address = 1; 319 string name = 2; 320 bool removed = 5; 321 uint64 update_clock = 7; 322 string chain_short_names = 8; 323 string ens = 9; 324 bool is_test = 10; 325 string color = 11; 326 } 327 328 message SyncCommunitySettings { 329 uint64 clock = 1; 330 string community_id = 2; 331 bool history_archive_support_enabled = 3; 332 } 333 334 message SyncTrustedUser { 335 uint64 clock = 1; 336 string id = 2; 337 TrustStatus status = 3; 338 339 enum TrustStatus { 340 UNKNOWN = 0; 341 TRUSTED = 1; 342 UNTRUSTWORTHY = 2; 343 } 344 } 345 346 message SyncVerificationRequest { 347 uint64 clock = 1; 348 string from = 2; 349 string to = 3; 350 string challenge = 4; 351 uint64 requested_at = 5; 352 string response = 6; 353 uint64 replied_at = 7; 354 VerificationStatus verification_status = 8; 355 string id = 9; 356 357 enum VerificationStatus { 358 UNKNOWN = 0; 359 PENDING = 1; 360 ACCEPTED = 2; 361 DECLINED = 3; 362 CANCELED = 4; 363 } 364 } 365 366 message SyncContactRequestDecision { 367 uint64 clock = 1; 368 /* common.Message.ID */ 369 string requestId = 2; 370 DecisionStatus decision_status = 3; 371 /* 372 The `contactId` is solely utilized during local pair synchronization. 373 We cannot use `requestId` to locate the corresponding UserMessage and AC notification in the database 374 because UserMessages are not synchronized. Specifically, during local pair sync, `contactId` is essential 375 for managing AC notifications generated by `syncContactRequestForInstallationContact`. These notifications 376 undergo special processing via the function `defaultContactRequestID`, necessitating the use of `contactId` 377 to correctly link related records. 378 */ 379 string contactId = 4; 380 381 382 enum DecisionStatus { 383 ACCEPTED = 0; 384 DECLINED = 1; 385 } 386 } 387 388 /* `BackedUpProfile` is used to describe profile of logged in user */ 389 message BackedUpProfile { 390 string key_uid = 1; 391 string display_name = 2; 392 uint64 display_name_clock = 3; 393 repeated SyncProfilePicture pictures = 4; 394 SyncSocialLinks social_links = 5 [deprecated = true]; 395 repeated SyncEnsUsernameDetail ens_username_details = 6; 396 SyncProfileShowcasePreferences profile_showcase_preferences = 7; 397 } 398 399 message RawMessage { 400 bytes payload = 1; 401 ApplicationMetadataMessage.Type messageType = 2; 402 } 403 404 message SyncRawMessage { 405 repeated RawMessage rawMessages = 1; 406 407 // we need these to be able to login 408 bytes subAccountsJsonBytes = 2; 409 bytes settingsJsonBytes = 3; 410 } 411 412 message SyncKeycard { 413 string uid = 1; 414 string name = 2; 415 bool locked = 3; 416 string key_uid = 4; 417 repeated bytes addresses = 5; 418 uint64 position = 6; 419 } 420 421 message SyncSocialLinks { 422 repeated SocialLink social_links = 1; 423 uint64 clock = 2; 424 option deprecated = true; 425 } 426 427 message SyncAccountCustomizationColor { 428 uint64 updated_at = 1; 429 string customization_color = 2; 430 string key_uid = 3; 431 } 432 433 message TokenPreferences { 434 string key = 1; 435 int64 position = 2; 436 int64 groupPosition = 3; 437 bool visible = 4; 438 string communityId = 5; 439 } 440 441 message SyncTokenPreferences { 442 uint64 clock = 1; 443 bool testnet = 2; 444 repeated TokenPreferences preferences = 3; 445 } 446 447 message CollectiblePreferences { 448 int64 type = 1; 449 string key = 2; 450 int64 position = 3; 451 bool visible = 4; 452 } 453 454 message SyncCollectiblePreferences { 455 uint64 clock = 1; 456 bool testnet = 2; 457 repeated CollectiblePreferences preferences = 3; 458 }