@libp2p/daemon-protocol 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1528 +0,0 @@
1
- import * as $protobuf from "protobufjs";
2
- /** Properties of a Request. */
3
- export interface IRequest {
4
-
5
- /** Request type */
6
- type: Request.Type;
7
-
8
- /** Request connect */
9
- connect?: (IConnectRequest|null);
10
-
11
- /** Request streamOpen */
12
- streamOpen?: (IStreamOpenRequest|null);
13
-
14
- /** Request streamHandler */
15
- streamHandler?: (IStreamHandlerRequest|null);
16
-
17
- /** Request dht */
18
- dht?: (IDHTRequest|null);
19
-
20
- /** Request connManager */
21
- connManager?: (IConnManagerRequest|null);
22
-
23
- /** Request disconnect */
24
- disconnect?: (IDisconnectRequest|null);
25
-
26
- /** Request pubsub */
27
- pubsub?: (IPSRequest|null);
28
-
29
- /** Request peerStore */
30
- peerStore?: (IPeerstoreRequest|null);
31
- }
32
-
33
- /** Represents a Request. */
34
- export class Request implements IRequest {
35
-
36
- /**
37
- * Constructs a new Request.
38
- * @param [p] Properties to set
39
- */
40
- constructor(p?: IRequest);
41
-
42
- /** Request type. */
43
- public type: Request.Type;
44
-
45
- /** Request connect. */
46
- public connect?: (IConnectRequest|null);
47
-
48
- /** Request streamOpen. */
49
- public streamOpen?: (IStreamOpenRequest|null);
50
-
51
- /** Request streamHandler. */
52
- public streamHandler?: (IStreamHandlerRequest|null);
53
-
54
- /** Request dht. */
55
- public dht?: (IDHTRequest|null);
56
-
57
- /** Request connManager. */
58
- public connManager?: (IConnManagerRequest|null);
59
-
60
- /** Request disconnect. */
61
- public disconnect?: (IDisconnectRequest|null);
62
-
63
- /** Request pubsub. */
64
- public pubsub?: (IPSRequest|null);
65
-
66
- /** Request peerStore. */
67
- public peerStore?: (IPeerstoreRequest|null);
68
-
69
- /** Request _connect. */
70
- public _connect?: "connect";
71
-
72
- /** Request _streamOpen. */
73
- public _streamOpen?: "streamOpen";
74
-
75
- /** Request _streamHandler. */
76
- public _streamHandler?: "streamHandler";
77
-
78
- /** Request _dht. */
79
- public _dht?: "dht";
80
-
81
- /** Request _connManager. */
82
- public _connManager?: "connManager";
83
-
84
- /** Request _disconnect. */
85
- public _disconnect?: "disconnect";
86
-
87
- /** Request _pubsub. */
88
- public _pubsub?: "pubsub";
89
-
90
- /** Request _peerStore. */
91
- public _peerStore?: "peerStore";
92
-
93
- /**
94
- * Encodes the specified Request message. Does not implicitly {@link Request.verify|verify} messages.
95
- * @param m Request message or plain object to encode
96
- * @param [w] Writer to encode to
97
- * @returns Writer
98
- */
99
- public static encode(m: IRequest, w?: $protobuf.Writer): $protobuf.Writer;
100
-
101
- /**
102
- * Decodes a Request message from the specified reader or buffer.
103
- * @param r Reader or buffer to decode from
104
- * @param [l] Message length if known beforehand
105
- * @returns Request
106
- * @throws {Error} If the payload is not a reader or valid buffer
107
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
108
- */
109
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Request;
110
-
111
- /**
112
- * Creates a Request message from a plain object. Also converts values to their respective internal types.
113
- * @param d Plain object
114
- * @returns Request
115
- */
116
- public static fromObject(d: { [k: string]: any }): Request;
117
-
118
- /**
119
- * Creates a plain object from a Request message. Also converts values to other types if specified.
120
- * @param m Request
121
- * @param [o] Conversion options
122
- * @returns Plain object
123
- */
124
- public static toObject(m: Request, o?: $protobuf.IConversionOptions): { [k: string]: any };
125
-
126
- /**
127
- * Converts this Request to JSON.
128
- * @returns JSON object
129
- */
130
- public toJSON(): { [k: string]: any };
131
- }
132
-
133
- export namespace Request {
134
-
135
- /** Type enum. */
136
- enum Type {
137
- IDENTIFY = 0,
138
- CONNECT = 1,
139
- STREAM_OPEN = 2,
140
- STREAM_HANDLER = 3,
141
- DHT = 4,
142
- LIST_PEERS = 5,
143
- CONNMANAGER = 6,
144
- DISCONNECT = 7,
145
- PUBSUB = 8,
146
- PEERSTORE = 9
147
- }
148
- }
149
-
150
- /** Properties of a Response. */
151
- export interface IResponse {
152
-
153
- /** Response type */
154
- type: Response.Type;
155
-
156
- /** Response error */
157
- error?: (IErrorResponse|null);
158
-
159
- /** Response streamInfo */
160
- streamInfo?: (IStreamInfo|null);
161
-
162
- /** Response identify */
163
- identify?: (IIdentifyResponse|null);
164
-
165
- /** Response dht */
166
- dht?: (IDHTResponse|null);
167
-
168
- /** Response peers */
169
- peers?: (IPeerInfo[]|null);
170
-
171
- /** Response pubsub */
172
- pubsub?: (IPSResponse|null);
173
-
174
- /** Response peerStore */
175
- peerStore?: (IPeerstoreResponse|null);
176
- }
177
-
178
- /** Represents a Response. */
179
- export class Response implements IResponse {
180
-
181
- /**
182
- * Constructs a new Response.
183
- * @param [p] Properties to set
184
- */
185
- constructor(p?: IResponse);
186
-
187
- /** Response type. */
188
- public type: Response.Type;
189
-
190
- /** Response error. */
191
- public error?: (IErrorResponse|null);
192
-
193
- /** Response streamInfo. */
194
- public streamInfo?: (IStreamInfo|null);
195
-
196
- /** Response identify. */
197
- public identify?: (IIdentifyResponse|null);
198
-
199
- /** Response dht. */
200
- public dht?: (IDHTResponse|null);
201
-
202
- /** Response peers. */
203
- public peers: IPeerInfo[];
204
-
205
- /** Response pubsub. */
206
- public pubsub?: (IPSResponse|null);
207
-
208
- /** Response peerStore. */
209
- public peerStore?: (IPeerstoreResponse|null);
210
-
211
- /** Response _error. */
212
- public _error?: "error";
213
-
214
- /** Response _streamInfo. */
215
- public _streamInfo?: "streamInfo";
216
-
217
- /** Response _identify. */
218
- public _identify?: "identify";
219
-
220
- /** Response _dht. */
221
- public _dht?: "dht";
222
-
223
- /** Response _pubsub. */
224
- public _pubsub?: "pubsub";
225
-
226
- /** Response _peerStore. */
227
- public _peerStore?: "peerStore";
228
-
229
- /**
230
- * Encodes the specified Response message. Does not implicitly {@link Response.verify|verify} messages.
231
- * @param m Response message or plain object to encode
232
- * @param [w] Writer to encode to
233
- * @returns Writer
234
- */
235
- public static encode(m: IResponse, w?: $protobuf.Writer): $protobuf.Writer;
236
-
237
- /**
238
- * Decodes a Response message from the specified reader or buffer.
239
- * @param r Reader or buffer to decode from
240
- * @param [l] Message length if known beforehand
241
- * @returns Response
242
- * @throws {Error} If the payload is not a reader or valid buffer
243
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
244
- */
245
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Response;
246
-
247
- /**
248
- * Creates a Response message from a plain object. Also converts values to their respective internal types.
249
- * @param d Plain object
250
- * @returns Response
251
- */
252
- public static fromObject(d: { [k: string]: any }): Response;
253
-
254
- /**
255
- * Creates a plain object from a Response message. Also converts values to other types if specified.
256
- * @param m Response
257
- * @param [o] Conversion options
258
- * @returns Plain object
259
- */
260
- public static toObject(m: Response, o?: $protobuf.IConversionOptions): { [k: string]: any };
261
-
262
- /**
263
- * Converts this Response to JSON.
264
- * @returns JSON object
265
- */
266
- public toJSON(): { [k: string]: any };
267
- }
268
-
269
- export namespace Response {
270
-
271
- /** Type enum. */
272
- enum Type {
273
- OK = 0,
274
- ERROR = 1
275
- }
276
- }
277
-
278
- /** Properties of an IdentifyResponse. */
279
- export interface IIdentifyResponse {
280
-
281
- /** IdentifyResponse id */
282
- id: Uint8Array;
283
-
284
- /** IdentifyResponse addrs */
285
- addrs?: (Uint8Array[]|null);
286
- }
287
-
288
- /** Represents an IdentifyResponse. */
289
- export class IdentifyResponse implements IIdentifyResponse {
290
-
291
- /**
292
- * Constructs a new IdentifyResponse.
293
- * @param [p] Properties to set
294
- */
295
- constructor(p?: IIdentifyResponse);
296
-
297
- /** IdentifyResponse id. */
298
- public id: Uint8Array;
299
-
300
- /** IdentifyResponse addrs. */
301
- public addrs: Uint8Array[];
302
-
303
- /**
304
- * Encodes the specified IdentifyResponse message. Does not implicitly {@link IdentifyResponse.verify|verify} messages.
305
- * @param m IdentifyResponse message or plain object to encode
306
- * @param [w] Writer to encode to
307
- * @returns Writer
308
- */
309
- public static encode(m: IIdentifyResponse, w?: $protobuf.Writer): $protobuf.Writer;
310
-
311
- /**
312
- * Decodes an IdentifyResponse message from the specified reader or buffer.
313
- * @param r Reader or buffer to decode from
314
- * @param [l] Message length if known beforehand
315
- * @returns IdentifyResponse
316
- * @throws {Error} If the payload is not a reader or valid buffer
317
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
318
- */
319
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): IdentifyResponse;
320
-
321
- /**
322
- * Creates an IdentifyResponse message from a plain object. Also converts values to their respective internal types.
323
- * @param d Plain object
324
- * @returns IdentifyResponse
325
- */
326
- public static fromObject(d: { [k: string]: any }): IdentifyResponse;
327
-
328
- /**
329
- * Creates a plain object from an IdentifyResponse message. Also converts values to other types if specified.
330
- * @param m IdentifyResponse
331
- * @param [o] Conversion options
332
- * @returns Plain object
333
- */
334
- public static toObject(m: IdentifyResponse, o?: $protobuf.IConversionOptions): { [k: string]: any };
335
-
336
- /**
337
- * Converts this IdentifyResponse to JSON.
338
- * @returns JSON object
339
- */
340
- public toJSON(): { [k: string]: any };
341
- }
342
-
343
- /** Properties of a ConnectRequest. */
344
- export interface IConnectRequest {
345
-
346
- /** ConnectRequest peer */
347
- peer: Uint8Array;
348
-
349
- /** ConnectRequest addrs */
350
- addrs?: (Uint8Array[]|null);
351
-
352
- /** ConnectRequest timeout */
353
- timeout?: (number|null);
354
- }
355
-
356
- /** Represents a ConnectRequest. */
357
- export class ConnectRequest implements IConnectRequest {
358
-
359
- /**
360
- * Constructs a new ConnectRequest.
361
- * @param [p] Properties to set
362
- */
363
- constructor(p?: IConnectRequest);
364
-
365
- /** ConnectRequest peer. */
366
- public peer: Uint8Array;
367
-
368
- /** ConnectRequest addrs. */
369
- public addrs: Uint8Array[];
370
-
371
- /** ConnectRequest timeout. */
372
- public timeout?: (number|null);
373
-
374
- /** ConnectRequest _timeout. */
375
- public _timeout?: "timeout";
376
-
377
- /**
378
- * Encodes the specified ConnectRequest message. Does not implicitly {@link ConnectRequest.verify|verify} messages.
379
- * @param m ConnectRequest message or plain object to encode
380
- * @param [w] Writer to encode to
381
- * @returns Writer
382
- */
383
- public static encode(m: IConnectRequest, w?: $protobuf.Writer): $protobuf.Writer;
384
-
385
- /**
386
- * Decodes a ConnectRequest message from the specified reader or buffer.
387
- * @param r Reader or buffer to decode from
388
- * @param [l] Message length if known beforehand
389
- * @returns ConnectRequest
390
- * @throws {Error} If the payload is not a reader or valid buffer
391
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
392
- */
393
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ConnectRequest;
394
-
395
- /**
396
- * Creates a ConnectRequest message from a plain object. Also converts values to their respective internal types.
397
- * @param d Plain object
398
- * @returns ConnectRequest
399
- */
400
- public static fromObject(d: { [k: string]: any }): ConnectRequest;
401
-
402
- /**
403
- * Creates a plain object from a ConnectRequest message. Also converts values to other types if specified.
404
- * @param m ConnectRequest
405
- * @param [o] Conversion options
406
- * @returns Plain object
407
- */
408
- public static toObject(m: ConnectRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
409
-
410
- /**
411
- * Converts this ConnectRequest to JSON.
412
- * @returns JSON object
413
- */
414
- public toJSON(): { [k: string]: any };
415
- }
416
-
417
- /** Properties of a StreamOpenRequest. */
418
- export interface IStreamOpenRequest {
419
-
420
- /** StreamOpenRequest peer */
421
- peer: Uint8Array;
422
-
423
- /** StreamOpenRequest proto */
424
- proto?: (string[]|null);
425
-
426
- /** StreamOpenRequest timeout */
427
- timeout?: (number|null);
428
- }
429
-
430
- /** Represents a StreamOpenRequest. */
431
- export class StreamOpenRequest implements IStreamOpenRequest {
432
-
433
- /**
434
- * Constructs a new StreamOpenRequest.
435
- * @param [p] Properties to set
436
- */
437
- constructor(p?: IStreamOpenRequest);
438
-
439
- /** StreamOpenRequest peer. */
440
- public peer: Uint8Array;
441
-
442
- /** StreamOpenRequest proto. */
443
- public proto: string[];
444
-
445
- /** StreamOpenRequest timeout. */
446
- public timeout?: (number|null);
447
-
448
- /** StreamOpenRequest _timeout. */
449
- public _timeout?: "timeout";
450
-
451
- /**
452
- * Encodes the specified StreamOpenRequest message. Does not implicitly {@link StreamOpenRequest.verify|verify} messages.
453
- * @param m StreamOpenRequest message or plain object to encode
454
- * @param [w] Writer to encode to
455
- * @returns Writer
456
- */
457
- public static encode(m: IStreamOpenRequest, w?: $protobuf.Writer): $protobuf.Writer;
458
-
459
- /**
460
- * Decodes a StreamOpenRequest message from the specified reader or buffer.
461
- * @param r Reader or buffer to decode from
462
- * @param [l] Message length if known beforehand
463
- * @returns StreamOpenRequest
464
- * @throws {Error} If the payload is not a reader or valid buffer
465
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
466
- */
467
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): StreamOpenRequest;
468
-
469
- /**
470
- * Creates a StreamOpenRequest message from a plain object. Also converts values to their respective internal types.
471
- * @param d Plain object
472
- * @returns StreamOpenRequest
473
- */
474
- public static fromObject(d: { [k: string]: any }): StreamOpenRequest;
475
-
476
- /**
477
- * Creates a plain object from a StreamOpenRequest message. Also converts values to other types if specified.
478
- * @param m StreamOpenRequest
479
- * @param [o] Conversion options
480
- * @returns Plain object
481
- */
482
- public static toObject(m: StreamOpenRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
483
-
484
- /**
485
- * Converts this StreamOpenRequest to JSON.
486
- * @returns JSON object
487
- */
488
- public toJSON(): { [k: string]: any };
489
- }
490
-
491
- /** Properties of a StreamHandlerRequest. */
492
- export interface IStreamHandlerRequest {
493
-
494
- /** StreamHandlerRequest addr */
495
- addr: Uint8Array;
496
-
497
- /** StreamHandlerRequest proto */
498
- proto?: (string[]|null);
499
- }
500
-
501
- /** Represents a StreamHandlerRequest. */
502
- export class StreamHandlerRequest implements IStreamHandlerRequest {
503
-
504
- /**
505
- * Constructs a new StreamHandlerRequest.
506
- * @param [p] Properties to set
507
- */
508
- constructor(p?: IStreamHandlerRequest);
509
-
510
- /** StreamHandlerRequest addr. */
511
- public addr: Uint8Array;
512
-
513
- /** StreamHandlerRequest proto. */
514
- public proto: string[];
515
-
516
- /**
517
- * Encodes the specified StreamHandlerRequest message. Does not implicitly {@link StreamHandlerRequest.verify|verify} messages.
518
- * @param m StreamHandlerRequest message or plain object to encode
519
- * @param [w] Writer to encode to
520
- * @returns Writer
521
- */
522
- public static encode(m: IStreamHandlerRequest, w?: $protobuf.Writer): $protobuf.Writer;
523
-
524
- /**
525
- * Decodes a StreamHandlerRequest message from the specified reader or buffer.
526
- * @param r Reader or buffer to decode from
527
- * @param [l] Message length if known beforehand
528
- * @returns StreamHandlerRequest
529
- * @throws {Error} If the payload is not a reader or valid buffer
530
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
531
- */
532
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): StreamHandlerRequest;
533
-
534
- /**
535
- * Creates a StreamHandlerRequest message from a plain object. Also converts values to their respective internal types.
536
- * @param d Plain object
537
- * @returns StreamHandlerRequest
538
- */
539
- public static fromObject(d: { [k: string]: any }): StreamHandlerRequest;
540
-
541
- /**
542
- * Creates a plain object from a StreamHandlerRequest message. Also converts values to other types if specified.
543
- * @param m StreamHandlerRequest
544
- * @param [o] Conversion options
545
- * @returns Plain object
546
- */
547
- public static toObject(m: StreamHandlerRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
548
-
549
- /**
550
- * Converts this StreamHandlerRequest to JSON.
551
- * @returns JSON object
552
- */
553
- public toJSON(): { [k: string]: any };
554
- }
555
-
556
- /** Properties of an ErrorResponse. */
557
- export interface IErrorResponse {
558
-
559
- /** ErrorResponse msg */
560
- msg: string;
561
- }
562
-
563
- /** Represents an ErrorResponse. */
564
- export class ErrorResponse implements IErrorResponse {
565
-
566
- /**
567
- * Constructs a new ErrorResponse.
568
- * @param [p] Properties to set
569
- */
570
- constructor(p?: IErrorResponse);
571
-
572
- /** ErrorResponse msg. */
573
- public msg: string;
574
-
575
- /**
576
- * Encodes the specified ErrorResponse message. Does not implicitly {@link ErrorResponse.verify|verify} messages.
577
- * @param m ErrorResponse message or plain object to encode
578
- * @param [w] Writer to encode to
579
- * @returns Writer
580
- */
581
- public static encode(m: IErrorResponse, w?: $protobuf.Writer): $protobuf.Writer;
582
-
583
- /**
584
- * Decodes an ErrorResponse message from the specified reader or buffer.
585
- * @param r Reader or buffer to decode from
586
- * @param [l] Message length if known beforehand
587
- * @returns ErrorResponse
588
- * @throws {Error} If the payload is not a reader or valid buffer
589
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
590
- */
591
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ErrorResponse;
592
-
593
- /**
594
- * Creates an ErrorResponse message from a plain object. Also converts values to their respective internal types.
595
- * @param d Plain object
596
- * @returns ErrorResponse
597
- */
598
- public static fromObject(d: { [k: string]: any }): ErrorResponse;
599
-
600
- /**
601
- * Creates a plain object from an ErrorResponse message. Also converts values to other types if specified.
602
- * @param m ErrorResponse
603
- * @param [o] Conversion options
604
- * @returns Plain object
605
- */
606
- public static toObject(m: ErrorResponse, o?: $protobuf.IConversionOptions): { [k: string]: any };
607
-
608
- /**
609
- * Converts this ErrorResponse to JSON.
610
- * @returns JSON object
611
- */
612
- public toJSON(): { [k: string]: any };
613
- }
614
-
615
- /** Properties of a StreamInfo. */
616
- export interface IStreamInfo {
617
-
618
- /** StreamInfo peer */
619
- peer: Uint8Array;
620
-
621
- /** StreamInfo addr */
622
- addr: Uint8Array;
623
-
624
- /** StreamInfo proto */
625
- proto: string;
626
- }
627
-
628
- /** Represents a StreamInfo. */
629
- export class StreamInfo implements IStreamInfo {
630
-
631
- /**
632
- * Constructs a new StreamInfo.
633
- * @param [p] Properties to set
634
- */
635
- constructor(p?: IStreamInfo);
636
-
637
- /** StreamInfo peer. */
638
- public peer: Uint8Array;
639
-
640
- /** StreamInfo addr. */
641
- public addr: Uint8Array;
642
-
643
- /** StreamInfo proto. */
644
- public proto: string;
645
-
646
- /**
647
- * Encodes the specified StreamInfo message. Does not implicitly {@link StreamInfo.verify|verify} messages.
648
- * @param m StreamInfo message or plain object to encode
649
- * @param [w] Writer to encode to
650
- * @returns Writer
651
- */
652
- public static encode(m: IStreamInfo, w?: $protobuf.Writer): $protobuf.Writer;
653
-
654
- /**
655
- * Decodes a StreamInfo message from the specified reader or buffer.
656
- * @param r Reader or buffer to decode from
657
- * @param [l] Message length if known beforehand
658
- * @returns StreamInfo
659
- * @throws {Error} If the payload is not a reader or valid buffer
660
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
661
- */
662
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): StreamInfo;
663
-
664
- /**
665
- * Creates a StreamInfo message from a plain object. Also converts values to their respective internal types.
666
- * @param d Plain object
667
- * @returns StreamInfo
668
- */
669
- public static fromObject(d: { [k: string]: any }): StreamInfo;
670
-
671
- /**
672
- * Creates a plain object from a StreamInfo message. Also converts values to other types if specified.
673
- * @param m StreamInfo
674
- * @param [o] Conversion options
675
- * @returns Plain object
676
- */
677
- public static toObject(m: StreamInfo, o?: $protobuf.IConversionOptions): { [k: string]: any };
678
-
679
- /**
680
- * Converts this StreamInfo to JSON.
681
- * @returns JSON object
682
- */
683
- public toJSON(): { [k: string]: any };
684
- }
685
-
686
- /** Properties of a DHTRequest. */
687
- export interface IDHTRequest {
688
-
689
- /** DHTRequest type */
690
- type: DHTRequest.Type;
691
-
692
- /** DHTRequest peer */
693
- peer?: (Uint8Array|null);
694
-
695
- /** DHTRequest cid */
696
- cid?: (Uint8Array|null);
697
-
698
- /** DHTRequest key */
699
- key?: (Uint8Array|null);
700
-
701
- /** DHTRequest value */
702
- value?: (Uint8Array|null);
703
-
704
- /** DHTRequest count */
705
- count?: (number|null);
706
-
707
- /** DHTRequest timeout */
708
- timeout?: (number|null);
709
- }
710
-
711
- /** Represents a DHTRequest. */
712
- export class DHTRequest implements IDHTRequest {
713
-
714
- /**
715
- * Constructs a new DHTRequest.
716
- * @param [p] Properties to set
717
- */
718
- constructor(p?: IDHTRequest);
719
-
720
- /** DHTRequest type. */
721
- public type: DHTRequest.Type;
722
-
723
- /** DHTRequest peer. */
724
- public peer?: (Uint8Array|null);
725
-
726
- /** DHTRequest cid. */
727
- public cid?: (Uint8Array|null);
728
-
729
- /** DHTRequest key. */
730
- public key?: (Uint8Array|null);
731
-
732
- /** DHTRequest value. */
733
- public value?: (Uint8Array|null);
734
-
735
- /** DHTRequest count. */
736
- public count?: (number|null);
737
-
738
- /** DHTRequest timeout. */
739
- public timeout?: (number|null);
740
-
741
- /** DHTRequest _peer. */
742
- public _peer?: "peer";
743
-
744
- /** DHTRequest _cid. */
745
- public _cid?: "cid";
746
-
747
- /** DHTRequest _key. */
748
- public _key?: "key";
749
-
750
- /** DHTRequest _value. */
751
- public _value?: "value";
752
-
753
- /** DHTRequest _count. */
754
- public _count?: "count";
755
-
756
- /** DHTRequest _timeout. */
757
- public _timeout?: "timeout";
758
-
759
- /**
760
- * Encodes the specified DHTRequest message. Does not implicitly {@link DHTRequest.verify|verify} messages.
761
- * @param m DHTRequest message or plain object to encode
762
- * @param [w] Writer to encode to
763
- * @returns Writer
764
- */
765
- public static encode(m: IDHTRequest, w?: $protobuf.Writer): $protobuf.Writer;
766
-
767
- /**
768
- * Decodes a DHTRequest message from the specified reader or buffer.
769
- * @param r Reader or buffer to decode from
770
- * @param [l] Message length if known beforehand
771
- * @returns DHTRequest
772
- * @throws {Error} If the payload is not a reader or valid buffer
773
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
774
- */
775
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): DHTRequest;
776
-
777
- /**
778
- * Creates a DHTRequest message from a plain object. Also converts values to their respective internal types.
779
- * @param d Plain object
780
- * @returns DHTRequest
781
- */
782
- public static fromObject(d: { [k: string]: any }): DHTRequest;
783
-
784
- /**
785
- * Creates a plain object from a DHTRequest message. Also converts values to other types if specified.
786
- * @param m DHTRequest
787
- * @param [o] Conversion options
788
- * @returns Plain object
789
- */
790
- public static toObject(m: DHTRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
791
-
792
- /**
793
- * Converts this DHTRequest to JSON.
794
- * @returns JSON object
795
- */
796
- public toJSON(): { [k: string]: any };
797
- }
798
-
799
- export namespace DHTRequest {
800
-
801
- /** Type enum. */
802
- enum Type {
803
- FIND_PEER = 0,
804
- FIND_PEERS_CONNECTED_TO_PEER = 1,
805
- FIND_PROVIDERS = 2,
806
- GET_CLOSEST_PEERS = 3,
807
- GET_PUBLIC_KEY = 4,
808
- GET_VALUE = 5,
809
- SEARCH_VALUE = 6,
810
- PUT_VALUE = 7,
811
- PROVIDE = 8
812
- }
813
- }
814
-
815
- /** Properties of a DHTResponse. */
816
- export interface IDHTResponse {
817
-
818
- /** DHTResponse type */
819
- type: DHTResponse.Type;
820
-
821
- /** DHTResponse peer */
822
- peer?: (IPeerInfo|null);
823
-
824
- /** DHTResponse value */
825
- value?: (Uint8Array|null);
826
- }
827
-
828
- /** Represents a DHTResponse. */
829
- export class DHTResponse implements IDHTResponse {
830
-
831
- /**
832
- * Constructs a new DHTResponse.
833
- * @param [p] Properties to set
834
- */
835
- constructor(p?: IDHTResponse);
836
-
837
- /** DHTResponse type. */
838
- public type: DHTResponse.Type;
839
-
840
- /** DHTResponse peer. */
841
- public peer?: (IPeerInfo|null);
842
-
843
- /** DHTResponse value. */
844
- public value?: (Uint8Array|null);
845
-
846
- /** DHTResponse _peer. */
847
- public _peer?: "peer";
848
-
849
- /** DHTResponse _value. */
850
- public _value?: "value";
851
-
852
- /**
853
- * Encodes the specified DHTResponse message. Does not implicitly {@link DHTResponse.verify|verify} messages.
854
- * @param m DHTResponse message or plain object to encode
855
- * @param [w] Writer to encode to
856
- * @returns Writer
857
- */
858
- public static encode(m: IDHTResponse, w?: $protobuf.Writer): $protobuf.Writer;
859
-
860
- /**
861
- * Decodes a DHTResponse message from the specified reader or buffer.
862
- * @param r Reader or buffer to decode from
863
- * @param [l] Message length if known beforehand
864
- * @returns DHTResponse
865
- * @throws {Error} If the payload is not a reader or valid buffer
866
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
867
- */
868
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): DHTResponse;
869
-
870
- /**
871
- * Creates a DHTResponse message from a plain object. Also converts values to their respective internal types.
872
- * @param d Plain object
873
- * @returns DHTResponse
874
- */
875
- public static fromObject(d: { [k: string]: any }): DHTResponse;
876
-
877
- /**
878
- * Creates a plain object from a DHTResponse message. Also converts values to other types if specified.
879
- * @param m DHTResponse
880
- * @param [o] Conversion options
881
- * @returns Plain object
882
- */
883
- public static toObject(m: DHTResponse, o?: $protobuf.IConversionOptions): { [k: string]: any };
884
-
885
- /**
886
- * Converts this DHTResponse to JSON.
887
- * @returns JSON object
888
- */
889
- public toJSON(): { [k: string]: any };
890
- }
891
-
892
- export namespace DHTResponse {
893
-
894
- /** Type enum. */
895
- enum Type {
896
- BEGIN = 0,
897
- VALUE = 1,
898
- END = 2
899
- }
900
- }
901
-
902
- /** Properties of a PeerInfo. */
903
- export interface IPeerInfo {
904
-
905
- /** PeerInfo id */
906
- id: Uint8Array;
907
-
908
- /** PeerInfo addrs */
909
- addrs?: (Uint8Array[]|null);
910
- }
911
-
912
- /** Represents a PeerInfo. */
913
- export class PeerInfo implements IPeerInfo {
914
-
915
- /**
916
- * Constructs a new PeerInfo.
917
- * @param [p] Properties to set
918
- */
919
- constructor(p?: IPeerInfo);
920
-
921
- /** PeerInfo id. */
922
- public id: Uint8Array;
923
-
924
- /** PeerInfo addrs. */
925
- public addrs: Uint8Array[];
926
-
927
- /**
928
- * Encodes the specified PeerInfo message. Does not implicitly {@link PeerInfo.verify|verify} messages.
929
- * @param m PeerInfo message or plain object to encode
930
- * @param [w] Writer to encode to
931
- * @returns Writer
932
- */
933
- public static encode(m: IPeerInfo, w?: $protobuf.Writer): $protobuf.Writer;
934
-
935
- /**
936
- * Decodes a PeerInfo message from the specified reader or buffer.
937
- * @param r Reader or buffer to decode from
938
- * @param [l] Message length if known beforehand
939
- * @returns PeerInfo
940
- * @throws {Error} If the payload is not a reader or valid buffer
941
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
942
- */
943
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PeerInfo;
944
-
945
- /**
946
- * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types.
947
- * @param d Plain object
948
- * @returns PeerInfo
949
- */
950
- public static fromObject(d: { [k: string]: any }): PeerInfo;
951
-
952
- /**
953
- * Creates a plain object from a PeerInfo message. Also converts values to other types if specified.
954
- * @param m PeerInfo
955
- * @param [o] Conversion options
956
- * @returns Plain object
957
- */
958
- public static toObject(m: PeerInfo, o?: $protobuf.IConversionOptions): { [k: string]: any };
959
-
960
- /**
961
- * Converts this PeerInfo to JSON.
962
- * @returns JSON object
963
- */
964
- public toJSON(): { [k: string]: any };
965
- }
966
-
967
- /** Properties of a ConnManagerRequest. */
968
- export interface IConnManagerRequest {
969
-
970
- /** ConnManagerRequest type */
971
- type: ConnManagerRequest.Type;
972
-
973
- /** ConnManagerRequest peer */
974
- peer?: (Uint8Array|null);
975
-
976
- /** ConnManagerRequest tag */
977
- tag?: (string|null);
978
-
979
- /** ConnManagerRequest weight */
980
- weight?: (number|null);
981
- }
982
-
983
- /** Represents a ConnManagerRequest. */
984
- export class ConnManagerRequest implements IConnManagerRequest {
985
-
986
- /**
987
- * Constructs a new ConnManagerRequest.
988
- * @param [p] Properties to set
989
- */
990
- constructor(p?: IConnManagerRequest);
991
-
992
- /** ConnManagerRequest type. */
993
- public type: ConnManagerRequest.Type;
994
-
995
- /** ConnManagerRequest peer. */
996
- public peer?: (Uint8Array|null);
997
-
998
- /** ConnManagerRequest tag. */
999
- public tag?: (string|null);
1000
-
1001
- /** ConnManagerRequest weight. */
1002
- public weight?: (number|null);
1003
-
1004
- /** ConnManagerRequest _peer. */
1005
- public _peer?: "peer";
1006
-
1007
- /** ConnManagerRequest _tag. */
1008
- public _tag?: "tag";
1009
-
1010
- /** ConnManagerRequest _weight. */
1011
- public _weight?: "weight";
1012
-
1013
- /**
1014
- * Encodes the specified ConnManagerRequest message. Does not implicitly {@link ConnManagerRequest.verify|verify} messages.
1015
- * @param m ConnManagerRequest message or plain object to encode
1016
- * @param [w] Writer to encode to
1017
- * @returns Writer
1018
- */
1019
- public static encode(m: IConnManagerRequest, w?: $protobuf.Writer): $protobuf.Writer;
1020
-
1021
- /**
1022
- * Decodes a ConnManagerRequest message from the specified reader or buffer.
1023
- * @param r Reader or buffer to decode from
1024
- * @param [l] Message length if known beforehand
1025
- * @returns ConnManagerRequest
1026
- * @throws {Error} If the payload is not a reader or valid buffer
1027
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1028
- */
1029
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ConnManagerRequest;
1030
-
1031
- /**
1032
- * Creates a ConnManagerRequest message from a plain object. Also converts values to their respective internal types.
1033
- * @param d Plain object
1034
- * @returns ConnManagerRequest
1035
- */
1036
- public static fromObject(d: { [k: string]: any }): ConnManagerRequest;
1037
-
1038
- /**
1039
- * Creates a plain object from a ConnManagerRequest message. Also converts values to other types if specified.
1040
- * @param m ConnManagerRequest
1041
- * @param [o] Conversion options
1042
- * @returns Plain object
1043
- */
1044
- public static toObject(m: ConnManagerRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
1045
-
1046
- /**
1047
- * Converts this ConnManagerRequest to JSON.
1048
- * @returns JSON object
1049
- */
1050
- public toJSON(): { [k: string]: any };
1051
- }
1052
-
1053
- export namespace ConnManagerRequest {
1054
-
1055
- /** Type enum. */
1056
- enum Type {
1057
- TAG_PEER = 0,
1058
- UNTAG_PEER = 1,
1059
- TRIM = 2
1060
- }
1061
- }
1062
-
1063
- /** Properties of a DisconnectRequest. */
1064
- export interface IDisconnectRequest {
1065
-
1066
- /** DisconnectRequest peer */
1067
- peer: Uint8Array;
1068
- }
1069
-
1070
- /** Represents a DisconnectRequest. */
1071
- export class DisconnectRequest implements IDisconnectRequest {
1072
-
1073
- /**
1074
- * Constructs a new DisconnectRequest.
1075
- * @param [p] Properties to set
1076
- */
1077
- constructor(p?: IDisconnectRequest);
1078
-
1079
- /** DisconnectRequest peer. */
1080
- public peer: Uint8Array;
1081
-
1082
- /**
1083
- * Encodes the specified DisconnectRequest message. Does not implicitly {@link DisconnectRequest.verify|verify} messages.
1084
- * @param m DisconnectRequest message or plain object to encode
1085
- * @param [w] Writer to encode to
1086
- * @returns Writer
1087
- */
1088
- public static encode(m: IDisconnectRequest, w?: $protobuf.Writer): $protobuf.Writer;
1089
-
1090
- /**
1091
- * Decodes a DisconnectRequest message from the specified reader or buffer.
1092
- * @param r Reader or buffer to decode from
1093
- * @param [l] Message length if known beforehand
1094
- * @returns DisconnectRequest
1095
- * @throws {Error} If the payload is not a reader or valid buffer
1096
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1097
- */
1098
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): DisconnectRequest;
1099
-
1100
- /**
1101
- * Creates a DisconnectRequest message from a plain object. Also converts values to their respective internal types.
1102
- * @param d Plain object
1103
- * @returns DisconnectRequest
1104
- */
1105
- public static fromObject(d: { [k: string]: any }): DisconnectRequest;
1106
-
1107
- /**
1108
- * Creates a plain object from a DisconnectRequest message. Also converts values to other types if specified.
1109
- * @param m DisconnectRequest
1110
- * @param [o] Conversion options
1111
- * @returns Plain object
1112
- */
1113
- public static toObject(m: DisconnectRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
1114
-
1115
- /**
1116
- * Converts this DisconnectRequest to JSON.
1117
- * @returns JSON object
1118
- */
1119
- public toJSON(): { [k: string]: any };
1120
- }
1121
-
1122
- /** Properties of a PSRequest. */
1123
- export interface IPSRequest {
1124
-
1125
- /** PSRequest type */
1126
- type: PSRequest.Type;
1127
-
1128
- /** PSRequest topic */
1129
- topic?: (string|null);
1130
-
1131
- /** PSRequest data */
1132
- data?: (Uint8Array|null);
1133
- }
1134
-
1135
- /** Represents a PSRequest. */
1136
- export class PSRequest implements IPSRequest {
1137
-
1138
- /**
1139
- * Constructs a new PSRequest.
1140
- * @param [p] Properties to set
1141
- */
1142
- constructor(p?: IPSRequest);
1143
-
1144
- /** PSRequest type. */
1145
- public type: PSRequest.Type;
1146
-
1147
- /** PSRequest topic. */
1148
- public topic?: (string|null);
1149
-
1150
- /** PSRequest data. */
1151
- public data?: (Uint8Array|null);
1152
-
1153
- /** PSRequest _topic. */
1154
- public _topic?: "topic";
1155
-
1156
- /** PSRequest _data. */
1157
- public _data?: "data";
1158
-
1159
- /**
1160
- * Encodes the specified PSRequest message. Does not implicitly {@link PSRequest.verify|verify} messages.
1161
- * @param m PSRequest message or plain object to encode
1162
- * @param [w] Writer to encode to
1163
- * @returns Writer
1164
- */
1165
- public static encode(m: IPSRequest, w?: $protobuf.Writer): $protobuf.Writer;
1166
-
1167
- /**
1168
- * Decodes a PSRequest message from the specified reader or buffer.
1169
- * @param r Reader or buffer to decode from
1170
- * @param [l] Message length if known beforehand
1171
- * @returns PSRequest
1172
- * @throws {Error} If the payload is not a reader or valid buffer
1173
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1174
- */
1175
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PSRequest;
1176
-
1177
- /**
1178
- * Creates a PSRequest message from a plain object. Also converts values to their respective internal types.
1179
- * @param d Plain object
1180
- * @returns PSRequest
1181
- */
1182
- public static fromObject(d: { [k: string]: any }): PSRequest;
1183
-
1184
- /**
1185
- * Creates a plain object from a PSRequest message. Also converts values to other types if specified.
1186
- * @param m PSRequest
1187
- * @param [o] Conversion options
1188
- * @returns Plain object
1189
- */
1190
- public static toObject(m: PSRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
1191
-
1192
- /**
1193
- * Converts this PSRequest to JSON.
1194
- * @returns JSON object
1195
- */
1196
- public toJSON(): { [k: string]: any };
1197
- }
1198
-
1199
- export namespace PSRequest {
1200
-
1201
- /** Type enum. */
1202
- enum Type {
1203
- GET_TOPICS = 0,
1204
- LIST_PEERS = 1,
1205
- PUBLISH = 2,
1206
- SUBSCRIBE = 3
1207
- }
1208
- }
1209
-
1210
- /** Properties of a PSMessage. */
1211
- export interface IPSMessage {
1212
-
1213
- /** PSMessage from */
1214
- from?: (Uint8Array|null);
1215
-
1216
- /** PSMessage data */
1217
- data?: (Uint8Array|null);
1218
-
1219
- /** PSMessage seqno */
1220
- seqno?: (Uint8Array|null);
1221
-
1222
- /** PSMessage topicIDs */
1223
- topicIDs?: (string[]|null);
1224
-
1225
- /** PSMessage signature */
1226
- signature?: (Uint8Array|null);
1227
-
1228
- /** PSMessage key */
1229
- key?: (Uint8Array|null);
1230
- }
1231
-
1232
- /** Represents a PSMessage. */
1233
- export class PSMessage implements IPSMessage {
1234
-
1235
- /**
1236
- * Constructs a new PSMessage.
1237
- * @param [p] Properties to set
1238
- */
1239
- constructor(p?: IPSMessage);
1240
-
1241
- /** PSMessage from. */
1242
- public from?: (Uint8Array|null);
1243
-
1244
- /** PSMessage data. */
1245
- public data?: (Uint8Array|null);
1246
-
1247
- /** PSMessage seqno. */
1248
- public seqno?: (Uint8Array|null);
1249
-
1250
- /** PSMessage topicIDs. */
1251
- public topicIDs: string[];
1252
-
1253
- /** PSMessage signature. */
1254
- public signature?: (Uint8Array|null);
1255
-
1256
- /** PSMessage key. */
1257
- public key?: (Uint8Array|null);
1258
-
1259
- /** PSMessage _from. */
1260
- public _from?: "from";
1261
-
1262
- /** PSMessage _data. */
1263
- public _data?: "data";
1264
-
1265
- /** PSMessage _seqno. */
1266
- public _seqno?: "seqno";
1267
-
1268
- /** PSMessage _signature. */
1269
- public _signature?: "signature";
1270
-
1271
- /** PSMessage _key. */
1272
- public _key?: "key";
1273
-
1274
- /**
1275
- * Encodes the specified PSMessage message. Does not implicitly {@link PSMessage.verify|verify} messages.
1276
- * @param m PSMessage message or plain object to encode
1277
- * @param [w] Writer to encode to
1278
- * @returns Writer
1279
- */
1280
- public static encode(m: IPSMessage, w?: $protobuf.Writer): $protobuf.Writer;
1281
-
1282
- /**
1283
- * Decodes a PSMessage message from the specified reader or buffer.
1284
- * @param r Reader or buffer to decode from
1285
- * @param [l] Message length if known beforehand
1286
- * @returns PSMessage
1287
- * @throws {Error} If the payload is not a reader or valid buffer
1288
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1289
- */
1290
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PSMessage;
1291
-
1292
- /**
1293
- * Creates a PSMessage message from a plain object. Also converts values to their respective internal types.
1294
- * @param d Plain object
1295
- * @returns PSMessage
1296
- */
1297
- public static fromObject(d: { [k: string]: any }): PSMessage;
1298
-
1299
- /**
1300
- * Creates a plain object from a PSMessage message. Also converts values to other types if specified.
1301
- * @param m PSMessage
1302
- * @param [o] Conversion options
1303
- * @returns Plain object
1304
- */
1305
- public static toObject(m: PSMessage, o?: $protobuf.IConversionOptions): { [k: string]: any };
1306
-
1307
- /**
1308
- * Converts this PSMessage to JSON.
1309
- * @returns JSON object
1310
- */
1311
- public toJSON(): { [k: string]: any };
1312
- }
1313
-
1314
- /** Properties of a PSResponse. */
1315
- export interface IPSResponse {
1316
-
1317
- /** PSResponse topics */
1318
- topics?: (string[]|null);
1319
-
1320
- /** PSResponse peerIDs */
1321
- peerIDs?: (Uint8Array[]|null);
1322
- }
1323
-
1324
- /** Represents a PSResponse. */
1325
- export class PSResponse implements IPSResponse {
1326
-
1327
- /**
1328
- * Constructs a new PSResponse.
1329
- * @param [p] Properties to set
1330
- */
1331
- constructor(p?: IPSResponse);
1332
-
1333
- /** PSResponse topics. */
1334
- public topics: string[];
1335
-
1336
- /** PSResponse peerIDs. */
1337
- public peerIDs: Uint8Array[];
1338
-
1339
- /**
1340
- * Encodes the specified PSResponse message. Does not implicitly {@link PSResponse.verify|verify} messages.
1341
- * @param m PSResponse message or plain object to encode
1342
- * @param [w] Writer to encode to
1343
- * @returns Writer
1344
- */
1345
- public static encode(m: IPSResponse, w?: $protobuf.Writer): $protobuf.Writer;
1346
-
1347
- /**
1348
- * Decodes a PSResponse message from the specified reader or buffer.
1349
- * @param r Reader or buffer to decode from
1350
- * @param [l] Message length if known beforehand
1351
- * @returns PSResponse
1352
- * @throws {Error} If the payload is not a reader or valid buffer
1353
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1354
- */
1355
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PSResponse;
1356
-
1357
- /**
1358
- * Creates a PSResponse message from a plain object. Also converts values to their respective internal types.
1359
- * @param d Plain object
1360
- * @returns PSResponse
1361
- */
1362
- public static fromObject(d: { [k: string]: any }): PSResponse;
1363
-
1364
- /**
1365
- * Creates a plain object from a PSResponse message. Also converts values to other types if specified.
1366
- * @param m PSResponse
1367
- * @param [o] Conversion options
1368
- * @returns Plain object
1369
- */
1370
- public static toObject(m: PSResponse, o?: $protobuf.IConversionOptions): { [k: string]: any };
1371
-
1372
- /**
1373
- * Converts this PSResponse to JSON.
1374
- * @returns JSON object
1375
- */
1376
- public toJSON(): { [k: string]: any };
1377
- }
1378
-
1379
- /** Properties of a PeerstoreRequest. */
1380
- export interface IPeerstoreRequest {
1381
-
1382
- /** PeerstoreRequest type */
1383
- type: PeerstoreRequest.Type;
1384
-
1385
- /** PeerstoreRequest id */
1386
- id?: (Uint8Array|null);
1387
-
1388
- /** PeerstoreRequest protos */
1389
- protos?: (string[]|null);
1390
- }
1391
-
1392
- /** Represents a PeerstoreRequest. */
1393
- export class PeerstoreRequest implements IPeerstoreRequest {
1394
-
1395
- /**
1396
- * Constructs a new PeerstoreRequest.
1397
- * @param [p] Properties to set
1398
- */
1399
- constructor(p?: IPeerstoreRequest);
1400
-
1401
- /** PeerstoreRequest type. */
1402
- public type: PeerstoreRequest.Type;
1403
-
1404
- /** PeerstoreRequest id. */
1405
- public id?: (Uint8Array|null);
1406
-
1407
- /** PeerstoreRequest protos. */
1408
- public protos: string[];
1409
-
1410
- /** PeerstoreRequest _id. */
1411
- public _id?: "id";
1412
-
1413
- /**
1414
- * Encodes the specified PeerstoreRequest message. Does not implicitly {@link PeerstoreRequest.verify|verify} messages.
1415
- * @param m PeerstoreRequest message or plain object to encode
1416
- * @param [w] Writer to encode to
1417
- * @returns Writer
1418
- */
1419
- public static encode(m: IPeerstoreRequest, w?: $protobuf.Writer): $protobuf.Writer;
1420
-
1421
- /**
1422
- * Decodes a PeerstoreRequest message from the specified reader or buffer.
1423
- * @param r Reader or buffer to decode from
1424
- * @param [l] Message length if known beforehand
1425
- * @returns PeerstoreRequest
1426
- * @throws {Error} If the payload is not a reader or valid buffer
1427
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1428
- */
1429
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PeerstoreRequest;
1430
-
1431
- /**
1432
- * Creates a PeerstoreRequest message from a plain object. Also converts values to their respective internal types.
1433
- * @param d Plain object
1434
- * @returns PeerstoreRequest
1435
- */
1436
- public static fromObject(d: { [k: string]: any }): PeerstoreRequest;
1437
-
1438
- /**
1439
- * Creates a plain object from a PeerstoreRequest message. Also converts values to other types if specified.
1440
- * @param m PeerstoreRequest
1441
- * @param [o] Conversion options
1442
- * @returns Plain object
1443
- */
1444
- public static toObject(m: PeerstoreRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
1445
-
1446
- /**
1447
- * Converts this PeerstoreRequest to JSON.
1448
- * @returns JSON object
1449
- */
1450
- public toJSON(): { [k: string]: any };
1451
- }
1452
-
1453
- export namespace PeerstoreRequest {
1454
-
1455
- /** Type enum. */
1456
- enum Type {
1457
- GET_PROTOCOLS = 1,
1458
- GET_PEER_INFO = 2
1459
- }
1460
- }
1461
-
1462
- /** Properties of a PeerstoreResponse. */
1463
- export interface IPeerstoreResponse {
1464
-
1465
- /** PeerstoreResponse peer */
1466
- peer?: (IPeerInfo|null);
1467
-
1468
- /** PeerstoreResponse protos */
1469
- protos?: (string[]|null);
1470
- }
1471
-
1472
- /** Represents a PeerstoreResponse. */
1473
- export class PeerstoreResponse implements IPeerstoreResponse {
1474
-
1475
- /**
1476
- * Constructs a new PeerstoreResponse.
1477
- * @param [p] Properties to set
1478
- */
1479
- constructor(p?: IPeerstoreResponse);
1480
-
1481
- /** PeerstoreResponse peer. */
1482
- public peer?: (IPeerInfo|null);
1483
-
1484
- /** PeerstoreResponse protos. */
1485
- public protos: string[];
1486
-
1487
- /** PeerstoreResponse _peer. */
1488
- public _peer?: "peer";
1489
-
1490
- /**
1491
- * Encodes the specified PeerstoreResponse message. Does not implicitly {@link PeerstoreResponse.verify|verify} messages.
1492
- * @param m PeerstoreResponse message or plain object to encode
1493
- * @param [w] Writer to encode to
1494
- * @returns Writer
1495
- */
1496
- public static encode(m: IPeerstoreResponse, w?: $protobuf.Writer): $protobuf.Writer;
1497
-
1498
- /**
1499
- * Decodes a PeerstoreResponse message from the specified reader or buffer.
1500
- * @param r Reader or buffer to decode from
1501
- * @param [l] Message length if known beforehand
1502
- * @returns PeerstoreResponse
1503
- * @throws {Error} If the payload is not a reader or valid buffer
1504
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
1505
- */
1506
- public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PeerstoreResponse;
1507
-
1508
- /**
1509
- * Creates a PeerstoreResponse message from a plain object. Also converts values to their respective internal types.
1510
- * @param d Plain object
1511
- * @returns PeerstoreResponse
1512
- */
1513
- public static fromObject(d: { [k: string]: any }): PeerstoreResponse;
1514
-
1515
- /**
1516
- * Creates a plain object from a PeerstoreResponse message. Also converts values to other types if specified.
1517
- * @param m PeerstoreResponse
1518
- * @param [o] Conversion options
1519
- * @returns Plain object
1520
- */
1521
- public static toObject(m: PeerstoreResponse, o?: $protobuf.IConversionOptions): { [k: string]: any };
1522
-
1523
- /**
1524
- * Converts this PeerstoreResponse to JSON.
1525
- * @returns JSON object
1526
- */
1527
- public toJSON(): { [k: string]: any };
1528
- }