pactus-grpc 1.7.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/network_pb.js ADDED
@@ -0,0 +1,2829 @@
1
+ // source: network.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global =
17
+ (typeof globalThis !== 'undefined' && globalThis) ||
18
+ (typeof window !== 'undefined' && window) ||
19
+ (typeof global !== 'undefined' && global) ||
20
+ (typeof self !== 'undefined' && self) ||
21
+ (function () { return this; }).call(null) ||
22
+ Function('return this')();
23
+
24
+ goog.exportSymbol('proto.pactus.ConnectionInfo', null, global);
25
+ goog.exportSymbol('proto.pactus.CounterInfo', null, global);
26
+ goog.exportSymbol('proto.pactus.GetNetworkInfoRequest', null, global);
27
+ goog.exportSymbol('proto.pactus.GetNetworkInfoResponse', null, global);
28
+ goog.exportSymbol('proto.pactus.GetNodeInfoRequest', null, global);
29
+ goog.exportSymbol('proto.pactus.GetNodeInfoResponse', null, global);
30
+ goog.exportSymbol('proto.pactus.MetricInfo', null, global);
31
+ goog.exportSymbol('proto.pactus.PeerInfo', null, global);
32
+ goog.exportSymbol('proto.pactus.ZMQPublisherInfo', null, global);
33
+ /**
34
+ * Generated by JsPbCodeGenerator.
35
+ * @param {Array=} opt_data Optional initial data array, typically from a
36
+ * server response, or constructed directly in Javascript. The array is used
37
+ * in place and becomes part of the constructed object. It is not cloned.
38
+ * If no data is provided, the constructed object will be empty, but still
39
+ * valid.
40
+ * @extends {jspb.Message}
41
+ * @constructor
42
+ */
43
+ proto.pactus.GetNetworkInfoRequest = function(opt_data) {
44
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
45
+ };
46
+ goog.inherits(proto.pactus.GetNetworkInfoRequest, jspb.Message);
47
+ if (goog.DEBUG && !COMPILED) {
48
+ /**
49
+ * @public
50
+ * @override
51
+ */
52
+ proto.pactus.GetNetworkInfoRequest.displayName = 'proto.pactus.GetNetworkInfoRequest';
53
+ }
54
+ /**
55
+ * Generated by JsPbCodeGenerator.
56
+ * @param {Array=} opt_data Optional initial data array, typically from a
57
+ * server response, or constructed directly in Javascript. The array is used
58
+ * in place and becomes part of the constructed object. It is not cloned.
59
+ * If no data is provided, the constructed object will be empty, but still
60
+ * valid.
61
+ * @extends {jspb.Message}
62
+ * @constructor
63
+ */
64
+ proto.pactus.GetNetworkInfoResponse = function(opt_data) {
65
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.pactus.GetNetworkInfoResponse.repeatedFields_, null);
66
+ };
67
+ goog.inherits(proto.pactus.GetNetworkInfoResponse, jspb.Message);
68
+ if (goog.DEBUG && !COMPILED) {
69
+ /**
70
+ * @public
71
+ * @override
72
+ */
73
+ proto.pactus.GetNetworkInfoResponse.displayName = 'proto.pactus.GetNetworkInfoResponse';
74
+ }
75
+ /**
76
+ * Generated by JsPbCodeGenerator.
77
+ * @param {Array=} opt_data Optional initial data array, typically from a
78
+ * server response, or constructed directly in Javascript. The array is used
79
+ * in place and becomes part of the constructed object. It is not cloned.
80
+ * If no data is provided, the constructed object will be empty, but still
81
+ * valid.
82
+ * @extends {jspb.Message}
83
+ * @constructor
84
+ */
85
+ proto.pactus.GetNodeInfoRequest = function(opt_data) {
86
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
87
+ };
88
+ goog.inherits(proto.pactus.GetNodeInfoRequest, jspb.Message);
89
+ if (goog.DEBUG && !COMPILED) {
90
+ /**
91
+ * @public
92
+ * @override
93
+ */
94
+ proto.pactus.GetNodeInfoRequest.displayName = 'proto.pactus.GetNodeInfoRequest';
95
+ }
96
+ /**
97
+ * Generated by JsPbCodeGenerator.
98
+ * @param {Array=} opt_data Optional initial data array, typically from a
99
+ * server response, or constructed directly in Javascript. The array is used
100
+ * in place and becomes part of the constructed object. It is not cloned.
101
+ * If no data is provided, the constructed object will be empty, but still
102
+ * valid.
103
+ * @extends {jspb.Message}
104
+ * @constructor
105
+ */
106
+ proto.pactus.GetNodeInfoResponse = function(opt_data) {
107
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.pactus.GetNodeInfoResponse.repeatedFields_, null);
108
+ };
109
+ goog.inherits(proto.pactus.GetNodeInfoResponse, jspb.Message);
110
+ if (goog.DEBUG && !COMPILED) {
111
+ /**
112
+ * @public
113
+ * @override
114
+ */
115
+ proto.pactus.GetNodeInfoResponse.displayName = 'proto.pactus.GetNodeInfoResponse';
116
+ }
117
+ /**
118
+ * Generated by JsPbCodeGenerator.
119
+ * @param {Array=} opt_data Optional initial data array, typically from a
120
+ * server response, or constructed directly in Javascript. The array is used
121
+ * in place and becomes part of the constructed object. It is not cloned.
122
+ * If no data is provided, the constructed object will be empty, but still
123
+ * valid.
124
+ * @extends {jspb.Message}
125
+ * @constructor
126
+ */
127
+ proto.pactus.ZMQPublisherInfo = function(opt_data) {
128
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
129
+ };
130
+ goog.inherits(proto.pactus.ZMQPublisherInfo, jspb.Message);
131
+ if (goog.DEBUG && !COMPILED) {
132
+ /**
133
+ * @public
134
+ * @override
135
+ */
136
+ proto.pactus.ZMQPublisherInfo.displayName = 'proto.pactus.ZMQPublisherInfo';
137
+ }
138
+ /**
139
+ * Generated by JsPbCodeGenerator.
140
+ * @param {Array=} opt_data Optional initial data array, typically from a
141
+ * server response, or constructed directly in Javascript. The array is used
142
+ * in place and becomes part of the constructed object. It is not cloned.
143
+ * If no data is provided, the constructed object will be empty, but still
144
+ * valid.
145
+ * @extends {jspb.Message}
146
+ * @constructor
147
+ */
148
+ proto.pactus.PeerInfo = function(opt_data) {
149
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.pactus.PeerInfo.repeatedFields_, null);
150
+ };
151
+ goog.inherits(proto.pactus.PeerInfo, jspb.Message);
152
+ if (goog.DEBUG && !COMPILED) {
153
+ /**
154
+ * @public
155
+ * @override
156
+ */
157
+ proto.pactus.PeerInfo.displayName = 'proto.pactus.PeerInfo';
158
+ }
159
+ /**
160
+ * Generated by JsPbCodeGenerator.
161
+ * @param {Array=} opt_data Optional initial data array, typically from a
162
+ * server response, or constructed directly in Javascript. The array is used
163
+ * in place and becomes part of the constructed object. It is not cloned.
164
+ * If no data is provided, the constructed object will be empty, but still
165
+ * valid.
166
+ * @extends {jspb.Message}
167
+ * @constructor
168
+ */
169
+ proto.pactus.ConnectionInfo = function(opt_data) {
170
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
171
+ };
172
+ goog.inherits(proto.pactus.ConnectionInfo, jspb.Message);
173
+ if (goog.DEBUG && !COMPILED) {
174
+ /**
175
+ * @public
176
+ * @override
177
+ */
178
+ proto.pactus.ConnectionInfo.displayName = 'proto.pactus.ConnectionInfo';
179
+ }
180
+ /**
181
+ * Generated by JsPbCodeGenerator.
182
+ * @param {Array=} opt_data Optional initial data array, typically from a
183
+ * server response, or constructed directly in Javascript. The array is used
184
+ * in place and becomes part of the constructed object. It is not cloned.
185
+ * If no data is provided, the constructed object will be empty, but still
186
+ * valid.
187
+ * @extends {jspb.Message}
188
+ * @constructor
189
+ */
190
+ proto.pactus.MetricInfo = function(opt_data) {
191
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
192
+ };
193
+ goog.inherits(proto.pactus.MetricInfo, jspb.Message);
194
+ if (goog.DEBUG && !COMPILED) {
195
+ /**
196
+ * @public
197
+ * @override
198
+ */
199
+ proto.pactus.MetricInfo.displayName = 'proto.pactus.MetricInfo';
200
+ }
201
+ /**
202
+ * Generated by JsPbCodeGenerator.
203
+ * @param {Array=} opt_data Optional initial data array, typically from a
204
+ * server response, or constructed directly in Javascript. The array is used
205
+ * in place and becomes part of the constructed object. It is not cloned.
206
+ * If no data is provided, the constructed object will be empty, but still
207
+ * valid.
208
+ * @extends {jspb.Message}
209
+ * @constructor
210
+ */
211
+ proto.pactus.CounterInfo = function(opt_data) {
212
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
213
+ };
214
+ goog.inherits(proto.pactus.CounterInfo, jspb.Message);
215
+ if (goog.DEBUG && !COMPILED) {
216
+ /**
217
+ * @public
218
+ * @override
219
+ */
220
+ proto.pactus.CounterInfo.displayName = 'proto.pactus.CounterInfo';
221
+ }
222
+
223
+
224
+
225
+ if (jspb.Message.GENERATE_TO_OBJECT) {
226
+ /**
227
+ * Creates an object representation of this proto.
228
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
229
+ * Optional fields that are not set will be set to undefined.
230
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
231
+ * For the list of reserved names please see:
232
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
233
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
234
+ * JSPB instance for transitional soy proto support:
235
+ * http://goto/soy-param-migration
236
+ * @return {!Object}
237
+ */
238
+ proto.pactus.GetNetworkInfoRequest.prototype.toObject = function(opt_includeInstance) {
239
+ return proto.pactus.GetNetworkInfoRequest.toObject(opt_includeInstance, this);
240
+ };
241
+
242
+
243
+ /**
244
+ * Static version of the {@see toObject} method.
245
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
246
+ * the JSPB instance for transitional soy proto support:
247
+ * http://goto/soy-param-migration
248
+ * @param {!proto.pactus.GetNetworkInfoRequest} msg The msg instance to transform.
249
+ * @return {!Object}
250
+ * @suppress {unusedLocalVariables} f is only used for nested messages
251
+ */
252
+ proto.pactus.GetNetworkInfoRequest.toObject = function(includeInstance, msg) {
253
+ var f, obj = {
254
+ onlyConnected: jspb.Message.getBooleanFieldWithDefault(msg, 1, false)
255
+ };
256
+
257
+ if (includeInstance) {
258
+ obj.$jspbMessageInstance = msg;
259
+ }
260
+ return obj;
261
+ };
262
+ }
263
+
264
+
265
+ /**
266
+ * Deserializes binary data (in protobuf wire format).
267
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
268
+ * @return {!proto.pactus.GetNetworkInfoRequest}
269
+ */
270
+ proto.pactus.GetNetworkInfoRequest.deserializeBinary = function(bytes) {
271
+ var reader = new jspb.BinaryReader(bytes);
272
+ var msg = new proto.pactus.GetNetworkInfoRequest;
273
+ return proto.pactus.GetNetworkInfoRequest.deserializeBinaryFromReader(msg, reader);
274
+ };
275
+
276
+
277
+ /**
278
+ * Deserializes binary data (in protobuf wire format) from the
279
+ * given reader into the given message object.
280
+ * @param {!proto.pactus.GetNetworkInfoRequest} msg The message object to deserialize into.
281
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
282
+ * @return {!proto.pactus.GetNetworkInfoRequest}
283
+ */
284
+ proto.pactus.GetNetworkInfoRequest.deserializeBinaryFromReader = function(msg, reader) {
285
+ while (reader.nextField()) {
286
+ if (reader.isEndGroup()) {
287
+ break;
288
+ }
289
+ var field = reader.getFieldNumber();
290
+ switch (field) {
291
+ case 1:
292
+ var value = /** @type {boolean} */ (reader.readBool());
293
+ msg.setOnlyConnected(value);
294
+ break;
295
+ default:
296
+ reader.skipField();
297
+ break;
298
+ }
299
+ }
300
+ return msg;
301
+ };
302
+
303
+
304
+ /**
305
+ * Serializes the message to binary data (in protobuf wire format).
306
+ * @return {!Uint8Array}
307
+ */
308
+ proto.pactus.GetNetworkInfoRequest.prototype.serializeBinary = function() {
309
+ var writer = new jspb.BinaryWriter();
310
+ proto.pactus.GetNetworkInfoRequest.serializeBinaryToWriter(this, writer);
311
+ return writer.getResultBuffer();
312
+ };
313
+
314
+
315
+ /**
316
+ * Serializes the given message to binary data (in protobuf wire
317
+ * format), writing to the given BinaryWriter.
318
+ * @param {!proto.pactus.GetNetworkInfoRequest} message
319
+ * @param {!jspb.BinaryWriter} writer
320
+ * @suppress {unusedLocalVariables} f is only used for nested messages
321
+ */
322
+ proto.pactus.GetNetworkInfoRequest.serializeBinaryToWriter = function(message, writer) {
323
+ var f = undefined;
324
+ f = message.getOnlyConnected();
325
+ if (f) {
326
+ writer.writeBool(
327
+ 1,
328
+ f
329
+ );
330
+ }
331
+ };
332
+
333
+
334
+ /**
335
+ * optional bool only_connected = 1;
336
+ * @return {boolean}
337
+ */
338
+ proto.pactus.GetNetworkInfoRequest.prototype.getOnlyConnected = function() {
339
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
340
+ };
341
+
342
+
343
+ /**
344
+ * @param {boolean} value
345
+ * @return {!proto.pactus.GetNetworkInfoRequest} returns this
346
+ */
347
+ proto.pactus.GetNetworkInfoRequest.prototype.setOnlyConnected = function(value) {
348
+ return jspb.Message.setProto3BooleanField(this, 1, value);
349
+ };
350
+
351
+
352
+
353
+ /**
354
+ * List of repeated fields within this message type.
355
+ * @private {!Array<number>}
356
+ * @const
357
+ */
358
+ proto.pactus.GetNetworkInfoResponse.repeatedFields_ = [3];
359
+
360
+
361
+
362
+ if (jspb.Message.GENERATE_TO_OBJECT) {
363
+ /**
364
+ * Creates an object representation of this proto.
365
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
366
+ * Optional fields that are not set will be set to undefined.
367
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
368
+ * For the list of reserved names please see:
369
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
370
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
371
+ * JSPB instance for transitional soy proto support:
372
+ * http://goto/soy-param-migration
373
+ * @return {!Object}
374
+ */
375
+ proto.pactus.GetNetworkInfoResponse.prototype.toObject = function(opt_includeInstance) {
376
+ return proto.pactus.GetNetworkInfoResponse.toObject(opt_includeInstance, this);
377
+ };
378
+
379
+
380
+ /**
381
+ * Static version of the {@see toObject} method.
382
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
383
+ * the JSPB instance for transitional soy proto support:
384
+ * http://goto/soy-param-migration
385
+ * @param {!proto.pactus.GetNetworkInfoResponse} msg The msg instance to transform.
386
+ * @return {!Object}
387
+ * @suppress {unusedLocalVariables} f is only used for nested messages
388
+ */
389
+ proto.pactus.GetNetworkInfoResponse.toObject = function(includeInstance, msg) {
390
+ var f, obj = {
391
+ networkName: jspb.Message.getFieldWithDefault(msg, 1, ""),
392
+ connectedPeersCount: jspb.Message.getFieldWithDefault(msg, 2, 0),
393
+ connectedPeersList: jspb.Message.toObjectList(msg.getConnectedPeersList(),
394
+ proto.pactus.PeerInfo.toObject, includeInstance),
395
+ metricInfo: (f = msg.getMetricInfo()) && proto.pactus.MetricInfo.toObject(includeInstance, f)
396
+ };
397
+
398
+ if (includeInstance) {
399
+ obj.$jspbMessageInstance = msg;
400
+ }
401
+ return obj;
402
+ };
403
+ }
404
+
405
+
406
+ /**
407
+ * Deserializes binary data (in protobuf wire format).
408
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
409
+ * @return {!proto.pactus.GetNetworkInfoResponse}
410
+ */
411
+ proto.pactus.GetNetworkInfoResponse.deserializeBinary = function(bytes) {
412
+ var reader = new jspb.BinaryReader(bytes);
413
+ var msg = new proto.pactus.GetNetworkInfoResponse;
414
+ return proto.pactus.GetNetworkInfoResponse.deserializeBinaryFromReader(msg, reader);
415
+ };
416
+
417
+
418
+ /**
419
+ * Deserializes binary data (in protobuf wire format) from the
420
+ * given reader into the given message object.
421
+ * @param {!proto.pactus.GetNetworkInfoResponse} msg The message object to deserialize into.
422
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
423
+ * @return {!proto.pactus.GetNetworkInfoResponse}
424
+ */
425
+ proto.pactus.GetNetworkInfoResponse.deserializeBinaryFromReader = function(msg, reader) {
426
+ while (reader.nextField()) {
427
+ if (reader.isEndGroup()) {
428
+ break;
429
+ }
430
+ var field = reader.getFieldNumber();
431
+ switch (field) {
432
+ case 1:
433
+ var value = /** @type {string} */ (reader.readString());
434
+ msg.setNetworkName(value);
435
+ break;
436
+ case 2:
437
+ var value = /** @type {number} */ (reader.readUint32());
438
+ msg.setConnectedPeersCount(value);
439
+ break;
440
+ case 3:
441
+ var value = new proto.pactus.PeerInfo;
442
+ reader.readMessage(value,proto.pactus.PeerInfo.deserializeBinaryFromReader);
443
+ msg.addConnectedPeers(value);
444
+ break;
445
+ case 4:
446
+ var value = new proto.pactus.MetricInfo;
447
+ reader.readMessage(value,proto.pactus.MetricInfo.deserializeBinaryFromReader);
448
+ msg.setMetricInfo(value);
449
+ break;
450
+ default:
451
+ reader.skipField();
452
+ break;
453
+ }
454
+ }
455
+ return msg;
456
+ };
457
+
458
+
459
+ /**
460
+ * Serializes the message to binary data (in protobuf wire format).
461
+ * @return {!Uint8Array}
462
+ */
463
+ proto.pactus.GetNetworkInfoResponse.prototype.serializeBinary = function() {
464
+ var writer = new jspb.BinaryWriter();
465
+ proto.pactus.GetNetworkInfoResponse.serializeBinaryToWriter(this, writer);
466
+ return writer.getResultBuffer();
467
+ };
468
+
469
+
470
+ /**
471
+ * Serializes the given message to binary data (in protobuf wire
472
+ * format), writing to the given BinaryWriter.
473
+ * @param {!proto.pactus.GetNetworkInfoResponse} message
474
+ * @param {!jspb.BinaryWriter} writer
475
+ * @suppress {unusedLocalVariables} f is only used for nested messages
476
+ */
477
+ proto.pactus.GetNetworkInfoResponse.serializeBinaryToWriter = function(message, writer) {
478
+ var f = undefined;
479
+ f = message.getNetworkName();
480
+ if (f.length > 0) {
481
+ writer.writeString(
482
+ 1,
483
+ f
484
+ );
485
+ }
486
+ f = message.getConnectedPeersCount();
487
+ if (f !== 0) {
488
+ writer.writeUint32(
489
+ 2,
490
+ f
491
+ );
492
+ }
493
+ f = message.getConnectedPeersList();
494
+ if (f.length > 0) {
495
+ writer.writeRepeatedMessage(
496
+ 3,
497
+ f,
498
+ proto.pactus.PeerInfo.serializeBinaryToWriter
499
+ );
500
+ }
501
+ f = message.getMetricInfo();
502
+ if (f != null) {
503
+ writer.writeMessage(
504
+ 4,
505
+ f,
506
+ proto.pactus.MetricInfo.serializeBinaryToWriter
507
+ );
508
+ }
509
+ };
510
+
511
+
512
+ /**
513
+ * optional string network_name = 1;
514
+ * @return {string}
515
+ */
516
+ proto.pactus.GetNetworkInfoResponse.prototype.getNetworkName = function() {
517
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
518
+ };
519
+
520
+
521
+ /**
522
+ * @param {string} value
523
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
524
+ */
525
+ proto.pactus.GetNetworkInfoResponse.prototype.setNetworkName = function(value) {
526
+ return jspb.Message.setProto3StringField(this, 1, value);
527
+ };
528
+
529
+
530
+ /**
531
+ * optional uint32 connected_peers_count = 2;
532
+ * @return {number}
533
+ */
534
+ proto.pactus.GetNetworkInfoResponse.prototype.getConnectedPeersCount = function() {
535
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
536
+ };
537
+
538
+
539
+ /**
540
+ * @param {number} value
541
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
542
+ */
543
+ proto.pactus.GetNetworkInfoResponse.prototype.setConnectedPeersCount = function(value) {
544
+ return jspb.Message.setProto3IntField(this, 2, value);
545
+ };
546
+
547
+
548
+ /**
549
+ * repeated PeerInfo connected_peers = 3;
550
+ * @return {!Array<!proto.pactus.PeerInfo>}
551
+ */
552
+ proto.pactus.GetNetworkInfoResponse.prototype.getConnectedPeersList = function() {
553
+ return /** @type{!Array<!proto.pactus.PeerInfo>} */ (
554
+ jspb.Message.getRepeatedWrapperField(this, proto.pactus.PeerInfo, 3));
555
+ };
556
+
557
+
558
+ /**
559
+ * @param {!Array<!proto.pactus.PeerInfo>} value
560
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
561
+ */
562
+ proto.pactus.GetNetworkInfoResponse.prototype.setConnectedPeersList = function(value) {
563
+ return jspb.Message.setRepeatedWrapperField(this, 3, value);
564
+ };
565
+
566
+
567
+ /**
568
+ * @param {!proto.pactus.PeerInfo=} opt_value
569
+ * @param {number=} opt_index
570
+ * @return {!proto.pactus.PeerInfo}
571
+ */
572
+ proto.pactus.GetNetworkInfoResponse.prototype.addConnectedPeers = function(opt_value, opt_index) {
573
+ return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.pactus.PeerInfo, opt_index);
574
+ };
575
+
576
+
577
+ /**
578
+ * Clears the list making it empty but non-null.
579
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
580
+ */
581
+ proto.pactus.GetNetworkInfoResponse.prototype.clearConnectedPeersList = function() {
582
+ return this.setConnectedPeersList([]);
583
+ };
584
+
585
+
586
+ /**
587
+ * optional MetricInfo metric_info = 4;
588
+ * @return {?proto.pactus.MetricInfo}
589
+ */
590
+ proto.pactus.GetNetworkInfoResponse.prototype.getMetricInfo = function() {
591
+ return /** @type{?proto.pactus.MetricInfo} */ (
592
+ jspb.Message.getWrapperField(this, proto.pactus.MetricInfo, 4));
593
+ };
594
+
595
+
596
+ /**
597
+ * @param {?proto.pactus.MetricInfo|undefined} value
598
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
599
+ */
600
+ proto.pactus.GetNetworkInfoResponse.prototype.setMetricInfo = function(value) {
601
+ return jspb.Message.setWrapperField(this, 4, value);
602
+ };
603
+
604
+
605
+ /**
606
+ * Clears the message field making it undefined.
607
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
608
+ */
609
+ proto.pactus.GetNetworkInfoResponse.prototype.clearMetricInfo = function() {
610
+ return this.setMetricInfo(undefined);
611
+ };
612
+
613
+
614
+ /**
615
+ * Returns whether this field is set.
616
+ * @return {boolean}
617
+ */
618
+ proto.pactus.GetNetworkInfoResponse.prototype.hasMetricInfo = function() {
619
+ return jspb.Message.getField(this, 4) != null;
620
+ };
621
+
622
+
623
+
624
+
625
+
626
+ if (jspb.Message.GENERATE_TO_OBJECT) {
627
+ /**
628
+ * Creates an object representation of this proto.
629
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
630
+ * Optional fields that are not set will be set to undefined.
631
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
632
+ * For the list of reserved names please see:
633
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
634
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
635
+ * JSPB instance for transitional soy proto support:
636
+ * http://goto/soy-param-migration
637
+ * @return {!Object}
638
+ */
639
+ proto.pactus.GetNodeInfoRequest.prototype.toObject = function(opt_includeInstance) {
640
+ return proto.pactus.GetNodeInfoRequest.toObject(opt_includeInstance, this);
641
+ };
642
+
643
+
644
+ /**
645
+ * Static version of the {@see toObject} method.
646
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
647
+ * the JSPB instance for transitional soy proto support:
648
+ * http://goto/soy-param-migration
649
+ * @param {!proto.pactus.GetNodeInfoRequest} msg The msg instance to transform.
650
+ * @return {!Object}
651
+ * @suppress {unusedLocalVariables} f is only used for nested messages
652
+ */
653
+ proto.pactus.GetNodeInfoRequest.toObject = function(includeInstance, msg) {
654
+ var f, obj = {
655
+
656
+ };
657
+
658
+ if (includeInstance) {
659
+ obj.$jspbMessageInstance = msg;
660
+ }
661
+ return obj;
662
+ };
663
+ }
664
+
665
+
666
+ /**
667
+ * Deserializes binary data (in protobuf wire format).
668
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
669
+ * @return {!proto.pactus.GetNodeInfoRequest}
670
+ */
671
+ proto.pactus.GetNodeInfoRequest.deserializeBinary = function(bytes) {
672
+ var reader = new jspb.BinaryReader(bytes);
673
+ var msg = new proto.pactus.GetNodeInfoRequest;
674
+ return proto.pactus.GetNodeInfoRequest.deserializeBinaryFromReader(msg, reader);
675
+ };
676
+
677
+
678
+ /**
679
+ * Deserializes binary data (in protobuf wire format) from the
680
+ * given reader into the given message object.
681
+ * @param {!proto.pactus.GetNodeInfoRequest} msg The message object to deserialize into.
682
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
683
+ * @return {!proto.pactus.GetNodeInfoRequest}
684
+ */
685
+ proto.pactus.GetNodeInfoRequest.deserializeBinaryFromReader = function(msg, reader) {
686
+ while (reader.nextField()) {
687
+ if (reader.isEndGroup()) {
688
+ break;
689
+ }
690
+ var field = reader.getFieldNumber();
691
+ switch (field) {
692
+ default:
693
+ reader.skipField();
694
+ break;
695
+ }
696
+ }
697
+ return msg;
698
+ };
699
+
700
+
701
+ /**
702
+ * Serializes the message to binary data (in protobuf wire format).
703
+ * @return {!Uint8Array}
704
+ */
705
+ proto.pactus.GetNodeInfoRequest.prototype.serializeBinary = function() {
706
+ var writer = new jspb.BinaryWriter();
707
+ proto.pactus.GetNodeInfoRequest.serializeBinaryToWriter(this, writer);
708
+ return writer.getResultBuffer();
709
+ };
710
+
711
+
712
+ /**
713
+ * Serializes the given message to binary data (in protobuf wire
714
+ * format), writing to the given BinaryWriter.
715
+ * @param {!proto.pactus.GetNodeInfoRequest} message
716
+ * @param {!jspb.BinaryWriter} writer
717
+ * @suppress {unusedLocalVariables} f is only used for nested messages
718
+ */
719
+ proto.pactus.GetNodeInfoRequest.serializeBinaryToWriter = function(message, writer) {
720
+ var f = undefined;
721
+ };
722
+
723
+
724
+
725
+ /**
726
+ * List of repeated fields within this message type.
727
+ * @private {!Array<number>}
728
+ * @const
729
+ */
730
+ proto.pactus.GetNodeInfoResponse.repeatedFields_ = [8,9,15];
731
+
732
+
733
+
734
+ if (jspb.Message.GENERATE_TO_OBJECT) {
735
+ /**
736
+ * Creates an object representation of this proto.
737
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
738
+ * Optional fields that are not set will be set to undefined.
739
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
740
+ * For the list of reserved names please see:
741
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
742
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
743
+ * JSPB instance for transitional soy proto support:
744
+ * http://goto/soy-param-migration
745
+ * @return {!Object}
746
+ */
747
+ proto.pactus.GetNodeInfoResponse.prototype.toObject = function(opt_includeInstance) {
748
+ return proto.pactus.GetNodeInfoResponse.toObject(opt_includeInstance, this);
749
+ };
750
+
751
+
752
+ /**
753
+ * Static version of the {@see toObject} method.
754
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
755
+ * the JSPB instance for transitional soy proto support:
756
+ * http://goto/soy-param-migration
757
+ * @param {!proto.pactus.GetNodeInfoResponse} msg The msg instance to transform.
758
+ * @return {!Object}
759
+ * @suppress {unusedLocalVariables} f is only used for nested messages
760
+ */
761
+ proto.pactus.GetNodeInfoResponse.toObject = function(includeInstance, msg) {
762
+ var f, obj = {
763
+ moniker: jspb.Message.getFieldWithDefault(msg, 1, ""),
764
+ agent: jspb.Message.getFieldWithDefault(msg, 2, ""),
765
+ peerId: jspb.Message.getFieldWithDefault(msg, 3, ""),
766
+ startedAt: jspb.Message.getFieldWithDefault(msg, 4, 0),
767
+ reachability: jspb.Message.getFieldWithDefault(msg, 5, ""),
768
+ services: jspb.Message.getFieldWithDefault(msg, 6, 0),
769
+ servicesNames: jspb.Message.getFieldWithDefault(msg, 7, ""),
770
+ localAddrsList: (f = jspb.Message.getRepeatedField(msg, 8)) == null ? undefined : f,
771
+ protocolsList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f,
772
+ clockOffset: jspb.Message.getFloatingPointFieldWithDefault(msg, 13, 0.0),
773
+ connectionInfo: (f = msg.getConnectionInfo()) && proto.pactus.ConnectionInfo.toObject(includeInstance, f),
774
+ zmqPublishersList: jspb.Message.toObjectList(msg.getZmqPublishersList(),
775
+ proto.pactus.ZMQPublisherInfo.toObject, includeInstance)
776
+ };
777
+
778
+ if (includeInstance) {
779
+ obj.$jspbMessageInstance = msg;
780
+ }
781
+ return obj;
782
+ };
783
+ }
784
+
785
+
786
+ /**
787
+ * Deserializes binary data (in protobuf wire format).
788
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
789
+ * @return {!proto.pactus.GetNodeInfoResponse}
790
+ */
791
+ proto.pactus.GetNodeInfoResponse.deserializeBinary = function(bytes) {
792
+ var reader = new jspb.BinaryReader(bytes);
793
+ var msg = new proto.pactus.GetNodeInfoResponse;
794
+ return proto.pactus.GetNodeInfoResponse.deserializeBinaryFromReader(msg, reader);
795
+ };
796
+
797
+
798
+ /**
799
+ * Deserializes binary data (in protobuf wire format) from the
800
+ * given reader into the given message object.
801
+ * @param {!proto.pactus.GetNodeInfoResponse} msg The message object to deserialize into.
802
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
803
+ * @return {!proto.pactus.GetNodeInfoResponse}
804
+ */
805
+ proto.pactus.GetNodeInfoResponse.deserializeBinaryFromReader = function(msg, reader) {
806
+ while (reader.nextField()) {
807
+ if (reader.isEndGroup()) {
808
+ break;
809
+ }
810
+ var field = reader.getFieldNumber();
811
+ switch (field) {
812
+ case 1:
813
+ var value = /** @type {string} */ (reader.readString());
814
+ msg.setMoniker(value);
815
+ break;
816
+ case 2:
817
+ var value = /** @type {string} */ (reader.readString());
818
+ msg.setAgent(value);
819
+ break;
820
+ case 3:
821
+ var value = /** @type {string} */ (reader.readString());
822
+ msg.setPeerId(value);
823
+ break;
824
+ case 4:
825
+ var value = /** @type {number} */ (reader.readUint64());
826
+ msg.setStartedAt(value);
827
+ break;
828
+ case 5:
829
+ var value = /** @type {string} */ (reader.readString());
830
+ msg.setReachability(value);
831
+ break;
832
+ case 6:
833
+ var value = /** @type {number} */ (reader.readInt32());
834
+ msg.setServices(value);
835
+ break;
836
+ case 7:
837
+ var value = /** @type {string} */ (reader.readString());
838
+ msg.setServicesNames(value);
839
+ break;
840
+ case 8:
841
+ var value = /** @type {string} */ (reader.readString());
842
+ msg.addLocalAddrs(value);
843
+ break;
844
+ case 9:
845
+ var value = /** @type {string} */ (reader.readString());
846
+ msg.addProtocols(value);
847
+ break;
848
+ case 13:
849
+ var value = /** @type {number} */ (reader.readDouble());
850
+ msg.setClockOffset(value);
851
+ break;
852
+ case 14:
853
+ var value = new proto.pactus.ConnectionInfo;
854
+ reader.readMessage(value,proto.pactus.ConnectionInfo.deserializeBinaryFromReader);
855
+ msg.setConnectionInfo(value);
856
+ break;
857
+ case 15:
858
+ var value = new proto.pactus.ZMQPublisherInfo;
859
+ reader.readMessage(value,proto.pactus.ZMQPublisherInfo.deserializeBinaryFromReader);
860
+ msg.addZmqPublishers(value);
861
+ break;
862
+ default:
863
+ reader.skipField();
864
+ break;
865
+ }
866
+ }
867
+ return msg;
868
+ };
869
+
870
+
871
+ /**
872
+ * Serializes the message to binary data (in protobuf wire format).
873
+ * @return {!Uint8Array}
874
+ */
875
+ proto.pactus.GetNodeInfoResponse.prototype.serializeBinary = function() {
876
+ var writer = new jspb.BinaryWriter();
877
+ proto.pactus.GetNodeInfoResponse.serializeBinaryToWriter(this, writer);
878
+ return writer.getResultBuffer();
879
+ };
880
+
881
+
882
+ /**
883
+ * Serializes the given message to binary data (in protobuf wire
884
+ * format), writing to the given BinaryWriter.
885
+ * @param {!proto.pactus.GetNodeInfoResponse} message
886
+ * @param {!jspb.BinaryWriter} writer
887
+ * @suppress {unusedLocalVariables} f is only used for nested messages
888
+ */
889
+ proto.pactus.GetNodeInfoResponse.serializeBinaryToWriter = function(message, writer) {
890
+ var f = undefined;
891
+ f = message.getMoniker();
892
+ if (f.length > 0) {
893
+ writer.writeString(
894
+ 1,
895
+ f
896
+ );
897
+ }
898
+ f = message.getAgent();
899
+ if (f.length > 0) {
900
+ writer.writeString(
901
+ 2,
902
+ f
903
+ );
904
+ }
905
+ f = message.getPeerId();
906
+ if (f.length > 0) {
907
+ writer.writeString(
908
+ 3,
909
+ f
910
+ );
911
+ }
912
+ f = message.getStartedAt();
913
+ if (f !== 0) {
914
+ writer.writeUint64(
915
+ 4,
916
+ f
917
+ );
918
+ }
919
+ f = message.getReachability();
920
+ if (f.length > 0) {
921
+ writer.writeString(
922
+ 5,
923
+ f
924
+ );
925
+ }
926
+ f = message.getServices();
927
+ if (f !== 0) {
928
+ writer.writeInt32(
929
+ 6,
930
+ f
931
+ );
932
+ }
933
+ f = message.getServicesNames();
934
+ if (f.length > 0) {
935
+ writer.writeString(
936
+ 7,
937
+ f
938
+ );
939
+ }
940
+ f = message.getLocalAddrsList();
941
+ if (f.length > 0) {
942
+ writer.writeRepeatedString(
943
+ 8,
944
+ f
945
+ );
946
+ }
947
+ f = message.getProtocolsList();
948
+ if (f.length > 0) {
949
+ writer.writeRepeatedString(
950
+ 9,
951
+ f
952
+ );
953
+ }
954
+ f = message.getClockOffset();
955
+ if (f !== 0.0) {
956
+ writer.writeDouble(
957
+ 13,
958
+ f
959
+ );
960
+ }
961
+ f = message.getConnectionInfo();
962
+ if (f != null) {
963
+ writer.writeMessage(
964
+ 14,
965
+ f,
966
+ proto.pactus.ConnectionInfo.serializeBinaryToWriter
967
+ );
968
+ }
969
+ f = message.getZmqPublishersList();
970
+ if (f.length > 0) {
971
+ writer.writeRepeatedMessage(
972
+ 15,
973
+ f,
974
+ proto.pactus.ZMQPublisherInfo.serializeBinaryToWriter
975
+ );
976
+ }
977
+ };
978
+
979
+
980
+ /**
981
+ * optional string moniker = 1;
982
+ * @return {string}
983
+ */
984
+ proto.pactus.GetNodeInfoResponse.prototype.getMoniker = function() {
985
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
986
+ };
987
+
988
+
989
+ /**
990
+ * @param {string} value
991
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
992
+ */
993
+ proto.pactus.GetNodeInfoResponse.prototype.setMoniker = function(value) {
994
+ return jspb.Message.setProto3StringField(this, 1, value);
995
+ };
996
+
997
+
998
+ /**
999
+ * optional string agent = 2;
1000
+ * @return {string}
1001
+ */
1002
+ proto.pactus.GetNodeInfoResponse.prototype.getAgent = function() {
1003
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1004
+ };
1005
+
1006
+
1007
+ /**
1008
+ * @param {string} value
1009
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1010
+ */
1011
+ proto.pactus.GetNodeInfoResponse.prototype.setAgent = function(value) {
1012
+ return jspb.Message.setProto3StringField(this, 2, value);
1013
+ };
1014
+
1015
+
1016
+ /**
1017
+ * optional string peer_id = 3;
1018
+ * @return {string}
1019
+ */
1020
+ proto.pactus.GetNodeInfoResponse.prototype.getPeerId = function() {
1021
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
1022
+ };
1023
+
1024
+
1025
+ /**
1026
+ * @param {string} value
1027
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1028
+ */
1029
+ proto.pactus.GetNodeInfoResponse.prototype.setPeerId = function(value) {
1030
+ return jspb.Message.setProto3StringField(this, 3, value);
1031
+ };
1032
+
1033
+
1034
+ /**
1035
+ * optional uint64 started_at = 4;
1036
+ * @return {number}
1037
+ */
1038
+ proto.pactus.GetNodeInfoResponse.prototype.getStartedAt = function() {
1039
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
1040
+ };
1041
+
1042
+
1043
+ /**
1044
+ * @param {number} value
1045
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1046
+ */
1047
+ proto.pactus.GetNodeInfoResponse.prototype.setStartedAt = function(value) {
1048
+ return jspb.Message.setProto3IntField(this, 4, value);
1049
+ };
1050
+
1051
+
1052
+ /**
1053
+ * optional string reachability = 5;
1054
+ * @return {string}
1055
+ */
1056
+ proto.pactus.GetNodeInfoResponse.prototype.getReachability = function() {
1057
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
1058
+ };
1059
+
1060
+
1061
+ /**
1062
+ * @param {string} value
1063
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1064
+ */
1065
+ proto.pactus.GetNodeInfoResponse.prototype.setReachability = function(value) {
1066
+ return jspb.Message.setProto3StringField(this, 5, value);
1067
+ };
1068
+
1069
+
1070
+ /**
1071
+ * optional int32 services = 6;
1072
+ * @return {number}
1073
+ */
1074
+ proto.pactus.GetNodeInfoResponse.prototype.getServices = function() {
1075
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
1076
+ };
1077
+
1078
+
1079
+ /**
1080
+ * @param {number} value
1081
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1082
+ */
1083
+ proto.pactus.GetNodeInfoResponse.prototype.setServices = function(value) {
1084
+ return jspb.Message.setProto3IntField(this, 6, value);
1085
+ };
1086
+
1087
+
1088
+ /**
1089
+ * optional string services_names = 7;
1090
+ * @return {string}
1091
+ */
1092
+ proto.pactus.GetNodeInfoResponse.prototype.getServicesNames = function() {
1093
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
1094
+ };
1095
+
1096
+
1097
+ /**
1098
+ * @param {string} value
1099
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1100
+ */
1101
+ proto.pactus.GetNodeInfoResponse.prototype.setServicesNames = function(value) {
1102
+ return jspb.Message.setProto3StringField(this, 7, value);
1103
+ };
1104
+
1105
+
1106
+ /**
1107
+ * repeated string local_addrs = 8;
1108
+ * @return {!Array<string>}
1109
+ */
1110
+ proto.pactus.GetNodeInfoResponse.prototype.getLocalAddrsList = function() {
1111
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 8));
1112
+ };
1113
+
1114
+
1115
+ /**
1116
+ * @param {!Array<string>} value
1117
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1118
+ */
1119
+ proto.pactus.GetNodeInfoResponse.prototype.setLocalAddrsList = function(value) {
1120
+ return jspb.Message.setField(this, 8, value || []);
1121
+ };
1122
+
1123
+
1124
+ /**
1125
+ * @param {string} value
1126
+ * @param {number=} opt_index
1127
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1128
+ */
1129
+ proto.pactus.GetNodeInfoResponse.prototype.addLocalAddrs = function(value, opt_index) {
1130
+ return jspb.Message.addToRepeatedField(this, 8, value, opt_index);
1131
+ };
1132
+
1133
+
1134
+ /**
1135
+ * Clears the list making it empty but non-null.
1136
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1137
+ */
1138
+ proto.pactus.GetNodeInfoResponse.prototype.clearLocalAddrsList = function() {
1139
+ return this.setLocalAddrsList([]);
1140
+ };
1141
+
1142
+
1143
+ /**
1144
+ * repeated string protocols = 9;
1145
+ * @return {!Array<string>}
1146
+ */
1147
+ proto.pactus.GetNodeInfoResponse.prototype.getProtocolsList = function() {
1148
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 9));
1149
+ };
1150
+
1151
+
1152
+ /**
1153
+ * @param {!Array<string>} value
1154
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1155
+ */
1156
+ proto.pactus.GetNodeInfoResponse.prototype.setProtocolsList = function(value) {
1157
+ return jspb.Message.setField(this, 9, value || []);
1158
+ };
1159
+
1160
+
1161
+ /**
1162
+ * @param {string} value
1163
+ * @param {number=} opt_index
1164
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1165
+ */
1166
+ proto.pactus.GetNodeInfoResponse.prototype.addProtocols = function(value, opt_index) {
1167
+ return jspb.Message.addToRepeatedField(this, 9, value, opt_index);
1168
+ };
1169
+
1170
+
1171
+ /**
1172
+ * Clears the list making it empty but non-null.
1173
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1174
+ */
1175
+ proto.pactus.GetNodeInfoResponse.prototype.clearProtocolsList = function() {
1176
+ return this.setProtocolsList([]);
1177
+ };
1178
+
1179
+
1180
+ /**
1181
+ * optional double clock_offset = 13;
1182
+ * @return {number}
1183
+ */
1184
+ proto.pactus.GetNodeInfoResponse.prototype.getClockOffset = function() {
1185
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 13, 0.0));
1186
+ };
1187
+
1188
+
1189
+ /**
1190
+ * @param {number} value
1191
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1192
+ */
1193
+ proto.pactus.GetNodeInfoResponse.prototype.setClockOffset = function(value) {
1194
+ return jspb.Message.setProto3FloatField(this, 13, value);
1195
+ };
1196
+
1197
+
1198
+ /**
1199
+ * optional ConnectionInfo connection_info = 14;
1200
+ * @return {?proto.pactus.ConnectionInfo}
1201
+ */
1202
+ proto.pactus.GetNodeInfoResponse.prototype.getConnectionInfo = function() {
1203
+ return /** @type{?proto.pactus.ConnectionInfo} */ (
1204
+ jspb.Message.getWrapperField(this, proto.pactus.ConnectionInfo, 14));
1205
+ };
1206
+
1207
+
1208
+ /**
1209
+ * @param {?proto.pactus.ConnectionInfo|undefined} value
1210
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1211
+ */
1212
+ proto.pactus.GetNodeInfoResponse.prototype.setConnectionInfo = function(value) {
1213
+ return jspb.Message.setWrapperField(this, 14, value);
1214
+ };
1215
+
1216
+
1217
+ /**
1218
+ * Clears the message field making it undefined.
1219
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1220
+ */
1221
+ proto.pactus.GetNodeInfoResponse.prototype.clearConnectionInfo = function() {
1222
+ return this.setConnectionInfo(undefined);
1223
+ };
1224
+
1225
+
1226
+ /**
1227
+ * Returns whether this field is set.
1228
+ * @return {boolean}
1229
+ */
1230
+ proto.pactus.GetNodeInfoResponse.prototype.hasConnectionInfo = function() {
1231
+ return jspb.Message.getField(this, 14) != null;
1232
+ };
1233
+
1234
+
1235
+ /**
1236
+ * repeated ZMQPublisherInfo zmq_publishers = 15;
1237
+ * @return {!Array<!proto.pactus.ZMQPublisherInfo>}
1238
+ */
1239
+ proto.pactus.GetNodeInfoResponse.prototype.getZmqPublishersList = function() {
1240
+ return /** @type{!Array<!proto.pactus.ZMQPublisherInfo>} */ (
1241
+ jspb.Message.getRepeatedWrapperField(this, proto.pactus.ZMQPublisherInfo, 15));
1242
+ };
1243
+
1244
+
1245
+ /**
1246
+ * @param {!Array<!proto.pactus.ZMQPublisherInfo>} value
1247
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1248
+ */
1249
+ proto.pactus.GetNodeInfoResponse.prototype.setZmqPublishersList = function(value) {
1250
+ return jspb.Message.setRepeatedWrapperField(this, 15, value);
1251
+ };
1252
+
1253
+
1254
+ /**
1255
+ * @param {!proto.pactus.ZMQPublisherInfo=} opt_value
1256
+ * @param {number=} opt_index
1257
+ * @return {!proto.pactus.ZMQPublisherInfo}
1258
+ */
1259
+ proto.pactus.GetNodeInfoResponse.prototype.addZmqPublishers = function(opt_value, opt_index) {
1260
+ return jspb.Message.addToRepeatedWrapperField(this, 15, opt_value, proto.pactus.ZMQPublisherInfo, opt_index);
1261
+ };
1262
+
1263
+
1264
+ /**
1265
+ * Clears the list making it empty but non-null.
1266
+ * @return {!proto.pactus.GetNodeInfoResponse} returns this
1267
+ */
1268
+ proto.pactus.GetNodeInfoResponse.prototype.clearZmqPublishersList = function() {
1269
+ return this.setZmqPublishersList([]);
1270
+ };
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1277
+ /**
1278
+ * Creates an object representation of this proto.
1279
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1280
+ * Optional fields that are not set will be set to undefined.
1281
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1282
+ * For the list of reserved names please see:
1283
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1284
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1285
+ * JSPB instance for transitional soy proto support:
1286
+ * http://goto/soy-param-migration
1287
+ * @return {!Object}
1288
+ */
1289
+ proto.pactus.ZMQPublisherInfo.prototype.toObject = function(opt_includeInstance) {
1290
+ return proto.pactus.ZMQPublisherInfo.toObject(opt_includeInstance, this);
1291
+ };
1292
+
1293
+
1294
+ /**
1295
+ * Static version of the {@see toObject} method.
1296
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1297
+ * the JSPB instance for transitional soy proto support:
1298
+ * http://goto/soy-param-migration
1299
+ * @param {!proto.pactus.ZMQPublisherInfo} msg The msg instance to transform.
1300
+ * @return {!Object}
1301
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1302
+ */
1303
+ proto.pactus.ZMQPublisherInfo.toObject = function(includeInstance, msg) {
1304
+ var f, obj = {
1305
+ topic: jspb.Message.getFieldWithDefault(msg, 1, ""),
1306
+ address: jspb.Message.getFieldWithDefault(msg, 2, ""),
1307
+ hwm: jspb.Message.getFieldWithDefault(msg, 3, 0)
1308
+ };
1309
+
1310
+ if (includeInstance) {
1311
+ obj.$jspbMessageInstance = msg;
1312
+ }
1313
+ return obj;
1314
+ };
1315
+ }
1316
+
1317
+
1318
+ /**
1319
+ * Deserializes binary data (in protobuf wire format).
1320
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1321
+ * @return {!proto.pactus.ZMQPublisherInfo}
1322
+ */
1323
+ proto.pactus.ZMQPublisherInfo.deserializeBinary = function(bytes) {
1324
+ var reader = new jspb.BinaryReader(bytes);
1325
+ var msg = new proto.pactus.ZMQPublisherInfo;
1326
+ return proto.pactus.ZMQPublisherInfo.deserializeBinaryFromReader(msg, reader);
1327
+ };
1328
+
1329
+
1330
+ /**
1331
+ * Deserializes binary data (in protobuf wire format) from the
1332
+ * given reader into the given message object.
1333
+ * @param {!proto.pactus.ZMQPublisherInfo} msg The message object to deserialize into.
1334
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1335
+ * @return {!proto.pactus.ZMQPublisherInfo}
1336
+ */
1337
+ proto.pactus.ZMQPublisherInfo.deserializeBinaryFromReader = function(msg, reader) {
1338
+ while (reader.nextField()) {
1339
+ if (reader.isEndGroup()) {
1340
+ break;
1341
+ }
1342
+ var field = reader.getFieldNumber();
1343
+ switch (field) {
1344
+ case 1:
1345
+ var value = /** @type {string} */ (reader.readString());
1346
+ msg.setTopic(value);
1347
+ break;
1348
+ case 2:
1349
+ var value = /** @type {string} */ (reader.readString());
1350
+ msg.setAddress(value);
1351
+ break;
1352
+ case 3:
1353
+ var value = /** @type {number} */ (reader.readInt32());
1354
+ msg.setHwm(value);
1355
+ break;
1356
+ default:
1357
+ reader.skipField();
1358
+ break;
1359
+ }
1360
+ }
1361
+ return msg;
1362
+ };
1363
+
1364
+
1365
+ /**
1366
+ * Serializes the message to binary data (in protobuf wire format).
1367
+ * @return {!Uint8Array}
1368
+ */
1369
+ proto.pactus.ZMQPublisherInfo.prototype.serializeBinary = function() {
1370
+ var writer = new jspb.BinaryWriter();
1371
+ proto.pactus.ZMQPublisherInfo.serializeBinaryToWriter(this, writer);
1372
+ return writer.getResultBuffer();
1373
+ };
1374
+
1375
+
1376
+ /**
1377
+ * Serializes the given message to binary data (in protobuf wire
1378
+ * format), writing to the given BinaryWriter.
1379
+ * @param {!proto.pactus.ZMQPublisherInfo} message
1380
+ * @param {!jspb.BinaryWriter} writer
1381
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1382
+ */
1383
+ proto.pactus.ZMQPublisherInfo.serializeBinaryToWriter = function(message, writer) {
1384
+ var f = undefined;
1385
+ f = message.getTopic();
1386
+ if (f.length > 0) {
1387
+ writer.writeString(
1388
+ 1,
1389
+ f
1390
+ );
1391
+ }
1392
+ f = message.getAddress();
1393
+ if (f.length > 0) {
1394
+ writer.writeString(
1395
+ 2,
1396
+ f
1397
+ );
1398
+ }
1399
+ f = message.getHwm();
1400
+ if (f !== 0) {
1401
+ writer.writeInt32(
1402
+ 3,
1403
+ f
1404
+ );
1405
+ }
1406
+ };
1407
+
1408
+
1409
+ /**
1410
+ * optional string topic = 1;
1411
+ * @return {string}
1412
+ */
1413
+ proto.pactus.ZMQPublisherInfo.prototype.getTopic = function() {
1414
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1415
+ };
1416
+
1417
+
1418
+ /**
1419
+ * @param {string} value
1420
+ * @return {!proto.pactus.ZMQPublisherInfo} returns this
1421
+ */
1422
+ proto.pactus.ZMQPublisherInfo.prototype.setTopic = function(value) {
1423
+ return jspb.Message.setProto3StringField(this, 1, value);
1424
+ };
1425
+
1426
+
1427
+ /**
1428
+ * optional string address = 2;
1429
+ * @return {string}
1430
+ */
1431
+ proto.pactus.ZMQPublisherInfo.prototype.getAddress = function() {
1432
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1433
+ };
1434
+
1435
+
1436
+ /**
1437
+ * @param {string} value
1438
+ * @return {!proto.pactus.ZMQPublisherInfo} returns this
1439
+ */
1440
+ proto.pactus.ZMQPublisherInfo.prototype.setAddress = function(value) {
1441
+ return jspb.Message.setProto3StringField(this, 2, value);
1442
+ };
1443
+
1444
+
1445
+ /**
1446
+ * optional int32 hwm = 3;
1447
+ * @return {number}
1448
+ */
1449
+ proto.pactus.ZMQPublisherInfo.prototype.getHwm = function() {
1450
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
1451
+ };
1452
+
1453
+
1454
+ /**
1455
+ * @param {number} value
1456
+ * @return {!proto.pactus.ZMQPublisherInfo} returns this
1457
+ */
1458
+ proto.pactus.ZMQPublisherInfo.prototype.setHwm = function(value) {
1459
+ return jspb.Message.setProto3IntField(this, 3, value);
1460
+ };
1461
+
1462
+
1463
+
1464
+ /**
1465
+ * List of repeated fields within this message type.
1466
+ * @private {!Array<number>}
1467
+ * @const
1468
+ */
1469
+ proto.pactus.PeerInfo.repeatedFields_ = [5,6,14];
1470
+
1471
+
1472
+
1473
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1474
+ /**
1475
+ * Creates an object representation of this proto.
1476
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1477
+ * Optional fields that are not set will be set to undefined.
1478
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1479
+ * For the list of reserved names please see:
1480
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1481
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1482
+ * JSPB instance for transitional soy proto support:
1483
+ * http://goto/soy-param-migration
1484
+ * @return {!Object}
1485
+ */
1486
+ proto.pactus.PeerInfo.prototype.toObject = function(opt_includeInstance) {
1487
+ return proto.pactus.PeerInfo.toObject(opt_includeInstance, this);
1488
+ };
1489
+
1490
+
1491
+ /**
1492
+ * Static version of the {@see toObject} method.
1493
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1494
+ * the JSPB instance for transitional soy proto support:
1495
+ * http://goto/soy-param-migration
1496
+ * @param {!proto.pactus.PeerInfo} msg The msg instance to transform.
1497
+ * @return {!Object}
1498
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1499
+ */
1500
+ proto.pactus.PeerInfo.toObject = function(includeInstance, msg) {
1501
+ var f, obj = {
1502
+ status: jspb.Message.getFieldWithDefault(msg, 1, 0),
1503
+ moniker: jspb.Message.getFieldWithDefault(msg, 2, ""),
1504
+ agent: jspb.Message.getFieldWithDefault(msg, 3, ""),
1505
+ peerId: jspb.Message.getFieldWithDefault(msg, 4, ""),
1506
+ consensusKeysList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f,
1507
+ consensusAddressesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f,
1508
+ services: jspb.Message.getFieldWithDefault(msg, 7, 0),
1509
+ lastBlockHash: jspb.Message.getFieldWithDefault(msg, 8, ""),
1510
+ height: jspb.Message.getFieldWithDefault(msg, 9, 0),
1511
+ lastSent: jspb.Message.getFieldWithDefault(msg, 10, 0),
1512
+ lastReceived: jspb.Message.getFieldWithDefault(msg, 11, 0),
1513
+ address: jspb.Message.getFieldWithDefault(msg, 12, ""),
1514
+ direction: jspb.Message.getFieldWithDefault(msg, 13, ""),
1515
+ protocolsList: (f = jspb.Message.getRepeatedField(msg, 14)) == null ? undefined : f,
1516
+ totalSessions: jspb.Message.getFieldWithDefault(msg, 15, 0),
1517
+ completedSessions: jspb.Message.getFieldWithDefault(msg, 16, 0),
1518
+ metricInfo: (f = msg.getMetricInfo()) && proto.pactus.MetricInfo.toObject(includeInstance, f)
1519
+ };
1520
+
1521
+ if (includeInstance) {
1522
+ obj.$jspbMessageInstance = msg;
1523
+ }
1524
+ return obj;
1525
+ };
1526
+ }
1527
+
1528
+
1529
+ /**
1530
+ * Deserializes binary data (in protobuf wire format).
1531
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1532
+ * @return {!proto.pactus.PeerInfo}
1533
+ */
1534
+ proto.pactus.PeerInfo.deserializeBinary = function(bytes) {
1535
+ var reader = new jspb.BinaryReader(bytes);
1536
+ var msg = new proto.pactus.PeerInfo;
1537
+ return proto.pactus.PeerInfo.deserializeBinaryFromReader(msg, reader);
1538
+ };
1539
+
1540
+
1541
+ /**
1542
+ * Deserializes binary data (in protobuf wire format) from the
1543
+ * given reader into the given message object.
1544
+ * @param {!proto.pactus.PeerInfo} msg The message object to deserialize into.
1545
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1546
+ * @return {!proto.pactus.PeerInfo}
1547
+ */
1548
+ proto.pactus.PeerInfo.deserializeBinaryFromReader = function(msg, reader) {
1549
+ while (reader.nextField()) {
1550
+ if (reader.isEndGroup()) {
1551
+ break;
1552
+ }
1553
+ var field = reader.getFieldNumber();
1554
+ switch (field) {
1555
+ case 1:
1556
+ var value = /** @type {number} */ (reader.readInt32());
1557
+ msg.setStatus(value);
1558
+ break;
1559
+ case 2:
1560
+ var value = /** @type {string} */ (reader.readString());
1561
+ msg.setMoniker(value);
1562
+ break;
1563
+ case 3:
1564
+ var value = /** @type {string} */ (reader.readString());
1565
+ msg.setAgent(value);
1566
+ break;
1567
+ case 4:
1568
+ var value = /** @type {string} */ (reader.readString());
1569
+ msg.setPeerId(value);
1570
+ break;
1571
+ case 5:
1572
+ var value = /** @type {string} */ (reader.readString());
1573
+ msg.addConsensusKeys(value);
1574
+ break;
1575
+ case 6:
1576
+ var value = /** @type {string} */ (reader.readString());
1577
+ msg.addConsensusAddresses(value);
1578
+ break;
1579
+ case 7:
1580
+ var value = /** @type {number} */ (reader.readUint32());
1581
+ msg.setServices(value);
1582
+ break;
1583
+ case 8:
1584
+ var value = /** @type {string} */ (reader.readString());
1585
+ msg.setLastBlockHash(value);
1586
+ break;
1587
+ case 9:
1588
+ var value = /** @type {number} */ (reader.readUint32());
1589
+ msg.setHeight(value);
1590
+ break;
1591
+ case 10:
1592
+ var value = /** @type {number} */ (reader.readInt64());
1593
+ msg.setLastSent(value);
1594
+ break;
1595
+ case 11:
1596
+ var value = /** @type {number} */ (reader.readInt64());
1597
+ msg.setLastReceived(value);
1598
+ break;
1599
+ case 12:
1600
+ var value = /** @type {string} */ (reader.readString());
1601
+ msg.setAddress(value);
1602
+ break;
1603
+ case 13:
1604
+ var value = /** @type {string} */ (reader.readString());
1605
+ msg.setDirection(value);
1606
+ break;
1607
+ case 14:
1608
+ var value = /** @type {string} */ (reader.readString());
1609
+ msg.addProtocols(value);
1610
+ break;
1611
+ case 15:
1612
+ var value = /** @type {number} */ (reader.readInt32());
1613
+ msg.setTotalSessions(value);
1614
+ break;
1615
+ case 16:
1616
+ var value = /** @type {number} */ (reader.readInt32());
1617
+ msg.setCompletedSessions(value);
1618
+ break;
1619
+ case 17:
1620
+ var value = new proto.pactus.MetricInfo;
1621
+ reader.readMessage(value,proto.pactus.MetricInfo.deserializeBinaryFromReader);
1622
+ msg.setMetricInfo(value);
1623
+ break;
1624
+ default:
1625
+ reader.skipField();
1626
+ break;
1627
+ }
1628
+ }
1629
+ return msg;
1630
+ };
1631
+
1632
+
1633
+ /**
1634
+ * Serializes the message to binary data (in protobuf wire format).
1635
+ * @return {!Uint8Array}
1636
+ */
1637
+ proto.pactus.PeerInfo.prototype.serializeBinary = function() {
1638
+ var writer = new jspb.BinaryWriter();
1639
+ proto.pactus.PeerInfo.serializeBinaryToWriter(this, writer);
1640
+ return writer.getResultBuffer();
1641
+ };
1642
+
1643
+
1644
+ /**
1645
+ * Serializes the given message to binary data (in protobuf wire
1646
+ * format), writing to the given BinaryWriter.
1647
+ * @param {!proto.pactus.PeerInfo} message
1648
+ * @param {!jspb.BinaryWriter} writer
1649
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1650
+ */
1651
+ proto.pactus.PeerInfo.serializeBinaryToWriter = function(message, writer) {
1652
+ var f = undefined;
1653
+ f = message.getStatus();
1654
+ if (f !== 0) {
1655
+ writer.writeInt32(
1656
+ 1,
1657
+ f
1658
+ );
1659
+ }
1660
+ f = message.getMoniker();
1661
+ if (f.length > 0) {
1662
+ writer.writeString(
1663
+ 2,
1664
+ f
1665
+ );
1666
+ }
1667
+ f = message.getAgent();
1668
+ if (f.length > 0) {
1669
+ writer.writeString(
1670
+ 3,
1671
+ f
1672
+ );
1673
+ }
1674
+ f = message.getPeerId();
1675
+ if (f.length > 0) {
1676
+ writer.writeString(
1677
+ 4,
1678
+ f
1679
+ );
1680
+ }
1681
+ f = message.getConsensusKeysList();
1682
+ if (f.length > 0) {
1683
+ writer.writeRepeatedString(
1684
+ 5,
1685
+ f
1686
+ );
1687
+ }
1688
+ f = message.getConsensusAddressesList();
1689
+ if (f.length > 0) {
1690
+ writer.writeRepeatedString(
1691
+ 6,
1692
+ f
1693
+ );
1694
+ }
1695
+ f = message.getServices();
1696
+ if (f !== 0) {
1697
+ writer.writeUint32(
1698
+ 7,
1699
+ f
1700
+ );
1701
+ }
1702
+ f = message.getLastBlockHash();
1703
+ if (f.length > 0) {
1704
+ writer.writeString(
1705
+ 8,
1706
+ f
1707
+ );
1708
+ }
1709
+ f = message.getHeight();
1710
+ if (f !== 0) {
1711
+ writer.writeUint32(
1712
+ 9,
1713
+ f
1714
+ );
1715
+ }
1716
+ f = message.getLastSent();
1717
+ if (f !== 0) {
1718
+ writer.writeInt64(
1719
+ 10,
1720
+ f
1721
+ );
1722
+ }
1723
+ f = message.getLastReceived();
1724
+ if (f !== 0) {
1725
+ writer.writeInt64(
1726
+ 11,
1727
+ f
1728
+ );
1729
+ }
1730
+ f = message.getAddress();
1731
+ if (f.length > 0) {
1732
+ writer.writeString(
1733
+ 12,
1734
+ f
1735
+ );
1736
+ }
1737
+ f = message.getDirection();
1738
+ if (f.length > 0) {
1739
+ writer.writeString(
1740
+ 13,
1741
+ f
1742
+ );
1743
+ }
1744
+ f = message.getProtocolsList();
1745
+ if (f.length > 0) {
1746
+ writer.writeRepeatedString(
1747
+ 14,
1748
+ f
1749
+ );
1750
+ }
1751
+ f = message.getTotalSessions();
1752
+ if (f !== 0) {
1753
+ writer.writeInt32(
1754
+ 15,
1755
+ f
1756
+ );
1757
+ }
1758
+ f = message.getCompletedSessions();
1759
+ if (f !== 0) {
1760
+ writer.writeInt32(
1761
+ 16,
1762
+ f
1763
+ );
1764
+ }
1765
+ f = message.getMetricInfo();
1766
+ if (f != null) {
1767
+ writer.writeMessage(
1768
+ 17,
1769
+ f,
1770
+ proto.pactus.MetricInfo.serializeBinaryToWriter
1771
+ );
1772
+ }
1773
+ };
1774
+
1775
+
1776
+ /**
1777
+ * optional int32 status = 1;
1778
+ * @return {number}
1779
+ */
1780
+ proto.pactus.PeerInfo.prototype.getStatus = function() {
1781
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
1782
+ };
1783
+
1784
+
1785
+ /**
1786
+ * @param {number} value
1787
+ * @return {!proto.pactus.PeerInfo} returns this
1788
+ */
1789
+ proto.pactus.PeerInfo.prototype.setStatus = function(value) {
1790
+ return jspb.Message.setProto3IntField(this, 1, value);
1791
+ };
1792
+
1793
+
1794
+ /**
1795
+ * optional string moniker = 2;
1796
+ * @return {string}
1797
+ */
1798
+ proto.pactus.PeerInfo.prototype.getMoniker = function() {
1799
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1800
+ };
1801
+
1802
+
1803
+ /**
1804
+ * @param {string} value
1805
+ * @return {!proto.pactus.PeerInfo} returns this
1806
+ */
1807
+ proto.pactus.PeerInfo.prototype.setMoniker = function(value) {
1808
+ return jspb.Message.setProto3StringField(this, 2, value);
1809
+ };
1810
+
1811
+
1812
+ /**
1813
+ * optional string agent = 3;
1814
+ * @return {string}
1815
+ */
1816
+ proto.pactus.PeerInfo.prototype.getAgent = function() {
1817
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
1818
+ };
1819
+
1820
+
1821
+ /**
1822
+ * @param {string} value
1823
+ * @return {!proto.pactus.PeerInfo} returns this
1824
+ */
1825
+ proto.pactus.PeerInfo.prototype.setAgent = function(value) {
1826
+ return jspb.Message.setProto3StringField(this, 3, value);
1827
+ };
1828
+
1829
+
1830
+ /**
1831
+ * optional string peer_id = 4;
1832
+ * @return {string}
1833
+ */
1834
+ proto.pactus.PeerInfo.prototype.getPeerId = function() {
1835
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
1836
+ };
1837
+
1838
+
1839
+ /**
1840
+ * @param {string} value
1841
+ * @return {!proto.pactus.PeerInfo} returns this
1842
+ */
1843
+ proto.pactus.PeerInfo.prototype.setPeerId = function(value) {
1844
+ return jspb.Message.setProto3StringField(this, 4, value);
1845
+ };
1846
+
1847
+
1848
+ /**
1849
+ * repeated string consensus_keys = 5;
1850
+ * @return {!Array<string>}
1851
+ */
1852
+ proto.pactus.PeerInfo.prototype.getConsensusKeysList = function() {
1853
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 5));
1854
+ };
1855
+
1856
+
1857
+ /**
1858
+ * @param {!Array<string>} value
1859
+ * @return {!proto.pactus.PeerInfo} returns this
1860
+ */
1861
+ proto.pactus.PeerInfo.prototype.setConsensusKeysList = function(value) {
1862
+ return jspb.Message.setField(this, 5, value || []);
1863
+ };
1864
+
1865
+
1866
+ /**
1867
+ * @param {string} value
1868
+ * @param {number=} opt_index
1869
+ * @return {!proto.pactus.PeerInfo} returns this
1870
+ */
1871
+ proto.pactus.PeerInfo.prototype.addConsensusKeys = function(value, opt_index) {
1872
+ return jspb.Message.addToRepeatedField(this, 5, value, opt_index);
1873
+ };
1874
+
1875
+
1876
+ /**
1877
+ * Clears the list making it empty but non-null.
1878
+ * @return {!proto.pactus.PeerInfo} returns this
1879
+ */
1880
+ proto.pactus.PeerInfo.prototype.clearConsensusKeysList = function() {
1881
+ return this.setConsensusKeysList([]);
1882
+ };
1883
+
1884
+
1885
+ /**
1886
+ * repeated string consensus_addresses = 6;
1887
+ * @return {!Array<string>}
1888
+ */
1889
+ proto.pactus.PeerInfo.prototype.getConsensusAddressesList = function() {
1890
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 6));
1891
+ };
1892
+
1893
+
1894
+ /**
1895
+ * @param {!Array<string>} value
1896
+ * @return {!proto.pactus.PeerInfo} returns this
1897
+ */
1898
+ proto.pactus.PeerInfo.prototype.setConsensusAddressesList = function(value) {
1899
+ return jspb.Message.setField(this, 6, value || []);
1900
+ };
1901
+
1902
+
1903
+ /**
1904
+ * @param {string} value
1905
+ * @param {number=} opt_index
1906
+ * @return {!proto.pactus.PeerInfo} returns this
1907
+ */
1908
+ proto.pactus.PeerInfo.prototype.addConsensusAddresses = function(value, opt_index) {
1909
+ return jspb.Message.addToRepeatedField(this, 6, value, opt_index);
1910
+ };
1911
+
1912
+
1913
+ /**
1914
+ * Clears the list making it empty but non-null.
1915
+ * @return {!proto.pactus.PeerInfo} returns this
1916
+ */
1917
+ proto.pactus.PeerInfo.prototype.clearConsensusAddressesList = function() {
1918
+ return this.setConsensusAddressesList([]);
1919
+ };
1920
+
1921
+
1922
+ /**
1923
+ * optional uint32 services = 7;
1924
+ * @return {number}
1925
+ */
1926
+ proto.pactus.PeerInfo.prototype.getServices = function() {
1927
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
1928
+ };
1929
+
1930
+
1931
+ /**
1932
+ * @param {number} value
1933
+ * @return {!proto.pactus.PeerInfo} returns this
1934
+ */
1935
+ proto.pactus.PeerInfo.prototype.setServices = function(value) {
1936
+ return jspb.Message.setProto3IntField(this, 7, value);
1937
+ };
1938
+
1939
+
1940
+ /**
1941
+ * optional string last_block_hash = 8;
1942
+ * @return {string}
1943
+ */
1944
+ proto.pactus.PeerInfo.prototype.getLastBlockHash = function() {
1945
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
1946
+ };
1947
+
1948
+
1949
+ /**
1950
+ * @param {string} value
1951
+ * @return {!proto.pactus.PeerInfo} returns this
1952
+ */
1953
+ proto.pactus.PeerInfo.prototype.setLastBlockHash = function(value) {
1954
+ return jspb.Message.setProto3StringField(this, 8, value);
1955
+ };
1956
+
1957
+
1958
+ /**
1959
+ * optional uint32 height = 9;
1960
+ * @return {number}
1961
+ */
1962
+ proto.pactus.PeerInfo.prototype.getHeight = function() {
1963
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
1964
+ };
1965
+
1966
+
1967
+ /**
1968
+ * @param {number} value
1969
+ * @return {!proto.pactus.PeerInfo} returns this
1970
+ */
1971
+ proto.pactus.PeerInfo.prototype.setHeight = function(value) {
1972
+ return jspb.Message.setProto3IntField(this, 9, value);
1973
+ };
1974
+
1975
+
1976
+ /**
1977
+ * optional int64 last_sent = 10;
1978
+ * @return {number}
1979
+ */
1980
+ proto.pactus.PeerInfo.prototype.getLastSent = function() {
1981
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
1982
+ };
1983
+
1984
+
1985
+ /**
1986
+ * @param {number} value
1987
+ * @return {!proto.pactus.PeerInfo} returns this
1988
+ */
1989
+ proto.pactus.PeerInfo.prototype.setLastSent = function(value) {
1990
+ return jspb.Message.setProto3IntField(this, 10, value);
1991
+ };
1992
+
1993
+
1994
+ /**
1995
+ * optional int64 last_received = 11;
1996
+ * @return {number}
1997
+ */
1998
+ proto.pactus.PeerInfo.prototype.getLastReceived = function() {
1999
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
2000
+ };
2001
+
2002
+
2003
+ /**
2004
+ * @param {number} value
2005
+ * @return {!proto.pactus.PeerInfo} returns this
2006
+ */
2007
+ proto.pactus.PeerInfo.prototype.setLastReceived = function(value) {
2008
+ return jspb.Message.setProto3IntField(this, 11, value);
2009
+ };
2010
+
2011
+
2012
+ /**
2013
+ * optional string address = 12;
2014
+ * @return {string}
2015
+ */
2016
+ proto.pactus.PeerInfo.prototype.getAddress = function() {
2017
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, ""));
2018
+ };
2019
+
2020
+
2021
+ /**
2022
+ * @param {string} value
2023
+ * @return {!proto.pactus.PeerInfo} returns this
2024
+ */
2025
+ proto.pactus.PeerInfo.prototype.setAddress = function(value) {
2026
+ return jspb.Message.setProto3StringField(this, 12, value);
2027
+ };
2028
+
2029
+
2030
+ /**
2031
+ * optional string direction = 13;
2032
+ * @return {string}
2033
+ */
2034
+ proto.pactus.PeerInfo.prototype.getDirection = function() {
2035
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, ""));
2036
+ };
2037
+
2038
+
2039
+ /**
2040
+ * @param {string} value
2041
+ * @return {!proto.pactus.PeerInfo} returns this
2042
+ */
2043
+ proto.pactus.PeerInfo.prototype.setDirection = function(value) {
2044
+ return jspb.Message.setProto3StringField(this, 13, value);
2045
+ };
2046
+
2047
+
2048
+ /**
2049
+ * repeated string protocols = 14;
2050
+ * @return {!Array<string>}
2051
+ */
2052
+ proto.pactus.PeerInfo.prototype.getProtocolsList = function() {
2053
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 14));
2054
+ };
2055
+
2056
+
2057
+ /**
2058
+ * @param {!Array<string>} value
2059
+ * @return {!proto.pactus.PeerInfo} returns this
2060
+ */
2061
+ proto.pactus.PeerInfo.prototype.setProtocolsList = function(value) {
2062
+ return jspb.Message.setField(this, 14, value || []);
2063
+ };
2064
+
2065
+
2066
+ /**
2067
+ * @param {string} value
2068
+ * @param {number=} opt_index
2069
+ * @return {!proto.pactus.PeerInfo} returns this
2070
+ */
2071
+ proto.pactus.PeerInfo.prototype.addProtocols = function(value, opt_index) {
2072
+ return jspb.Message.addToRepeatedField(this, 14, value, opt_index);
2073
+ };
2074
+
2075
+
2076
+ /**
2077
+ * Clears the list making it empty but non-null.
2078
+ * @return {!proto.pactus.PeerInfo} returns this
2079
+ */
2080
+ proto.pactus.PeerInfo.prototype.clearProtocolsList = function() {
2081
+ return this.setProtocolsList([]);
2082
+ };
2083
+
2084
+
2085
+ /**
2086
+ * optional int32 total_sessions = 15;
2087
+ * @return {number}
2088
+ */
2089
+ proto.pactus.PeerInfo.prototype.getTotalSessions = function() {
2090
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0));
2091
+ };
2092
+
2093
+
2094
+ /**
2095
+ * @param {number} value
2096
+ * @return {!proto.pactus.PeerInfo} returns this
2097
+ */
2098
+ proto.pactus.PeerInfo.prototype.setTotalSessions = function(value) {
2099
+ return jspb.Message.setProto3IntField(this, 15, value);
2100
+ };
2101
+
2102
+
2103
+ /**
2104
+ * optional int32 completed_sessions = 16;
2105
+ * @return {number}
2106
+ */
2107
+ proto.pactus.PeerInfo.prototype.getCompletedSessions = function() {
2108
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0));
2109
+ };
2110
+
2111
+
2112
+ /**
2113
+ * @param {number} value
2114
+ * @return {!proto.pactus.PeerInfo} returns this
2115
+ */
2116
+ proto.pactus.PeerInfo.prototype.setCompletedSessions = function(value) {
2117
+ return jspb.Message.setProto3IntField(this, 16, value);
2118
+ };
2119
+
2120
+
2121
+ /**
2122
+ * optional MetricInfo metric_info = 17;
2123
+ * @return {?proto.pactus.MetricInfo}
2124
+ */
2125
+ proto.pactus.PeerInfo.prototype.getMetricInfo = function() {
2126
+ return /** @type{?proto.pactus.MetricInfo} */ (
2127
+ jspb.Message.getWrapperField(this, proto.pactus.MetricInfo, 17));
2128
+ };
2129
+
2130
+
2131
+ /**
2132
+ * @param {?proto.pactus.MetricInfo|undefined} value
2133
+ * @return {!proto.pactus.PeerInfo} returns this
2134
+ */
2135
+ proto.pactus.PeerInfo.prototype.setMetricInfo = function(value) {
2136
+ return jspb.Message.setWrapperField(this, 17, value);
2137
+ };
2138
+
2139
+
2140
+ /**
2141
+ * Clears the message field making it undefined.
2142
+ * @return {!proto.pactus.PeerInfo} returns this
2143
+ */
2144
+ proto.pactus.PeerInfo.prototype.clearMetricInfo = function() {
2145
+ return this.setMetricInfo(undefined);
2146
+ };
2147
+
2148
+
2149
+ /**
2150
+ * Returns whether this field is set.
2151
+ * @return {boolean}
2152
+ */
2153
+ proto.pactus.PeerInfo.prototype.hasMetricInfo = function() {
2154
+ return jspb.Message.getField(this, 17) != null;
2155
+ };
2156
+
2157
+
2158
+
2159
+
2160
+
2161
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2162
+ /**
2163
+ * Creates an object representation of this proto.
2164
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2165
+ * Optional fields that are not set will be set to undefined.
2166
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2167
+ * For the list of reserved names please see:
2168
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2169
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2170
+ * JSPB instance for transitional soy proto support:
2171
+ * http://goto/soy-param-migration
2172
+ * @return {!Object}
2173
+ */
2174
+ proto.pactus.ConnectionInfo.prototype.toObject = function(opt_includeInstance) {
2175
+ return proto.pactus.ConnectionInfo.toObject(opt_includeInstance, this);
2176
+ };
2177
+
2178
+
2179
+ /**
2180
+ * Static version of the {@see toObject} method.
2181
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2182
+ * the JSPB instance for transitional soy proto support:
2183
+ * http://goto/soy-param-migration
2184
+ * @param {!proto.pactus.ConnectionInfo} msg The msg instance to transform.
2185
+ * @return {!Object}
2186
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2187
+ */
2188
+ proto.pactus.ConnectionInfo.toObject = function(includeInstance, msg) {
2189
+ var f, obj = {
2190
+ connections: jspb.Message.getFieldWithDefault(msg, 1, 0),
2191
+ inboundConnections: jspb.Message.getFieldWithDefault(msg, 2, 0),
2192
+ outboundConnections: jspb.Message.getFieldWithDefault(msg, 3, 0)
2193
+ };
2194
+
2195
+ if (includeInstance) {
2196
+ obj.$jspbMessageInstance = msg;
2197
+ }
2198
+ return obj;
2199
+ };
2200
+ }
2201
+
2202
+
2203
+ /**
2204
+ * Deserializes binary data (in protobuf wire format).
2205
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2206
+ * @return {!proto.pactus.ConnectionInfo}
2207
+ */
2208
+ proto.pactus.ConnectionInfo.deserializeBinary = function(bytes) {
2209
+ var reader = new jspb.BinaryReader(bytes);
2210
+ var msg = new proto.pactus.ConnectionInfo;
2211
+ return proto.pactus.ConnectionInfo.deserializeBinaryFromReader(msg, reader);
2212
+ };
2213
+
2214
+
2215
+ /**
2216
+ * Deserializes binary data (in protobuf wire format) from the
2217
+ * given reader into the given message object.
2218
+ * @param {!proto.pactus.ConnectionInfo} msg The message object to deserialize into.
2219
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2220
+ * @return {!proto.pactus.ConnectionInfo}
2221
+ */
2222
+ proto.pactus.ConnectionInfo.deserializeBinaryFromReader = function(msg, reader) {
2223
+ while (reader.nextField()) {
2224
+ if (reader.isEndGroup()) {
2225
+ break;
2226
+ }
2227
+ var field = reader.getFieldNumber();
2228
+ switch (field) {
2229
+ case 1:
2230
+ var value = /** @type {number} */ (reader.readUint64());
2231
+ msg.setConnections(value);
2232
+ break;
2233
+ case 2:
2234
+ var value = /** @type {number} */ (reader.readUint64());
2235
+ msg.setInboundConnections(value);
2236
+ break;
2237
+ case 3:
2238
+ var value = /** @type {number} */ (reader.readUint64());
2239
+ msg.setOutboundConnections(value);
2240
+ break;
2241
+ default:
2242
+ reader.skipField();
2243
+ break;
2244
+ }
2245
+ }
2246
+ return msg;
2247
+ };
2248
+
2249
+
2250
+ /**
2251
+ * Serializes the message to binary data (in protobuf wire format).
2252
+ * @return {!Uint8Array}
2253
+ */
2254
+ proto.pactus.ConnectionInfo.prototype.serializeBinary = function() {
2255
+ var writer = new jspb.BinaryWriter();
2256
+ proto.pactus.ConnectionInfo.serializeBinaryToWriter(this, writer);
2257
+ return writer.getResultBuffer();
2258
+ };
2259
+
2260
+
2261
+ /**
2262
+ * Serializes the given message to binary data (in protobuf wire
2263
+ * format), writing to the given BinaryWriter.
2264
+ * @param {!proto.pactus.ConnectionInfo} message
2265
+ * @param {!jspb.BinaryWriter} writer
2266
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2267
+ */
2268
+ proto.pactus.ConnectionInfo.serializeBinaryToWriter = function(message, writer) {
2269
+ var f = undefined;
2270
+ f = message.getConnections();
2271
+ if (f !== 0) {
2272
+ writer.writeUint64(
2273
+ 1,
2274
+ f
2275
+ );
2276
+ }
2277
+ f = message.getInboundConnections();
2278
+ if (f !== 0) {
2279
+ writer.writeUint64(
2280
+ 2,
2281
+ f
2282
+ );
2283
+ }
2284
+ f = message.getOutboundConnections();
2285
+ if (f !== 0) {
2286
+ writer.writeUint64(
2287
+ 3,
2288
+ f
2289
+ );
2290
+ }
2291
+ };
2292
+
2293
+
2294
+ /**
2295
+ * optional uint64 connections = 1;
2296
+ * @return {number}
2297
+ */
2298
+ proto.pactus.ConnectionInfo.prototype.getConnections = function() {
2299
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2300
+ };
2301
+
2302
+
2303
+ /**
2304
+ * @param {number} value
2305
+ * @return {!proto.pactus.ConnectionInfo} returns this
2306
+ */
2307
+ proto.pactus.ConnectionInfo.prototype.setConnections = function(value) {
2308
+ return jspb.Message.setProto3IntField(this, 1, value);
2309
+ };
2310
+
2311
+
2312
+ /**
2313
+ * optional uint64 inbound_connections = 2;
2314
+ * @return {number}
2315
+ */
2316
+ proto.pactus.ConnectionInfo.prototype.getInboundConnections = function() {
2317
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
2318
+ };
2319
+
2320
+
2321
+ /**
2322
+ * @param {number} value
2323
+ * @return {!proto.pactus.ConnectionInfo} returns this
2324
+ */
2325
+ proto.pactus.ConnectionInfo.prototype.setInboundConnections = function(value) {
2326
+ return jspb.Message.setProto3IntField(this, 2, value);
2327
+ };
2328
+
2329
+
2330
+ /**
2331
+ * optional uint64 outbound_connections = 3;
2332
+ * @return {number}
2333
+ */
2334
+ proto.pactus.ConnectionInfo.prototype.getOutboundConnections = function() {
2335
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
2336
+ };
2337
+
2338
+
2339
+ /**
2340
+ * @param {number} value
2341
+ * @return {!proto.pactus.ConnectionInfo} returns this
2342
+ */
2343
+ proto.pactus.ConnectionInfo.prototype.setOutboundConnections = function(value) {
2344
+ return jspb.Message.setProto3IntField(this, 3, value);
2345
+ };
2346
+
2347
+
2348
+
2349
+
2350
+
2351
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2352
+ /**
2353
+ * Creates an object representation of this proto.
2354
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2355
+ * Optional fields that are not set will be set to undefined.
2356
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2357
+ * For the list of reserved names please see:
2358
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2359
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2360
+ * JSPB instance for transitional soy proto support:
2361
+ * http://goto/soy-param-migration
2362
+ * @return {!Object}
2363
+ */
2364
+ proto.pactus.MetricInfo.prototype.toObject = function(opt_includeInstance) {
2365
+ return proto.pactus.MetricInfo.toObject(opt_includeInstance, this);
2366
+ };
2367
+
2368
+
2369
+ /**
2370
+ * Static version of the {@see toObject} method.
2371
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2372
+ * the JSPB instance for transitional soy proto support:
2373
+ * http://goto/soy-param-migration
2374
+ * @param {!proto.pactus.MetricInfo} msg The msg instance to transform.
2375
+ * @return {!Object}
2376
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2377
+ */
2378
+ proto.pactus.MetricInfo.toObject = function(includeInstance, msg) {
2379
+ var f, obj = {
2380
+ totalinvalid: (f = msg.getTotalinvalid()) && proto.pactus.CounterInfo.toObject(includeInstance, f),
2381
+ totalsent: (f = msg.getTotalsent()) && proto.pactus.CounterInfo.toObject(includeInstance, f),
2382
+ totalreceived: (f = msg.getTotalreceived()) && proto.pactus.CounterInfo.toObject(includeInstance, f),
2383
+ messagesentMap: (f = msg.getMessagesentMap()) ? f.toObject(includeInstance, proto.pactus.CounterInfo.toObject) : [],
2384
+ messagereceivedMap: (f = msg.getMessagereceivedMap()) ? f.toObject(includeInstance, proto.pactus.CounterInfo.toObject) : []
2385
+ };
2386
+
2387
+ if (includeInstance) {
2388
+ obj.$jspbMessageInstance = msg;
2389
+ }
2390
+ return obj;
2391
+ };
2392
+ }
2393
+
2394
+
2395
+ /**
2396
+ * Deserializes binary data (in protobuf wire format).
2397
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2398
+ * @return {!proto.pactus.MetricInfo}
2399
+ */
2400
+ proto.pactus.MetricInfo.deserializeBinary = function(bytes) {
2401
+ var reader = new jspb.BinaryReader(bytes);
2402
+ var msg = new proto.pactus.MetricInfo;
2403
+ return proto.pactus.MetricInfo.deserializeBinaryFromReader(msg, reader);
2404
+ };
2405
+
2406
+
2407
+ /**
2408
+ * Deserializes binary data (in protobuf wire format) from the
2409
+ * given reader into the given message object.
2410
+ * @param {!proto.pactus.MetricInfo} msg The message object to deserialize into.
2411
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2412
+ * @return {!proto.pactus.MetricInfo}
2413
+ */
2414
+ proto.pactus.MetricInfo.deserializeBinaryFromReader = function(msg, reader) {
2415
+ while (reader.nextField()) {
2416
+ if (reader.isEndGroup()) {
2417
+ break;
2418
+ }
2419
+ var field = reader.getFieldNumber();
2420
+ switch (field) {
2421
+ case 1:
2422
+ var value = new proto.pactus.CounterInfo;
2423
+ reader.readMessage(value,proto.pactus.CounterInfo.deserializeBinaryFromReader);
2424
+ msg.setTotalinvalid(value);
2425
+ break;
2426
+ case 2:
2427
+ var value = new proto.pactus.CounterInfo;
2428
+ reader.readMessage(value,proto.pactus.CounterInfo.deserializeBinaryFromReader);
2429
+ msg.setTotalsent(value);
2430
+ break;
2431
+ case 3:
2432
+ var value = new proto.pactus.CounterInfo;
2433
+ reader.readMessage(value,proto.pactus.CounterInfo.deserializeBinaryFromReader);
2434
+ msg.setTotalreceived(value);
2435
+ break;
2436
+ case 4:
2437
+ var value = msg.getMessagesentMap();
2438
+ reader.readMessage(value, function(message, reader) {
2439
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readMessage, proto.pactus.CounterInfo.deserializeBinaryFromReader, 0, new proto.pactus.CounterInfo());
2440
+ });
2441
+ break;
2442
+ case 5:
2443
+ var value = msg.getMessagereceivedMap();
2444
+ reader.readMessage(value, function(message, reader) {
2445
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readMessage, proto.pactus.CounterInfo.deserializeBinaryFromReader, 0, new proto.pactus.CounterInfo());
2446
+ });
2447
+ break;
2448
+ default:
2449
+ reader.skipField();
2450
+ break;
2451
+ }
2452
+ }
2453
+ return msg;
2454
+ };
2455
+
2456
+
2457
+ /**
2458
+ * Serializes the message to binary data (in protobuf wire format).
2459
+ * @return {!Uint8Array}
2460
+ */
2461
+ proto.pactus.MetricInfo.prototype.serializeBinary = function() {
2462
+ var writer = new jspb.BinaryWriter();
2463
+ proto.pactus.MetricInfo.serializeBinaryToWriter(this, writer);
2464
+ return writer.getResultBuffer();
2465
+ };
2466
+
2467
+
2468
+ /**
2469
+ * Serializes the given message to binary data (in protobuf wire
2470
+ * format), writing to the given BinaryWriter.
2471
+ * @param {!proto.pactus.MetricInfo} message
2472
+ * @param {!jspb.BinaryWriter} writer
2473
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2474
+ */
2475
+ proto.pactus.MetricInfo.serializeBinaryToWriter = function(message, writer) {
2476
+ var f = undefined;
2477
+ f = message.getTotalinvalid();
2478
+ if (f != null) {
2479
+ writer.writeMessage(
2480
+ 1,
2481
+ f,
2482
+ proto.pactus.CounterInfo.serializeBinaryToWriter
2483
+ );
2484
+ }
2485
+ f = message.getTotalsent();
2486
+ if (f != null) {
2487
+ writer.writeMessage(
2488
+ 2,
2489
+ f,
2490
+ proto.pactus.CounterInfo.serializeBinaryToWriter
2491
+ );
2492
+ }
2493
+ f = message.getTotalreceived();
2494
+ if (f != null) {
2495
+ writer.writeMessage(
2496
+ 3,
2497
+ f,
2498
+ proto.pactus.CounterInfo.serializeBinaryToWriter
2499
+ );
2500
+ }
2501
+ f = message.getMessagesentMap(true);
2502
+ if (f && f.getLength() > 0) {
2503
+ f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeMessage, proto.pactus.CounterInfo.serializeBinaryToWriter);
2504
+ }
2505
+ f = message.getMessagereceivedMap(true);
2506
+ if (f && f.getLength() > 0) {
2507
+ f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeMessage, proto.pactus.CounterInfo.serializeBinaryToWriter);
2508
+ }
2509
+ };
2510
+
2511
+
2512
+ /**
2513
+ * optional CounterInfo TotalInvalid = 1;
2514
+ * @return {?proto.pactus.CounterInfo}
2515
+ */
2516
+ proto.pactus.MetricInfo.prototype.getTotalinvalid = function() {
2517
+ return /** @type{?proto.pactus.CounterInfo} */ (
2518
+ jspb.Message.getWrapperField(this, proto.pactus.CounterInfo, 1));
2519
+ };
2520
+
2521
+
2522
+ /**
2523
+ * @param {?proto.pactus.CounterInfo|undefined} value
2524
+ * @return {!proto.pactus.MetricInfo} returns this
2525
+ */
2526
+ proto.pactus.MetricInfo.prototype.setTotalinvalid = function(value) {
2527
+ return jspb.Message.setWrapperField(this, 1, value);
2528
+ };
2529
+
2530
+
2531
+ /**
2532
+ * Clears the message field making it undefined.
2533
+ * @return {!proto.pactus.MetricInfo} returns this
2534
+ */
2535
+ proto.pactus.MetricInfo.prototype.clearTotalinvalid = function() {
2536
+ return this.setTotalinvalid(undefined);
2537
+ };
2538
+
2539
+
2540
+ /**
2541
+ * Returns whether this field is set.
2542
+ * @return {boolean}
2543
+ */
2544
+ proto.pactus.MetricInfo.prototype.hasTotalinvalid = function() {
2545
+ return jspb.Message.getField(this, 1) != null;
2546
+ };
2547
+
2548
+
2549
+ /**
2550
+ * optional CounterInfo TotalSent = 2;
2551
+ * @return {?proto.pactus.CounterInfo}
2552
+ */
2553
+ proto.pactus.MetricInfo.prototype.getTotalsent = function() {
2554
+ return /** @type{?proto.pactus.CounterInfo} */ (
2555
+ jspb.Message.getWrapperField(this, proto.pactus.CounterInfo, 2));
2556
+ };
2557
+
2558
+
2559
+ /**
2560
+ * @param {?proto.pactus.CounterInfo|undefined} value
2561
+ * @return {!proto.pactus.MetricInfo} returns this
2562
+ */
2563
+ proto.pactus.MetricInfo.prototype.setTotalsent = function(value) {
2564
+ return jspb.Message.setWrapperField(this, 2, value);
2565
+ };
2566
+
2567
+
2568
+ /**
2569
+ * Clears the message field making it undefined.
2570
+ * @return {!proto.pactus.MetricInfo} returns this
2571
+ */
2572
+ proto.pactus.MetricInfo.prototype.clearTotalsent = function() {
2573
+ return this.setTotalsent(undefined);
2574
+ };
2575
+
2576
+
2577
+ /**
2578
+ * Returns whether this field is set.
2579
+ * @return {boolean}
2580
+ */
2581
+ proto.pactus.MetricInfo.prototype.hasTotalsent = function() {
2582
+ return jspb.Message.getField(this, 2) != null;
2583
+ };
2584
+
2585
+
2586
+ /**
2587
+ * optional CounterInfo TotalReceived = 3;
2588
+ * @return {?proto.pactus.CounterInfo}
2589
+ */
2590
+ proto.pactus.MetricInfo.prototype.getTotalreceived = function() {
2591
+ return /** @type{?proto.pactus.CounterInfo} */ (
2592
+ jspb.Message.getWrapperField(this, proto.pactus.CounterInfo, 3));
2593
+ };
2594
+
2595
+
2596
+ /**
2597
+ * @param {?proto.pactus.CounterInfo|undefined} value
2598
+ * @return {!proto.pactus.MetricInfo} returns this
2599
+ */
2600
+ proto.pactus.MetricInfo.prototype.setTotalreceived = function(value) {
2601
+ return jspb.Message.setWrapperField(this, 3, value);
2602
+ };
2603
+
2604
+
2605
+ /**
2606
+ * Clears the message field making it undefined.
2607
+ * @return {!proto.pactus.MetricInfo} returns this
2608
+ */
2609
+ proto.pactus.MetricInfo.prototype.clearTotalreceived = function() {
2610
+ return this.setTotalreceived(undefined);
2611
+ };
2612
+
2613
+
2614
+ /**
2615
+ * Returns whether this field is set.
2616
+ * @return {boolean}
2617
+ */
2618
+ proto.pactus.MetricInfo.prototype.hasTotalreceived = function() {
2619
+ return jspb.Message.getField(this, 3) != null;
2620
+ };
2621
+
2622
+
2623
+ /**
2624
+ * map<int32, CounterInfo> MessageSent = 4;
2625
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
2626
+ * empty, instead returning `undefined`
2627
+ * @return {!jspb.Map<number,!proto.pactus.CounterInfo>}
2628
+ */
2629
+ proto.pactus.MetricInfo.prototype.getMessagesentMap = function(opt_noLazyCreate) {
2630
+ return /** @type {!jspb.Map<number,!proto.pactus.CounterInfo>} */ (
2631
+ jspb.Message.getMapField(this, 4, opt_noLazyCreate,
2632
+ proto.pactus.CounterInfo));
2633
+ };
2634
+
2635
+
2636
+ /**
2637
+ * Clears values from the map. The map will be non-null.
2638
+ * @return {!proto.pactus.MetricInfo} returns this
2639
+ */
2640
+ proto.pactus.MetricInfo.prototype.clearMessagesentMap = function() {
2641
+ this.getMessagesentMap().clear();
2642
+ return this;
2643
+ };
2644
+
2645
+
2646
+ /**
2647
+ * map<int32, CounterInfo> MessageReceived = 5;
2648
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
2649
+ * empty, instead returning `undefined`
2650
+ * @return {!jspb.Map<number,!proto.pactus.CounterInfo>}
2651
+ */
2652
+ proto.pactus.MetricInfo.prototype.getMessagereceivedMap = function(opt_noLazyCreate) {
2653
+ return /** @type {!jspb.Map<number,!proto.pactus.CounterInfo>} */ (
2654
+ jspb.Message.getMapField(this, 5, opt_noLazyCreate,
2655
+ proto.pactus.CounterInfo));
2656
+ };
2657
+
2658
+
2659
+ /**
2660
+ * Clears values from the map. The map will be non-null.
2661
+ * @return {!proto.pactus.MetricInfo} returns this
2662
+ */
2663
+ proto.pactus.MetricInfo.prototype.clearMessagereceivedMap = function() {
2664
+ this.getMessagereceivedMap().clear();
2665
+ return this;
2666
+ };
2667
+
2668
+
2669
+
2670
+
2671
+
2672
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2673
+ /**
2674
+ * Creates an object representation of this proto.
2675
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2676
+ * Optional fields that are not set will be set to undefined.
2677
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2678
+ * For the list of reserved names please see:
2679
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2680
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2681
+ * JSPB instance for transitional soy proto support:
2682
+ * http://goto/soy-param-migration
2683
+ * @return {!Object}
2684
+ */
2685
+ proto.pactus.CounterInfo.prototype.toObject = function(opt_includeInstance) {
2686
+ return proto.pactus.CounterInfo.toObject(opt_includeInstance, this);
2687
+ };
2688
+
2689
+
2690
+ /**
2691
+ * Static version of the {@see toObject} method.
2692
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2693
+ * the JSPB instance for transitional soy proto support:
2694
+ * http://goto/soy-param-migration
2695
+ * @param {!proto.pactus.CounterInfo} msg The msg instance to transform.
2696
+ * @return {!Object}
2697
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2698
+ */
2699
+ proto.pactus.CounterInfo.toObject = function(includeInstance, msg) {
2700
+ var f, obj = {
2701
+ bytes: jspb.Message.getFieldWithDefault(msg, 1, 0),
2702
+ bundles: jspb.Message.getFieldWithDefault(msg, 2, 0)
2703
+ };
2704
+
2705
+ if (includeInstance) {
2706
+ obj.$jspbMessageInstance = msg;
2707
+ }
2708
+ return obj;
2709
+ };
2710
+ }
2711
+
2712
+
2713
+ /**
2714
+ * Deserializes binary data (in protobuf wire format).
2715
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2716
+ * @return {!proto.pactus.CounterInfo}
2717
+ */
2718
+ proto.pactus.CounterInfo.deserializeBinary = function(bytes) {
2719
+ var reader = new jspb.BinaryReader(bytes);
2720
+ var msg = new proto.pactus.CounterInfo;
2721
+ return proto.pactus.CounterInfo.deserializeBinaryFromReader(msg, reader);
2722
+ };
2723
+
2724
+
2725
+ /**
2726
+ * Deserializes binary data (in protobuf wire format) from the
2727
+ * given reader into the given message object.
2728
+ * @param {!proto.pactus.CounterInfo} msg The message object to deserialize into.
2729
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2730
+ * @return {!proto.pactus.CounterInfo}
2731
+ */
2732
+ proto.pactus.CounterInfo.deserializeBinaryFromReader = function(msg, reader) {
2733
+ while (reader.nextField()) {
2734
+ if (reader.isEndGroup()) {
2735
+ break;
2736
+ }
2737
+ var field = reader.getFieldNumber();
2738
+ switch (field) {
2739
+ case 1:
2740
+ var value = /** @type {number} */ (reader.readUint64());
2741
+ msg.setBytes(value);
2742
+ break;
2743
+ case 2:
2744
+ var value = /** @type {number} */ (reader.readUint64());
2745
+ msg.setBundles(value);
2746
+ break;
2747
+ default:
2748
+ reader.skipField();
2749
+ break;
2750
+ }
2751
+ }
2752
+ return msg;
2753
+ };
2754
+
2755
+
2756
+ /**
2757
+ * Serializes the message to binary data (in protobuf wire format).
2758
+ * @return {!Uint8Array}
2759
+ */
2760
+ proto.pactus.CounterInfo.prototype.serializeBinary = function() {
2761
+ var writer = new jspb.BinaryWriter();
2762
+ proto.pactus.CounterInfo.serializeBinaryToWriter(this, writer);
2763
+ return writer.getResultBuffer();
2764
+ };
2765
+
2766
+
2767
+ /**
2768
+ * Serializes the given message to binary data (in protobuf wire
2769
+ * format), writing to the given BinaryWriter.
2770
+ * @param {!proto.pactus.CounterInfo} message
2771
+ * @param {!jspb.BinaryWriter} writer
2772
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2773
+ */
2774
+ proto.pactus.CounterInfo.serializeBinaryToWriter = function(message, writer) {
2775
+ var f = undefined;
2776
+ f = message.getBytes();
2777
+ if (f !== 0) {
2778
+ writer.writeUint64(
2779
+ 1,
2780
+ f
2781
+ );
2782
+ }
2783
+ f = message.getBundles();
2784
+ if (f !== 0) {
2785
+ writer.writeUint64(
2786
+ 2,
2787
+ f
2788
+ );
2789
+ }
2790
+ };
2791
+
2792
+
2793
+ /**
2794
+ * optional uint64 Bytes = 1;
2795
+ * @return {number}
2796
+ */
2797
+ proto.pactus.CounterInfo.prototype.getBytes = function() {
2798
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2799
+ };
2800
+
2801
+
2802
+ /**
2803
+ * @param {number} value
2804
+ * @return {!proto.pactus.CounterInfo} returns this
2805
+ */
2806
+ proto.pactus.CounterInfo.prototype.setBytes = function(value) {
2807
+ return jspb.Message.setProto3IntField(this, 1, value);
2808
+ };
2809
+
2810
+
2811
+ /**
2812
+ * optional uint64 Bundles = 2;
2813
+ * @return {number}
2814
+ */
2815
+ proto.pactus.CounterInfo.prototype.getBundles = function() {
2816
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
2817
+ };
2818
+
2819
+
2820
+ /**
2821
+ * @param {number} value
2822
+ * @return {!proto.pactus.CounterInfo} returns this
2823
+ */
2824
+ proto.pactus.CounterInfo.prototype.setBundles = function(value) {
2825
+ return jspb.Message.setProto3IntField(this, 2, value);
2826
+ };
2827
+
2828
+
2829
+ goog.object.extend(exports, proto.pactus);