@libp2p/daemon-protocol 2.0.1 → 2.0.2
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/index.d.ts +26 -26
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1093 -101
- package/dist/src/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1325 -133
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable import/export */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
3
3
|
|
|
4
|
-
import { enumeration, encodeMessage, decodeMessage, message
|
|
5
|
-
import type { Codec } from 'protons-runtime'
|
|
4
|
+
import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime'
|
|
6
5
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
6
|
+
import type { Codec } from 'protons-runtime'
|
|
7
7
|
|
|
8
8
|
export interface Request {
|
|
9
9
|
type: Request.Type
|
|
@@ -46,25 +46,123 @@ export namespace Request {
|
|
|
46
46
|
|
|
47
47
|
export namespace Type {
|
|
48
48
|
export const codec = () => {
|
|
49
|
-
return enumeration<
|
|
49
|
+
return enumeration<Type>(__TypeValues)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
let _codec: Codec<Request>
|
|
54
|
+
|
|
53
55
|
export const codec = (): Codec<Request> => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
if (_codec == null) {
|
|
57
|
+
_codec = message<Request>((obj, writer, opts = {}) => {
|
|
58
|
+
if (opts.lengthDelimited !== false) {
|
|
59
|
+
writer.fork()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (obj.type != null) {
|
|
63
|
+
writer.uint32(8)
|
|
64
|
+
Request.Type.codec().encode(obj.type, writer)
|
|
65
|
+
} else {
|
|
66
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (obj.connect != null) {
|
|
70
|
+
writer.uint32(18)
|
|
71
|
+
ConnectRequest.codec().encode(obj.connect, writer)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (obj.streamOpen != null) {
|
|
75
|
+
writer.uint32(26)
|
|
76
|
+
StreamOpenRequest.codec().encode(obj.streamOpen, writer)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (obj.streamHandler != null) {
|
|
80
|
+
writer.uint32(34)
|
|
81
|
+
StreamHandlerRequest.codec().encode(obj.streamHandler, writer)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (obj.dht != null) {
|
|
85
|
+
writer.uint32(42)
|
|
86
|
+
DHTRequest.codec().encode(obj.dht, writer)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (obj.connManager != null) {
|
|
90
|
+
writer.uint32(50)
|
|
91
|
+
ConnManagerRequest.codec().encode(obj.connManager, writer)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (obj.disconnect != null) {
|
|
95
|
+
writer.uint32(58)
|
|
96
|
+
DisconnectRequest.codec().encode(obj.disconnect, writer)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (obj.pubsub != null) {
|
|
100
|
+
writer.uint32(66)
|
|
101
|
+
PSRequest.codec().encode(obj.pubsub, writer)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (obj.peerStore != null) {
|
|
105
|
+
writer.uint32(74)
|
|
106
|
+
PeerstoreRequest.codec().encode(obj.peerStore, writer)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (opts.lengthDelimited !== false) {
|
|
110
|
+
writer.ldelim()
|
|
111
|
+
}
|
|
112
|
+
}, (reader, length) => {
|
|
113
|
+
const obj: any = {}
|
|
114
|
+
|
|
115
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
116
|
+
|
|
117
|
+
while (reader.pos < end) {
|
|
118
|
+
const tag = reader.uint32()
|
|
119
|
+
|
|
120
|
+
switch (tag >>> 3) {
|
|
121
|
+
case 1:
|
|
122
|
+
obj.type = Request.Type.codec().decode(reader)
|
|
123
|
+
break
|
|
124
|
+
case 2:
|
|
125
|
+
obj.connect = ConnectRequest.codec().decode(reader, reader.uint32())
|
|
126
|
+
break
|
|
127
|
+
case 3:
|
|
128
|
+
obj.streamOpen = StreamOpenRequest.codec().decode(reader, reader.uint32())
|
|
129
|
+
break
|
|
130
|
+
case 4:
|
|
131
|
+
obj.streamHandler = StreamHandlerRequest.codec().decode(reader, reader.uint32())
|
|
132
|
+
break
|
|
133
|
+
case 5:
|
|
134
|
+
obj.dht = DHTRequest.codec().decode(reader, reader.uint32())
|
|
135
|
+
break
|
|
136
|
+
case 6:
|
|
137
|
+
obj.connManager = ConnManagerRequest.codec().decode(reader, reader.uint32())
|
|
138
|
+
break
|
|
139
|
+
case 7:
|
|
140
|
+
obj.disconnect = DisconnectRequest.codec().decode(reader, reader.uint32())
|
|
141
|
+
break
|
|
142
|
+
case 8:
|
|
143
|
+
obj.pubsub = PSRequest.codec().decode(reader, reader.uint32())
|
|
144
|
+
break
|
|
145
|
+
case 9:
|
|
146
|
+
obj.peerStore = PeerstoreRequest.codec().decode(reader, reader.uint32())
|
|
147
|
+
break
|
|
148
|
+
default:
|
|
149
|
+
reader.skipType(tag & 7)
|
|
150
|
+
break
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (obj.type == null) {
|
|
155
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return obj
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return _codec
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const encode = (obj: Request): Uint8Array => {
|
|
68
166
|
return encodeMessage(obj, Request.codec())
|
|
69
167
|
}
|
|
70
168
|
|
|
@@ -97,24 +195,126 @@ export namespace Response {
|
|
|
97
195
|
|
|
98
196
|
export namespace Type {
|
|
99
197
|
export const codec = () => {
|
|
100
|
-
return enumeration<
|
|
198
|
+
return enumeration<Type>(__TypeValues)
|
|
101
199
|
}
|
|
102
200
|
}
|
|
103
201
|
|
|
202
|
+
let _codec: Codec<Response>
|
|
203
|
+
|
|
104
204
|
export const codec = (): Codec<Response> => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
205
|
+
if (_codec == null) {
|
|
206
|
+
_codec = message<Response>((obj, writer, opts = {}) => {
|
|
207
|
+
if (opts.lengthDelimited !== false) {
|
|
208
|
+
writer.fork()
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (obj.type != null) {
|
|
212
|
+
writer.uint32(8)
|
|
213
|
+
Response.Type.codec().encode(obj.type, writer)
|
|
214
|
+
} else {
|
|
215
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (obj.error != null) {
|
|
219
|
+
writer.uint32(18)
|
|
220
|
+
ErrorResponse.codec().encode(obj.error, writer)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (obj.streamInfo != null) {
|
|
224
|
+
writer.uint32(26)
|
|
225
|
+
StreamInfo.codec().encode(obj.streamInfo, writer)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (obj.identify != null) {
|
|
229
|
+
writer.uint32(34)
|
|
230
|
+
IdentifyResponse.codec().encode(obj.identify, writer)
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (obj.dht != null) {
|
|
234
|
+
writer.uint32(42)
|
|
235
|
+
DHTResponse.codec().encode(obj.dht, writer)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (obj.peers != null) {
|
|
239
|
+
for (const value of obj.peers) {
|
|
240
|
+
writer.uint32(50)
|
|
241
|
+
PeerInfo.codec().encode(value, writer)
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
throw new Error('Protocol error: required field "peers" was not found in object')
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (obj.pubsub != null) {
|
|
248
|
+
writer.uint32(58)
|
|
249
|
+
PSResponse.codec().encode(obj.pubsub, writer)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (obj.peerStore != null) {
|
|
253
|
+
writer.uint32(66)
|
|
254
|
+
PeerstoreResponse.codec().encode(obj.peerStore, writer)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (opts.lengthDelimited !== false) {
|
|
258
|
+
writer.ldelim()
|
|
259
|
+
}
|
|
260
|
+
}, (reader, length) => {
|
|
261
|
+
const obj: any = {}
|
|
262
|
+
|
|
263
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
264
|
+
|
|
265
|
+
while (reader.pos < end) {
|
|
266
|
+
const tag = reader.uint32()
|
|
267
|
+
|
|
268
|
+
switch (tag >>> 3) {
|
|
269
|
+
case 1:
|
|
270
|
+
obj.type = Response.Type.codec().decode(reader)
|
|
271
|
+
break
|
|
272
|
+
case 2:
|
|
273
|
+
obj.error = ErrorResponse.codec().decode(reader, reader.uint32())
|
|
274
|
+
break
|
|
275
|
+
case 3:
|
|
276
|
+
obj.streamInfo = StreamInfo.codec().decode(reader, reader.uint32())
|
|
277
|
+
break
|
|
278
|
+
case 4:
|
|
279
|
+
obj.identify = IdentifyResponse.codec().decode(reader, reader.uint32())
|
|
280
|
+
break
|
|
281
|
+
case 5:
|
|
282
|
+
obj.dht = DHTResponse.codec().decode(reader, reader.uint32())
|
|
283
|
+
break
|
|
284
|
+
case 6:
|
|
285
|
+
obj.peers = obj.peers ?? []
|
|
286
|
+
obj.peers.push(PeerInfo.codec().decode(reader, reader.uint32()))
|
|
287
|
+
break
|
|
288
|
+
case 7:
|
|
289
|
+
obj.pubsub = PSResponse.codec().decode(reader, reader.uint32())
|
|
290
|
+
break
|
|
291
|
+
case 8:
|
|
292
|
+
obj.peerStore = PeerstoreResponse.codec().decode(reader, reader.uint32())
|
|
293
|
+
break
|
|
294
|
+
default:
|
|
295
|
+
reader.skipType(tag & 7)
|
|
296
|
+
break
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
obj.peers = obj.peers ?? []
|
|
301
|
+
|
|
302
|
+
if (obj.type == null) {
|
|
303
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (obj.peers == null) {
|
|
307
|
+
throw new Error('Protocol error: value for required field "peers" was not found in protobuf')
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return obj
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return _codec
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export const encode = (obj: Response): Uint8Array => {
|
|
118
318
|
return encodeMessage(obj, Response.codec())
|
|
119
319
|
}
|
|
120
320
|
|
|
@@ -129,14 +329,74 @@ export interface IdentifyResponse {
|
|
|
129
329
|
}
|
|
130
330
|
|
|
131
331
|
export namespace IdentifyResponse {
|
|
332
|
+
let _codec: Codec<IdentifyResponse>
|
|
333
|
+
|
|
132
334
|
export const codec = (): Codec<IdentifyResponse> => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
335
|
+
if (_codec == null) {
|
|
336
|
+
_codec = message<IdentifyResponse>((obj, writer, opts = {}) => {
|
|
337
|
+
if (opts.lengthDelimited !== false) {
|
|
338
|
+
writer.fork()
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (obj.id != null) {
|
|
342
|
+
writer.uint32(10)
|
|
343
|
+
writer.bytes(obj.id)
|
|
344
|
+
} else {
|
|
345
|
+
throw new Error('Protocol error: required field "id" was not found in object')
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (obj.addrs != null) {
|
|
349
|
+
for (const value of obj.addrs) {
|
|
350
|
+
writer.uint32(18)
|
|
351
|
+
writer.bytes(value)
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
throw new Error('Protocol error: required field "addrs" was not found in object')
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (opts.lengthDelimited !== false) {
|
|
358
|
+
writer.ldelim()
|
|
359
|
+
}
|
|
360
|
+
}, (reader, length) => {
|
|
361
|
+
const obj: any = {}
|
|
362
|
+
|
|
363
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
364
|
+
|
|
365
|
+
while (reader.pos < end) {
|
|
366
|
+
const tag = reader.uint32()
|
|
367
|
+
|
|
368
|
+
switch (tag >>> 3) {
|
|
369
|
+
case 1:
|
|
370
|
+
obj.id = reader.bytes()
|
|
371
|
+
break
|
|
372
|
+
case 2:
|
|
373
|
+
obj.addrs = obj.addrs ?? []
|
|
374
|
+
obj.addrs.push(reader.bytes())
|
|
375
|
+
break
|
|
376
|
+
default:
|
|
377
|
+
reader.skipType(tag & 7)
|
|
378
|
+
break
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
obj.addrs = obj.addrs ?? []
|
|
383
|
+
|
|
384
|
+
if (obj.id == null) {
|
|
385
|
+
throw new Error('Protocol error: value for required field "id" was not found in protobuf')
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (obj.addrs == null) {
|
|
389
|
+
throw new Error('Protocol error: value for required field "addrs" was not found in protobuf')
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return obj
|
|
393
|
+
})
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return _codec
|
|
137
397
|
}
|
|
138
398
|
|
|
139
|
-
export const encode = (obj: IdentifyResponse):
|
|
399
|
+
export const encode = (obj: IdentifyResponse): Uint8Array => {
|
|
140
400
|
return encodeMessage(obj, IdentifyResponse.codec())
|
|
141
401
|
}
|
|
142
402
|
|
|
@@ -152,15 +412,82 @@ export interface ConnectRequest {
|
|
|
152
412
|
}
|
|
153
413
|
|
|
154
414
|
export namespace ConnectRequest {
|
|
415
|
+
let _codec: Codec<ConnectRequest>
|
|
416
|
+
|
|
155
417
|
export const codec = (): Codec<ConnectRequest> => {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
418
|
+
if (_codec == null) {
|
|
419
|
+
_codec = message<ConnectRequest>((obj, writer, opts = {}) => {
|
|
420
|
+
if (opts.lengthDelimited !== false) {
|
|
421
|
+
writer.fork()
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (obj.peer != null) {
|
|
425
|
+
writer.uint32(10)
|
|
426
|
+
writer.bytes(obj.peer)
|
|
427
|
+
} else {
|
|
428
|
+
throw new Error('Protocol error: required field "peer" was not found in object')
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (obj.addrs != null) {
|
|
432
|
+
for (const value of obj.addrs) {
|
|
433
|
+
writer.uint32(18)
|
|
434
|
+
writer.bytes(value)
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
throw new Error('Protocol error: required field "addrs" was not found in object')
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (obj.timeout != null) {
|
|
441
|
+
writer.uint32(24)
|
|
442
|
+
writer.int64(obj.timeout)
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (opts.lengthDelimited !== false) {
|
|
446
|
+
writer.ldelim()
|
|
447
|
+
}
|
|
448
|
+
}, (reader, length) => {
|
|
449
|
+
const obj: any = {}
|
|
450
|
+
|
|
451
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
452
|
+
|
|
453
|
+
while (reader.pos < end) {
|
|
454
|
+
const tag = reader.uint32()
|
|
455
|
+
|
|
456
|
+
switch (tag >>> 3) {
|
|
457
|
+
case 1:
|
|
458
|
+
obj.peer = reader.bytes()
|
|
459
|
+
break
|
|
460
|
+
case 2:
|
|
461
|
+
obj.addrs = obj.addrs ?? []
|
|
462
|
+
obj.addrs.push(reader.bytes())
|
|
463
|
+
break
|
|
464
|
+
case 3:
|
|
465
|
+
obj.timeout = reader.int64()
|
|
466
|
+
break
|
|
467
|
+
default:
|
|
468
|
+
reader.skipType(tag & 7)
|
|
469
|
+
break
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
obj.addrs = obj.addrs ?? []
|
|
474
|
+
|
|
475
|
+
if (obj.peer == null) {
|
|
476
|
+
throw new Error('Protocol error: value for required field "peer" was not found in protobuf')
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (obj.addrs == null) {
|
|
480
|
+
throw new Error('Protocol error: value for required field "addrs" was not found in protobuf')
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
return obj
|
|
484
|
+
})
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return _codec
|
|
161
488
|
}
|
|
162
489
|
|
|
163
|
-
export const encode = (obj: ConnectRequest):
|
|
490
|
+
export const encode = (obj: ConnectRequest): Uint8Array => {
|
|
164
491
|
return encodeMessage(obj, ConnectRequest.codec())
|
|
165
492
|
}
|
|
166
493
|
|
|
@@ -176,15 +503,82 @@ export interface StreamOpenRequest {
|
|
|
176
503
|
}
|
|
177
504
|
|
|
178
505
|
export namespace StreamOpenRequest {
|
|
506
|
+
let _codec: Codec<StreamOpenRequest>
|
|
507
|
+
|
|
179
508
|
export const codec = (): Codec<StreamOpenRequest> => {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
509
|
+
if (_codec == null) {
|
|
510
|
+
_codec = message<StreamOpenRequest>((obj, writer, opts = {}) => {
|
|
511
|
+
if (opts.lengthDelimited !== false) {
|
|
512
|
+
writer.fork()
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (obj.peer != null) {
|
|
516
|
+
writer.uint32(10)
|
|
517
|
+
writer.bytes(obj.peer)
|
|
518
|
+
} else {
|
|
519
|
+
throw new Error('Protocol error: required field "peer" was not found in object')
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (obj.proto != null) {
|
|
523
|
+
for (const value of obj.proto) {
|
|
524
|
+
writer.uint32(18)
|
|
525
|
+
writer.string(value)
|
|
526
|
+
}
|
|
527
|
+
} else {
|
|
528
|
+
throw new Error('Protocol error: required field "proto" was not found in object')
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (obj.timeout != null) {
|
|
532
|
+
writer.uint32(24)
|
|
533
|
+
writer.int64(obj.timeout)
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
if (opts.lengthDelimited !== false) {
|
|
537
|
+
writer.ldelim()
|
|
538
|
+
}
|
|
539
|
+
}, (reader, length) => {
|
|
540
|
+
const obj: any = {}
|
|
541
|
+
|
|
542
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
543
|
+
|
|
544
|
+
while (reader.pos < end) {
|
|
545
|
+
const tag = reader.uint32()
|
|
546
|
+
|
|
547
|
+
switch (tag >>> 3) {
|
|
548
|
+
case 1:
|
|
549
|
+
obj.peer = reader.bytes()
|
|
550
|
+
break
|
|
551
|
+
case 2:
|
|
552
|
+
obj.proto = obj.proto ?? []
|
|
553
|
+
obj.proto.push(reader.string())
|
|
554
|
+
break
|
|
555
|
+
case 3:
|
|
556
|
+
obj.timeout = reader.int64()
|
|
557
|
+
break
|
|
558
|
+
default:
|
|
559
|
+
reader.skipType(tag & 7)
|
|
560
|
+
break
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
obj.proto = obj.proto ?? []
|
|
565
|
+
|
|
566
|
+
if (obj.peer == null) {
|
|
567
|
+
throw new Error('Protocol error: value for required field "peer" was not found in protobuf')
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
if (obj.proto == null) {
|
|
571
|
+
throw new Error('Protocol error: value for required field "proto" was not found in protobuf')
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
return obj
|
|
575
|
+
})
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return _codec
|
|
185
579
|
}
|
|
186
580
|
|
|
187
|
-
export const encode = (obj: StreamOpenRequest):
|
|
581
|
+
export const encode = (obj: StreamOpenRequest): Uint8Array => {
|
|
188
582
|
return encodeMessage(obj, StreamOpenRequest.codec())
|
|
189
583
|
}
|
|
190
584
|
|
|
@@ -199,14 +593,74 @@ export interface StreamHandlerRequest {
|
|
|
199
593
|
}
|
|
200
594
|
|
|
201
595
|
export namespace StreamHandlerRequest {
|
|
596
|
+
let _codec: Codec<StreamHandlerRequest>
|
|
597
|
+
|
|
202
598
|
export const codec = (): Codec<StreamHandlerRequest> => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
599
|
+
if (_codec == null) {
|
|
600
|
+
_codec = message<StreamHandlerRequest>((obj, writer, opts = {}) => {
|
|
601
|
+
if (opts.lengthDelimited !== false) {
|
|
602
|
+
writer.fork()
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
if (obj.addr != null) {
|
|
606
|
+
writer.uint32(10)
|
|
607
|
+
writer.bytes(obj.addr)
|
|
608
|
+
} else {
|
|
609
|
+
throw new Error('Protocol error: required field "addr" was not found in object')
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
if (obj.proto != null) {
|
|
613
|
+
for (const value of obj.proto) {
|
|
614
|
+
writer.uint32(18)
|
|
615
|
+
writer.string(value)
|
|
616
|
+
}
|
|
617
|
+
} else {
|
|
618
|
+
throw new Error('Protocol error: required field "proto" was not found in object')
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if (opts.lengthDelimited !== false) {
|
|
622
|
+
writer.ldelim()
|
|
623
|
+
}
|
|
624
|
+
}, (reader, length) => {
|
|
625
|
+
const obj: any = {}
|
|
626
|
+
|
|
627
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
628
|
+
|
|
629
|
+
while (reader.pos < end) {
|
|
630
|
+
const tag = reader.uint32()
|
|
631
|
+
|
|
632
|
+
switch (tag >>> 3) {
|
|
633
|
+
case 1:
|
|
634
|
+
obj.addr = reader.bytes()
|
|
635
|
+
break
|
|
636
|
+
case 2:
|
|
637
|
+
obj.proto = obj.proto ?? []
|
|
638
|
+
obj.proto.push(reader.string())
|
|
639
|
+
break
|
|
640
|
+
default:
|
|
641
|
+
reader.skipType(tag & 7)
|
|
642
|
+
break
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
obj.proto = obj.proto ?? []
|
|
647
|
+
|
|
648
|
+
if (obj.addr == null) {
|
|
649
|
+
throw new Error('Protocol error: value for required field "addr" was not found in protobuf')
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
if (obj.proto == null) {
|
|
653
|
+
throw new Error('Protocol error: value for required field "proto" was not found in protobuf')
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
return obj
|
|
657
|
+
})
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
return _codec
|
|
207
661
|
}
|
|
208
662
|
|
|
209
|
-
export const encode = (obj: StreamHandlerRequest):
|
|
663
|
+
export const encode = (obj: StreamHandlerRequest): Uint8Array => {
|
|
210
664
|
return encodeMessage(obj, StreamHandlerRequest.codec())
|
|
211
665
|
}
|
|
212
666
|
|
|
@@ -220,13 +674,55 @@ export interface ErrorResponse {
|
|
|
220
674
|
}
|
|
221
675
|
|
|
222
676
|
export namespace ErrorResponse {
|
|
677
|
+
let _codec: Codec<ErrorResponse>
|
|
678
|
+
|
|
223
679
|
export const codec = (): Codec<ErrorResponse> => {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
680
|
+
if (_codec == null) {
|
|
681
|
+
_codec = message<ErrorResponse>((obj, writer, opts = {}) => {
|
|
682
|
+
if (opts.lengthDelimited !== false) {
|
|
683
|
+
writer.fork()
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
if (obj.msg != null) {
|
|
687
|
+
writer.uint32(10)
|
|
688
|
+
writer.string(obj.msg)
|
|
689
|
+
} else {
|
|
690
|
+
throw new Error('Protocol error: required field "msg" was not found in object')
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if (opts.lengthDelimited !== false) {
|
|
694
|
+
writer.ldelim()
|
|
695
|
+
}
|
|
696
|
+
}, (reader, length) => {
|
|
697
|
+
const obj: any = {}
|
|
698
|
+
|
|
699
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
700
|
+
|
|
701
|
+
while (reader.pos < end) {
|
|
702
|
+
const tag = reader.uint32()
|
|
703
|
+
|
|
704
|
+
switch (tag >>> 3) {
|
|
705
|
+
case 1:
|
|
706
|
+
obj.msg = reader.string()
|
|
707
|
+
break
|
|
708
|
+
default:
|
|
709
|
+
reader.skipType(tag & 7)
|
|
710
|
+
break
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (obj.msg == null) {
|
|
715
|
+
throw new Error('Protocol error: value for required field "msg" was not found in protobuf')
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return obj
|
|
719
|
+
})
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
return _codec
|
|
227
723
|
}
|
|
228
724
|
|
|
229
|
-
export const encode = (obj: ErrorResponse):
|
|
725
|
+
export const encode = (obj: ErrorResponse): Uint8Array => {
|
|
230
726
|
return encodeMessage(obj, ErrorResponse.codec())
|
|
231
727
|
}
|
|
232
728
|
|
|
@@ -242,15 +738,83 @@ export interface StreamInfo {
|
|
|
242
738
|
}
|
|
243
739
|
|
|
244
740
|
export namespace StreamInfo {
|
|
741
|
+
let _codec: Codec<StreamInfo>
|
|
742
|
+
|
|
245
743
|
export const codec = (): Codec<StreamInfo> => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
744
|
+
if (_codec == null) {
|
|
745
|
+
_codec = message<StreamInfo>((obj, writer, opts = {}) => {
|
|
746
|
+
if (opts.lengthDelimited !== false) {
|
|
747
|
+
writer.fork()
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (obj.peer != null) {
|
|
751
|
+
writer.uint32(10)
|
|
752
|
+
writer.bytes(obj.peer)
|
|
753
|
+
} else {
|
|
754
|
+
throw new Error('Protocol error: required field "peer" was not found in object')
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if (obj.addr != null) {
|
|
758
|
+
writer.uint32(18)
|
|
759
|
+
writer.bytes(obj.addr)
|
|
760
|
+
} else {
|
|
761
|
+
throw new Error('Protocol error: required field "addr" was not found in object')
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
if (obj.proto != null) {
|
|
765
|
+
writer.uint32(26)
|
|
766
|
+
writer.string(obj.proto)
|
|
767
|
+
} else {
|
|
768
|
+
throw new Error('Protocol error: required field "proto" was not found in object')
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
if (opts.lengthDelimited !== false) {
|
|
772
|
+
writer.ldelim()
|
|
773
|
+
}
|
|
774
|
+
}, (reader, length) => {
|
|
775
|
+
const obj: any = {}
|
|
776
|
+
|
|
777
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
778
|
+
|
|
779
|
+
while (reader.pos < end) {
|
|
780
|
+
const tag = reader.uint32()
|
|
781
|
+
|
|
782
|
+
switch (tag >>> 3) {
|
|
783
|
+
case 1:
|
|
784
|
+
obj.peer = reader.bytes()
|
|
785
|
+
break
|
|
786
|
+
case 2:
|
|
787
|
+
obj.addr = reader.bytes()
|
|
788
|
+
break
|
|
789
|
+
case 3:
|
|
790
|
+
obj.proto = reader.string()
|
|
791
|
+
break
|
|
792
|
+
default:
|
|
793
|
+
reader.skipType(tag & 7)
|
|
794
|
+
break
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
if (obj.peer == null) {
|
|
799
|
+
throw new Error('Protocol error: value for required field "peer" was not found in protobuf')
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
if (obj.addr == null) {
|
|
803
|
+
throw new Error('Protocol error: value for required field "addr" was not found in protobuf')
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (obj.proto == null) {
|
|
807
|
+
throw new Error('Protocol error: value for required field "proto" was not found in protobuf')
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
return obj
|
|
811
|
+
})
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
return _codec
|
|
251
815
|
}
|
|
252
816
|
|
|
253
|
-
export const encode = (obj: StreamInfo):
|
|
817
|
+
export const encode = (obj: StreamInfo): Uint8Array => {
|
|
254
818
|
return encodeMessage(obj, StreamInfo.codec())
|
|
255
819
|
}
|
|
256
820
|
|
|
@@ -296,23 +860,107 @@ export namespace DHTRequest {
|
|
|
296
860
|
|
|
297
861
|
export namespace Type {
|
|
298
862
|
export const codec = () => {
|
|
299
|
-
return enumeration<
|
|
863
|
+
return enumeration<Type>(__TypeValues)
|
|
300
864
|
}
|
|
301
865
|
}
|
|
302
866
|
|
|
867
|
+
let _codec: Codec<DHTRequest>
|
|
868
|
+
|
|
303
869
|
export const codec = (): Codec<DHTRequest> => {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
870
|
+
if (_codec == null) {
|
|
871
|
+
_codec = message<DHTRequest>((obj, writer, opts = {}) => {
|
|
872
|
+
if (opts.lengthDelimited !== false) {
|
|
873
|
+
writer.fork()
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
if (obj.type != null) {
|
|
877
|
+
writer.uint32(8)
|
|
878
|
+
DHTRequest.Type.codec().encode(obj.type, writer)
|
|
879
|
+
} else {
|
|
880
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
if (obj.peer != null) {
|
|
884
|
+
writer.uint32(18)
|
|
885
|
+
writer.bytes(obj.peer)
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if (obj.cid != null) {
|
|
889
|
+
writer.uint32(26)
|
|
890
|
+
writer.bytes(obj.cid)
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
if (obj.key != null) {
|
|
894
|
+
writer.uint32(34)
|
|
895
|
+
writer.bytes(obj.key)
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
if (obj.value != null) {
|
|
899
|
+
writer.uint32(42)
|
|
900
|
+
writer.bytes(obj.value)
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (obj.count != null) {
|
|
904
|
+
writer.uint32(48)
|
|
905
|
+
writer.int32(obj.count)
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if (obj.timeout != null) {
|
|
909
|
+
writer.uint32(56)
|
|
910
|
+
writer.int64(obj.timeout)
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
if (opts.lengthDelimited !== false) {
|
|
914
|
+
writer.ldelim()
|
|
915
|
+
}
|
|
916
|
+
}, (reader, length) => {
|
|
917
|
+
const obj: any = {}
|
|
918
|
+
|
|
919
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
920
|
+
|
|
921
|
+
while (reader.pos < end) {
|
|
922
|
+
const tag = reader.uint32()
|
|
923
|
+
|
|
924
|
+
switch (tag >>> 3) {
|
|
925
|
+
case 1:
|
|
926
|
+
obj.type = DHTRequest.Type.codec().decode(reader)
|
|
927
|
+
break
|
|
928
|
+
case 2:
|
|
929
|
+
obj.peer = reader.bytes()
|
|
930
|
+
break
|
|
931
|
+
case 3:
|
|
932
|
+
obj.cid = reader.bytes()
|
|
933
|
+
break
|
|
934
|
+
case 4:
|
|
935
|
+
obj.key = reader.bytes()
|
|
936
|
+
break
|
|
937
|
+
case 5:
|
|
938
|
+
obj.value = reader.bytes()
|
|
939
|
+
break
|
|
940
|
+
case 6:
|
|
941
|
+
obj.count = reader.int32()
|
|
942
|
+
break
|
|
943
|
+
case 7:
|
|
944
|
+
obj.timeout = reader.int64()
|
|
945
|
+
break
|
|
946
|
+
default:
|
|
947
|
+
reader.skipType(tag & 7)
|
|
948
|
+
break
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
if (obj.type == null) {
|
|
953
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
return obj
|
|
957
|
+
})
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
return _codec
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
export const encode = (obj: DHTRequest): Uint8Array => {
|
|
316
964
|
return encodeMessage(obj, DHTRequest.codec())
|
|
317
965
|
}
|
|
318
966
|
|
|
@@ -342,19 +990,75 @@ export namespace DHTResponse {
|
|
|
342
990
|
|
|
343
991
|
export namespace Type {
|
|
344
992
|
export const codec = () => {
|
|
345
|
-
return enumeration<
|
|
993
|
+
return enumeration<Type>(__TypeValues)
|
|
346
994
|
}
|
|
347
995
|
}
|
|
348
996
|
|
|
997
|
+
let _codec: Codec<DHTResponse>
|
|
998
|
+
|
|
349
999
|
export const codec = (): Codec<DHTResponse> => {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
1000
|
+
if (_codec == null) {
|
|
1001
|
+
_codec = message<DHTResponse>((obj, writer, opts = {}) => {
|
|
1002
|
+
if (opts.lengthDelimited !== false) {
|
|
1003
|
+
writer.fork()
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
if (obj.type != null) {
|
|
1007
|
+
writer.uint32(8)
|
|
1008
|
+
DHTResponse.Type.codec().encode(obj.type, writer)
|
|
1009
|
+
} else {
|
|
1010
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if (obj.peer != null) {
|
|
1014
|
+
writer.uint32(18)
|
|
1015
|
+
PeerInfo.codec().encode(obj.peer, writer)
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
if (obj.value != null) {
|
|
1019
|
+
writer.uint32(26)
|
|
1020
|
+
writer.bytes(obj.value)
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
if (opts.lengthDelimited !== false) {
|
|
1024
|
+
writer.ldelim()
|
|
1025
|
+
}
|
|
1026
|
+
}, (reader, length) => {
|
|
1027
|
+
const obj: any = {}
|
|
1028
|
+
|
|
1029
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1030
|
+
|
|
1031
|
+
while (reader.pos < end) {
|
|
1032
|
+
const tag = reader.uint32()
|
|
1033
|
+
|
|
1034
|
+
switch (tag >>> 3) {
|
|
1035
|
+
case 1:
|
|
1036
|
+
obj.type = DHTResponse.Type.codec().decode(reader)
|
|
1037
|
+
break
|
|
1038
|
+
case 2:
|
|
1039
|
+
obj.peer = PeerInfo.codec().decode(reader, reader.uint32())
|
|
1040
|
+
break
|
|
1041
|
+
case 3:
|
|
1042
|
+
obj.value = reader.bytes()
|
|
1043
|
+
break
|
|
1044
|
+
default:
|
|
1045
|
+
reader.skipType(tag & 7)
|
|
1046
|
+
break
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
if (obj.type == null) {
|
|
1051
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
return obj
|
|
1055
|
+
})
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
return _codec
|
|
355
1059
|
}
|
|
356
1060
|
|
|
357
|
-
export const encode = (obj: DHTResponse):
|
|
1061
|
+
export const encode = (obj: DHTResponse): Uint8Array => {
|
|
358
1062
|
return encodeMessage(obj, DHTResponse.codec())
|
|
359
1063
|
}
|
|
360
1064
|
|
|
@@ -369,14 +1073,74 @@ export interface PeerInfo {
|
|
|
369
1073
|
}
|
|
370
1074
|
|
|
371
1075
|
export namespace PeerInfo {
|
|
1076
|
+
let _codec: Codec<PeerInfo>
|
|
1077
|
+
|
|
372
1078
|
export const codec = (): Codec<PeerInfo> => {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
1079
|
+
if (_codec == null) {
|
|
1080
|
+
_codec = message<PeerInfo>((obj, writer, opts = {}) => {
|
|
1081
|
+
if (opts.lengthDelimited !== false) {
|
|
1082
|
+
writer.fork()
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
if (obj.id != null) {
|
|
1086
|
+
writer.uint32(10)
|
|
1087
|
+
writer.bytes(obj.id)
|
|
1088
|
+
} else {
|
|
1089
|
+
throw new Error('Protocol error: required field "id" was not found in object')
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
if (obj.addrs != null) {
|
|
1093
|
+
for (const value of obj.addrs) {
|
|
1094
|
+
writer.uint32(18)
|
|
1095
|
+
writer.bytes(value)
|
|
1096
|
+
}
|
|
1097
|
+
} else {
|
|
1098
|
+
throw new Error('Protocol error: required field "addrs" was not found in object')
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
if (opts.lengthDelimited !== false) {
|
|
1102
|
+
writer.ldelim()
|
|
1103
|
+
}
|
|
1104
|
+
}, (reader, length) => {
|
|
1105
|
+
const obj: any = {}
|
|
1106
|
+
|
|
1107
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1108
|
+
|
|
1109
|
+
while (reader.pos < end) {
|
|
1110
|
+
const tag = reader.uint32()
|
|
1111
|
+
|
|
1112
|
+
switch (tag >>> 3) {
|
|
1113
|
+
case 1:
|
|
1114
|
+
obj.id = reader.bytes()
|
|
1115
|
+
break
|
|
1116
|
+
case 2:
|
|
1117
|
+
obj.addrs = obj.addrs ?? []
|
|
1118
|
+
obj.addrs.push(reader.bytes())
|
|
1119
|
+
break
|
|
1120
|
+
default:
|
|
1121
|
+
reader.skipType(tag & 7)
|
|
1122
|
+
break
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
obj.addrs = obj.addrs ?? []
|
|
1127
|
+
|
|
1128
|
+
if (obj.id == null) {
|
|
1129
|
+
throw new Error('Protocol error: value for required field "id" was not found in protobuf')
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
if (obj.addrs == null) {
|
|
1133
|
+
throw new Error('Protocol error: value for required field "addrs" was not found in protobuf')
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
return obj
|
|
1137
|
+
})
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
return _codec
|
|
377
1141
|
}
|
|
378
1142
|
|
|
379
|
-
export const encode = (obj: PeerInfo):
|
|
1143
|
+
export const encode = (obj: PeerInfo): Uint8Array => {
|
|
380
1144
|
return encodeMessage(obj, PeerInfo.codec())
|
|
381
1145
|
}
|
|
382
1146
|
|
|
@@ -407,20 +1171,83 @@ export namespace ConnManagerRequest {
|
|
|
407
1171
|
|
|
408
1172
|
export namespace Type {
|
|
409
1173
|
export const codec = () => {
|
|
410
|
-
return enumeration<
|
|
1174
|
+
return enumeration<Type>(__TypeValues)
|
|
411
1175
|
}
|
|
412
1176
|
}
|
|
413
1177
|
|
|
1178
|
+
let _codec: Codec<ConnManagerRequest>
|
|
1179
|
+
|
|
414
1180
|
export const codec = (): Codec<ConnManagerRequest> => {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
1181
|
+
if (_codec == null) {
|
|
1182
|
+
_codec = message<ConnManagerRequest>((obj, writer, opts = {}) => {
|
|
1183
|
+
if (opts.lengthDelimited !== false) {
|
|
1184
|
+
writer.fork()
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
if (obj.type != null) {
|
|
1188
|
+
writer.uint32(8)
|
|
1189
|
+
ConnManagerRequest.Type.codec().encode(obj.type, writer)
|
|
1190
|
+
} else {
|
|
1191
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
if (obj.peer != null) {
|
|
1195
|
+
writer.uint32(18)
|
|
1196
|
+
writer.bytes(obj.peer)
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
if (obj.tag != null) {
|
|
1200
|
+
writer.uint32(26)
|
|
1201
|
+
writer.string(obj.tag)
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
if (obj.weight != null) {
|
|
1205
|
+
writer.uint32(32)
|
|
1206
|
+
writer.int64(obj.weight)
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (opts.lengthDelimited !== false) {
|
|
1210
|
+
writer.ldelim()
|
|
1211
|
+
}
|
|
1212
|
+
}, (reader, length) => {
|
|
1213
|
+
const obj: any = {}
|
|
1214
|
+
|
|
1215
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1216
|
+
|
|
1217
|
+
while (reader.pos < end) {
|
|
1218
|
+
const tag = reader.uint32()
|
|
1219
|
+
|
|
1220
|
+
switch (tag >>> 3) {
|
|
1221
|
+
case 1:
|
|
1222
|
+
obj.type = ConnManagerRequest.Type.codec().decode(reader)
|
|
1223
|
+
break
|
|
1224
|
+
case 2:
|
|
1225
|
+
obj.peer = reader.bytes()
|
|
1226
|
+
break
|
|
1227
|
+
case 3:
|
|
1228
|
+
obj.tag = reader.string()
|
|
1229
|
+
break
|
|
1230
|
+
case 4:
|
|
1231
|
+
obj.weight = reader.int64()
|
|
1232
|
+
break
|
|
1233
|
+
default:
|
|
1234
|
+
reader.skipType(tag & 7)
|
|
1235
|
+
break
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if (obj.type == null) {
|
|
1240
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
return obj
|
|
1244
|
+
})
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
return _codec
|
|
421
1248
|
}
|
|
422
1249
|
|
|
423
|
-
export const encode = (obj: ConnManagerRequest):
|
|
1250
|
+
export const encode = (obj: ConnManagerRequest): Uint8Array => {
|
|
424
1251
|
return encodeMessage(obj, ConnManagerRequest.codec())
|
|
425
1252
|
}
|
|
426
1253
|
|
|
@@ -434,13 +1261,55 @@ export interface DisconnectRequest {
|
|
|
434
1261
|
}
|
|
435
1262
|
|
|
436
1263
|
export namespace DisconnectRequest {
|
|
1264
|
+
let _codec: Codec<DisconnectRequest>
|
|
1265
|
+
|
|
437
1266
|
export const codec = (): Codec<DisconnectRequest> => {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
1267
|
+
if (_codec == null) {
|
|
1268
|
+
_codec = message<DisconnectRequest>((obj, writer, opts = {}) => {
|
|
1269
|
+
if (opts.lengthDelimited !== false) {
|
|
1270
|
+
writer.fork()
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
if (obj.peer != null) {
|
|
1274
|
+
writer.uint32(10)
|
|
1275
|
+
writer.bytes(obj.peer)
|
|
1276
|
+
} else {
|
|
1277
|
+
throw new Error('Protocol error: required field "peer" was not found in object')
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
if (opts.lengthDelimited !== false) {
|
|
1281
|
+
writer.ldelim()
|
|
1282
|
+
}
|
|
1283
|
+
}, (reader, length) => {
|
|
1284
|
+
const obj: any = {}
|
|
1285
|
+
|
|
1286
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1287
|
+
|
|
1288
|
+
while (reader.pos < end) {
|
|
1289
|
+
const tag = reader.uint32()
|
|
1290
|
+
|
|
1291
|
+
switch (tag >>> 3) {
|
|
1292
|
+
case 1:
|
|
1293
|
+
obj.peer = reader.bytes()
|
|
1294
|
+
break
|
|
1295
|
+
default:
|
|
1296
|
+
reader.skipType(tag & 7)
|
|
1297
|
+
break
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
if (obj.peer == null) {
|
|
1302
|
+
throw new Error('Protocol error: value for required field "peer" was not found in protobuf')
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
return obj
|
|
1306
|
+
})
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
return _codec
|
|
441
1310
|
}
|
|
442
1311
|
|
|
443
|
-
export const encode = (obj: DisconnectRequest):
|
|
1312
|
+
export const encode = (obj: DisconnectRequest): Uint8Array => {
|
|
444
1313
|
return encodeMessage(obj, DisconnectRequest.codec())
|
|
445
1314
|
}
|
|
446
1315
|
|
|
@@ -472,19 +1341,75 @@ export namespace PSRequest {
|
|
|
472
1341
|
|
|
473
1342
|
export namespace Type {
|
|
474
1343
|
export const codec = () => {
|
|
475
|
-
return enumeration<
|
|
1344
|
+
return enumeration<Type>(__TypeValues)
|
|
476
1345
|
}
|
|
477
1346
|
}
|
|
478
1347
|
|
|
1348
|
+
let _codec: Codec<PSRequest>
|
|
1349
|
+
|
|
479
1350
|
export const codec = (): Codec<PSRequest> => {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
1351
|
+
if (_codec == null) {
|
|
1352
|
+
_codec = message<PSRequest>((obj, writer, opts = {}) => {
|
|
1353
|
+
if (opts.lengthDelimited !== false) {
|
|
1354
|
+
writer.fork()
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
if (obj.type != null) {
|
|
1358
|
+
writer.uint32(8)
|
|
1359
|
+
PSRequest.Type.codec().encode(obj.type, writer)
|
|
1360
|
+
} else {
|
|
1361
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
if (obj.topic != null) {
|
|
1365
|
+
writer.uint32(18)
|
|
1366
|
+
writer.string(obj.topic)
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
if (obj.data != null) {
|
|
1370
|
+
writer.uint32(26)
|
|
1371
|
+
writer.bytes(obj.data)
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
if (opts.lengthDelimited !== false) {
|
|
1375
|
+
writer.ldelim()
|
|
1376
|
+
}
|
|
1377
|
+
}, (reader, length) => {
|
|
1378
|
+
const obj: any = {}
|
|
1379
|
+
|
|
1380
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1381
|
+
|
|
1382
|
+
while (reader.pos < end) {
|
|
1383
|
+
const tag = reader.uint32()
|
|
1384
|
+
|
|
1385
|
+
switch (tag >>> 3) {
|
|
1386
|
+
case 1:
|
|
1387
|
+
obj.type = PSRequest.Type.codec().decode(reader)
|
|
1388
|
+
break
|
|
1389
|
+
case 2:
|
|
1390
|
+
obj.topic = reader.string()
|
|
1391
|
+
break
|
|
1392
|
+
case 3:
|
|
1393
|
+
obj.data = reader.bytes()
|
|
1394
|
+
break
|
|
1395
|
+
default:
|
|
1396
|
+
reader.skipType(tag & 7)
|
|
1397
|
+
break
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
if (obj.type == null) {
|
|
1402
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
return obj
|
|
1406
|
+
})
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
return _codec
|
|
485
1410
|
}
|
|
486
1411
|
|
|
487
|
-
export const encode = (obj: PSRequest):
|
|
1412
|
+
export const encode = (obj: PSRequest): Uint8Array => {
|
|
488
1413
|
return encodeMessage(obj, PSRequest.codec())
|
|
489
1414
|
}
|
|
490
1415
|
|
|
@@ -503,18 +1428,100 @@ export interface PSMessage {
|
|
|
503
1428
|
}
|
|
504
1429
|
|
|
505
1430
|
export namespace PSMessage {
|
|
1431
|
+
let _codec: Codec<PSMessage>
|
|
1432
|
+
|
|
506
1433
|
export const codec = (): Codec<PSMessage> => {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
1434
|
+
if (_codec == null) {
|
|
1435
|
+
_codec = message<PSMessage>((obj, writer, opts = {}) => {
|
|
1436
|
+
if (opts.lengthDelimited !== false) {
|
|
1437
|
+
writer.fork()
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
if (obj.from != null) {
|
|
1441
|
+
writer.uint32(10)
|
|
1442
|
+
writer.bytes(obj.from)
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
if (obj.data != null) {
|
|
1446
|
+
writer.uint32(18)
|
|
1447
|
+
writer.bytes(obj.data)
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
if (obj.seqno != null) {
|
|
1451
|
+
writer.uint32(26)
|
|
1452
|
+
writer.bytes(obj.seqno)
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
if (obj.topicIDs != null) {
|
|
1456
|
+
for (const value of obj.topicIDs) {
|
|
1457
|
+
writer.uint32(34)
|
|
1458
|
+
writer.string(value)
|
|
1459
|
+
}
|
|
1460
|
+
} else {
|
|
1461
|
+
throw new Error('Protocol error: required field "topicIDs" was not found in object')
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
if (obj.signature != null) {
|
|
1465
|
+
writer.uint32(42)
|
|
1466
|
+
writer.bytes(obj.signature)
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
if (obj.key != null) {
|
|
1470
|
+
writer.uint32(50)
|
|
1471
|
+
writer.bytes(obj.key)
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
if (opts.lengthDelimited !== false) {
|
|
1475
|
+
writer.ldelim()
|
|
1476
|
+
}
|
|
1477
|
+
}, (reader, length) => {
|
|
1478
|
+
const obj: any = {}
|
|
1479
|
+
|
|
1480
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1481
|
+
|
|
1482
|
+
while (reader.pos < end) {
|
|
1483
|
+
const tag = reader.uint32()
|
|
1484
|
+
|
|
1485
|
+
switch (tag >>> 3) {
|
|
1486
|
+
case 1:
|
|
1487
|
+
obj.from = reader.bytes()
|
|
1488
|
+
break
|
|
1489
|
+
case 2:
|
|
1490
|
+
obj.data = reader.bytes()
|
|
1491
|
+
break
|
|
1492
|
+
case 3:
|
|
1493
|
+
obj.seqno = reader.bytes()
|
|
1494
|
+
break
|
|
1495
|
+
case 4:
|
|
1496
|
+
obj.topicIDs = obj.topicIDs ?? []
|
|
1497
|
+
obj.topicIDs.push(reader.string())
|
|
1498
|
+
break
|
|
1499
|
+
case 5:
|
|
1500
|
+
obj.signature = reader.bytes()
|
|
1501
|
+
break
|
|
1502
|
+
case 6:
|
|
1503
|
+
obj.key = reader.bytes()
|
|
1504
|
+
break
|
|
1505
|
+
default:
|
|
1506
|
+
reader.skipType(tag & 7)
|
|
1507
|
+
break
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
obj.topicIDs = obj.topicIDs ?? []
|
|
1512
|
+
|
|
1513
|
+
if (obj.topicIDs == null) {
|
|
1514
|
+
throw new Error('Protocol error: value for required field "topicIDs" was not found in protobuf')
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
return obj
|
|
1518
|
+
})
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
return _codec
|
|
515
1522
|
}
|
|
516
1523
|
|
|
517
|
-
export const encode = (obj: PSMessage):
|
|
1524
|
+
export const encode = (obj: PSMessage): Uint8Array => {
|
|
518
1525
|
return encodeMessage(obj, PSMessage.codec())
|
|
519
1526
|
}
|
|
520
1527
|
|
|
@@ -529,14 +1536,78 @@ export interface PSResponse {
|
|
|
529
1536
|
}
|
|
530
1537
|
|
|
531
1538
|
export namespace PSResponse {
|
|
1539
|
+
let _codec: Codec<PSResponse>
|
|
1540
|
+
|
|
532
1541
|
export const codec = (): Codec<PSResponse> => {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
1542
|
+
if (_codec == null) {
|
|
1543
|
+
_codec = message<PSResponse>((obj, writer, opts = {}) => {
|
|
1544
|
+
if (opts.lengthDelimited !== false) {
|
|
1545
|
+
writer.fork()
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if (obj.topics != null) {
|
|
1549
|
+
for (const value of obj.topics) {
|
|
1550
|
+
writer.uint32(10)
|
|
1551
|
+
writer.string(value)
|
|
1552
|
+
}
|
|
1553
|
+
} else {
|
|
1554
|
+
throw new Error('Protocol error: required field "topics" was not found in object')
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
if (obj.peerIDs != null) {
|
|
1558
|
+
for (const value of obj.peerIDs) {
|
|
1559
|
+
writer.uint32(18)
|
|
1560
|
+
writer.bytes(value)
|
|
1561
|
+
}
|
|
1562
|
+
} else {
|
|
1563
|
+
throw new Error('Protocol error: required field "peerIDs" was not found in object')
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
if (opts.lengthDelimited !== false) {
|
|
1567
|
+
writer.ldelim()
|
|
1568
|
+
}
|
|
1569
|
+
}, (reader, length) => {
|
|
1570
|
+
const obj: any = {}
|
|
1571
|
+
|
|
1572
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1573
|
+
|
|
1574
|
+
while (reader.pos < end) {
|
|
1575
|
+
const tag = reader.uint32()
|
|
1576
|
+
|
|
1577
|
+
switch (tag >>> 3) {
|
|
1578
|
+
case 1:
|
|
1579
|
+
obj.topics = obj.topics ?? []
|
|
1580
|
+
obj.topics.push(reader.string())
|
|
1581
|
+
break
|
|
1582
|
+
case 2:
|
|
1583
|
+
obj.peerIDs = obj.peerIDs ?? []
|
|
1584
|
+
obj.peerIDs.push(reader.bytes())
|
|
1585
|
+
break
|
|
1586
|
+
default:
|
|
1587
|
+
reader.skipType(tag & 7)
|
|
1588
|
+
break
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
obj.topics = obj.topics ?? []
|
|
1593
|
+
obj.peerIDs = obj.peerIDs ?? []
|
|
1594
|
+
|
|
1595
|
+
if (obj.topics == null) {
|
|
1596
|
+
throw new Error('Protocol error: value for required field "topics" was not found in protobuf')
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
if (obj.peerIDs == null) {
|
|
1600
|
+
throw new Error('Protocol error: value for required field "peerIDs" was not found in protobuf')
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
return obj
|
|
1604
|
+
})
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
return _codec
|
|
537
1608
|
}
|
|
538
1609
|
|
|
539
|
-
export const encode = (obj: PSResponse):
|
|
1610
|
+
export const encode = (obj: PSResponse): Uint8Array => {
|
|
540
1611
|
return encodeMessage(obj, PSResponse.codec())
|
|
541
1612
|
}
|
|
542
1613
|
|
|
@@ -564,19 +1635,86 @@ export namespace PeerstoreRequest {
|
|
|
564
1635
|
|
|
565
1636
|
export namespace Type {
|
|
566
1637
|
export const codec = () => {
|
|
567
|
-
return enumeration<
|
|
1638
|
+
return enumeration<Type>(__TypeValues)
|
|
568
1639
|
}
|
|
569
1640
|
}
|
|
570
1641
|
|
|
1642
|
+
let _codec: Codec<PeerstoreRequest>
|
|
1643
|
+
|
|
571
1644
|
export const codec = (): Codec<PeerstoreRequest> => {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
1645
|
+
if (_codec == null) {
|
|
1646
|
+
_codec = message<PeerstoreRequest>((obj, writer, opts = {}) => {
|
|
1647
|
+
if (opts.lengthDelimited !== false) {
|
|
1648
|
+
writer.fork()
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
if (obj.type != null) {
|
|
1652
|
+
writer.uint32(8)
|
|
1653
|
+
PeerstoreRequest.Type.codec().encode(obj.type, writer)
|
|
1654
|
+
} else {
|
|
1655
|
+
throw new Error('Protocol error: required field "type" was not found in object')
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
if (obj.id != null) {
|
|
1659
|
+
writer.uint32(18)
|
|
1660
|
+
writer.bytes(obj.id)
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
if (obj.protos != null) {
|
|
1664
|
+
for (const value of obj.protos) {
|
|
1665
|
+
writer.uint32(26)
|
|
1666
|
+
writer.string(value)
|
|
1667
|
+
}
|
|
1668
|
+
} else {
|
|
1669
|
+
throw new Error('Protocol error: required field "protos" was not found in object')
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
if (opts.lengthDelimited !== false) {
|
|
1673
|
+
writer.ldelim()
|
|
1674
|
+
}
|
|
1675
|
+
}, (reader, length) => {
|
|
1676
|
+
const obj: any = {}
|
|
1677
|
+
|
|
1678
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1679
|
+
|
|
1680
|
+
while (reader.pos < end) {
|
|
1681
|
+
const tag = reader.uint32()
|
|
1682
|
+
|
|
1683
|
+
switch (tag >>> 3) {
|
|
1684
|
+
case 1:
|
|
1685
|
+
obj.type = PeerstoreRequest.Type.codec().decode(reader)
|
|
1686
|
+
break
|
|
1687
|
+
case 2:
|
|
1688
|
+
obj.id = reader.bytes()
|
|
1689
|
+
break
|
|
1690
|
+
case 3:
|
|
1691
|
+
obj.protos = obj.protos ?? []
|
|
1692
|
+
obj.protos.push(reader.string())
|
|
1693
|
+
break
|
|
1694
|
+
default:
|
|
1695
|
+
reader.skipType(tag & 7)
|
|
1696
|
+
break
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
obj.protos = obj.protos ?? []
|
|
1701
|
+
|
|
1702
|
+
if (obj.type == null) {
|
|
1703
|
+
throw new Error('Protocol error: value for required field "type" was not found in protobuf')
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
if (obj.protos == null) {
|
|
1707
|
+
throw new Error('Protocol error: value for required field "protos" was not found in protobuf')
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
return obj
|
|
1711
|
+
})
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
return _codec
|
|
577
1715
|
}
|
|
578
1716
|
|
|
579
|
-
export const encode = (obj: PeerstoreRequest):
|
|
1717
|
+
export const encode = (obj: PeerstoreRequest): Uint8Array => {
|
|
580
1718
|
return encodeMessage(obj, PeerstoreRequest.codec())
|
|
581
1719
|
}
|
|
582
1720
|
|
|
@@ -591,14 +1729,68 @@ export interface PeerstoreResponse {
|
|
|
591
1729
|
}
|
|
592
1730
|
|
|
593
1731
|
export namespace PeerstoreResponse {
|
|
1732
|
+
let _codec: Codec<PeerstoreResponse>
|
|
1733
|
+
|
|
594
1734
|
export const codec = (): Codec<PeerstoreResponse> => {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
1735
|
+
if (_codec == null) {
|
|
1736
|
+
_codec = message<PeerstoreResponse>((obj, writer, opts = {}) => {
|
|
1737
|
+
if (opts.lengthDelimited !== false) {
|
|
1738
|
+
writer.fork()
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
if (obj.peer != null) {
|
|
1742
|
+
writer.uint32(10)
|
|
1743
|
+
PeerInfo.codec().encode(obj.peer, writer)
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
if (obj.protos != null) {
|
|
1747
|
+
for (const value of obj.protos) {
|
|
1748
|
+
writer.uint32(18)
|
|
1749
|
+
writer.string(value)
|
|
1750
|
+
}
|
|
1751
|
+
} else {
|
|
1752
|
+
throw new Error('Protocol error: required field "protos" was not found in object')
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
if (opts.lengthDelimited !== false) {
|
|
1756
|
+
writer.ldelim()
|
|
1757
|
+
}
|
|
1758
|
+
}, (reader, length) => {
|
|
1759
|
+
const obj: any = {}
|
|
1760
|
+
|
|
1761
|
+
const end = length == null ? reader.len : reader.pos + length
|
|
1762
|
+
|
|
1763
|
+
while (reader.pos < end) {
|
|
1764
|
+
const tag = reader.uint32()
|
|
1765
|
+
|
|
1766
|
+
switch (tag >>> 3) {
|
|
1767
|
+
case 1:
|
|
1768
|
+
obj.peer = PeerInfo.codec().decode(reader, reader.uint32())
|
|
1769
|
+
break
|
|
1770
|
+
case 2:
|
|
1771
|
+
obj.protos = obj.protos ?? []
|
|
1772
|
+
obj.protos.push(reader.string())
|
|
1773
|
+
break
|
|
1774
|
+
default:
|
|
1775
|
+
reader.skipType(tag & 7)
|
|
1776
|
+
break
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
obj.protos = obj.protos ?? []
|
|
1781
|
+
|
|
1782
|
+
if (obj.protos == null) {
|
|
1783
|
+
throw new Error('Protocol error: value for required field "protos" was not found in protobuf')
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
return obj
|
|
1787
|
+
})
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
return _codec
|
|
599
1791
|
}
|
|
600
1792
|
|
|
601
|
-
export const encode = (obj: PeerstoreResponse):
|
|
1793
|
+
export const encode = (obj: PeerstoreResponse): Uint8Array => {
|
|
602
1794
|
return encodeMessage(obj, PeerstoreResponse.codec())
|
|
603
1795
|
}
|
|
604
1796
|
|