@libp2p/pubsub 1.2.6 → 1.2.7
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.
- package/dist/src/errors.d.ts +4 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +4 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +24 -22
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +139 -97
- package/dist/src/index.js.map +1 -1
- package/dist/src/message/rpc.d.ts +586 -175
- package/dist/src/message/rpc.js +1238 -67
- package/dist/src/message/sign.d.ts +1 -1
- package/dist/src/message/sign.d.ts.map +1 -1
- package/dist/src/message/sign.js +4 -8
- package/dist/src/message/sign.js.map +1 -1
- package/dist/src/utils.d.ts +2 -6
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +10 -17
- package/dist/src/utils.js.map +1 -1
- package/package.json +5 -9
- package/src/errors.ts +4 -0
- package/src/index.ts +169 -104
- package/src/message/rpc.d.ts +586 -175
- package/src/message/rpc.js +1238 -67
- package/src/message/rpc.proto +38 -4
- package/src/message/sign.ts +6 -9
- package/src/utils.ts +11 -20
package/src/message/rpc.d.ts
CHANGED
@@ -1,258 +1,669 @@
|
|
1
|
-
import * as $protobuf from
|
1
|
+
import * as $protobuf from "protobufjs";
|
2
2
|
/** Properties of a RPC. */
|
3
3
|
export interface IRPC {
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
/** RPC subscriptions */
|
6
|
+
subscriptions?: (RPC.ISubOpts[]|null);
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
/** RPC messages */
|
9
|
+
messages?: (RPC.IMessage[]|null);
|
10
|
+
|
11
|
+
/** RPC control */
|
12
|
+
control?: (IControlMessage|null);
|
10
13
|
}
|
11
14
|
|
12
15
|
/** Represents a RPC. */
|
13
16
|
export class RPC implements IRPC {
|
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
|
-
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Constructs a new RPC.
|
20
|
+
* @param [p] Properties to set
|
21
|
+
*/
|
22
|
+
constructor(p?: IRPC);
|
23
|
+
|
24
|
+
/** RPC subscriptions. */
|
25
|
+
public subscriptions: RPC.ISubOpts[];
|
26
|
+
|
27
|
+
/** RPC messages. */
|
28
|
+
public messages: RPC.IMessage[];
|
29
|
+
|
30
|
+
/** RPC control. */
|
31
|
+
public control?: (IControlMessage|null);
|
32
|
+
|
33
|
+
/** RPC _control. */
|
34
|
+
public _control?: "control";
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Encodes the specified RPC message. Does not implicitly {@link RPC.verify|verify} messages.
|
38
|
+
* @param m RPC message or plain object to encode
|
39
|
+
* @param [w] Writer to encode to
|
40
|
+
* @returns Writer
|
41
|
+
*/
|
42
|
+
public static encode(m: IRPC, w?: $protobuf.Writer): $protobuf.Writer;
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Decodes a RPC message from the specified reader or buffer.
|
46
|
+
* @param r Reader or buffer to decode from
|
47
|
+
* @param [l] Message length if known beforehand
|
48
|
+
* @returns RPC
|
49
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
50
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
51
|
+
*/
|
52
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): RPC;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Creates a RPC message from a plain object. Also converts values to their respective internal types.
|
56
|
+
* @param d Plain object
|
57
|
+
* @returns RPC
|
58
|
+
*/
|
59
|
+
public static fromObject(d: { [k: string]: any }): RPC;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Creates a plain object from a RPC message. Also converts values to other types if specified.
|
63
|
+
* @param m RPC
|
64
|
+
* @param [o] Conversion options
|
65
|
+
* @returns Plain object
|
66
|
+
*/
|
67
|
+
public static toObject(m: RPC, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Converts this RPC to JSON.
|
71
|
+
* @returns JSON object
|
72
|
+
*/
|
73
|
+
public toJSON(): { [k: string]: any };
|
70
74
|
}
|
71
75
|
|
72
76
|
export namespace RPC {
|
73
77
|
|
74
|
-
|
75
|
-
|
78
|
+
/** Properties of a SubOpts. */
|
79
|
+
interface ISubOpts {
|
80
|
+
|
81
|
+
/** SubOpts subscribe */
|
82
|
+
subscribe?: (boolean|null);
|
83
|
+
|
84
|
+
/** SubOpts topic */
|
85
|
+
topic?: (string|null);
|
86
|
+
}
|
87
|
+
|
88
|
+
/** Represents a SubOpts. */
|
89
|
+
class SubOpts implements ISubOpts {
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Constructs a new SubOpts.
|
93
|
+
* @param [p] Properties to set
|
94
|
+
*/
|
95
|
+
constructor(p?: RPC.ISubOpts);
|
96
|
+
|
97
|
+
/** SubOpts subscribe. */
|
98
|
+
public subscribe?: (boolean|null);
|
99
|
+
|
100
|
+
/** SubOpts topic. */
|
101
|
+
public topic?: (string|null);
|
102
|
+
|
103
|
+
/** SubOpts _subscribe. */
|
104
|
+
public _subscribe?: "subscribe";
|
105
|
+
|
106
|
+
/** SubOpts _topic. */
|
107
|
+
public _topic?: "topic";
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Encodes the specified SubOpts message. Does not implicitly {@link RPC.SubOpts.verify|verify} messages.
|
111
|
+
* @param m SubOpts message or plain object to encode
|
112
|
+
* @param [w] Writer to encode to
|
113
|
+
* @returns Writer
|
114
|
+
*/
|
115
|
+
public static encode(m: RPC.ISubOpts, w?: $protobuf.Writer): $protobuf.Writer;
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Decodes a SubOpts message from the specified reader or buffer.
|
119
|
+
* @param r Reader or buffer to decode from
|
120
|
+
* @param [l] Message length if known beforehand
|
121
|
+
* @returns SubOpts
|
122
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
123
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
124
|
+
*/
|
125
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): RPC.SubOpts;
|
126
|
+
|
127
|
+
/**
|
128
|
+
* Creates a SubOpts message from a plain object. Also converts values to their respective internal types.
|
129
|
+
* @param d Plain object
|
130
|
+
* @returns SubOpts
|
131
|
+
*/
|
132
|
+
public static fromObject(d: { [k: string]: any }): RPC.SubOpts;
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Creates a plain object from a SubOpts message. Also converts values to other types if specified.
|
136
|
+
* @param m SubOpts
|
137
|
+
* @param [o] Conversion options
|
138
|
+
* @returns Plain object
|
139
|
+
*/
|
140
|
+
public static toObject(m: RPC.SubOpts, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Converts this SubOpts to JSON.
|
144
|
+
* @returns JSON object
|
145
|
+
*/
|
146
|
+
public toJSON(): { [k: string]: any };
|
147
|
+
}
|
148
|
+
|
149
|
+
/** Properties of a Message. */
|
150
|
+
interface IMessage {
|
151
|
+
|
152
|
+
/** Message from */
|
153
|
+
from?: (Uint8Array|null);
|
154
|
+
|
155
|
+
/** Message data */
|
156
|
+
data?: (Uint8Array|null);
|
157
|
+
|
158
|
+
/** Message seqno */
|
159
|
+
seqno?: (Uint8Array|null);
|
160
|
+
|
161
|
+
/** Message topic */
|
162
|
+
topic?: (string|null);
|
163
|
+
|
164
|
+
/** Message signature */
|
165
|
+
signature?: (Uint8Array|null);
|
166
|
+
|
167
|
+
/** Message key */
|
168
|
+
key?: (Uint8Array|null);
|
169
|
+
}
|
170
|
+
|
171
|
+
/** Represents a Message. */
|
172
|
+
class Message implements IMessage {
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Constructs a new Message.
|
176
|
+
* @param [p] Properties to set
|
177
|
+
*/
|
178
|
+
constructor(p?: RPC.IMessage);
|
179
|
+
|
180
|
+
/** Message from. */
|
181
|
+
public from?: (Uint8Array|null);
|
182
|
+
|
183
|
+
/** Message data. */
|
184
|
+
public data?: (Uint8Array|null);
|
185
|
+
|
186
|
+
/** Message seqno. */
|
187
|
+
public seqno?: (Uint8Array|null);
|
188
|
+
|
189
|
+
/** Message topic. */
|
190
|
+
public topic?: (string|null);
|
191
|
+
|
192
|
+
/** Message signature. */
|
193
|
+
public signature?: (Uint8Array|null);
|
194
|
+
|
195
|
+
/** Message key. */
|
196
|
+
public key?: (Uint8Array|null);
|
197
|
+
|
198
|
+
/** Message _from. */
|
199
|
+
public _from?: "from";
|
200
|
+
|
201
|
+
/** Message _data. */
|
202
|
+
public _data?: "data";
|
203
|
+
|
204
|
+
/** Message _seqno. */
|
205
|
+
public _seqno?: "seqno";
|
206
|
+
|
207
|
+
/** Message _topic. */
|
208
|
+
public _topic?: "topic";
|
209
|
+
|
210
|
+
/** Message _signature. */
|
211
|
+
public _signature?: "signature";
|
212
|
+
|
213
|
+
/** Message _key. */
|
214
|
+
public _key?: "key";
|
215
|
+
|
216
|
+
/**
|
217
|
+
* Encodes the specified Message message. Does not implicitly {@link RPC.Message.verify|verify} messages.
|
218
|
+
* @param m Message message or plain object to encode
|
219
|
+
* @param [w] Writer to encode to
|
220
|
+
* @returns Writer
|
221
|
+
*/
|
222
|
+
public static encode(m: RPC.IMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Decodes a Message message from the specified reader or buffer.
|
226
|
+
* @param r Reader or buffer to decode from
|
227
|
+
* @param [l] Message length if known beforehand
|
228
|
+
* @returns Message
|
229
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
230
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
231
|
+
*/
|
232
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): RPC.Message;
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Creates a Message message from a plain object. Also converts values to their respective internal types.
|
236
|
+
* @param d Plain object
|
237
|
+
* @returns Message
|
238
|
+
*/
|
239
|
+
public static fromObject(d: { [k: string]: any }): RPC.Message;
|
240
|
+
|
241
|
+
/**
|
242
|
+
* Creates a plain object from a Message message. Also converts values to other types if specified.
|
243
|
+
* @param m Message
|
244
|
+
* @param [o] Conversion options
|
245
|
+
* @returns Plain object
|
246
|
+
*/
|
247
|
+
public static toObject(m: RPC.Message, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Converts this Message to JSON.
|
251
|
+
* @returns JSON object
|
252
|
+
*/
|
253
|
+
public toJSON(): { [k: string]: any };
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
/** Properties of a ControlMessage. */
|
258
|
+
export interface IControlMessage {
|
259
|
+
|
260
|
+
/** ControlMessage ihave */
|
261
|
+
ihave?: (IControlIHave[]|null);
|
262
|
+
|
263
|
+
/** ControlMessage iwant */
|
264
|
+
iwant?: (IControlIWant[]|null);
|
265
|
+
|
266
|
+
/** ControlMessage graft */
|
267
|
+
graft?: (IControlGraft[]|null);
|
76
268
|
|
77
|
-
/**
|
78
|
-
|
269
|
+
/** ControlMessage prune */
|
270
|
+
prune?: (IControlPrune[]|null);
|
271
|
+
}
|
79
272
|
|
80
|
-
|
81
|
-
|
82
|
-
}
|
273
|
+
/** Represents a ControlMessage. */
|
274
|
+
export class ControlMessage implements IControlMessage {
|
83
275
|
|
84
|
-
/** Represents a SubOpts. */
|
85
|
-
class SubOpts implements ISubOpts {
|
86
276
|
/**
|
87
|
-
* Constructs a new
|
88
|
-
*
|
89
|
-
* @param [p] - Properties to set
|
277
|
+
* Constructs a new ControlMessage.
|
278
|
+
* @param [p] Properties to set
|
90
279
|
*/
|
91
|
-
constructor
|
280
|
+
constructor(p?: IControlMessage);
|
92
281
|
|
93
|
-
/**
|
94
|
-
public
|
282
|
+
/** ControlMessage ihave. */
|
283
|
+
public ihave: IControlIHave[];
|
95
284
|
|
96
|
-
/**
|
97
|
-
public
|
285
|
+
/** ControlMessage iwant. */
|
286
|
+
public iwant: IControlIWant[];
|
98
287
|
|
99
|
-
/**
|
100
|
-
public
|
288
|
+
/** ControlMessage graft. */
|
289
|
+
public graft: IControlGraft[];
|
101
290
|
|
102
|
-
/**
|
103
|
-
public
|
291
|
+
/** ControlMessage prune. */
|
292
|
+
public prune: IControlPrune[];
|
104
293
|
|
105
294
|
/**
|
106
|
-
* Encodes the specified
|
107
|
-
*
|
108
|
-
* @param
|
109
|
-
* @param [w] - Writer to encode to
|
295
|
+
* Encodes the specified ControlMessage message. Does not implicitly {@link ControlMessage.verify|verify} messages.
|
296
|
+
* @param m ControlMessage message or plain object to encode
|
297
|
+
* @param [w] Writer to encode to
|
110
298
|
* @returns Writer
|
111
299
|
*/
|
112
|
-
public static encode
|
300
|
+
public static encode(m: IControlMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
113
301
|
|
114
302
|
/**
|
115
|
-
* Decodes a
|
116
|
-
*
|
117
|
-
* @param
|
118
|
-
* @
|
119
|
-
* @returns SubOpts
|
303
|
+
* Decodes a ControlMessage message from the specified reader or buffer.
|
304
|
+
* @param r Reader or buffer to decode from
|
305
|
+
* @param [l] Message length if known beforehand
|
306
|
+
* @returns ControlMessage
|
120
307
|
* @throws {Error} If the payload is not a reader or valid buffer
|
121
308
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
122
309
|
*/
|
123
|
-
public static decode
|
310
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlMessage;
|
124
311
|
|
125
312
|
/**
|
126
|
-
* Creates a
|
127
|
-
*
|
128
|
-
* @
|
129
|
-
* @returns SubOpts
|
313
|
+
* Creates a ControlMessage message from a plain object. Also converts values to their respective internal types.
|
314
|
+
* @param d Plain object
|
315
|
+
* @returns ControlMessage
|
130
316
|
*/
|
131
|
-
public static fromObject
|
317
|
+
public static fromObject(d: { [k: string]: any }): ControlMessage;
|
132
318
|
|
133
319
|
/**
|
134
|
-
* Creates a plain object from a
|
135
|
-
*
|
136
|
-
* @param
|
137
|
-
* @param [o] - Conversion options
|
320
|
+
* Creates a plain object from a ControlMessage message. Also converts values to other types if specified.
|
321
|
+
* @param m ControlMessage
|
322
|
+
* @param [o] Conversion options
|
138
323
|
* @returns Plain object
|
139
324
|
*/
|
140
|
-
public static toObject
|
325
|
+
public static toObject(m: ControlMessage, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
141
326
|
|
142
327
|
/**
|
143
|
-
* Converts this
|
144
|
-
*
|
328
|
+
* Converts this ControlMessage to JSON.
|
145
329
|
* @returns JSON object
|
146
330
|
*/
|
147
|
-
public toJSON
|
148
|
-
|
331
|
+
public toJSON(): { [k: string]: any };
|
332
|
+
}
|
333
|
+
|
334
|
+
/** Properties of a ControlIHave. */
|
335
|
+
export interface IControlIHave {
|
336
|
+
|
337
|
+
/** ControlIHave topicID */
|
338
|
+
topicID?: (string|null);
|
339
|
+
|
340
|
+
/** ControlIHave messageIDs */
|
341
|
+
messageIDs?: (string[]|null);
|
342
|
+
}
|
343
|
+
|
344
|
+
/** Represents a ControlIHave. */
|
345
|
+
export class ControlIHave implements IControlIHave {
|
346
|
+
|
347
|
+
/**
|
348
|
+
* Constructs a new ControlIHave.
|
349
|
+
* @param [p] Properties to set
|
350
|
+
*/
|
351
|
+
constructor(p?: IControlIHave);
|
149
352
|
|
150
|
-
|
151
|
-
|
353
|
+
/** ControlIHave topicID. */
|
354
|
+
public topicID?: (string|null);
|
152
355
|
|
153
|
-
/**
|
154
|
-
|
356
|
+
/** ControlIHave messageIDs. */
|
357
|
+
public messageIDs: string[];
|
155
358
|
|
156
|
-
/**
|
157
|
-
|
359
|
+
/** ControlIHave _topicID. */
|
360
|
+
public _topicID?: "topicID";
|
158
361
|
|
159
|
-
/**
|
160
|
-
|
362
|
+
/**
|
363
|
+
* Encodes the specified ControlIHave message. Does not implicitly {@link ControlIHave.verify|verify} messages.
|
364
|
+
* @param m ControlIHave message or plain object to encode
|
365
|
+
* @param [w] Writer to encode to
|
366
|
+
* @returns Writer
|
367
|
+
*/
|
368
|
+
public static encode(m: IControlIHave, w?: $protobuf.Writer): $protobuf.Writer;
|
161
369
|
|
162
|
-
/**
|
163
|
-
|
370
|
+
/**
|
371
|
+
* Decodes a ControlIHave message from the specified reader or buffer.
|
372
|
+
* @param r Reader or buffer to decode from
|
373
|
+
* @param [l] Message length if known beforehand
|
374
|
+
* @returns ControlIHave
|
375
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
376
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
377
|
+
*/
|
378
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlIHave;
|
164
379
|
|
165
|
-
/**
|
166
|
-
|
380
|
+
/**
|
381
|
+
* Creates a ControlIHave message from a plain object. Also converts values to their respective internal types.
|
382
|
+
* @param d Plain object
|
383
|
+
* @returns ControlIHave
|
384
|
+
*/
|
385
|
+
public static fromObject(d: { [k: string]: any }): ControlIHave;
|
167
386
|
|
168
|
-
/**
|
169
|
-
|
170
|
-
|
387
|
+
/**
|
388
|
+
* Creates a plain object from a ControlIHave message. Also converts values to other types if specified.
|
389
|
+
* @param m ControlIHave
|
390
|
+
* @param [o] Conversion options
|
391
|
+
* @returns Plain object
|
392
|
+
*/
|
393
|
+
public static toObject(m: ControlIHave, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
171
394
|
|
172
|
-
/** Represents a Message. */
|
173
|
-
class Message implements IMessage {
|
174
395
|
/**
|
175
|
-
*
|
176
|
-
*
|
177
|
-
* @param [p] - Properties to set
|
396
|
+
* Converts this ControlIHave to JSON.
|
397
|
+
* @returns JSON object
|
178
398
|
*/
|
179
|
-
|
399
|
+
public toJSON(): { [k: string]: any };
|
400
|
+
}
|
401
|
+
|
402
|
+
/** Properties of a ControlIWant. */
|
403
|
+
export interface IControlIWant {
|
180
404
|
|
181
|
-
/**
|
182
|
-
|
405
|
+
/** ControlIWant messageIDs */
|
406
|
+
messageIDs?: (string[]|null);
|
407
|
+
}
|
183
408
|
|
184
|
-
|
185
|
-
|
409
|
+
/** Represents a ControlIWant. */
|
410
|
+
export class ControlIWant implements IControlIWant {
|
186
411
|
|
187
|
-
/**
|
188
|
-
|
412
|
+
/**
|
413
|
+
* Constructs a new ControlIWant.
|
414
|
+
* @param [p] Properties to set
|
415
|
+
*/
|
416
|
+
constructor(p?: IControlIWant);
|
189
417
|
|
190
|
-
/**
|
191
|
-
public
|
418
|
+
/** ControlIWant messageIDs. */
|
419
|
+
public messageIDs: string[];
|
420
|
+
|
421
|
+
/**
|
422
|
+
* Encodes the specified ControlIWant message. Does not implicitly {@link ControlIWant.verify|verify} messages.
|
423
|
+
* @param m ControlIWant message or plain object to encode
|
424
|
+
* @param [w] Writer to encode to
|
425
|
+
* @returns Writer
|
426
|
+
*/
|
427
|
+
public static encode(m: IControlIWant, w?: $protobuf.Writer): $protobuf.Writer;
|
192
428
|
|
193
|
-
/**
|
194
|
-
|
429
|
+
/**
|
430
|
+
* Decodes a ControlIWant message from the specified reader or buffer.
|
431
|
+
* @param r Reader or buffer to decode from
|
432
|
+
* @param [l] Message length if known beforehand
|
433
|
+
* @returns ControlIWant
|
434
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
435
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
436
|
+
*/
|
437
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlIWant;
|
195
438
|
|
196
|
-
/**
|
197
|
-
|
439
|
+
/**
|
440
|
+
* Creates a ControlIWant message from a plain object. Also converts values to their respective internal types.
|
441
|
+
* @param d Plain object
|
442
|
+
* @returns ControlIWant
|
443
|
+
*/
|
444
|
+
public static fromObject(d: { [k: string]: any }): ControlIWant;
|
198
445
|
|
199
|
-
/**
|
200
|
-
|
446
|
+
/**
|
447
|
+
* Creates a plain object from a ControlIWant message. Also converts values to other types if specified.
|
448
|
+
* @param m ControlIWant
|
449
|
+
* @param [o] Conversion options
|
450
|
+
* @returns Plain object
|
451
|
+
*/
|
452
|
+
public static toObject(m: ControlIWant, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
453
|
+
|
454
|
+
/**
|
455
|
+
* Converts this ControlIWant to JSON.
|
456
|
+
* @returns JSON object
|
457
|
+
*/
|
458
|
+
public toJSON(): { [k: string]: any };
|
459
|
+
}
|
460
|
+
|
461
|
+
/** Properties of a ControlGraft. */
|
462
|
+
export interface IControlGraft {
|
463
|
+
|
464
|
+
/** ControlGraft topicID */
|
465
|
+
topicID?: (string|null);
|
466
|
+
}
|
467
|
+
|
468
|
+
/** Represents a ControlGraft. */
|
469
|
+
export class ControlGraft implements IControlGraft {
|
470
|
+
|
471
|
+
/**
|
472
|
+
* Constructs a new ControlGraft.
|
473
|
+
* @param [p] Properties to set
|
474
|
+
*/
|
475
|
+
constructor(p?: IControlGraft);
|
476
|
+
|
477
|
+
/** ControlGraft topicID. */
|
478
|
+
public topicID?: (string|null);
|
479
|
+
|
480
|
+
/** ControlGraft _topicID. */
|
481
|
+
public _topicID?: "topicID";
|
482
|
+
|
483
|
+
/**
|
484
|
+
* Encodes the specified ControlGraft message. Does not implicitly {@link ControlGraft.verify|verify} messages.
|
485
|
+
* @param m ControlGraft message or plain object to encode
|
486
|
+
* @param [w] Writer to encode to
|
487
|
+
* @returns Writer
|
488
|
+
*/
|
489
|
+
public static encode(m: IControlGraft, w?: $protobuf.Writer): $protobuf.Writer;
|
490
|
+
|
491
|
+
/**
|
492
|
+
* Decodes a ControlGraft message from the specified reader or buffer.
|
493
|
+
* @param r Reader or buffer to decode from
|
494
|
+
* @param [l] Message length if known beforehand
|
495
|
+
* @returns ControlGraft
|
496
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
497
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
498
|
+
*/
|
499
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlGraft;
|
500
|
+
|
501
|
+
/**
|
502
|
+
* Creates a ControlGraft message from a plain object. Also converts values to their respective internal types.
|
503
|
+
* @param d Plain object
|
504
|
+
* @returns ControlGraft
|
505
|
+
*/
|
506
|
+
public static fromObject(d: { [k: string]: any }): ControlGraft;
|
507
|
+
|
508
|
+
/**
|
509
|
+
* Creates a plain object from a ControlGraft message. Also converts values to other types if specified.
|
510
|
+
* @param m ControlGraft
|
511
|
+
* @param [o] Conversion options
|
512
|
+
* @returns Plain object
|
513
|
+
*/
|
514
|
+
public static toObject(m: ControlGraft, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
515
|
+
|
516
|
+
/**
|
517
|
+
* Converts this ControlGraft to JSON.
|
518
|
+
* @returns JSON object
|
519
|
+
*/
|
520
|
+
public toJSON(): { [k: string]: any };
|
521
|
+
}
|
522
|
+
|
523
|
+
/** Properties of a ControlPrune. */
|
524
|
+
export interface IControlPrune {
|
525
|
+
|
526
|
+
/** ControlPrune topicID */
|
527
|
+
topicID?: (string|null);
|
528
|
+
|
529
|
+
/** ControlPrune peers */
|
530
|
+
peers?: (IPeerInfo[]|null);
|
531
|
+
|
532
|
+
/** ControlPrune backoff */
|
533
|
+
backoff?: (number|null);
|
534
|
+
}
|
535
|
+
|
536
|
+
/** Represents a ControlPrune. */
|
537
|
+
export class ControlPrune implements IControlPrune {
|
538
|
+
|
539
|
+
/**
|
540
|
+
* Constructs a new ControlPrune.
|
541
|
+
* @param [p] Properties to set
|
542
|
+
*/
|
543
|
+
constructor(p?: IControlPrune);
|
544
|
+
|
545
|
+
/** ControlPrune topicID. */
|
546
|
+
public topicID?: (string|null);
|
547
|
+
|
548
|
+
/** ControlPrune peers. */
|
549
|
+
public peers: IPeerInfo[];
|
550
|
+
|
551
|
+
/** ControlPrune backoff. */
|
552
|
+
public backoff?: (number|null);
|
553
|
+
|
554
|
+
/** ControlPrune _topicID. */
|
555
|
+
public _topicID?: "topicID";
|
556
|
+
|
557
|
+
/** ControlPrune _backoff. */
|
558
|
+
public _backoff?: "backoff";
|
559
|
+
|
560
|
+
/**
|
561
|
+
* Encodes the specified ControlPrune message. Does not implicitly {@link ControlPrune.verify|verify} messages.
|
562
|
+
* @param m ControlPrune message or plain object to encode
|
563
|
+
* @param [w] Writer to encode to
|
564
|
+
* @returns Writer
|
565
|
+
*/
|
566
|
+
public static encode(m: IControlPrune, w?: $protobuf.Writer): $protobuf.Writer;
|
567
|
+
|
568
|
+
/**
|
569
|
+
* Decodes a ControlPrune message from the specified reader or buffer.
|
570
|
+
* @param r Reader or buffer to decode from
|
571
|
+
* @param [l] Message length if known beforehand
|
572
|
+
* @returns ControlPrune
|
573
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
574
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
575
|
+
*/
|
576
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): ControlPrune;
|
577
|
+
|
578
|
+
/**
|
579
|
+
* Creates a ControlPrune message from a plain object. Also converts values to their respective internal types.
|
580
|
+
* @param d Plain object
|
581
|
+
* @returns ControlPrune
|
582
|
+
*/
|
583
|
+
public static fromObject(d: { [k: string]: any }): ControlPrune;
|
584
|
+
|
585
|
+
/**
|
586
|
+
* Creates a plain object from a ControlPrune message. Also converts values to other types if specified.
|
587
|
+
* @param m ControlPrune
|
588
|
+
* @param [o] Conversion options
|
589
|
+
* @returns Plain object
|
590
|
+
*/
|
591
|
+
public static toObject(m: ControlPrune, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
592
|
+
|
593
|
+
/**
|
594
|
+
* Converts this ControlPrune to JSON.
|
595
|
+
* @returns JSON object
|
596
|
+
*/
|
597
|
+
public toJSON(): { [k: string]: any };
|
598
|
+
}
|
599
|
+
|
600
|
+
/** Properties of a PeerInfo. */
|
601
|
+
export interface IPeerInfo {
|
602
|
+
|
603
|
+
/** PeerInfo peerID */
|
604
|
+
peerID?: (Uint8Array|null);
|
605
|
+
|
606
|
+
/** PeerInfo signedPeerRecord */
|
607
|
+
signedPeerRecord?: (Uint8Array|null);
|
608
|
+
}
|
609
|
+
|
610
|
+
/** Represents a PeerInfo. */
|
611
|
+
export class PeerInfo implements IPeerInfo {
|
612
|
+
|
613
|
+
/**
|
614
|
+
* Constructs a new PeerInfo.
|
615
|
+
* @param [p] Properties to set
|
616
|
+
*/
|
617
|
+
constructor(p?: IPeerInfo);
|
201
618
|
|
202
|
-
/**
|
203
|
-
public
|
619
|
+
/** PeerInfo peerID. */
|
620
|
+
public peerID?: (Uint8Array|null);
|
204
621
|
|
205
|
-
/**
|
206
|
-
public
|
622
|
+
/** PeerInfo signedPeerRecord. */
|
623
|
+
public signedPeerRecord?: (Uint8Array|null);
|
207
624
|
|
208
|
-
/**
|
209
|
-
public
|
625
|
+
/** PeerInfo _peerID. */
|
626
|
+
public _peerID?: "peerID";
|
210
627
|
|
211
|
-
/**
|
212
|
-
public
|
628
|
+
/** PeerInfo _signedPeerRecord. */
|
629
|
+
public _signedPeerRecord?: "signedPeerRecord";
|
213
630
|
|
214
631
|
/**
|
215
|
-
* Encodes the specified
|
216
|
-
*
|
217
|
-
* @param
|
218
|
-
* @param [w] - Writer to encode to
|
632
|
+
* Encodes the specified PeerInfo message. Does not implicitly {@link PeerInfo.verify|verify} messages.
|
633
|
+
* @param m PeerInfo message or plain object to encode
|
634
|
+
* @param [w] Writer to encode to
|
219
635
|
* @returns Writer
|
220
636
|
*/
|
221
|
-
public static encode
|
637
|
+
public static encode(m: IPeerInfo, w?: $protobuf.Writer): $protobuf.Writer;
|
222
638
|
|
223
639
|
/**
|
224
|
-
* Decodes a
|
225
|
-
*
|
226
|
-
* @param
|
227
|
-
* @
|
228
|
-
* @returns Message
|
640
|
+
* Decodes a PeerInfo message from the specified reader or buffer.
|
641
|
+
* @param r Reader or buffer to decode from
|
642
|
+
* @param [l] Message length if known beforehand
|
643
|
+
* @returns PeerInfo
|
229
644
|
* @throws {Error} If the payload is not a reader or valid buffer
|
230
645
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
231
646
|
*/
|
232
|
-
public static decode
|
647
|
+
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PeerInfo;
|
233
648
|
|
234
649
|
/**
|
235
|
-
* Creates a
|
236
|
-
*
|
237
|
-
* @
|
238
|
-
* @returns Message
|
650
|
+
* Creates a PeerInfo message from a plain object. Also converts values to their respective internal types.
|
651
|
+
* @param d Plain object
|
652
|
+
* @returns PeerInfo
|
239
653
|
*/
|
240
|
-
public static fromObject
|
654
|
+
public static fromObject(d: { [k: string]: any }): PeerInfo;
|
241
655
|
|
242
656
|
/**
|
243
|
-
* Creates a plain object from a
|
244
|
-
*
|
245
|
-
* @param
|
246
|
-
* @param [o] - Conversion options
|
657
|
+
* Creates a plain object from a PeerInfo message. Also converts values to other types if specified.
|
658
|
+
* @param m PeerInfo
|
659
|
+
* @param [o] Conversion options
|
247
660
|
* @returns Plain object
|
248
661
|
*/
|
249
|
-
public static toObject
|
662
|
+
public static toObject(m: PeerInfo, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
250
663
|
|
251
664
|
/**
|
252
|
-
* Converts this
|
253
|
-
*
|
665
|
+
* Converts this PeerInfo to JSON.
|
254
666
|
* @returns JSON object
|
255
667
|
*/
|
256
|
-
public toJSON
|
257
|
-
}
|
668
|
+
public toJSON(): { [k: string]: any };
|
258
669
|
}
|