-
Notifications
You must be signed in to change notification settings - Fork 12
/
clientrpc.proto
968 lines (813 loc) · 34.3 KB
/
clientrpc.proto
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
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
syntax = "proto3";
/******************************************************************************
* Services
*****************************************************************************/
option go_package = "github.com/companyzero/bisconrelay/clientrpc/types";
/* VersionService is the service information about the version of a running RPC
server. */
service VersionService {
/* Version returns version information about the server. */
rpc Version(VersionRequest) returns (VersionResponse);
/* KeepaliveStream returns a stream where the server continuously writes
keepalive events.
The stream only terminates if the client requests it or the connection to
the server is closed.
*/
rpc KeepaliveStream(KeepaliveStreamRequest) returns (stream KeepaliveEvent);
}
/* ChatService is the service for interacting with a BR client chat messages. */
service ChatService {
/* UserPublicIdentity returns public information from user's br client */
rpc UserPublicIdentity(PublicIdentityReq) returns (PublicIdentity);
/* PM sends a private message to a user of the client. */
rpc PM(PMRequest) returns (PMResponse);
/* PMStream returns a stream that gets PMs received by the client. */
rpc PMStream(PMStreamRequest) returns (stream ReceivedPM);
/* AckReceivedPM acks to the server that PMs up to a sequence ID have been
processed. */
rpc AckReceivedPM(AckRequest) returns (AckResponse);
/* GCM sends a message in a GC. */
rpc GCM(GCMRequest) returns (GCMResponse);
/* GCMStream returns a stream that gets GC messages received by the client. */
rpc GCMStream(GCMStreamRequest) returns (stream GCReceivedMsg);
/* AckReceivedGCM acks to the server that GCMs up to a sequence ID have been
processed. */
rpc AckReceivedGCM(AckRequest) returns (AckResponse);
/* MediateKX requests a transitive mediate KX with a mediator, towards a
target user. */
rpc MediateKX(MediateKXRequest) returns (MediateKXResponse);
/* KXStream returns a stream that gets notifications of completed KXs. Both
new users and KXs resulting from a reset trigger a new event in this
stream. */
rpc KXStream(KXStreamRequest) returns (stream KXCompleted);
/* AckKXCompleted acks to the server that KXs up to the sequence ID have been
processed. */
rpc AckKXCompleted(AckRequest) returns (AckResponse);
/* WriteNewInvite writes an invite to be sent (out-of-band) to an user to
perform KX with. */
rpc WriteNewInvite(WriteNewInviteRequest) returns (WriteNewInviteResponse);
/* AcceptInvite accepts an invite to kx with the user-provided invite. */
rpc AcceptInvite(AcceptInviteRequest) returns (AcceptInviteResponse);
/* SendFile sends a file to a user.
TODO: move to ContentService. */
rpc SendFile(SendFileRequest) returns (SendFileResponse);
/* UserNick returns the nick of an user. */
rpc UserNick(UserNickRequest) returns (UserNickResponse);
}
/* GCService offers GC-related management operations. */
service GCService {
/* InviteToGC invites an user to join a GC. The local user must have admin
privileges in the gc. */
rpc InviteToGC(InviteToGCRequest) returns (InviteToGCResponse);
/* AcceptGCInvite accepts an invitation to join a GC. */
rpc AcceptGCInvite(AcceptGCInviteRequest) returns (AcceptGCInviteResponse);
/* KickFromGC kicks an user from a GC. The local user must have admin
privileges in the GC. */
rpc KickFromGC(KickFromGCRequest) returns (KickFromGCResponse);
/* GetGC returns the full definition for a GC. */
rpc GetGC(GetGCRequest) returns (GetGCResponse);
/* List returns a list with all GCs. */
rpc List(ListGCsRequest) returns (ListGCsResponse);
/* ReceivedGCInvites returns a stream that gets sent invitations that remote
users make for the local client to join GCs. */
rpc ReceivedGCInvites(ReceivedGCInvitesRequest) returns (stream ReceivedGCInvite);
/* AckReceivedGCInvites acks received gc invite events. */
rpc AckReceivedGCInvites(AckRequest) returns (AckResponse);
/* MembersAdded returns a stream that gets sent events about members added
to GCs the local client participates in. */
rpc MembersAdded(GCMembersAddedRequest) returns (stream GCMembersAddedEvent);
/* AckMembersAdded acks received members added events. */
rpc AckMembersAdded(AckRequest) returns (AckResponse);
/* MembersRemoved returns a stream that gets sent events about members removed
from GCs the local client participates in. */
rpc MembersRemoved(GCMembersRemovedRequest) returns (stream GCMembersRemovedEvent);
/* AckMembersRemoved acks received members removed events. */
rpc AckMembersRemoved(AckRequest) returns (AckResponse);
/* JoinedGCs returns a stream that gets sent events about GCs the local client
has joined. */
rpc JoinedGCs(JoinedGCsRequest) returns (stream JoinedGCEvent);
/* AckJoinedGCs acks received joined gc events. */
rpc AckJoinedGCs(AckRequest) returns (AckResponse);
}
/* PostsService is the service for performing posts-related actions. */
service PostsService {
/* SubscribeToPosts makes the local client subscribe to a remote user's posts. */
rpc SubscribeToPosts(SubscribeToPostsRequest) returns (SubscribeToPostsResponse);
/* UnsubscribeToPosts makes the local client unsubscribe from a remote user's posts. */
rpc UnsubscribeToPosts(UnsubscribeToPostsRequest) returns (UnsubscribeToPostsResponse);
/* PostsStream creates a stream that receives updates about posts received
from remote users the local client is subscribed to. */
rpc PostsStream(PostsStreamRequest) returns (stream ReceivedPost);
/* AckReceivedPost acknowledges posts received up to a given sequence_id have
been processed. */
rpc AckReceivedPost(AckRequest) returns (AckResponse);
/* PostsStatusStream creates a stream that receives updates about post status
events (comments, replies, etc). */
rpc PostsStatusStream(PostsStatusStreamRequest) returns (stream ReceivedPostStatus);
/* AckReceivedPostStatus acknowledges post status received up to a given
sequence_id have been processed. */
rpc AckReceivedPostStatus(AckRequest) returns (AckResponse);
}
/* PaymentsService is the service to perform payment-related actions. */
service PaymentsService {
/* TipUser attempts to send a tip to a user. The user must be or come online
for this to complete. The request to tip is persisted and may continue
after a client restart. */
rpc TipUser(TipUserRequest) returns (TipUserResponse);
/* TipProgress starts a stream that receives events about the progress of
TipUser requests. Multiple events for the same request may be received. */
rpc TipProgress(TipProgressRequest) returns (stream TipProgressEvent);
/* AckTipProgress acknowledges events received up to a given
sequence_id have been processed. */
rpc AckTipProgress(AckRequest) returns (AckResponse);
}
/* ResourcesService is the service to perform resource and page related actions. */
service ResourcesService {
/* RequestsStream streams requests made to the local client by remote clients
for resources and pages. A clientrpc client may send the responses by using
the FulfillRequest call. */
rpc RequestsStream (ResourceRequestsStreamRequest) returns (stream ResourceRequestsStreamResponse);
/* FulfillRequest fulfills a previous request received from an user for a
local client resource. */
rpc FulfillRequest(FulfillResourceRequest) returns (FulfillResourceRequestResponse);
}
/* ContentService is the service to perform content (file transfer) related actions. */
service ContentService {
/* DownloadsCompletedStream streams completed downloads (file transfers) made
by the local client. This includes both downloads initiated by the local
client and pushed by remote clients. */
rpc DownloadsCompletedStream (DownloadsCompletedStreamRequest) returns (stream DownloadCompletedResponse);
/* AckDownloadCompleted acks download completed events. */
rpc AckDownloadCompleted(AckRequest) returns (AckResponse);
}
/******************************************************************************
* Messages
*****************************************************************************/
message VersionRequest {
}
/* VersionResponse is the information about the running RPC server. */
message VersionResponse {
/* app_version is the version of the application. */
string app_version = 1;
/* go_runtime is the Go version the server was compiled with. */
string go_runtime = 2;
/* app_name is the name of the underlying app running the server. */
string app_name = 3;
}
/* KeepaliveStreamRequest is the request for a new keepalive stream. */
message KeepaliveStreamRequest{
/* interval is how often to send the keepalive (in milliseconds).
A minimum of 1 second is imposed, regardless of the value passed as
interval. */
int64 interval = 1;
}
/* KeepaliveEvent is a single keepalive event. */
message KeepaliveEvent{
/* timestamp is the unix timestamp on the server, with second precision. */
int64 timestamp = 1;
}
/* AckRequest is a request to ack that a type of message up to a sequence ID has
been processed. */
message AckRequest {
/* sequence_id is the ID up to which messages have been processed. */
uint64 sequence_id = 1;
}
/* AckResponse is the response to an ack request. */
message AckResponse {}
/* PMRequest is a request to send a new private message. */
message PMRequest {
/* user is either the nick, alias or an hex-encoded user ID of the destination. */
string user = 1;
/* msg is the message to be sent. */
RMPrivateMessage msg = 2;
}
/* PMResponse is the response of the client for a new message. */
message PMResponse {}
/* PMStreamRequest is the request for a new private message reception stream.*/
message PMStreamRequest {
/* unacked_from specifies to the server the sequence_id of the last processed
PM. PMs received by the server that have a higher sequence_id will be
streamed back to the client. */
uint64 unacked_from = 1;
}
/* ReceivedPM is a private message received by the client. */
message ReceivedPM {
/* uid is the source user ID in raw format. */
bytes uid = 1;
/* nick is the source's nick or alias. */
string nick = 2;
/* msg is the received message payload. */
RMPrivateMessage msg = 3;
/* timestamp_ms is the timestamp from unix epoch with millisecond precision. */
int64 timestamp_ms = 4;
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 5;
}
/* GCMRequest is a request to send a GC message. */
message GCMRequest {
/* gc is either an hex-encoded GCID or a GC alias. */
string gc = 1;
/* msg is the text payload of the message. */
string msg = 2;
}
/* GCMResponse is the response to sending a GC message. */
message GCMResponse {}
/* GCMStreamRequest is a request to a stream of received GC messages. */
message GCMStreamRequest {
/* unacked_from specifies to the server the sequence_id of the last processed
GCM. GCMs received by the server that have a higher sequence_id will be
streamed back to the client. */
uint64 unacked_from = 1;
}
/* GCReceivedMsg is a GC message received from a remote user. */
message GCReceivedMsg {
/* uid is the source user ID. */
bytes uid = 1;
/* nick is the source user nick/alias. */
string nick = 2;
/* gc_alias is the local alias of the GC where the message was sent. */
string gc_alias = 3;
/* msg is the received message. */
RMGroupMessage msg = 4;
/* timestamp_ms is the server timestamp of the message with millisecond precision. */
int64 timestamp_ms = 5;
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 6;
}
/* SubscribeToPostsRequest is a request to subscribe to a remote user's posts. */
message SubscribeToPostsRequest {
/* user is the nick or hex-encoded ID of the user to subscribe to. */
string user = 1;
}
/* SubscribeToPostsResponse is the response to subscribing to a remote user's posts. */
message SubscribeToPostsResponse {}
/* UnsubscribeToPostsRequest is a request to unsubscribe from a remote user's posts. */
message UnsubscribeToPostsRequest {
/* user is the nick or hex-encoded ID of the user to unsubscribe from. */
string user = 1;
}
/* UnsubscribeToPostsResponse is the response to an unsubscribe request. */
message UnsubscribeToPostsResponse{}
/* PostSummary is the summary information about a post. */
message PostSummary {
/* id is the post ID (hash of the post metadata). */
bytes id = 1;
/* from is the id of the relayer of the post (who the local client received
the post from). */
bytes from = 2;
/* author_id is the id of the author of the post. */
bytes author_id = 3;
/* author_nick is the reported nick of the author of the post. */
string author_nick = 4;
/* date is the unix timestamp of the post. */
int64 date = 5;
/* last_status_ts is the timestamp of the last recorded status update of the
post. */
int64 last_status_ts = 6;
/* title is either the included or suggested title of the post. */
string title = 7;
}
/* PostsStreamRequest is the request to establish a stream of received post events. */
message PostsStreamRequest {
/* unacked_from specifies to the server the sequence_id of the last processed
post. Posts received by the server that have a higher sequence_id will be
streamed back to the client. */
uint64 unacked_from = 1;
}
/* ReceivedPost is a post received by the local client. */
message ReceivedPost {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* relayer_id is the id of the user we received the post from (may not be the
same as the author). */
bytes relayer_id = 2;
/* summary is the summary information about the post. */
PostSummary summary = 3;
/* post is the full post data. */
PostMetadata post = 4;
}
/* PostsStatusStreamRequest is a request to establish a stream that receives
post status updates received by the local client. */
message PostsStatusStreamRequest {
/* unacked_from specifies to the server the sequence_id of the last processed
Post Status. Post Status received by the server that have a higher
sequence_id will be streamed back to the client. */
uint64 unacked_from = 1;
}
/* ReceivedPostStatus is a post status update received by the local client. */
message ReceivedPostStatus{
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* relayer_id is the id of the sender of the client that sent the update. */
bytes relayer_id = 2;
/* post_id is the id of the corresponding post. */
bytes post_id = 3;
/* status_from is the original author of the status. */
bytes status_from = 4;
/* status is the full status data. */
PostMetadataStatus status = 5;
/* status_from_nick is the nick of the original author of the status. */
string status_from_nick = 6;
}
/* TipUserRequest is a request to tip a remote user. */
message TipUserRequest {
/* user is the remote user nick or hex-encoded ID. */
string user = 1;
/* dcr_amount is the DCR amount to send as tip. */
double dcr_amount = 2;
/* max_attempts is the number of max attempts to try to send the tip. */
int32 max_attempts = 3;
}
/* TipUserResponse is the response to a tip user request. */
message TipUserResponse{}
/* MediateKXRequest is the request to perform a transitive KX with a given
user. */
message MediateKXRequest{
/* mediator is the nick or hex ID of the mediator user (which must already be
KX'd with). */
string mediator = 1;
/* target is the hex ID of the target user to KX with. */
string target = 2;
}
/* MediateKXResponse is the response to a mediate KX request. */
message MediateKXResponse {}
/* KXStreamRequest is the request sent when obtaining a stream of KX notifications. */
message KXStreamRequest{
/* unacked_from specifies to the server the sequence_id of the last completed
KX. KXs completed by the server that have a higher sequence_id will be
streamed back to the client. */
uint64 unacked_from = 1;
}
/* KXCompleted is the information about a completed KX event. */
message KXCompleted {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* uid is the raw ID of the KX'd user. */
bytes uid = 2;
/* nick is the nick of the KX'd user. */
string nick = 3;
/* initial_rendezvous is the initial random RV the key exchange happened. */
bytes initial_rendezvous = 4;
}
/* WriteNewInviteRequest is the request to add a new invite. */
message WriteNewInviteRequest {
/* gc is the hex-encoded ID or the alias of the GC in the local client. */
string gc = 1;
/* fund_amount is how much to send as funds in the invite. If zero, no funds
are included. Amount is in atoms. */
uint64 fund_amount = 2;
};
/* WriteNewInviteResponse is an invite that can be sent (out-of-band) to an
user the local client wishes to KX with. */
message WriteNewInviteResponse {
/* invite_bytes is the raw invite. */
bytes invite_bytes = 1;
/* invite is the data contained in the raw invite. */
OOBPublicIdentityInvite invite = 2;
/* invite_key is the pre-paid invite key string that can be used to fetch the
invite from the server. */
string invite_key = 3;
};
/* AcceptInviteRequest is the request to accept an invite to KX with an user. */
message AcceptInviteRequest {
/* invite_bytes is the raw invite. */
bytes invite_bytes = 1;
};
/* AcceptInviteResponse is the response to accepting an invite to KX with an user. */
message AcceptInviteResponse {
/* invite is the decoded invite accepted. */
OOBPublicIdentityInvite invite = 1;
};
/* InviteToGCRequest is the request to invite an user to a GC. */
message InviteToGCRequest {
/* gc is the hex-encoded ID or the alias of the GC in the local client. */
string gc = 1;
/* user is the hex-encoded ID of the user or its nick. */
string user = 2;
};
/* InviteToGCResponse is the response to the request to invite an user to a GC. */
message InviteToGCResponse {};
/* AcceptGCInviteRequest is the request to accept an invite to join a GC. */
message AcceptGCInviteRequest {
/* invite_id is the id to use to join the invite. */
uint64 invite_id = 1;
};
/* AcceptGCInviteResponse is the response to accept an invite to join a GC. */
message AcceptGCInviteResponse {};
/* SendFileRequest is the request to send a file to a user. */
message SendFileRequest {
/* user is the hex-encoded ID of the user or its nick. */
string user = 1;
/* filename is the absolute path to the file. */
string filename = 2;
};
/* SendFileResponse is the response to sending a file to a user. */
message SendFileResponse {};
/* UserNickRequest is the request to fetch a user's nick. */
message UserNickRequest {
/* uid is the uid in raw bytes format. */
bytes uid = 1;
/* hex_uid is the uid in hex format. */
string hex_uid = 2;
}
/* UserNickResponse is the response to fetch a user's nick. */
message UserNickResponse {
/* nick is the nick of the user. */
string nick = 1;
}
/* KickFromGCRequest is the request to kick an user from a GC. */
message KickFromGCRequest {
/* gc is the hex-encoded ID or alias of the target GC. */
string gc = 1;
/* user is the hex-encoded ID or nick of the target user. */
string user = 2;
/* reason is an optional reason to send for the kick. */
string reason = 3;
};
/* KickFromGCResponse is the response to a kick request. */
message KickFromGCResponse {};
/* GetGCRequest is the request to get GC datails. */
message GetGCRequest {
/* gc is the hex-encoded ID or alias of the target GC. */
string gc = 1;
};
/* GetGCResponse is the response to a request to get GC details. */
message GetGCResponse {
/* gc is the gc definition. */
RMGroupList gc = 1;
};
/* ListGCsRequest is the request to list GC data. */
message ListGCsRequest {};
/* ListGCsResponse is the response to a request to list GC data. */
message ListGCsResponse {
/* GCInfo is the summary info for a GC. */
message GCInfo {
/* id is the unique GC ID. */
bytes id = 1;
/* name is the local name/alias for the GC. */
string name = 2;
/* version is the current version the GC definition is on. */
uint32 version = 3;
/* timestamp is the timestamp of the last modification to the GC definition. */
int64 timestamp = 4;
/* nb_members is the total number of members in the GC. */
uint32 nb_members = 5;
}
/* gcs is the list of GCs for the local client. */
repeated GCInfo gcs = 1;
};
/* ReceivedGCInvitesRequest is the request to start receiving GC invite events. */
message ReceivedGCInvitesRequest {
/* unacked_from specifies to the server the sequence_id of the last received
GC invite. Invites received by the server that have a higher sequence_id
will be streamed back to the client. */
uint64 unacked_from = 1;
};
/* ReceivedGCInvite is the event sent when an invitation to join a GC is received. */
message ReceivedGCInvite {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* inviter_uid is the UID of the user that sent the invitation. */
bytes inviter_uid = 2;
/* inviter_nick is the nick of the user that sent the invitation. */
string inviter_nick = 3;
/* invite_id is the unique invite ID that must be spcecified when accepting
the invitation. */
uint64 invite_id = 4;
/* invite is the invite information. */
RMGroupInvite invite = 5;
};
/* UserAndNick groups users and nicks when used in lists. */
message UserAndNick {
/* uid is the unique user ID. */
bytes uid = 1;
/* nick is the local alias or nick of the user. */
string nick = 2;
/* known flags whether the local client is KX'd with this user. */
bool known = 3;
}
/* GCMembersAddedRequest is the request sent to create a stream that receives
GC members added events. */
message GCMembersAddedRequest {
/* unacked_from specifies to the server the sequence_id of the last received
GC members added event. Events received by the server that have a higher
sequence_id will be streamed back to the client. */
uint64 unacked_from = 1;
};
/* GCMembersAddedEvent are events received when a GC has new members. */
message GCMembersAddedEvent {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* gc is the ID of the GC. */
bytes gc = 2;
/* gc_name is the local alias of the GC. */
string gc_name = 3;
/* users is the list of users added to the GC. */
repeated UserAndNick users = 4;
};
/* GCMembersRemovedRequest is the request to create a stream to receive GC
members removed events. */
message GCMembersRemovedRequest {
/* unacked_from specifies to the server the sequence_id of the last received
GC members removed event. Events received by the server that have a higher
sequence_id will be streamed back to the client. */
uint64 unacked_from = 1;
};
/* GCMembersRemovedEvent is an event received when members are removed from a GC. */
message GCMembersRemovedEvent {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* gc is the ID of the GC. */
bytes gc = 2;
/* gc_name is the local alias of the GC. */
string gc_name = 3;
/* users is the list of users removed from the GC. */
repeated UserAndNick users = 4;
};
/* JoinedGCsRequest is the request to create a stream that receives events about
GCs the local client has joined. */
message JoinedGCsRequest {
/* unacked_from specifies to the server the sequence_id of the last received
GC joined event. Events received by the server that have a higher
sequence_id will be streamed back to the client. */
uint64 unacked_from = 1;
};
/* JoinedGCEvent is the event received when the local client joins a GC. */
message JoinedGCEvent {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* gc is the GC definition. */
RMGroupList gc = 2;
};
/* TipProgressRequest is the request to create a stream that receives events
about the progress of TipUser requests. */
message TipProgressRequest {
/* unacked_from specifies to the server the sequence_id of the last received
tip progress event. Events received by the server that have a higher
sequence_id will be streamed back to the client. */
uint64 unacked_from = 1;
};
/* TipProgressEvent details the progress of a TipUser request. */
message TipProgressEvent{
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* uid is the User ID of the TipUser target. */
bytes uid = 2;
/* nick is the nick of the TipUser target. */
string nick = 3;
/* amount_matoms is the amount being tipped in milli-atoms. */
int64 amount_matoms = 4;
/* completed flags whether the TipUser request was successfully completed
(i.e. if the tip was paid). */
bool completed = 5;
/* attempt is the attempt number. */
int32 attempt = 6;
/* attempt_err is filled when the attempt to fetch an invoice or perform
the payment for a received invoice failed. */
string attempt_err = 7;
/* will_retry flags whether a new attempt to request an invoice and perform
a payment will be done or if no more attempts will happen. */
bool will_retry = 8;
};
/* ResourceRequestsStreamRequest is the request for a stream to receive resource
requests. */
message ResourceRequestsStreamRequest {}
/* ResourceRequestsStreamResponse is the a request made by a remote client for
one of the local client's resources. */
message ResourceRequestsStreamResponse {
/* id is an opaque ID to link requests and responses made through the clientrpc
interface. */
uint64 id = 1;
/* uid is the User ID of the client that requested the resource. */
bytes uid = 2;
/* nick is the nick of the client that requested the resource. */
string nick = 3;
/* request is the actual request made by the remote client. */
RMFetchResource request = 4;
}
/* FulfillResourceRequest fulfills a remote request for a local client resource. */
message FulfillResourceRequest {
/* id must be the corresponding request received by the clientrpc client. */
uint64 id = 1;
/* error_msg is an optional error message to fail the request with. */
string error_msg = 2;
/* response is the actual resource that should be sent to the remote client. */
RMFetchResourceReply response = 3;
}
/* FulfillResourceRequestResponse is the response to a FulfillResourceResquest
call. */
message FulfillResourceRequestResponse{
}
/* DownloadsCompletedRequest is the request sent when obtaining a stream of
completed downloads notifications. */
message DownloadsCompletedStreamRequest{
/* unacked_from specifies to the server the sequence_id of the last completed
download. Downloads completed by the server that have a higher sequence_id
will be streamed back to the client. */
uint64 unacked_from = 1;
}
/* DownloadCompletedResponse is the data about one completed file download. */
message DownloadCompletedResponse {
/* sequence_id is an opaque sequential ID. */
uint64 sequence_id = 1;
/* uid is the User ID of the client that sent the file. */
bytes uid = 2;
/* nick is the nick of the client that sent the resource. */
string nick = 3;
/* disk_path is the path of the file in the local client's disk. */
string disk_path = 4;
/* file_metadata is the metadata about the file. */
FileMetadata file_metadata = 5;
}
/******************************************************************************
* Routed RPC Compat
*****************************************************************************/
/* The message definitions below this point should all be compatible to their
corresponding definitions in the /rpc package. The intention is to eventually
replace the definitions there for this ones. In particular, the json_name
defined for each field MUST be the same as the existing one for the type. */
enum MessageMode {
/* MESSAGE_MODE_NORMAL is the standard mode for messages. */
MESSAGE_MODE_NORMAL = 0;
/* MESSAGE_MODE_ME are messages sent in the passive voice (i.e. with /me). */
MESSAGE_MODE_ME = 1;
}
/* RMPrivateMessage is the network-level routed private message.*/
message RMPrivateMessage {
/* message is the private message payload. */
string message = 1;
/* mode is the message mode. */
MessageMode mode = 2;
}
/* RMGroupMessage is the network-level routed group message. */
message RMGroupMessage {
/* id is the group chat id where the message was sent. */
bytes id = 1;
/* generation is the internal generation of the group chat metadata when the
sender sent this message. */
uint64 generation = 2;
/* message is the textual content. */
string message = 3;
/* mode is the mode of the message. */
MessageMode mode = 4;
}
/* PostMetadata is the network-level post data. */
message PostMetadata {
/* version defines the available fields within attributes. */
uint64 version = 1;
/* attributes defines the available post attributes. */
map<string, string> attributes = 2;
}
/* PostMetadataStatus is the network-level post status update data. */
message PostMetadataStatus {
/* version defines the available fields within attributes. */
uint64 version = 1;
/* from is the UID of the original status creator. */
string from = 2;
/* link is the ID of the post. */
string link = 3;
/* attributes is the list of post update attributes. */
map<string,string> attributes = 4;
}
/* PublicIdentityReq is a request to get PublicIdentity. */
message PublicIdentityReq {
}
/* PublicIdentity is the lowlevel public identity. */
message PublicIdentity {
/* name is the name of the user. */
string name = 1;
/* nick is the short name/alias of the user. */
string nick = 2;
/* sig_key is the signature key used to authenticate messages from the user. */
bytes sig_key = 3;
/* key is the NTRU public key of the user. */
bytes key = 4;
/* identity is the public ID of the user. */
bytes identity = 5;
/* digest is a hash of the user's public information. */
bytes digest = 6;
/* signature is a signature of the user's public information. */
bytes signature = 7;
}
/* InviteFunds is the lowlevel information about funds added to an invite. */
message InviteFunds {
/* tx is the hash of the transaction that includes the funds. */
string tx = 1;
/* index is the output index of the transaction that includes the funds. */
uint32 index = 2;
/* tree is the tree of the transaction that includes the funds. */
int32 tree = 3;
/* private_key is the private key needed to redeem the funds in the transaction. */
string private_key = 4 [json_name="private_key"];
/* height_hint is a height at or before the transaction that includes the funds
is mined in. */
uint32 height_hint = 5;
/* address is the public address that the funds were sent to. */
string address = 6;
}
/* OOBPublicIdentityInvite is an out-of-band invite to perform a KX. */
message OOBPublicIdentityInvite {
/* public is the public identity of the inviter. */
PublicIdentity public = 1;
/* initial_rendezvous is the initial random RV where key exchange will happen. */
bytes initial_rendezvous = 2 [json_name="initialrendezvous"];
/* reset_rendezvous is the inviter's reset RV in case of ratchet reset actions. */
bytes reset_rendezvous = 3 [json_name="resetrendezvous"];
/* funds are funds that may be included in the invite and are redeemable by
the invitee. */
InviteFunds funds = 4;
}
/* RMGroupInvite is the information about an invite to join a GC. */
message RMGroupInvite {
/* id is the ID of the GC. */
bytes id = 1;
/* name is the name of the GC. */
string name = 2;
/* token is a random number that must be sent back by the invitee to the inviter. */
uint64 token = 3;
/* description is a description of the GC. */
string description = 4;
/* expires is a timestamp for when the invitation expires. */
int64 expires = 5;
/* version is the version of the current definition of the GC. */
uint32 version = 6;
}
/* RMGroupList is the full definition of a GC. */
message RMGroupList {
/* id is the ID of the GC. */
bytes id = 1;
/* name is the name of the GC. */
string name = 2;
/* generation is a monotonically increasing count of GC changes. */
uint64 generation = 3;
/* timestamp is the timestamp for the last modification of the GC defintions. */
int64 timestamp = 4;
/* version is the GC rules version. */
uint32 version = 5;
/* members is the list of user IDs that are in the GC. */
repeated bytes members = 6;
/* extra_admins is the list of user IDs that are additional admins of the GC. */
repeated bytes extra_admins = 7 [json_name="extra_admins"];
}
/* RMFetchResource is the lowlevel request to fetch a resource. */
message RMFetchResource {
/* path is the resource's path (already split into segments). */
repeated string path = 1;
/* meta is metadata associated with the request. */
map<string,string> meta = 2;
/* tag is a unique tag that should be relayed back on the reply. */
uint64 tag = 3;
/* data is raw request data. */
bytes data = 4;
/* index is used in chunked/multipart requests. */
uint32 index = 5;
/* count is the total number of chunks in multipart requests. */
uint32 count = 6;
}
/* RMFetchResourceReply is the lowlevel resource response. */
message RMFetchResourceReply {
/* tag is the same as the request tag. */
uint64 tag = 1;
/* status is the general status of the response. */
uint32 status = 2;
/* meta is additional response metadata. */
map<string,string> meta = 3;
/* data is the raw response data. */
bytes data = 4;
/* index is used in chunked/multipart responses. */
uint32 index = 5;
/* count is the total number of chunks in multipart responses. */
uint32 count = 6;
}
/* FileManifest is metadata about a chunk of the file. */
message FileManifest {
/* index is the position of this manifest item on the file metadata manifest. */
uint64 index = 1;
/* size is the size of this chunk. */
uint64 size = 2;
/* hash is the hash of the chunk data. */
bytes hash = 3;
}
/* FileMetadata is metadata about a file in the file transfer subsystem. */
message FileMetadata {
/* version of the metadata. */
uint64 version = 1;
/* cost (in milliatoms) to download the file. */
uint64 cost = 2;
/* size (in bytes) of the file. */
uint64 size = 3;
/* directory where the file is stored in the source. */
string directory = 4;
/* filename of the file. */
string filename = 5;
/* description of the file. */
string description = 6;
/* hash of the file contents. */
string hash = 7;
/* manifest of the chunks that compose the file. */
repeated FileManifest manifest = 8;
/* signature of the file by the host. */
string signature = 9;
/* attributes of the file. */
map<string,string> attributes = 10;
}