1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
// Namespace: "chat.1"
// Protocol: "chatUi"
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Serialize, Deserialize};
use serde_repr::{Deserialize_repr, Serialize_repr};use super::*;

use crate::protocol::keybase1;
use crate::protocol::gregor1;
use crate::protocol::stellar1;
use super::common::*;
use super::unfurl::*;
use super::commands::*;
#[derive(Serialize, Deserialize, Debug)]
pub struct UIPagination {
  #[serde(default)]
  pub next: Option<String>,
  #[serde(default)]
  pub previous: Option<String>,
  pub num: Option<i32>,
  #[serde(default)]
  pub last: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UnverifiedInboxUIItemMetadata {
  #[serde(default)]
  pub channelName: Option<String>,
  #[serde(default)]
  pub headline: Option<String>,
  #[serde(default)]
  pub headlineDecorated: Option<String>,
  #[serde(default)]
  pub snippet: Option<String>,
  #[serde(default)]
  pub snippetDecoration: Option<String>,
  #[serde(default)]
  pub writerNames: Option<Vec<String>>,
  #[serde(default)]
  pub resetParticipants: Option<Vec<String>>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UnverifiedInboxUIItem {
  #[serde(default)]
  pub convID: Option<String>,
  pub topicType: Option<TopicType>,
  #[serde(default)]
  pub isPublic: Option<bool>,
  #[serde(default)]
  pub name: Option<String>,
  pub visibility: Option<keybase1::TLFVisibility>,
  pub status: Option<ConversationStatus>,
  pub membersType: Option<ConversationMembersType>,
  pub memberStatus: Option<ConversationMemberStatus>,
  pub teamType: Option<TeamType>,
  pub notifications: Option<ConversationNotificationInfo>,
  pub time: Option<gregor1::Time>,
  pub version: Option<ConversationVers>,
  pub localVersion: Option<LocalConversationVers>,
  pub convRetention: Option<RetentionPolicy>,
  pub teamRetention: Option<RetentionPolicy>,
  pub maxMsgID: Option<MessageID>,
  pub maxVisibleMsgID: Option<MessageID>,
  pub readMsgID: Option<MessageID>,
  pub localMetadata: Option<UnverifiedInboxUIItemMetadata>,
  pub draft: Option<String>,
  pub finalizeInfo: Option<ConversationFinalizeInfo>,
  #[serde(default)]
  pub supersedes: Option<Vec<ConversationMetadata>>,
  #[serde(default)]
  pub supersededBy: Option<Vec<ConversationMetadata>>,
  pub commands: Option<ConversationCommandGroups>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UnverifiedInboxUIItems {
  #[serde(default)]
  pub items: Option<Vec<UnverifiedInboxUIItem>>,
  pub pagination: Option<UIPagination>,
  #[serde(default)]
  pub offline: Option<bool>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UIParticipantType {
  None_0,
  User_1, // Keybase or SBS
  Phoneno_2,
  Email_3,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIParticipant {
  #[serde(rename = "type")]
  pub ty: Option<UIParticipantType>,
  #[serde(default)]
  pub assertion: Option<String>,
  pub fullName: Option<String>,
  pub contactName: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct InboxUIItem {
  #[serde(default)]
  pub convID: Option<String>,
  pub topicType: Option<TopicType>,
  #[serde(default)]
  pub isPublic: Option<bool>,
  #[serde(default)]
  pub isEmpty: Option<bool>,
  #[serde(default)]
  pub name: Option<String>,
  #[serde(default)]
  pub snippet: Option<String>,
  #[serde(default)]
  pub snippetDecoration: Option<String>,
  #[serde(default)]
  pub channel: Option<String>,
  #[serde(default)]
  pub headline: Option<String>,
  #[serde(default)]
  pub headlineDecorated: Option<String>,
  pub draft: Option<String>,
  pub visibility: Option<keybase1::TLFVisibility>,
  #[serde(default)]
  pub participants: Option<Vec<UIParticipant>>,
  #[serde(default)]
  pub resetParticipants: Option<Vec<String>>,
  pub status: Option<ConversationStatus>,
  pub membersType: Option<ConversationMembersType>,
  pub memberStatus: Option<ConversationMemberStatus>,
  pub teamType: Option<TeamType>,
  pub time: Option<gregor1::Time>,
  pub notifications: Option<ConversationNotificationInfo>,
  pub creatorInfo: Option<ConversationCreatorInfoLocal>,
  pub version: Option<ConversationVers>,
  pub localVersion: Option<LocalConversationVers>,
  pub maxMsgID: Option<MessageID>,
  pub maxVisibleMsgID: Option<MessageID>,
  pub readMsgID: Option<MessageID>,
  pub convRetention: Option<RetentionPolicy>,
  pub teamRetention: Option<RetentionPolicy>,
  pub convSettings: Option<ConversationSettingsLocal>,
  pub finalizeInfo: Option<ConversationFinalizeInfo>,
  #[serde(default)]
  pub supersedes: Option<Vec<ConversationMetadata>>,
  #[serde(default)]
  pub supersededBy: Option<Vec<ConversationMetadata>>,
  pub commands: Option<ConversationCommandGroups>,
  pub botCommands: Option<ConversationCommandGroups>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct InboxUIItemError {
  pub typ: Option<ConversationErrorType>,
  #[serde(default)]
  pub message: Option<String>,
  #[serde(default)]
  pub unverifiedTLFName: Option<String>,
  pub rekeyInfo: Option<ConversationErrorRekey>,
  pub remoteConv: Option<UnverifiedInboxUIItem>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct InboxUIItems {
  #[serde(default)]
  pub items: Option<Vec<InboxUIItem>>,
  pub pagination: Option<UIPagination>,
  #[serde(default)]
  pub offline: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIChannelNameMention {
  #[serde(default)]
  pub name: Option<String>,
  #[serde(default)]
  pub convID: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIAssetUrlInfo {
  #[serde(default)]
  pub previewUrl: Option<String>,
  #[serde(default)]
  pub fullUrl: Option<String>,
  #[serde(default)]
  pub fullUrlCached: Option<bool>,
  #[serde(default)]
  pub mimeType: Option<String>,
  pub videoDuration: Option<String>,
  #[serde(default)]
  pub inlineVideoPlayable: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIPaymentInfo {
  pub accountID: Option<stellar1::AccountID>,
  #[serde(default)]
  pub amountDescription: Option<String>,
  #[serde(default)]
  pub worth: Option<String>,
  #[serde(default)]
  pub worthAtSendTime: Option<String>,
  pub delta: Option<stellar1::BalanceDelta>,
  #[serde(default)]
  pub note: Option<String>,
  pub paymentID: Option<stellar1::PaymentID>,
  pub status: Option<stellar1::PaymentStatus>,
  #[serde(default)]
  pub statusDescription: Option<String>,
  #[serde(default)]
  pub statusDetail: Option<String>,
  #[serde(default)]
  pub showCancel: Option<bool>,
  #[serde(default)]
  pub fromUsername: Option<String>,
  #[serde(default)]
  pub toUsername: Option<String>,
  #[serde(default)]
  pub sourceAmount: Option<String>,
  pub sourceAsset: Option<stellar1::Asset>,
  #[serde(default)]
  pub issuerDescription: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIRequestInfo {
  #[serde(default)]
  pub amount: Option<String>,
  #[serde(default)]
  pub amountDescription: Option<String>,
  pub asset: Option<stellar1::Asset>,
  pub currency: Option<stellar1::OutsideCurrencyCode>,
  #[serde(default)]
  pub worthAtRequestTime: Option<String>,
  pub status: Option<stellar1::RequestStatus>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIMessageUnfurlInfo {
  pub unfurlMessageID: Option<MessageID>,
  #[serde(default)]
  pub url: Option<String>,
  pub unfurl: Option<UnfurlDisplay>,
  #[serde(default)]
  pub isCollapsed: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIMessageValid {
  pub messageID: Option<MessageID>,
  pub ctime: Option<gregor1::Time>,
  pub outboxID: Option<String>,
  pub messageBody: Option<MessageBody>,
  pub decoratedTextBody: Option<String>,
  #[serde(default)]
  pub bodySummary: Option<String>,
  #[serde(default)]
  pub senderUsername: Option<String>,
  #[serde(default)]
  pub senderDeviceName: Option<String>,
  #[serde(default)]
  pub senderDeviceType: Option<String>,
  pub senderUID: Option<gregor1::UID>,
  pub senderDeviceID: Option<gregor1::DeviceID>,
  #[serde(default)]
  pub superseded: Option<bool>,
  pub assetUrlInfo: Option<UIAssetUrlInfo>,
  pub senderDeviceRevokedAt: Option<gregor1::Time>,
  #[serde(default)]
  pub atMentions: Option<Vec<String>>,
  pub channelMention: Option<ChannelMention>,
  #[serde(default)]
  pub channelNameMentions: Option<Vec<UIChannelNameMention>>,
  #[serde(default)]
  pub isEphemeral: Option<bool>,
  #[serde(default)]
  pub isEphemeralExpired: Option<bool>,
  pub explodedBy: Option<String>,
  pub etime: Option<gregor1::Time>,
  pub reactions: Option<ReactionMap>,
  #[serde(default)]
  pub hasPairwiseMacs: Option<bool>,
  #[serde(default)]
  pub paymentInfos: Option<Vec<UIPaymentInfo>>,
  pub requestInfo: Option<UIRequestInfo>,
  #[serde(default)]
  pub unfurls: Option<Vec<UIMessageUnfurlInfo>>,
  #[serde(default)]
  pub isCollapsed: Option<bool>,
  pub flipGameID: Option<String>,
  #[serde(default)]
  pub isDeleteable: Option<bool>,
  #[serde(default)]
  pub isEditable: Option<bool>,
  pub replyTo: Option<Box<UIMessage>>,
  pub botUID: Option<gregor1::UID>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIMessageOutbox {
  pub state: Option<OutboxState>,
  #[serde(default)]
  pub outboxID: Option<String>,
  pub messageType: Option<MessageType>,
  #[serde(default)]
  pub body: Option<String>,
  pub decoratedTextBody: Option<String>,
  pub ctime: Option<gregor1::Time>,
  pub ordinal: Option<f64>,
  #[serde(default)]
  pub isEphemeral: Option<bool>,
  pub flipGameID: Option<String>,
  pub replyTo: Option<Box<UIMessage>>,
  #[serde(default)]
  pub filename: Option<String>,
  #[serde(default)]
  pub title: Option<String>,
  pub preview: Option<MakePreviewRes>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum MessageUnboxedState {
  Valid_1,
  Error_2,
  Outbox_3,
  Placeholder_4,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum UIMessage {
  Valid {valid: UIMessageValid},
  Error {error: MessageUnboxedError},
  Outbox {outbox: UIMessageOutbox},
  Placeholder {placeholder: MessageUnboxedPlaceholder},
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIMessages {
  #[serde(default)]
  pub messages: Option<Vec<Box<UIMessage>>>,
  pub pagination: Option<UIPagination>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UITeamMention {
  #[serde(default)]
  pub inTeam: Option<bool>,
  #[serde(default)]
  pub open: Option<bool>,
  pub description: Option<String>,
  pub numMembers: Option<i32>,
  #[serde(default)]
  pub publicAdmins: Option<Vec<String>>,
  pub convID: Option<String>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UITextDecorationTyp {
  Payment_0,
  Atmention_1,
  Channelnamemention_2,
  Maybemention_3,
  Link_4,
  Mailto_5,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UIMaybeMentionStatus {
  Unknown_0,
  User_1,
  Team_2,
  Nothing_3,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UILinkDecoration {
  #[serde(default)]
  pub display: Option<String>,
  #[serde(default)]
  pub url: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum UIMaybeMentionInfo {
  Unknown {unknown: ()},
  User {user: ()},
  Team {team: UITeamMention},
  Nothing {nothing: ()},
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum UITextDecoration {
  Payment {payment: TextPayment},
  Atmention {atmention: String},
  Channelnamemention {channelnamemention: UIChannelNameMention},
  Maybemention {maybemention: MaybeMention},
  Link {link: UILinkDecoration},
  Mailto {mailto: UILinkDecoration},
}













#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UIChatThreadStatusTyp {
  None_0,
  Server_1,
  Validating_2,
  Validated_3,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum UIChatThreadStatus {
  None {none: ()},
  Server {server: ()},
  Validating {validating: i32},
  Validated {validated: ()},
}











#[derive(Serialize, Deserialize, Debug)]
pub struct UIChatSearchConvHit {
  #[serde(default)]
  pub convID: Option<String>,
  pub teamType: Option<TeamType>,
  #[serde(default)]
  pub name: Option<String>,
  pub mtime: Option<gregor1::Time>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIChatSearchConvHits {
  #[serde(default)]
  pub hits: Option<Vec<UIChatSearchConvHit>>,
  #[serde(default)]
  pub unreadMatches: Option<bool>,
}













#[derive(Serialize, Deserialize, Debug)]
pub struct UIChatPayment {
  #[serde(default)]
  pub username: Option<String>,
  #[serde(default)]
  pub fullName: Option<String>,
  #[serde(default)]
  pub xlmAmount: Option<String>,
  pub error: Option<String>,
  pub displayAmount: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UIChatPaymentSummary {
  #[serde(default)]
  pub xlmTotal: Option<String>,
  #[serde(default)]
  pub displayTotal: Option<String>,
  #[serde(default)]
  pub payments: Option<Vec<UIChatPayment>>,
}









#[derive(Serialize, Deserialize, Debug)]
pub struct GiphySearchResult {
  #[serde(default)]
  pub targetUrl: Option<String>,
  #[serde(default)]
  pub previewUrl: Option<String>,
  pub previewWidth: Option<i32>,
  pub previewHeight: Option<i32>,
  #[serde(default)]
  pub previewIsVideo: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GiphySearchResults {
  #[serde(default)]
  pub results: Option<Vec<GiphySearchResult>>,
  #[serde(default)]
  pub galleryUrl: Option<String>,
}







#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UICoinFlipPhase {
  Commitment_0,
  Reveals_1,
  Complete_2,
  Error_3,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UICoinFlipErrorParticipant {
  #[serde(default)]
  pub user: Option<String>,
  #[serde(default)]
  pub device: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UICoinFlipAbsenteeError {
  #[serde(default)]
  pub absentees: Option<Vec<UICoinFlipErrorParticipant>>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UICoinFlipErrorTyp {
  Generic_0,
  Absentee_1,
  Timeout_2,
  Aborted_3,
  Dupreg_4,
  Dupcommitcomplete_5,
  Dupreveal_6,
  Commitmismatch_7,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum UICoinFlipError {
  Generic {generic: String},
  Absentee {absentee: UICoinFlipAbsenteeError},
  Timeout {timeout: ()},
  Aborted {aborted: ()},
  Dupreg {dupreg: UICoinFlipErrorParticipant},
  Dupcommitcomplete {dupcommitcomplete: UICoinFlipErrorParticipant},
  Dupreveal {dupreveal: UICoinFlipErrorParticipant},
  Commitmismatch {commitmismatch: UICoinFlipErrorParticipant},
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UICoinFlipResultTyp {
  Number_0,
  Shuffle_1,
  Deck_2,
  Hands_3,
  Coin_4,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UICoinFlipHand {
  #[serde(default)]
  pub target: Option<String>,
  #[serde(default)]
  pub hand: Option<Vec<i32>>,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum UICoinFlipResult {
  Number {number: String},
  Shuffle {shuffle: Vec<String>},
  Deck {deck: Vec<i32>},
  Hands {hands: Vec<UICoinFlipHand>},
  Coin {coin: bool},
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UICoinFlipParticipant {
  #[serde(default)]
  pub uid: Option<String>,
  #[serde(default)]
  pub deviceID: Option<String>,
  #[serde(default)]
  pub username: Option<String>,
  #[serde(default)]
  pub deviceName: Option<String>,
  #[serde(default)]
  pub commitment: Option<String>,
  pub reveal: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct UICoinFlipStatus {
  #[serde(default)]
  pub gameID: Option<String>,
  pub phase: Option<UICoinFlipPhase>,
  #[serde(default)]
  pub progressText: Option<String>,
  #[serde(default)]
  pub resultText: Option<String>,
  #[serde(default)]
  pub commitmentVisualization: Option<String>,
  #[serde(default)]
  pub revealVisualization: Option<String>,
  #[serde(default)]
  pub participants: Option<Vec<UICoinFlipParticipant>>,
  pub errorInfo: Option<UICoinFlipError>,
  pub resultInfo: Option<UICoinFlipResult>,
}



#[derive(Serialize, Deserialize, Debug)]
pub struct UICommandMarkdown {
  #[serde(default)]
  pub body: Option<String>,
  pub title: Option<String>,
}







// LINT: @lint("ignore")
pub type LocationWatchID = u64;





#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UICommandStatusDisplayTyp {
  Status_0,
  Warning_1,
  Error_2,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UICommandStatusActionTyp {
  Appsettings_0,
}



#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum UIBotCommandsUpdateStatus {
  Uptodate_0,
  Updating_1,
  Failed_2,
  Blank_3,
}