UNPKG

159 kBJavaScriptView Raw
1/**
2 * @fileoverview
3 * @enhanceable
4 * @suppress {messageConventions} JS Compiler reports an error if a variable or
5 * field starts with 'MSG_' and isn't a translatable message.
6 * @public
7 */
8// GENERATED CODE -- DO NOT EDIT!
9
10var jspb = require('google-protobuf');
11var goog = jspb;
12var global = Function('return this')();
13
14var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js');
15var core_Discover_pb = require('../core/Discover_pb.js');
16goog.exportSymbol('proto.protocol.Account', null, global);
17goog.exportSymbol('proto.protocol.Account.Vote', null, global);
18goog.exportSymbol('proto.protocol.AccountType', null, global);
19goog.exportSymbol('proto.protocol.Block', null, global);
20goog.exportSymbol('proto.protocol.BlockHeader', null, global);
21goog.exportSymbol('proto.protocol.BlockHeader.raw', null, global);
22goog.exportSymbol('proto.protocol.BlockInventory', null, global);
23goog.exportSymbol('proto.protocol.BlockInventory.BlockId', null, global);
24goog.exportSymbol('proto.protocol.BlockInventory.Type', null, global);
25goog.exportSymbol('proto.protocol.ChainInventory', null, global);
26goog.exportSymbol('proto.protocol.ChainInventory.BlockId', null, global);
27goog.exportSymbol('proto.protocol.DisconnectMessage', null, global);
28goog.exportSymbol('proto.protocol.HelloMessage', null, global);
29goog.exportSymbol('proto.protocol.Inventory', null, global);
30goog.exportSymbol('proto.protocol.Inventory.InventoryType', null, global);
31goog.exportSymbol('proto.protocol.Items', null, global);
32goog.exportSymbol('proto.protocol.Items.ItemType', null, global);
33goog.exportSymbol('proto.protocol.ReasonCode', null, global);
34goog.exportSymbol('proto.protocol.TXInput', null, global);
35goog.exportSymbol('proto.protocol.TXInput.raw', null, global);
36goog.exportSymbol('proto.protocol.TXOutput', null, global);
37goog.exportSymbol('proto.protocol.TXOutputs', null, global);
38goog.exportSymbol('proto.protocol.Transaction', null, global);
39goog.exportSymbol('proto.protocol.Transaction.Contract', null, global);
40goog.exportSymbol('proto.protocol.Transaction.Contract.ContractType', null, global);
41goog.exportSymbol('proto.protocol.Transaction.Result', null, global);
42goog.exportSymbol('proto.protocol.Transaction.Result.code', null, global);
43goog.exportSymbol('proto.protocol.Transaction.TransactionType', null, global);
44goog.exportSymbol('proto.protocol.Transaction.raw', null, global);
45goog.exportSymbol('proto.protocol.Witness', null, global);
46
47/**
48 * Generated by JsPbCodeGenerator.
49 * @param {Array=} opt_data Optional initial data array, typically from a
50 * server response, or constructed directly in Javascript. The array is used
51 * in place and becomes part of the constructed object. It is not cloned.
52 * If no data is provided, the constructed object will be empty, but still
53 * valid.
54 * @extends {jspb.Message}
55 * @constructor
56 */
57proto.protocol.Account = function(opt_data) {
58 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Account.repeatedFields_, null);
59};
60goog.inherits(proto.protocol.Account, jspb.Message);
61if (goog.DEBUG && !COMPILED) {
62 proto.protocol.Account.displayName = 'proto.protocol.Account';
63}
64/**
65 * List of repeated fields within this message type.
66 * @private {!Array<number>}
67 * @const
68 */
69proto.protocol.Account.repeatedFields_ = [5];
70
71
72
73if (jspb.Message.GENERATE_TO_OBJECT) {
74/**
75 * Creates an object representation of this proto suitable for use in Soy templates.
76 * Field names that are reserved in JavaScript and will be renamed to pb_name.
77 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
78 * For the list of reserved names please see:
79 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
80 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
81 * for transitional soy proto support: http://goto/soy-param-migration
82 * @return {!Object}
83 */
84proto.protocol.Account.prototype.toObject = function(opt_includeInstance) {
85 return proto.protocol.Account.toObject(opt_includeInstance, this);
86};
87
88
89/**
90 * Static version of the {@see toObject} method.
91 * @param {boolean|undefined} includeInstance Whether to include the JSPB
92 * instance for transitional soy proto support:
93 * http://goto/soy-param-migration
94 * @param {!proto.protocol.Account} msg The msg instance to transform.
95 * @return {!Object}
96 * @suppress {unusedLocalVariables} f is only used for nested messages
97 */
98proto.protocol.Account.toObject = function(includeInstance, msg) {
99 var f, obj = {
100 accountName: msg.getAccountName_asB64(),
101 type: jspb.Message.getFieldWithDefault(msg, 2, 0),
102 address: msg.getAddress_asB64(),
103 balance: jspb.Message.getFieldWithDefault(msg, 4, 0),
104 votesList: jspb.Message.toObjectList(msg.getVotesList(),
105 proto.protocol.Account.Vote.toObject, includeInstance),
106 assetMap: (f = msg.getAssetMap()) ? f.toObject(includeInstance, undefined) : [],
107 latestOprationTime: jspb.Message.getFieldWithDefault(msg, 10, 0)
108 };
109
110 if (includeInstance) {
111 obj.$jspbMessageInstance = msg;
112 }
113 return obj;
114};
115}
116
117
118/**
119 * Deserializes binary data (in protobuf wire format).
120 * @param {jspb.ByteSource} bytes The bytes to deserialize.
121 * @return {!proto.protocol.Account}
122 */
123proto.protocol.Account.deserializeBinary = function(bytes) {
124 var reader = new jspb.BinaryReader(bytes);
125 var msg = new proto.protocol.Account;
126 return proto.protocol.Account.deserializeBinaryFromReader(msg, reader);
127};
128
129
130/**
131 * Deserializes binary data (in protobuf wire format) from the
132 * given reader into the given message object.
133 * @param {!proto.protocol.Account} msg The message object to deserialize into.
134 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
135 * @return {!proto.protocol.Account}
136 */
137proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) {
138 while (reader.nextField()) {
139 if (reader.isEndGroup()) {
140 break;
141 }
142 var field = reader.getFieldNumber();
143 switch (field) {
144 case 1:
145 var value = /** @type {!Uint8Array} */ (reader.readBytes());
146 msg.setAccountName(value);
147 break;
148 case 2:
149 var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum());
150 msg.setType(value);
151 break;
152 case 3:
153 var value = /** @type {!Uint8Array} */ (reader.readBytes());
154 msg.setAddress(value);
155 break;
156 case 4:
157 var value = /** @type {number} */ (reader.readInt64());
158 msg.setBalance(value);
159 break;
160 case 5:
161 var value = new proto.protocol.Account.Vote;
162 reader.readMessage(value,proto.protocol.Account.Vote.deserializeBinaryFromReader);
163 msg.addVotes(value);
164 break;
165 case 6:
166 var value = msg.getAssetMap();
167 reader.readMessage(value, function(message, reader) {
168 jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64);
169 });
170 break;
171 case 10:
172 var value = /** @type {number} */ (reader.readInt64());
173 msg.setLatestOprationTime(value);
174 break;
175 default:
176 reader.skipField();
177 break;
178 }
179 }
180 return msg;
181};
182
183
184/**
185 * Serializes the message to binary data (in protobuf wire format).
186 * @return {!Uint8Array}
187 */
188proto.protocol.Account.prototype.serializeBinary = function() {
189 var writer = new jspb.BinaryWriter();
190 proto.protocol.Account.serializeBinaryToWriter(this, writer);
191 return writer.getResultBuffer();
192};
193
194
195/**
196 * Serializes the given message to binary data (in protobuf wire
197 * format), writing to the given BinaryWriter.
198 * @param {!proto.protocol.Account} message
199 * @param {!jspb.BinaryWriter} writer
200 * @suppress {unusedLocalVariables} f is only used for nested messages
201 */
202proto.protocol.Account.serializeBinaryToWriter = function(message, writer) {
203 var f = undefined;
204 f = message.getAccountName_asU8();
205 if (f.length > 0) {
206 writer.writeBytes(
207 1,
208 f
209 );
210 }
211 f = message.getType();
212 if (f !== 0.0) {
213 writer.writeEnum(
214 2,
215 f
216 );
217 }
218 f = message.getAddress_asU8();
219 if (f.length > 0) {
220 writer.writeBytes(
221 3,
222 f
223 );
224 }
225 f = message.getBalance();
226 if (f !== 0) {
227 writer.writeInt64(
228 4,
229 f
230 );
231 }
232 f = message.getVotesList();
233 if (f.length > 0) {
234 writer.writeRepeatedMessage(
235 5,
236 f,
237 proto.protocol.Account.Vote.serializeBinaryToWriter
238 );
239 }
240 f = message.getAssetMap(true);
241 if (f && f.getLength() > 0) {
242 f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64);
243 }
244 f = message.getLatestOprationTime();
245 if (f !== 0) {
246 writer.writeInt64(
247 10,
248 f
249 );
250 }
251};
252
253
254
255/**
256 * Generated by JsPbCodeGenerator.
257 * @param {Array=} opt_data Optional initial data array, typically from a
258 * server response, or constructed directly in Javascript. The array is used
259 * in place and becomes part of the constructed object. It is not cloned.
260 * If no data is provided, the constructed object will be empty, but still
261 * valid.
262 * @extends {jspb.Message}
263 * @constructor
264 */
265proto.protocol.Account.Vote = function(opt_data) {
266 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
267};
268goog.inherits(proto.protocol.Account.Vote, jspb.Message);
269if (goog.DEBUG && !COMPILED) {
270 proto.protocol.Account.Vote.displayName = 'proto.protocol.Account.Vote';
271}
272
273
274if (jspb.Message.GENERATE_TO_OBJECT) {
275/**
276 * Creates an object representation of this proto suitable for use in Soy templates.
277 * Field names that are reserved in JavaScript and will be renamed to pb_name.
278 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
279 * For the list of reserved names please see:
280 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
281 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
282 * for transitional soy proto support: http://goto/soy-param-migration
283 * @return {!Object}
284 */
285proto.protocol.Account.Vote.prototype.toObject = function(opt_includeInstance) {
286 return proto.protocol.Account.Vote.toObject(opt_includeInstance, this);
287};
288
289
290/**
291 * Static version of the {@see toObject} method.
292 * @param {boolean|undefined} includeInstance Whether to include the JSPB
293 * instance for transitional soy proto support:
294 * http://goto/soy-param-migration
295 * @param {!proto.protocol.Account.Vote} msg The msg instance to transform.
296 * @return {!Object}
297 * @suppress {unusedLocalVariables} f is only used for nested messages
298 */
299proto.protocol.Account.Vote.toObject = function(includeInstance, msg) {
300 var f, obj = {
301 voteAddress: msg.getVoteAddress_asB64(),
302 voteCount: jspb.Message.getFieldWithDefault(msg, 2, 0)
303 };
304
305 if (includeInstance) {
306 obj.$jspbMessageInstance = msg;
307 }
308 return obj;
309};
310}
311
312
313/**
314 * Deserializes binary data (in protobuf wire format).
315 * @param {jspb.ByteSource} bytes The bytes to deserialize.
316 * @return {!proto.protocol.Account.Vote}
317 */
318proto.protocol.Account.Vote.deserializeBinary = function(bytes) {
319 var reader = new jspb.BinaryReader(bytes);
320 var msg = new proto.protocol.Account.Vote;
321 return proto.protocol.Account.Vote.deserializeBinaryFromReader(msg, reader);
322};
323
324
325/**
326 * Deserializes binary data (in protobuf wire format) from the
327 * given reader into the given message object.
328 * @param {!proto.protocol.Account.Vote} msg The message object to deserialize into.
329 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
330 * @return {!proto.protocol.Account.Vote}
331 */
332proto.protocol.Account.Vote.deserializeBinaryFromReader = function(msg, reader) {
333 while (reader.nextField()) {
334 if (reader.isEndGroup()) {
335 break;
336 }
337 var field = reader.getFieldNumber();
338 switch (field) {
339 case 1:
340 var value = /** @type {!Uint8Array} */ (reader.readBytes());
341 msg.setVoteAddress(value);
342 break;
343 case 2:
344 var value = /** @type {number} */ (reader.readInt64());
345 msg.setVoteCount(value);
346 break;
347 default:
348 reader.skipField();
349 break;
350 }
351 }
352 return msg;
353};
354
355
356/**
357 * Serializes the message to binary data (in protobuf wire format).
358 * @return {!Uint8Array}
359 */
360proto.protocol.Account.Vote.prototype.serializeBinary = function() {
361 var writer = new jspb.BinaryWriter();
362 proto.protocol.Account.Vote.serializeBinaryToWriter(this, writer);
363 return writer.getResultBuffer();
364};
365
366
367/**
368 * Serializes the given message to binary data (in protobuf wire
369 * format), writing to the given BinaryWriter.
370 * @param {!proto.protocol.Account.Vote} message
371 * @param {!jspb.BinaryWriter} writer
372 * @suppress {unusedLocalVariables} f is only used for nested messages
373 */
374proto.protocol.Account.Vote.serializeBinaryToWriter = function(message, writer) {
375 var f = undefined;
376 f = message.getVoteAddress_asU8();
377 if (f.length > 0) {
378 writer.writeBytes(
379 1,
380 f
381 );
382 }
383 f = message.getVoteCount();
384 if (f !== 0) {
385 writer.writeInt64(
386 2,
387 f
388 );
389 }
390};
391
392
393/**
394 * optional bytes vote_address = 1;
395 * @return {!(string|Uint8Array)}
396 */
397proto.protocol.Account.Vote.prototype.getVoteAddress = function() {
398 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
399};
400
401
402/**
403 * optional bytes vote_address = 1;
404 * This is a type-conversion wrapper around `getVoteAddress()`
405 * @return {string}
406 */
407proto.protocol.Account.Vote.prototype.getVoteAddress_asB64 = function() {
408 return /** @type {string} */ (jspb.Message.bytesAsB64(
409 this.getVoteAddress()));
410};
411
412
413/**
414 * optional bytes vote_address = 1;
415 * Note that Uint8Array is not supported on all browsers.
416 * @see http://caniuse.com/Uint8Array
417 * This is a type-conversion wrapper around `getVoteAddress()`
418 * @return {!Uint8Array}
419 */
420proto.protocol.Account.Vote.prototype.getVoteAddress_asU8 = function() {
421 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
422 this.getVoteAddress()));
423};
424
425
426/** @param {!(string|Uint8Array)} value */
427proto.protocol.Account.Vote.prototype.setVoteAddress = function(value) {
428 jspb.Message.setProto3BytesField(this, 1, value);
429};
430
431
432/**
433 * optional int64 vote_count = 2;
434 * @return {number}
435 */
436proto.protocol.Account.Vote.prototype.getVoteCount = function() {
437 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
438};
439
440
441/** @param {number} value */
442proto.protocol.Account.Vote.prototype.setVoteCount = function(value) {
443 jspb.Message.setProto3IntField(this, 2, value);
444};
445
446
447/**
448 * optional bytes account_name = 1;
449 * @return {!(string|Uint8Array)}
450 */
451proto.protocol.Account.prototype.getAccountName = function() {
452 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
453};
454
455
456/**
457 * optional bytes account_name = 1;
458 * This is a type-conversion wrapper around `getAccountName()`
459 * @return {string}
460 */
461proto.protocol.Account.prototype.getAccountName_asB64 = function() {
462 return /** @type {string} */ (jspb.Message.bytesAsB64(
463 this.getAccountName()));
464};
465
466
467/**
468 * optional bytes account_name = 1;
469 * Note that Uint8Array is not supported on all browsers.
470 * @see http://caniuse.com/Uint8Array
471 * This is a type-conversion wrapper around `getAccountName()`
472 * @return {!Uint8Array}
473 */
474proto.protocol.Account.prototype.getAccountName_asU8 = function() {
475 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
476 this.getAccountName()));
477};
478
479
480/** @param {!(string|Uint8Array)} value */
481proto.protocol.Account.prototype.setAccountName = function(value) {
482 jspb.Message.setProto3BytesField(this, 1, value);
483};
484
485
486/**
487 * optional AccountType type = 2;
488 * @return {!proto.protocol.AccountType}
489 */
490proto.protocol.Account.prototype.getType = function() {
491 return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
492};
493
494
495/** @param {!proto.protocol.AccountType} value */
496proto.protocol.Account.prototype.setType = function(value) {
497 jspb.Message.setProto3EnumField(this, 2, value);
498};
499
500
501/**
502 * optional bytes address = 3;
503 * @return {!(string|Uint8Array)}
504 */
505proto.protocol.Account.prototype.getAddress = function() {
506 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
507};
508
509
510/**
511 * optional bytes address = 3;
512 * This is a type-conversion wrapper around `getAddress()`
513 * @return {string}
514 */
515proto.protocol.Account.prototype.getAddress_asB64 = function() {
516 return /** @type {string} */ (jspb.Message.bytesAsB64(
517 this.getAddress()));
518};
519
520
521/**
522 * optional bytes address = 3;
523 * Note that Uint8Array is not supported on all browsers.
524 * @see http://caniuse.com/Uint8Array
525 * This is a type-conversion wrapper around `getAddress()`
526 * @return {!Uint8Array}
527 */
528proto.protocol.Account.prototype.getAddress_asU8 = function() {
529 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
530 this.getAddress()));
531};
532
533
534/** @param {!(string|Uint8Array)} value */
535proto.protocol.Account.prototype.setAddress = function(value) {
536 jspb.Message.setProto3BytesField(this, 3, value);
537};
538
539
540/**
541 * optional int64 balance = 4;
542 * @return {number}
543 */
544proto.protocol.Account.prototype.getBalance = function() {
545 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
546};
547
548
549/** @param {number} value */
550proto.protocol.Account.prototype.setBalance = function(value) {
551 jspb.Message.setProto3IntField(this, 4, value);
552};
553
554
555/**
556 * repeated Vote votes = 5;
557 * @return {!Array.<!proto.protocol.Account.Vote>}
558 */
559proto.protocol.Account.prototype.getVotesList = function() {
560 return /** @type{!Array.<!proto.protocol.Account.Vote>} */ (
561 jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Vote, 5));
562};
563
564
565/** @param {!Array.<!proto.protocol.Account.Vote>} value */
566proto.protocol.Account.prototype.setVotesList = function(value) {
567 jspb.Message.setRepeatedWrapperField(this, 5, value);
568};
569
570
571/**
572 * @param {!proto.protocol.Account.Vote=} opt_value
573 * @param {number=} opt_index
574 * @return {!proto.protocol.Account.Vote}
575 */
576proto.protocol.Account.prototype.addVotes = function(opt_value, opt_index) {
577 return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Account.Vote, opt_index);
578};
579
580
581proto.protocol.Account.prototype.clearVotesList = function() {
582 this.setVotesList([]);
583};
584
585
586/**
587 * map<string, int64> asset = 6;
588 * @param {boolean=} opt_noLazyCreate Do not create the map if
589 * empty, instead returning `undefined`
590 * @return {!jspb.Map<string,number>}
591 */
592proto.protocol.Account.prototype.getAssetMap = function(opt_noLazyCreate) {
593 return /** @type {!jspb.Map<string,number>} */ (
594 jspb.Message.getMapField(this, 6, opt_noLazyCreate,
595 null));
596};
597
598
599proto.protocol.Account.prototype.clearAssetMap = function() {
600 this.getAssetMap().clear();
601};
602
603
604/**
605 * optional int64 latest_opration_time = 10;
606 * @return {number}
607 */
608proto.protocol.Account.prototype.getLatestOprationTime = function() {
609 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
610};
611
612
613/** @param {number} value */
614proto.protocol.Account.prototype.setLatestOprationTime = function(value) {
615 jspb.Message.setProto3IntField(this, 10, value);
616};
617
618
619
620/**
621 * Generated by JsPbCodeGenerator.
622 * @param {Array=} opt_data Optional initial data array, typically from a
623 * server response, or constructed directly in Javascript. The array is used
624 * in place and becomes part of the constructed object. It is not cloned.
625 * If no data is provided, the constructed object will be empty, but still
626 * valid.
627 * @extends {jspb.Message}
628 * @constructor
629 */
630proto.protocol.Witness = function(opt_data) {
631 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
632};
633goog.inherits(proto.protocol.Witness, jspb.Message);
634if (goog.DEBUG && !COMPILED) {
635 proto.protocol.Witness.displayName = 'proto.protocol.Witness';
636}
637
638
639if (jspb.Message.GENERATE_TO_OBJECT) {
640/**
641 * Creates an object representation of this proto suitable for use in Soy templates.
642 * Field names that are reserved in JavaScript and will be renamed to pb_name.
643 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
644 * For the list of reserved names please see:
645 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
646 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
647 * for transitional soy proto support: http://goto/soy-param-migration
648 * @return {!Object}
649 */
650proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) {
651 return proto.protocol.Witness.toObject(opt_includeInstance, this);
652};
653
654
655/**
656 * Static version of the {@see toObject} method.
657 * @param {boolean|undefined} includeInstance Whether to include the JSPB
658 * instance for transitional soy proto support:
659 * http://goto/soy-param-migration
660 * @param {!proto.protocol.Witness} msg The msg instance to transform.
661 * @return {!Object}
662 * @suppress {unusedLocalVariables} f is only used for nested messages
663 */
664proto.protocol.Witness.toObject = function(includeInstance, msg) {
665 var f, obj = {
666 address: msg.getAddress_asB64(),
667 votecount: jspb.Message.getFieldWithDefault(msg, 2, 0),
668 pubkey: msg.getPubkey_asB64(),
669 url: jspb.Message.getFieldWithDefault(msg, 4, ""),
670 totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0),
671 totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0),
672 latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0),
673 latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0),
674 isjobs: jspb.Message.getFieldWithDefault(msg, 9, false)
675 };
676
677 if (includeInstance) {
678 obj.$jspbMessageInstance = msg;
679 }
680 return obj;
681};
682}
683
684
685/**
686 * Deserializes binary data (in protobuf wire format).
687 * @param {jspb.ByteSource} bytes The bytes to deserialize.
688 * @return {!proto.protocol.Witness}
689 */
690proto.protocol.Witness.deserializeBinary = function(bytes) {
691 var reader = new jspb.BinaryReader(bytes);
692 var msg = new proto.protocol.Witness;
693 return proto.protocol.Witness.deserializeBinaryFromReader(msg, reader);
694};
695
696
697/**
698 * Deserializes binary data (in protobuf wire format) from the
699 * given reader into the given message object.
700 * @param {!proto.protocol.Witness} msg The message object to deserialize into.
701 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
702 * @return {!proto.protocol.Witness}
703 */
704proto.protocol.Witness.deserializeBinaryFromReader = function(msg, reader) {
705 while (reader.nextField()) {
706 if (reader.isEndGroup()) {
707 break;
708 }
709 var field = reader.getFieldNumber();
710 switch (field) {
711 case 1:
712 var value = /** @type {!Uint8Array} */ (reader.readBytes());
713 msg.setAddress(value);
714 break;
715 case 2:
716 var value = /** @type {number} */ (reader.readInt64());
717 msg.setVotecount(value);
718 break;
719 case 3:
720 var value = /** @type {!Uint8Array} */ (reader.readBytes());
721 msg.setPubkey(value);
722 break;
723 case 4:
724 var value = /** @type {string} */ (reader.readString());
725 msg.setUrl(value);
726 break;
727 case 5:
728 var value = /** @type {number} */ (reader.readInt64());
729 msg.setTotalproduced(value);
730 break;
731 case 6:
732 var value = /** @type {number} */ (reader.readInt64());
733 msg.setTotalmissed(value);
734 break;
735 case 7:
736 var value = /** @type {number} */ (reader.readInt64());
737 msg.setLatestblocknum(value);
738 break;
739 case 8:
740 var value = /** @type {number} */ (reader.readInt64());
741 msg.setLatestslotnum(value);
742 break;
743 case 9:
744 var value = /** @type {boolean} */ (reader.readBool());
745 msg.setIsjobs(value);
746 break;
747 default:
748 reader.skipField();
749 break;
750 }
751 }
752 return msg;
753};
754
755
756/**
757 * Serializes the message to binary data (in protobuf wire format).
758 * @return {!Uint8Array}
759 */
760proto.protocol.Witness.prototype.serializeBinary = function() {
761 var writer = new jspb.BinaryWriter();
762 proto.protocol.Witness.serializeBinaryToWriter(this, writer);
763 return writer.getResultBuffer();
764};
765
766
767/**
768 * Serializes the given message to binary data (in protobuf wire
769 * format), writing to the given BinaryWriter.
770 * @param {!proto.protocol.Witness} message
771 * @param {!jspb.BinaryWriter} writer
772 * @suppress {unusedLocalVariables} f is only used for nested messages
773 */
774proto.protocol.Witness.serializeBinaryToWriter = function(message, writer) {
775 var f = undefined;
776 f = message.getAddress_asU8();
777 if (f.length > 0) {
778 writer.writeBytes(
779 1,
780 f
781 );
782 }
783 f = message.getVotecount();
784 if (f !== 0) {
785 writer.writeInt64(
786 2,
787 f
788 );
789 }
790 f = message.getPubkey_asU8();
791 if (f.length > 0) {
792 writer.writeBytes(
793 3,
794 f
795 );
796 }
797 f = message.getUrl();
798 if (f.length > 0) {
799 writer.writeString(
800 4,
801 f
802 );
803 }
804 f = message.getTotalproduced();
805 if (f !== 0) {
806 writer.writeInt64(
807 5,
808 f
809 );
810 }
811 f = message.getTotalmissed();
812 if (f !== 0) {
813 writer.writeInt64(
814 6,
815 f
816 );
817 }
818 f = message.getLatestblocknum();
819 if (f !== 0) {
820 writer.writeInt64(
821 7,
822 f
823 );
824 }
825 f = message.getLatestslotnum();
826 if (f !== 0) {
827 writer.writeInt64(
828 8,
829 f
830 );
831 }
832 f = message.getIsjobs();
833 if (f) {
834 writer.writeBool(
835 9,
836 f
837 );
838 }
839};
840
841
842/**
843 * optional bytes address = 1;
844 * @return {!(string|Uint8Array)}
845 */
846proto.protocol.Witness.prototype.getAddress = function() {
847 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
848};
849
850
851/**
852 * optional bytes address = 1;
853 * This is a type-conversion wrapper around `getAddress()`
854 * @return {string}
855 */
856proto.protocol.Witness.prototype.getAddress_asB64 = function() {
857 return /** @type {string} */ (jspb.Message.bytesAsB64(
858 this.getAddress()));
859};
860
861
862/**
863 * optional bytes address = 1;
864 * Note that Uint8Array is not supported on all browsers.
865 * @see http://caniuse.com/Uint8Array
866 * This is a type-conversion wrapper around `getAddress()`
867 * @return {!Uint8Array}
868 */
869proto.protocol.Witness.prototype.getAddress_asU8 = function() {
870 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
871 this.getAddress()));
872};
873
874
875/** @param {!(string|Uint8Array)} value */
876proto.protocol.Witness.prototype.setAddress = function(value) {
877 jspb.Message.setProto3BytesField(this, 1, value);
878};
879
880
881/**
882 * optional int64 voteCount = 2;
883 * @return {number}
884 */
885proto.protocol.Witness.prototype.getVotecount = function() {
886 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
887};
888
889
890/** @param {number} value */
891proto.protocol.Witness.prototype.setVotecount = function(value) {
892 jspb.Message.setProto3IntField(this, 2, value);
893};
894
895
896/**
897 * optional bytes pubKey = 3;
898 * @return {!(string|Uint8Array)}
899 */
900proto.protocol.Witness.prototype.getPubkey = function() {
901 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
902};
903
904
905/**
906 * optional bytes pubKey = 3;
907 * This is a type-conversion wrapper around `getPubkey()`
908 * @return {string}
909 */
910proto.protocol.Witness.prototype.getPubkey_asB64 = function() {
911 return /** @type {string} */ (jspb.Message.bytesAsB64(
912 this.getPubkey()));
913};
914
915
916/**
917 * optional bytes pubKey = 3;
918 * Note that Uint8Array is not supported on all browsers.
919 * @see http://caniuse.com/Uint8Array
920 * This is a type-conversion wrapper around `getPubkey()`
921 * @return {!Uint8Array}
922 */
923proto.protocol.Witness.prototype.getPubkey_asU8 = function() {
924 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
925 this.getPubkey()));
926};
927
928
929/** @param {!(string|Uint8Array)} value */
930proto.protocol.Witness.prototype.setPubkey = function(value) {
931 jspb.Message.setProto3BytesField(this, 3, value);
932};
933
934
935/**
936 * optional string url = 4;
937 * @return {string}
938 */
939proto.protocol.Witness.prototype.getUrl = function() {
940 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
941};
942
943
944/** @param {string} value */
945proto.protocol.Witness.prototype.setUrl = function(value) {
946 jspb.Message.setProto3StringField(this, 4, value);
947};
948
949
950/**
951 * optional int64 totalProduced = 5;
952 * @return {number}
953 */
954proto.protocol.Witness.prototype.getTotalproduced = function() {
955 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
956};
957
958
959/** @param {number} value */
960proto.protocol.Witness.prototype.setTotalproduced = function(value) {
961 jspb.Message.setProto3IntField(this, 5, value);
962};
963
964
965/**
966 * optional int64 totalMissed = 6;
967 * @return {number}
968 */
969proto.protocol.Witness.prototype.getTotalmissed = function() {
970 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
971};
972
973
974/** @param {number} value */
975proto.protocol.Witness.prototype.setTotalmissed = function(value) {
976 jspb.Message.setProto3IntField(this, 6, value);
977};
978
979
980/**
981 * optional int64 latestBlockNum = 7;
982 * @return {number}
983 */
984proto.protocol.Witness.prototype.getLatestblocknum = function() {
985 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
986};
987
988
989/** @param {number} value */
990proto.protocol.Witness.prototype.setLatestblocknum = function(value) {
991 jspb.Message.setProto3IntField(this, 7, value);
992};
993
994
995/**
996 * optional int64 latestSlotNum = 8;
997 * @return {number}
998 */
999proto.protocol.Witness.prototype.getLatestslotnum = function() {
1000 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
1001};
1002
1003
1004/** @param {number} value */
1005proto.protocol.Witness.prototype.setLatestslotnum = function(value) {
1006 jspb.Message.setProto3IntField(this, 8, value);
1007};
1008
1009
1010/**
1011 * optional bool isJobs = 9;
1012 * Note that Boolean fields may be set to 0/1 when serialized from a Java server.
1013 * You should avoid comparisons like {@code val === true/false} in those cases.
1014 * @return {boolean}
1015 */
1016proto.protocol.Witness.prototype.getIsjobs = function() {
1017 return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 9, false));
1018};
1019
1020
1021/** @param {boolean} value */
1022proto.protocol.Witness.prototype.setIsjobs = function(value) {
1023 jspb.Message.setProto3BooleanField(this, 9, value);
1024};
1025
1026
1027
1028/**
1029 * Generated by JsPbCodeGenerator.
1030 * @param {Array=} opt_data Optional initial data array, typically from a
1031 * server response, or constructed directly in Javascript. The array is used
1032 * in place and becomes part of the constructed object. It is not cloned.
1033 * If no data is provided, the constructed object will be empty, but still
1034 * valid.
1035 * @extends {jspb.Message}
1036 * @constructor
1037 */
1038proto.protocol.TXOutput = function(opt_data) {
1039 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
1040};
1041goog.inherits(proto.protocol.TXOutput, jspb.Message);
1042if (goog.DEBUG && !COMPILED) {
1043 proto.protocol.TXOutput.displayName = 'proto.protocol.TXOutput';
1044}
1045
1046
1047if (jspb.Message.GENERATE_TO_OBJECT) {
1048/**
1049 * Creates an object representation of this proto suitable for use in Soy templates.
1050 * Field names that are reserved in JavaScript and will be renamed to pb_name.
1051 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1052 * For the list of reserved names please see:
1053 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
1054 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
1055 * for transitional soy proto support: http://goto/soy-param-migration
1056 * @return {!Object}
1057 */
1058proto.protocol.TXOutput.prototype.toObject = function(opt_includeInstance) {
1059 return proto.protocol.TXOutput.toObject(opt_includeInstance, this);
1060};
1061
1062
1063/**
1064 * Static version of the {@see toObject} method.
1065 * @param {boolean|undefined} includeInstance Whether to include the JSPB
1066 * instance for transitional soy proto support:
1067 * http://goto/soy-param-migration
1068 * @param {!proto.protocol.TXOutput} msg The msg instance to transform.
1069 * @return {!Object}
1070 * @suppress {unusedLocalVariables} f is only used for nested messages
1071 */
1072proto.protocol.TXOutput.toObject = function(includeInstance, msg) {
1073 var f, obj = {
1074 value: jspb.Message.getFieldWithDefault(msg, 1, 0),
1075 pubkeyhash: msg.getPubkeyhash_asB64()
1076 };
1077
1078 if (includeInstance) {
1079 obj.$jspbMessageInstance = msg;
1080 }
1081 return obj;
1082};
1083}
1084
1085
1086/**
1087 * Deserializes binary data (in protobuf wire format).
1088 * @param {jspb.ByteSource} bytes The bytes to deserialize.
1089 * @return {!proto.protocol.TXOutput}
1090 */
1091proto.protocol.TXOutput.deserializeBinary = function(bytes) {
1092 var reader = new jspb.BinaryReader(bytes);
1093 var msg = new proto.protocol.TXOutput;
1094 return proto.protocol.TXOutput.deserializeBinaryFromReader(msg, reader);
1095};
1096
1097
1098/**
1099 * Deserializes binary data (in protobuf wire format) from the
1100 * given reader into the given message object.
1101 * @param {!proto.protocol.TXOutput} msg The message object to deserialize into.
1102 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1103 * @return {!proto.protocol.TXOutput}
1104 */
1105proto.protocol.TXOutput.deserializeBinaryFromReader = function(msg, reader) {
1106 while (reader.nextField()) {
1107 if (reader.isEndGroup()) {
1108 break;
1109 }
1110 var field = reader.getFieldNumber();
1111 switch (field) {
1112 case 1:
1113 var value = /** @type {number} */ (reader.readInt64());
1114 msg.setValue(value);
1115 break;
1116 case 2:
1117 var value = /** @type {!Uint8Array} */ (reader.readBytes());
1118 msg.setPubkeyhash(value);
1119 break;
1120 default:
1121 reader.skipField();
1122 break;
1123 }
1124 }
1125 return msg;
1126};
1127
1128
1129/**
1130 * Serializes the message to binary data (in protobuf wire format).
1131 * @return {!Uint8Array}
1132 */
1133proto.protocol.TXOutput.prototype.serializeBinary = function() {
1134 var writer = new jspb.BinaryWriter();
1135 proto.protocol.TXOutput.serializeBinaryToWriter(this, writer);
1136 return writer.getResultBuffer();
1137};
1138
1139
1140/**
1141 * Serializes the given message to binary data (in protobuf wire
1142 * format), writing to the given BinaryWriter.
1143 * @param {!proto.protocol.TXOutput} message
1144 * @param {!jspb.BinaryWriter} writer
1145 * @suppress {unusedLocalVariables} f is only used for nested messages
1146 */
1147proto.protocol.TXOutput.serializeBinaryToWriter = function(message, writer) {
1148 var f = undefined;
1149 f = message.getValue();
1150 if (f !== 0) {
1151 writer.writeInt64(
1152 1,
1153 f
1154 );
1155 }
1156 f = message.getPubkeyhash_asU8();
1157 if (f.length > 0) {
1158 writer.writeBytes(
1159 2,
1160 f
1161 );
1162 }
1163};
1164
1165
1166/**
1167 * optional int64 value = 1;
1168 * @return {number}
1169 */
1170proto.protocol.TXOutput.prototype.getValue = function() {
1171 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
1172};
1173
1174
1175/** @param {number} value */
1176proto.protocol.TXOutput.prototype.setValue = function(value) {
1177 jspb.Message.setProto3IntField(this, 1, value);
1178};
1179
1180
1181/**
1182 * optional bytes pubKeyHash = 2;
1183 * @return {!(string|Uint8Array)}
1184 */
1185proto.protocol.TXOutput.prototype.getPubkeyhash = function() {
1186 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1187};
1188
1189
1190/**
1191 * optional bytes pubKeyHash = 2;
1192 * This is a type-conversion wrapper around `getPubkeyhash()`
1193 * @return {string}
1194 */
1195proto.protocol.TXOutput.prototype.getPubkeyhash_asB64 = function() {
1196 return /** @type {string} */ (jspb.Message.bytesAsB64(
1197 this.getPubkeyhash()));
1198};
1199
1200
1201/**
1202 * optional bytes pubKeyHash = 2;
1203 * Note that Uint8Array is not supported on all browsers.
1204 * @see http://caniuse.com/Uint8Array
1205 * This is a type-conversion wrapper around `getPubkeyhash()`
1206 * @return {!Uint8Array}
1207 */
1208proto.protocol.TXOutput.prototype.getPubkeyhash_asU8 = function() {
1209 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1210 this.getPubkeyhash()));
1211};
1212
1213
1214/** @param {!(string|Uint8Array)} value */
1215proto.protocol.TXOutput.prototype.setPubkeyhash = function(value) {
1216 jspb.Message.setProto3BytesField(this, 2, value);
1217};
1218
1219
1220
1221/**
1222 * Generated by JsPbCodeGenerator.
1223 * @param {Array=} opt_data Optional initial data array, typically from a
1224 * server response, or constructed directly in Javascript. The array is used
1225 * in place and becomes part of the constructed object. It is not cloned.
1226 * If no data is provided, the constructed object will be empty, but still
1227 * valid.
1228 * @extends {jspb.Message}
1229 * @constructor
1230 */
1231proto.protocol.TXInput = function(opt_data) {
1232 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
1233};
1234goog.inherits(proto.protocol.TXInput, jspb.Message);
1235if (goog.DEBUG && !COMPILED) {
1236 proto.protocol.TXInput.displayName = 'proto.protocol.TXInput';
1237}
1238
1239
1240if (jspb.Message.GENERATE_TO_OBJECT) {
1241/**
1242 * Creates an object representation of this proto suitable for use in Soy templates.
1243 * Field names that are reserved in JavaScript and will be renamed to pb_name.
1244 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1245 * For the list of reserved names please see:
1246 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
1247 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
1248 * for transitional soy proto support: http://goto/soy-param-migration
1249 * @return {!Object}
1250 */
1251proto.protocol.TXInput.prototype.toObject = function(opt_includeInstance) {
1252 return proto.protocol.TXInput.toObject(opt_includeInstance, this);
1253};
1254
1255
1256/**
1257 * Static version of the {@see toObject} method.
1258 * @param {boolean|undefined} includeInstance Whether to include the JSPB
1259 * instance for transitional soy proto support:
1260 * http://goto/soy-param-migration
1261 * @param {!proto.protocol.TXInput} msg The msg instance to transform.
1262 * @return {!Object}
1263 * @suppress {unusedLocalVariables} f is only used for nested messages
1264 */
1265proto.protocol.TXInput.toObject = function(includeInstance, msg) {
1266 var f, obj = {
1267 rawData: (f = msg.getRawData()) && proto.protocol.TXInput.raw.toObject(includeInstance, f),
1268 signature: msg.getSignature_asB64()
1269 };
1270
1271 if (includeInstance) {
1272 obj.$jspbMessageInstance = msg;
1273 }
1274 return obj;
1275};
1276}
1277
1278
1279/**
1280 * Deserializes binary data (in protobuf wire format).
1281 * @param {jspb.ByteSource} bytes The bytes to deserialize.
1282 * @return {!proto.protocol.TXInput}
1283 */
1284proto.protocol.TXInput.deserializeBinary = function(bytes) {
1285 var reader = new jspb.BinaryReader(bytes);
1286 var msg = new proto.protocol.TXInput;
1287 return proto.protocol.TXInput.deserializeBinaryFromReader(msg, reader);
1288};
1289
1290
1291/**
1292 * Deserializes binary data (in protobuf wire format) from the
1293 * given reader into the given message object.
1294 * @param {!proto.protocol.TXInput} msg The message object to deserialize into.
1295 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1296 * @return {!proto.protocol.TXInput}
1297 */
1298proto.protocol.TXInput.deserializeBinaryFromReader = function(msg, reader) {
1299 while (reader.nextField()) {
1300 if (reader.isEndGroup()) {
1301 break;
1302 }
1303 var field = reader.getFieldNumber();
1304 switch (field) {
1305 case 1:
1306 var value = new proto.protocol.TXInput.raw;
1307 reader.readMessage(value,proto.protocol.TXInput.raw.deserializeBinaryFromReader);
1308 msg.setRawData(value);
1309 break;
1310 case 4:
1311 var value = /** @type {!Uint8Array} */ (reader.readBytes());
1312 msg.setSignature(value);
1313 break;
1314 default:
1315 reader.skipField();
1316 break;
1317 }
1318 }
1319 return msg;
1320};
1321
1322
1323/**
1324 * Serializes the message to binary data (in protobuf wire format).
1325 * @return {!Uint8Array}
1326 */
1327proto.protocol.TXInput.prototype.serializeBinary = function() {
1328 var writer = new jspb.BinaryWriter();
1329 proto.protocol.TXInput.serializeBinaryToWriter(this, writer);
1330 return writer.getResultBuffer();
1331};
1332
1333
1334/**
1335 * Serializes the given message to binary data (in protobuf wire
1336 * format), writing to the given BinaryWriter.
1337 * @param {!proto.protocol.TXInput} message
1338 * @param {!jspb.BinaryWriter} writer
1339 * @suppress {unusedLocalVariables} f is only used for nested messages
1340 */
1341proto.protocol.TXInput.serializeBinaryToWriter = function(message, writer) {
1342 var f = undefined;
1343 f = message.getRawData();
1344 if (f != null) {
1345 writer.writeMessage(
1346 1,
1347 f,
1348 proto.protocol.TXInput.raw.serializeBinaryToWriter
1349 );
1350 }
1351 f = message.getSignature_asU8();
1352 if (f.length > 0) {
1353 writer.writeBytes(
1354 4,
1355 f
1356 );
1357 }
1358};
1359
1360
1361
1362/**
1363 * Generated by JsPbCodeGenerator.
1364 * @param {Array=} opt_data Optional initial data array, typically from a
1365 * server response, or constructed directly in Javascript. The array is used
1366 * in place and becomes part of the constructed object. It is not cloned.
1367 * If no data is provided, the constructed object will be empty, but still
1368 * valid.
1369 * @extends {jspb.Message}
1370 * @constructor
1371 */
1372proto.protocol.TXInput.raw = function(opt_data) {
1373 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
1374};
1375goog.inherits(proto.protocol.TXInput.raw, jspb.Message);
1376if (goog.DEBUG && !COMPILED) {
1377 proto.protocol.TXInput.raw.displayName = 'proto.protocol.TXInput.raw';
1378}
1379
1380
1381if (jspb.Message.GENERATE_TO_OBJECT) {
1382/**
1383 * Creates an object representation of this proto suitable for use in Soy templates.
1384 * Field names that are reserved in JavaScript and will be renamed to pb_name.
1385 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1386 * For the list of reserved names please see:
1387 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
1388 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
1389 * for transitional soy proto support: http://goto/soy-param-migration
1390 * @return {!Object}
1391 */
1392proto.protocol.TXInput.raw.prototype.toObject = function(opt_includeInstance) {
1393 return proto.protocol.TXInput.raw.toObject(opt_includeInstance, this);
1394};
1395
1396
1397/**
1398 * Static version of the {@see toObject} method.
1399 * @param {boolean|undefined} includeInstance Whether to include the JSPB
1400 * instance for transitional soy proto support:
1401 * http://goto/soy-param-migration
1402 * @param {!proto.protocol.TXInput.raw} msg The msg instance to transform.
1403 * @return {!Object}
1404 * @suppress {unusedLocalVariables} f is only used for nested messages
1405 */
1406proto.protocol.TXInput.raw.toObject = function(includeInstance, msg) {
1407 var f, obj = {
1408 txid: msg.getTxid_asB64(),
1409 vout: jspb.Message.getFieldWithDefault(msg, 2, 0),
1410 pubkey: msg.getPubkey_asB64()
1411 };
1412
1413 if (includeInstance) {
1414 obj.$jspbMessageInstance = msg;
1415 }
1416 return obj;
1417};
1418}
1419
1420
1421/**
1422 * Deserializes binary data (in protobuf wire format).
1423 * @param {jspb.ByteSource} bytes The bytes to deserialize.
1424 * @return {!proto.protocol.TXInput.raw}
1425 */
1426proto.protocol.TXInput.raw.deserializeBinary = function(bytes) {
1427 var reader = new jspb.BinaryReader(bytes);
1428 var msg = new proto.protocol.TXInput.raw;
1429 return proto.protocol.TXInput.raw.deserializeBinaryFromReader(msg, reader);
1430};
1431
1432
1433/**
1434 * Deserializes binary data (in protobuf wire format) from the
1435 * given reader into the given message object.
1436 * @param {!proto.protocol.TXInput.raw} msg The message object to deserialize into.
1437 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1438 * @return {!proto.protocol.TXInput.raw}
1439 */
1440proto.protocol.TXInput.raw.deserializeBinaryFromReader = function(msg, reader) {
1441 while (reader.nextField()) {
1442 if (reader.isEndGroup()) {
1443 break;
1444 }
1445 var field = reader.getFieldNumber();
1446 switch (field) {
1447 case 1:
1448 var value = /** @type {!Uint8Array} */ (reader.readBytes());
1449 msg.setTxid(value);
1450 break;
1451 case 2:
1452 var value = /** @type {number} */ (reader.readInt64());
1453 msg.setVout(value);
1454 break;
1455 case 3:
1456 var value = /** @type {!Uint8Array} */ (reader.readBytes());
1457 msg.setPubkey(value);
1458 break;
1459 default:
1460 reader.skipField();
1461 break;
1462 }
1463 }
1464 return msg;
1465};
1466
1467
1468/**
1469 * Serializes the message to binary data (in protobuf wire format).
1470 * @return {!Uint8Array}
1471 */
1472proto.protocol.TXInput.raw.prototype.serializeBinary = function() {
1473 var writer = new jspb.BinaryWriter();
1474 proto.protocol.TXInput.raw.serializeBinaryToWriter(this, writer);
1475 return writer.getResultBuffer();
1476};
1477
1478
1479/**
1480 * Serializes the given message to binary data (in protobuf wire
1481 * format), writing to the given BinaryWriter.
1482 * @param {!proto.protocol.TXInput.raw} message
1483 * @param {!jspb.BinaryWriter} writer
1484 * @suppress {unusedLocalVariables} f is only used for nested messages
1485 */
1486proto.protocol.TXInput.raw.serializeBinaryToWriter = function(message, writer) {
1487 var f = undefined;
1488 f = message.getTxid_asU8();
1489 if (f.length > 0) {
1490 writer.writeBytes(
1491 1,
1492 f
1493 );
1494 }
1495 f = message.getVout();
1496 if (f !== 0) {
1497 writer.writeInt64(
1498 2,
1499 f
1500 );
1501 }
1502 f = message.getPubkey_asU8();
1503 if (f.length > 0) {
1504 writer.writeBytes(
1505 3,
1506 f
1507 );
1508 }
1509};
1510
1511
1512/**
1513 * optional bytes txID = 1;
1514 * @return {!(string|Uint8Array)}
1515 */
1516proto.protocol.TXInput.raw.prototype.getTxid = function() {
1517 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1518};
1519
1520
1521/**
1522 * optional bytes txID = 1;
1523 * This is a type-conversion wrapper around `getTxid()`
1524 * @return {string}
1525 */
1526proto.protocol.TXInput.raw.prototype.getTxid_asB64 = function() {
1527 return /** @type {string} */ (jspb.Message.bytesAsB64(
1528 this.getTxid()));
1529};
1530
1531
1532/**
1533 * optional bytes txID = 1;
1534 * Note that Uint8Array is not supported on all browsers.
1535 * @see http://caniuse.com/Uint8Array
1536 * This is a type-conversion wrapper around `getTxid()`
1537 * @return {!Uint8Array}
1538 */
1539proto.protocol.TXInput.raw.prototype.getTxid_asU8 = function() {
1540 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1541 this.getTxid()));
1542};
1543
1544
1545/** @param {!(string|Uint8Array)} value */
1546proto.protocol.TXInput.raw.prototype.setTxid = function(value) {
1547 jspb.Message.setProto3BytesField(this, 1, value);
1548};
1549
1550
1551/**
1552 * optional int64 vout = 2;
1553 * @return {number}
1554 */
1555proto.protocol.TXInput.raw.prototype.getVout = function() {
1556 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
1557};
1558
1559
1560/** @param {number} value */
1561proto.protocol.TXInput.raw.prototype.setVout = function(value) {
1562 jspb.Message.setProto3IntField(this, 2, value);
1563};
1564
1565
1566/**
1567 * optional bytes pubKey = 3;
1568 * @return {!(string|Uint8Array)}
1569 */
1570proto.protocol.TXInput.raw.prototype.getPubkey = function() {
1571 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
1572};
1573
1574
1575/**
1576 * optional bytes pubKey = 3;
1577 * This is a type-conversion wrapper around `getPubkey()`
1578 * @return {string}
1579 */
1580proto.protocol.TXInput.raw.prototype.getPubkey_asB64 = function() {
1581 return /** @type {string} */ (jspb.Message.bytesAsB64(
1582 this.getPubkey()));
1583};
1584
1585
1586/**
1587 * optional bytes pubKey = 3;
1588 * Note that Uint8Array is not supported on all browsers.
1589 * @see http://caniuse.com/Uint8Array
1590 * This is a type-conversion wrapper around `getPubkey()`
1591 * @return {!Uint8Array}
1592 */
1593proto.protocol.TXInput.raw.prototype.getPubkey_asU8 = function() {
1594 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1595 this.getPubkey()));
1596};
1597
1598
1599/** @param {!(string|Uint8Array)} value */
1600proto.protocol.TXInput.raw.prototype.setPubkey = function(value) {
1601 jspb.Message.setProto3BytesField(this, 3, value);
1602};
1603
1604
1605/**
1606 * optional raw raw_data = 1;
1607 * @return {?proto.protocol.TXInput.raw}
1608 */
1609proto.protocol.TXInput.prototype.getRawData = function() {
1610 return /** @type{?proto.protocol.TXInput.raw} */ (
1611 jspb.Message.getWrapperField(this, proto.protocol.TXInput.raw, 1));
1612};
1613
1614
1615/** @param {?proto.protocol.TXInput.raw|undefined} value */
1616proto.protocol.TXInput.prototype.setRawData = function(value) {
1617 jspb.Message.setWrapperField(this, 1, value);
1618};
1619
1620
1621proto.protocol.TXInput.prototype.clearRawData = function() {
1622 this.setRawData(undefined);
1623};
1624
1625
1626/**
1627 * Returns whether this field is set.
1628 * @return {!boolean}
1629 */
1630proto.protocol.TXInput.prototype.hasRawData = function() {
1631 return jspb.Message.getField(this, 1) != null;
1632};
1633
1634
1635/**
1636 * optional bytes signature = 4;
1637 * @return {!(string|Uint8Array)}
1638 */
1639proto.protocol.TXInput.prototype.getSignature = function() {
1640 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
1641};
1642
1643
1644/**
1645 * optional bytes signature = 4;
1646 * This is a type-conversion wrapper around `getSignature()`
1647 * @return {string}
1648 */
1649proto.protocol.TXInput.prototype.getSignature_asB64 = function() {
1650 return /** @type {string} */ (jspb.Message.bytesAsB64(
1651 this.getSignature()));
1652};
1653
1654
1655/**
1656 * optional bytes signature = 4;
1657 * Note that Uint8Array is not supported on all browsers.
1658 * @see http://caniuse.com/Uint8Array
1659 * This is a type-conversion wrapper around `getSignature()`
1660 * @return {!Uint8Array}
1661 */
1662proto.protocol.TXInput.prototype.getSignature_asU8 = function() {
1663 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1664 this.getSignature()));
1665};
1666
1667
1668/** @param {!(string|Uint8Array)} value */
1669proto.protocol.TXInput.prototype.setSignature = function(value) {
1670 jspb.Message.setProto3BytesField(this, 4, value);
1671};
1672
1673
1674
1675/**
1676 * Generated by JsPbCodeGenerator.
1677 * @param {Array=} opt_data Optional initial data array, typically from a
1678 * server response, or constructed directly in Javascript. The array is used
1679 * in place and becomes part of the constructed object. It is not cloned.
1680 * If no data is provided, the constructed object will be empty, but still
1681 * valid.
1682 * @extends {jspb.Message}
1683 * @constructor
1684 */
1685proto.protocol.TXOutputs = function(opt_data) {
1686 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.TXOutputs.repeatedFields_, null);
1687};
1688goog.inherits(proto.protocol.TXOutputs, jspb.Message);
1689if (goog.DEBUG && !COMPILED) {
1690 proto.protocol.TXOutputs.displayName = 'proto.protocol.TXOutputs';
1691}
1692/**
1693 * List of repeated fields within this message type.
1694 * @private {!Array<number>}
1695 * @const
1696 */
1697proto.protocol.TXOutputs.repeatedFields_ = [1];
1698
1699
1700
1701if (jspb.Message.GENERATE_TO_OBJECT) {
1702/**
1703 * Creates an object representation of this proto suitable for use in Soy templates.
1704 * Field names that are reserved in JavaScript and will be renamed to pb_name.
1705 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1706 * For the list of reserved names please see:
1707 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
1708 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
1709 * for transitional soy proto support: http://goto/soy-param-migration
1710 * @return {!Object}
1711 */
1712proto.protocol.TXOutputs.prototype.toObject = function(opt_includeInstance) {
1713 return proto.protocol.TXOutputs.toObject(opt_includeInstance, this);
1714};
1715
1716
1717/**
1718 * Static version of the {@see toObject} method.
1719 * @param {boolean|undefined} includeInstance Whether to include the JSPB
1720 * instance for transitional soy proto support:
1721 * http://goto/soy-param-migration
1722 * @param {!proto.protocol.TXOutputs} msg The msg instance to transform.
1723 * @return {!Object}
1724 * @suppress {unusedLocalVariables} f is only used for nested messages
1725 */
1726proto.protocol.TXOutputs.toObject = function(includeInstance, msg) {
1727 var f, obj = {
1728 outputsList: jspb.Message.toObjectList(msg.getOutputsList(),
1729 proto.protocol.TXOutput.toObject, includeInstance)
1730 };
1731
1732 if (includeInstance) {
1733 obj.$jspbMessageInstance = msg;
1734 }
1735 return obj;
1736};
1737}
1738
1739
1740/**
1741 * Deserializes binary data (in protobuf wire format).
1742 * @param {jspb.ByteSource} bytes The bytes to deserialize.
1743 * @return {!proto.protocol.TXOutputs}
1744 */
1745proto.protocol.TXOutputs.deserializeBinary = function(bytes) {
1746 var reader = new jspb.BinaryReader(bytes);
1747 var msg = new proto.protocol.TXOutputs;
1748 return proto.protocol.TXOutputs.deserializeBinaryFromReader(msg, reader);
1749};
1750
1751
1752/**
1753 * Deserializes binary data (in protobuf wire format) from the
1754 * given reader into the given message object.
1755 * @param {!proto.protocol.TXOutputs} msg The message object to deserialize into.
1756 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1757 * @return {!proto.protocol.TXOutputs}
1758 */
1759proto.protocol.TXOutputs.deserializeBinaryFromReader = function(msg, reader) {
1760 while (reader.nextField()) {
1761 if (reader.isEndGroup()) {
1762 break;
1763 }
1764 var field = reader.getFieldNumber();
1765 switch (field) {
1766 case 1:
1767 var value = new proto.protocol.TXOutput;
1768 reader.readMessage(value,proto.protocol.TXOutput.deserializeBinaryFromReader);
1769 msg.addOutputs(value);
1770 break;
1771 default:
1772 reader.skipField();
1773 break;
1774 }
1775 }
1776 return msg;
1777};
1778
1779
1780/**
1781 * Serializes the message to binary data (in protobuf wire format).
1782 * @return {!Uint8Array}
1783 */
1784proto.protocol.TXOutputs.prototype.serializeBinary = function() {
1785 var writer = new jspb.BinaryWriter();
1786 proto.protocol.TXOutputs.serializeBinaryToWriter(this, writer);
1787 return writer.getResultBuffer();
1788};
1789
1790
1791/**
1792 * Serializes the given message to binary data (in protobuf wire
1793 * format), writing to the given BinaryWriter.
1794 * @param {!proto.protocol.TXOutputs} message
1795 * @param {!jspb.BinaryWriter} writer
1796 * @suppress {unusedLocalVariables} f is only used for nested messages
1797 */
1798proto.protocol.TXOutputs.serializeBinaryToWriter = function(message, writer) {
1799 var f = undefined;
1800 f = message.getOutputsList();
1801 if (f.length > 0) {
1802 writer.writeRepeatedMessage(
1803 1,
1804 f,
1805 proto.protocol.TXOutput.serializeBinaryToWriter
1806 );
1807 }
1808};
1809
1810
1811/**
1812 * repeated TXOutput outputs = 1;
1813 * @return {!Array.<!proto.protocol.TXOutput>}
1814 */
1815proto.protocol.TXOutputs.prototype.getOutputsList = function() {
1816 return /** @type{!Array.<!proto.protocol.TXOutput>} */ (
1817 jspb.Message.getRepeatedWrapperField(this, proto.protocol.TXOutput, 1));
1818};
1819
1820
1821/** @param {!Array.<!proto.protocol.TXOutput>} value */
1822proto.protocol.TXOutputs.prototype.setOutputsList = function(value) {
1823 jspb.Message.setRepeatedWrapperField(this, 1, value);
1824};
1825
1826
1827/**
1828 * @param {!proto.protocol.TXOutput=} opt_value
1829 * @param {number=} opt_index
1830 * @return {!proto.protocol.TXOutput}
1831 */
1832proto.protocol.TXOutputs.prototype.addOutputs = function(opt_value, opt_index) {
1833 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.TXOutput, opt_index);
1834};
1835
1836
1837proto.protocol.TXOutputs.prototype.clearOutputsList = function() {
1838 this.setOutputsList([]);
1839};
1840
1841
1842
1843/**
1844 * Generated by JsPbCodeGenerator.
1845 * @param {Array=} opt_data Optional initial data array, typically from a
1846 * server response, or constructed directly in Javascript. The array is used
1847 * in place and becomes part of the constructed object. It is not cloned.
1848 * If no data is provided, the constructed object will be empty, but still
1849 * valid.
1850 * @extends {jspb.Message}
1851 * @constructor
1852 */
1853proto.protocol.Transaction = function(opt_data) {
1854 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.repeatedFields_, null);
1855};
1856goog.inherits(proto.protocol.Transaction, jspb.Message);
1857if (goog.DEBUG && !COMPILED) {
1858 proto.protocol.Transaction.displayName = 'proto.protocol.Transaction';
1859}
1860/**
1861 * List of repeated fields within this message type.
1862 * @private {!Array<number>}
1863 * @const
1864 */
1865proto.protocol.Transaction.repeatedFields_ = [2,5];
1866
1867
1868
1869if (jspb.Message.GENERATE_TO_OBJECT) {
1870/**
1871 * Creates an object representation of this proto suitable for use in Soy templates.
1872 * Field names that are reserved in JavaScript and will be renamed to pb_name.
1873 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1874 * For the list of reserved names please see:
1875 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
1876 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
1877 * for transitional soy proto support: http://goto/soy-param-migration
1878 * @return {!Object}
1879 */
1880proto.protocol.Transaction.prototype.toObject = function(opt_includeInstance) {
1881 return proto.protocol.Transaction.toObject(opt_includeInstance, this);
1882};
1883
1884
1885/**
1886 * Static version of the {@see toObject} method.
1887 * @param {boolean|undefined} includeInstance Whether to include the JSPB
1888 * instance for transitional soy proto support:
1889 * http://goto/soy-param-migration
1890 * @param {!proto.protocol.Transaction} msg The msg instance to transform.
1891 * @return {!Object}
1892 * @suppress {unusedLocalVariables} f is only used for nested messages
1893 */
1894proto.protocol.Transaction.toObject = function(includeInstance, msg) {
1895 var f, obj = {
1896 rawData: (f = msg.getRawData()) && proto.protocol.Transaction.raw.toObject(includeInstance, f),
1897 signatureList: msg.getSignatureList_asB64(),
1898 retList: jspb.Message.toObjectList(msg.getRetList(),
1899 proto.protocol.Transaction.Result.toObject, includeInstance)
1900 };
1901
1902 if (includeInstance) {
1903 obj.$jspbMessageInstance = msg;
1904 }
1905 return obj;
1906};
1907}
1908
1909
1910/**
1911 * Deserializes binary data (in protobuf wire format).
1912 * @param {jspb.ByteSource} bytes The bytes to deserialize.
1913 * @return {!proto.protocol.Transaction}
1914 */
1915proto.protocol.Transaction.deserializeBinary = function(bytes) {
1916 var reader = new jspb.BinaryReader(bytes);
1917 var msg = new proto.protocol.Transaction;
1918 return proto.protocol.Transaction.deserializeBinaryFromReader(msg, reader);
1919};
1920
1921
1922/**
1923 * Deserializes binary data (in protobuf wire format) from the
1924 * given reader into the given message object.
1925 * @param {!proto.protocol.Transaction} msg The message object to deserialize into.
1926 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1927 * @return {!proto.protocol.Transaction}
1928 */
1929proto.protocol.Transaction.deserializeBinaryFromReader = function(msg, reader) {
1930 while (reader.nextField()) {
1931 if (reader.isEndGroup()) {
1932 break;
1933 }
1934 var field = reader.getFieldNumber();
1935 switch (field) {
1936 case 1:
1937 var value = new proto.protocol.Transaction.raw;
1938 reader.readMessage(value,proto.protocol.Transaction.raw.deserializeBinaryFromReader);
1939 msg.setRawData(value);
1940 break;
1941 case 2:
1942 var value = /** @type {!Uint8Array} */ (reader.readBytes());
1943 msg.addSignature(value);
1944 break;
1945 case 5:
1946 var value = new proto.protocol.Transaction.Result;
1947 reader.readMessage(value,proto.protocol.Transaction.Result.deserializeBinaryFromReader);
1948 msg.addRet(value);
1949 break;
1950 default:
1951 reader.skipField();
1952 break;
1953 }
1954 }
1955 return msg;
1956};
1957
1958
1959/**
1960 * Serializes the message to binary data (in protobuf wire format).
1961 * @return {!Uint8Array}
1962 */
1963proto.protocol.Transaction.prototype.serializeBinary = function() {
1964 var writer = new jspb.BinaryWriter();
1965 proto.protocol.Transaction.serializeBinaryToWriter(this, writer);
1966 return writer.getResultBuffer();
1967};
1968
1969
1970/**
1971 * Serializes the given message to binary data (in protobuf wire
1972 * format), writing to the given BinaryWriter.
1973 * @param {!proto.protocol.Transaction} message
1974 * @param {!jspb.BinaryWriter} writer
1975 * @suppress {unusedLocalVariables} f is only used for nested messages
1976 */
1977proto.protocol.Transaction.serializeBinaryToWriter = function(message, writer) {
1978 var f = undefined;
1979 f = message.getRawData();
1980 if (f != null) {
1981 writer.writeMessage(
1982 1,
1983 f,
1984 proto.protocol.Transaction.raw.serializeBinaryToWriter
1985 );
1986 }
1987 f = message.getSignatureList_asU8();
1988 if (f.length > 0) {
1989 writer.writeRepeatedBytes(
1990 2,
1991 f
1992 );
1993 }
1994 f = message.getRetList();
1995 if (f.length > 0) {
1996 writer.writeRepeatedMessage(
1997 5,
1998 f,
1999 proto.protocol.Transaction.Result.serializeBinaryToWriter
2000 );
2001 }
2002};
2003
2004
2005/**
2006 * @enum {number}
2007 */
2008proto.protocol.Transaction.TransactionType = {
2009 UTXOTYPE: 0,
2010 CONTRACTTYPE: 1
2011};
2012
2013
2014/**
2015 * Generated by JsPbCodeGenerator.
2016 * @param {Array=} opt_data Optional initial data array, typically from a
2017 * server response, or constructed directly in Javascript. The array is used
2018 * in place and becomes part of the constructed object. It is not cloned.
2019 * If no data is provided, the constructed object will be empty, but still
2020 * valid.
2021 * @extends {jspb.Message}
2022 * @constructor
2023 */
2024proto.protocol.Transaction.Contract = function(opt_data) {
2025 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
2026};
2027goog.inherits(proto.protocol.Transaction.Contract, jspb.Message);
2028if (goog.DEBUG && !COMPILED) {
2029 proto.protocol.Transaction.Contract.displayName = 'proto.protocol.Transaction.Contract';
2030}
2031
2032
2033if (jspb.Message.GENERATE_TO_OBJECT) {
2034/**
2035 * Creates an object representation of this proto suitable for use in Soy templates.
2036 * Field names that are reserved in JavaScript and will be renamed to pb_name.
2037 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2038 * For the list of reserved names please see:
2039 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
2040 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
2041 * for transitional soy proto support: http://goto/soy-param-migration
2042 * @return {!Object}
2043 */
2044proto.protocol.Transaction.Contract.prototype.toObject = function(opt_includeInstance) {
2045 return proto.protocol.Transaction.Contract.toObject(opt_includeInstance, this);
2046};
2047
2048
2049/**
2050 * Static version of the {@see toObject} method.
2051 * @param {boolean|undefined} includeInstance Whether to include the JSPB
2052 * instance for transitional soy proto support:
2053 * http://goto/soy-param-migration
2054 * @param {!proto.protocol.Transaction.Contract} msg The msg instance to transform.
2055 * @return {!Object}
2056 * @suppress {unusedLocalVariables} f is only used for nested messages
2057 */
2058proto.protocol.Transaction.Contract.toObject = function(includeInstance, msg) {
2059 var f, obj = {
2060 type: jspb.Message.getFieldWithDefault(msg, 1, 0),
2061 parameter: (f = msg.getParameter()) && google_protobuf_any_pb.Any.toObject(includeInstance, f)
2062 };
2063
2064 if (includeInstance) {
2065 obj.$jspbMessageInstance = msg;
2066 }
2067 return obj;
2068};
2069}
2070
2071
2072/**
2073 * Deserializes binary data (in protobuf wire format).
2074 * @param {jspb.ByteSource} bytes The bytes to deserialize.
2075 * @return {!proto.protocol.Transaction.Contract}
2076 */
2077proto.protocol.Transaction.Contract.deserializeBinary = function(bytes) {
2078 var reader = new jspb.BinaryReader(bytes);
2079 var msg = new proto.protocol.Transaction.Contract;
2080 return proto.protocol.Transaction.Contract.deserializeBinaryFromReader(msg, reader);
2081};
2082
2083
2084/**
2085 * Deserializes binary data (in protobuf wire format) from the
2086 * given reader into the given message object.
2087 * @param {!proto.protocol.Transaction.Contract} msg The message object to deserialize into.
2088 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2089 * @return {!proto.protocol.Transaction.Contract}
2090 */
2091proto.protocol.Transaction.Contract.deserializeBinaryFromReader = function(msg, reader) {
2092 while (reader.nextField()) {
2093 if (reader.isEndGroup()) {
2094 break;
2095 }
2096 var field = reader.getFieldNumber();
2097 switch (field) {
2098 case 1:
2099 var value = /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (reader.readEnum());
2100 msg.setType(value);
2101 break;
2102 case 2:
2103 var value = new google_protobuf_any_pb.Any;
2104 reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
2105 msg.setParameter(value);
2106 break;
2107 default:
2108 reader.skipField();
2109 break;
2110 }
2111 }
2112 return msg;
2113};
2114
2115
2116/**
2117 * Serializes the message to binary data (in protobuf wire format).
2118 * @return {!Uint8Array}
2119 */
2120proto.protocol.Transaction.Contract.prototype.serializeBinary = function() {
2121 var writer = new jspb.BinaryWriter();
2122 proto.protocol.Transaction.Contract.serializeBinaryToWriter(this, writer);
2123 return writer.getResultBuffer();
2124};
2125
2126
2127/**
2128 * Serializes the given message to binary data (in protobuf wire
2129 * format), writing to the given BinaryWriter.
2130 * @param {!proto.protocol.Transaction.Contract} message
2131 * @param {!jspb.BinaryWriter} writer
2132 * @suppress {unusedLocalVariables} f is only used for nested messages
2133 */
2134proto.protocol.Transaction.Contract.serializeBinaryToWriter = function(message, writer) {
2135 var f = undefined;
2136 f = message.getType();
2137 if (f !== 0.0) {
2138 writer.writeEnum(
2139 1,
2140 f
2141 );
2142 }
2143 f = message.getParameter();
2144 if (f != null) {
2145 writer.writeMessage(
2146 2,
2147 f,
2148 google_protobuf_any_pb.Any.serializeBinaryToWriter
2149 );
2150 }
2151};
2152
2153
2154/**
2155 * @enum {number}
2156 */
2157proto.protocol.Transaction.Contract.ContractType = {
2158 ACCOUNTCREATECONTRACT: 0,
2159 TRANSFERCONTRACT: 1,
2160 TRANSFERASSETCONTRACT: 2,
2161 VOTEASSETCONTRACT: 3,
2162 VOTEWITNESSCONTRACT: 4,
2163 WITNESSCREATECONTRACT: 5,
2164 ASSETISSUECONTRACT: 6,
2165 DEPLOYCONTRACT: 7,
2166 WITNESSUPDATECONTRACT: 8,
2167 PARTICIPATEASSETISSUECONTRACT: 9
2168};
2169
2170/**
2171 * optional ContractType type = 1;
2172 * @return {!proto.protocol.Transaction.Contract.ContractType}
2173 */
2174proto.protocol.Transaction.Contract.prototype.getType = function() {
2175 return /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2176};
2177
2178
2179/** @param {!proto.protocol.Transaction.Contract.ContractType} value */
2180proto.protocol.Transaction.Contract.prototype.setType = function(value) {
2181 jspb.Message.setProto3EnumField(this, 1, value);
2182};
2183
2184
2185/**
2186 * optional google.protobuf.Any parameter = 2;
2187 * @return {?proto.google.protobuf.Any}
2188 */
2189proto.protocol.Transaction.Contract.prototype.getParameter = function() {
2190 return /** @type{?proto.google.protobuf.Any} */ (
2191 jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2));
2192};
2193
2194
2195/** @param {?proto.google.protobuf.Any|undefined} value */
2196proto.protocol.Transaction.Contract.prototype.setParameter = function(value) {
2197 jspb.Message.setWrapperField(this, 2, value);
2198};
2199
2200
2201proto.protocol.Transaction.Contract.prototype.clearParameter = function() {
2202 this.setParameter(undefined);
2203};
2204
2205
2206/**
2207 * Returns whether this field is set.
2208 * @return {!boolean}
2209 */
2210proto.protocol.Transaction.Contract.prototype.hasParameter = function() {
2211 return jspb.Message.getField(this, 2) != null;
2212};
2213
2214
2215
2216/**
2217 * Generated by JsPbCodeGenerator.
2218 * @param {Array=} opt_data Optional initial data array, typically from a
2219 * server response, or constructed directly in Javascript. The array is used
2220 * in place and becomes part of the constructed object. It is not cloned.
2221 * If no data is provided, the constructed object will be empty, but still
2222 * valid.
2223 * @extends {jspb.Message}
2224 * @constructor
2225 */
2226proto.protocol.Transaction.Result = function(opt_data) {
2227 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
2228};
2229goog.inherits(proto.protocol.Transaction.Result, jspb.Message);
2230if (goog.DEBUG && !COMPILED) {
2231 proto.protocol.Transaction.Result.displayName = 'proto.protocol.Transaction.Result';
2232}
2233
2234
2235if (jspb.Message.GENERATE_TO_OBJECT) {
2236/**
2237 * Creates an object representation of this proto suitable for use in Soy templates.
2238 * Field names that are reserved in JavaScript and will be renamed to pb_name.
2239 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2240 * For the list of reserved names please see:
2241 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
2242 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
2243 * for transitional soy proto support: http://goto/soy-param-migration
2244 * @return {!Object}
2245 */
2246proto.protocol.Transaction.Result.prototype.toObject = function(opt_includeInstance) {
2247 return proto.protocol.Transaction.Result.toObject(opt_includeInstance, this);
2248};
2249
2250
2251/**
2252 * Static version of the {@see toObject} method.
2253 * @param {boolean|undefined} includeInstance Whether to include the JSPB
2254 * instance for transitional soy proto support:
2255 * http://goto/soy-param-migration
2256 * @param {!proto.protocol.Transaction.Result} msg The msg instance to transform.
2257 * @return {!Object}
2258 * @suppress {unusedLocalVariables} f is only used for nested messages
2259 */
2260proto.protocol.Transaction.Result.toObject = function(includeInstance, msg) {
2261 var f, obj = {
2262 fee: jspb.Message.getFieldWithDefault(msg, 1, 0),
2263 ret: jspb.Message.getFieldWithDefault(msg, 2, 0)
2264 };
2265
2266 if (includeInstance) {
2267 obj.$jspbMessageInstance = msg;
2268 }
2269 return obj;
2270};
2271}
2272
2273
2274/**
2275 * Deserializes binary data (in protobuf wire format).
2276 * @param {jspb.ByteSource} bytes The bytes to deserialize.
2277 * @return {!proto.protocol.Transaction.Result}
2278 */
2279proto.protocol.Transaction.Result.deserializeBinary = function(bytes) {
2280 var reader = new jspb.BinaryReader(bytes);
2281 var msg = new proto.protocol.Transaction.Result;
2282 return proto.protocol.Transaction.Result.deserializeBinaryFromReader(msg, reader);
2283};
2284
2285
2286/**
2287 * Deserializes binary data (in protobuf wire format) from the
2288 * given reader into the given message object.
2289 * @param {!proto.protocol.Transaction.Result} msg The message object to deserialize into.
2290 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2291 * @return {!proto.protocol.Transaction.Result}
2292 */
2293proto.protocol.Transaction.Result.deserializeBinaryFromReader = function(msg, reader) {
2294 while (reader.nextField()) {
2295 if (reader.isEndGroup()) {
2296 break;
2297 }
2298 var field = reader.getFieldNumber();
2299 switch (field) {
2300 case 1:
2301 var value = /** @type {number} */ (reader.readInt64());
2302 msg.setFee(value);
2303 break;
2304 case 2:
2305 var value = /** @type {!proto.protocol.Transaction.Result.code} */ (reader.readEnum());
2306 msg.setRet(value);
2307 break;
2308 default:
2309 reader.skipField();
2310 break;
2311 }
2312 }
2313 return msg;
2314};
2315
2316
2317/**
2318 * Serializes the message to binary data (in protobuf wire format).
2319 * @return {!Uint8Array}
2320 */
2321proto.protocol.Transaction.Result.prototype.serializeBinary = function() {
2322 var writer = new jspb.BinaryWriter();
2323 proto.protocol.Transaction.Result.serializeBinaryToWriter(this, writer);
2324 return writer.getResultBuffer();
2325};
2326
2327
2328/**
2329 * Serializes the given message to binary data (in protobuf wire
2330 * format), writing to the given BinaryWriter.
2331 * @param {!proto.protocol.Transaction.Result} message
2332 * @param {!jspb.BinaryWriter} writer
2333 * @suppress {unusedLocalVariables} f is only used for nested messages
2334 */
2335proto.protocol.Transaction.Result.serializeBinaryToWriter = function(message, writer) {
2336 var f = undefined;
2337 f = message.getFee();
2338 if (f !== 0) {
2339 writer.writeInt64(
2340 1,
2341 f
2342 );
2343 }
2344 f = message.getRet();
2345 if (f !== 0.0) {
2346 writer.writeEnum(
2347 2,
2348 f
2349 );
2350 }
2351};
2352
2353
2354/**
2355 * @enum {number}
2356 */
2357proto.protocol.Transaction.Result.code = {
2358 SUCESS: 0,
2359 FAILED: 1
2360};
2361
2362/**
2363 * optional int64 fee = 1;
2364 * @return {number}
2365 */
2366proto.protocol.Transaction.Result.prototype.getFee = function() {
2367 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2368};
2369
2370
2371/** @param {number} value */
2372proto.protocol.Transaction.Result.prototype.setFee = function(value) {
2373 jspb.Message.setProto3IntField(this, 1, value);
2374};
2375
2376
2377/**
2378 * optional code ret = 2;
2379 * @return {!proto.protocol.Transaction.Result.code}
2380 */
2381proto.protocol.Transaction.Result.prototype.getRet = function() {
2382 return /** @type {!proto.protocol.Transaction.Result.code} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
2383};
2384
2385
2386/** @param {!proto.protocol.Transaction.Result.code} value */
2387proto.protocol.Transaction.Result.prototype.setRet = function(value) {
2388 jspb.Message.setProto3EnumField(this, 2, value);
2389};
2390
2391
2392
2393/**
2394 * Generated by JsPbCodeGenerator.
2395 * @param {Array=} opt_data Optional initial data array, typically from a
2396 * server response, or constructed directly in Javascript. The array is used
2397 * in place and becomes part of the constructed object. It is not cloned.
2398 * If no data is provided, the constructed object will be empty, but still
2399 * valid.
2400 * @extends {jspb.Message}
2401 * @constructor
2402 */
2403proto.protocol.Transaction.raw = function(opt_data) {
2404 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.raw.repeatedFields_, null);
2405};
2406goog.inherits(proto.protocol.Transaction.raw, jspb.Message);
2407if (goog.DEBUG && !COMPILED) {
2408 proto.protocol.Transaction.raw.displayName = 'proto.protocol.Transaction.raw';
2409}
2410/**
2411 * List of repeated fields within this message type.
2412 * @private {!Array<number>}
2413 * @const
2414 */
2415proto.protocol.Transaction.raw.repeatedFields_ = [5,7,11];
2416
2417
2418
2419if (jspb.Message.GENERATE_TO_OBJECT) {
2420/**
2421 * Creates an object representation of this proto suitable for use in Soy templates.
2422 * Field names that are reserved in JavaScript and will be renamed to pb_name.
2423 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2424 * For the list of reserved names please see:
2425 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
2426 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
2427 * for transitional soy proto support: http://goto/soy-param-migration
2428 * @return {!Object}
2429 */
2430proto.protocol.Transaction.raw.prototype.toObject = function(opt_includeInstance) {
2431 return proto.protocol.Transaction.raw.toObject(opt_includeInstance, this);
2432};
2433
2434
2435/**
2436 * Static version of the {@see toObject} method.
2437 * @param {boolean|undefined} includeInstance Whether to include the JSPB
2438 * instance for transitional soy proto support:
2439 * http://goto/soy-param-migration
2440 * @param {!proto.protocol.Transaction.raw} msg The msg instance to transform.
2441 * @return {!Object}
2442 * @suppress {unusedLocalVariables} f is only used for nested messages
2443 */
2444proto.protocol.Transaction.raw.toObject = function(includeInstance, msg) {
2445 var f, obj = {
2446 type: jspb.Message.getFieldWithDefault(msg, 2, 0),
2447 vinList: jspb.Message.toObjectList(msg.getVinList(),
2448 proto.protocol.TXInput.toObject, includeInstance),
2449 voutList: jspb.Message.toObjectList(msg.getVoutList(),
2450 proto.protocol.TXOutput.toObject, includeInstance),
2451 expiration: jspb.Message.getFieldWithDefault(msg, 8, 0),
2452 data: msg.getData_asB64(),
2453 contractList: jspb.Message.toObjectList(msg.getContractList(),
2454 proto.protocol.Transaction.Contract.toObject, includeInstance),
2455 scripts: msg.getScripts_asB64(),
2456 timestamp: jspb.Message.getFieldWithDefault(msg, 17, 0)
2457 };
2458
2459 if (includeInstance) {
2460 obj.$jspbMessageInstance = msg;
2461 }
2462 return obj;
2463};
2464}
2465
2466
2467/**
2468 * Deserializes binary data (in protobuf wire format).
2469 * @param {jspb.ByteSource} bytes The bytes to deserialize.
2470 * @return {!proto.protocol.Transaction.raw}
2471 */
2472proto.protocol.Transaction.raw.deserializeBinary = function(bytes) {
2473 var reader = new jspb.BinaryReader(bytes);
2474 var msg = new proto.protocol.Transaction.raw;
2475 return proto.protocol.Transaction.raw.deserializeBinaryFromReader(msg, reader);
2476};
2477
2478
2479/**
2480 * Deserializes binary data (in protobuf wire format) from the
2481 * given reader into the given message object.
2482 * @param {!proto.protocol.Transaction.raw} msg The message object to deserialize into.
2483 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2484 * @return {!proto.protocol.Transaction.raw}
2485 */
2486proto.protocol.Transaction.raw.deserializeBinaryFromReader = function(msg, reader) {
2487 while (reader.nextField()) {
2488 if (reader.isEndGroup()) {
2489 break;
2490 }
2491 var field = reader.getFieldNumber();
2492 switch (field) {
2493 case 2:
2494 var value = /** @type {!proto.protocol.Transaction.TransactionType} */ (reader.readEnum());
2495 msg.setType(value);
2496 break;
2497 case 5:
2498 var value = new proto.protocol.TXInput;
2499 reader.readMessage(value,proto.protocol.TXInput.deserializeBinaryFromReader);
2500 msg.addVin(value);
2501 break;
2502 case 7:
2503 var value = new proto.protocol.TXOutput;
2504 reader.readMessage(value,proto.protocol.TXOutput.deserializeBinaryFromReader);
2505 msg.addVout(value);
2506 break;
2507 case 8:
2508 var value = /** @type {number} */ (reader.readInt64());
2509 msg.setExpiration(value);
2510 break;
2511 case 10:
2512 var value = /** @type {!Uint8Array} */ (reader.readBytes());
2513 msg.setData(value);
2514 break;
2515 case 11:
2516 var value = new proto.protocol.Transaction.Contract;
2517 reader.readMessage(value,proto.protocol.Transaction.Contract.deserializeBinaryFromReader);
2518 msg.addContract(value);
2519 break;
2520 case 16:
2521 var value = /** @type {!Uint8Array} */ (reader.readBytes());
2522 msg.setScripts(value);
2523 break;
2524 case 17:
2525 var value = /** @type {number} */ (reader.readInt64());
2526 msg.setTimestamp(value);
2527 break;
2528 default:
2529 reader.skipField();
2530 break;
2531 }
2532 }
2533 return msg;
2534};
2535
2536
2537/**
2538 * Serializes the message to binary data (in protobuf wire format).
2539 * @return {!Uint8Array}
2540 */
2541proto.protocol.Transaction.raw.prototype.serializeBinary = function() {
2542 var writer = new jspb.BinaryWriter();
2543 proto.protocol.Transaction.raw.serializeBinaryToWriter(this, writer);
2544 return writer.getResultBuffer();
2545};
2546
2547
2548/**
2549 * Serializes the given message to binary data (in protobuf wire
2550 * format), writing to the given BinaryWriter.
2551 * @param {!proto.protocol.Transaction.raw} message
2552 * @param {!jspb.BinaryWriter} writer
2553 * @suppress {unusedLocalVariables} f is only used for nested messages
2554 */
2555proto.protocol.Transaction.raw.serializeBinaryToWriter = function(message, writer) {
2556 var f = undefined;
2557 f = message.getType();
2558 if (f !== 0.0) {
2559 writer.writeEnum(
2560 2,
2561 f
2562 );
2563 }
2564 f = message.getVinList();
2565 if (f.length > 0) {
2566 writer.writeRepeatedMessage(
2567 5,
2568 f,
2569 proto.protocol.TXInput.serializeBinaryToWriter
2570 );
2571 }
2572 f = message.getVoutList();
2573 if (f.length > 0) {
2574 writer.writeRepeatedMessage(
2575 7,
2576 f,
2577 proto.protocol.TXOutput.serializeBinaryToWriter
2578 );
2579 }
2580 f = message.getExpiration();
2581 if (f !== 0) {
2582 writer.writeInt64(
2583 8,
2584 f
2585 );
2586 }
2587 f = message.getData_asU8();
2588 if (f.length > 0) {
2589 writer.writeBytes(
2590 10,
2591 f
2592 );
2593 }
2594 f = message.getContractList();
2595 if (f.length > 0) {
2596 writer.writeRepeatedMessage(
2597 11,
2598 f,
2599 proto.protocol.Transaction.Contract.serializeBinaryToWriter
2600 );
2601 }
2602 f = message.getScripts_asU8();
2603 if (f.length > 0) {
2604 writer.writeBytes(
2605 16,
2606 f
2607 );
2608 }
2609 f = message.getTimestamp();
2610 if (f !== 0) {
2611 writer.writeInt64(
2612 17,
2613 f
2614 );
2615 }
2616};
2617
2618
2619/**
2620 * optional TransactionType type = 2;
2621 * @return {!proto.protocol.Transaction.TransactionType}
2622 */
2623proto.protocol.Transaction.raw.prototype.getType = function() {
2624 return /** @type {!proto.protocol.Transaction.TransactionType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
2625};
2626
2627
2628/** @param {!proto.protocol.Transaction.TransactionType} value */
2629proto.protocol.Transaction.raw.prototype.setType = function(value) {
2630 jspb.Message.setProto3EnumField(this, 2, value);
2631};
2632
2633
2634/**
2635 * repeated TXInput vin = 5;
2636 * @return {!Array.<!proto.protocol.TXInput>}
2637 */
2638proto.protocol.Transaction.raw.prototype.getVinList = function() {
2639 return /** @type{!Array.<!proto.protocol.TXInput>} */ (
2640 jspb.Message.getRepeatedWrapperField(this, proto.protocol.TXInput, 5));
2641};
2642
2643
2644/** @param {!Array.<!proto.protocol.TXInput>} value */
2645proto.protocol.Transaction.raw.prototype.setVinList = function(value) {
2646 jspb.Message.setRepeatedWrapperField(this, 5, value);
2647};
2648
2649
2650/**
2651 * @param {!proto.protocol.TXInput=} opt_value
2652 * @param {number=} opt_index
2653 * @return {!proto.protocol.TXInput}
2654 */
2655proto.protocol.Transaction.raw.prototype.addVin = function(opt_value, opt_index) {
2656 return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.TXInput, opt_index);
2657};
2658
2659
2660proto.protocol.Transaction.raw.prototype.clearVinList = function() {
2661 this.setVinList([]);
2662};
2663
2664
2665/**
2666 * repeated TXOutput vout = 7;
2667 * @return {!Array.<!proto.protocol.TXOutput>}
2668 */
2669proto.protocol.Transaction.raw.prototype.getVoutList = function() {
2670 return /** @type{!Array.<!proto.protocol.TXOutput>} */ (
2671 jspb.Message.getRepeatedWrapperField(this, proto.protocol.TXOutput, 7));
2672};
2673
2674
2675/** @param {!Array.<!proto.protocol.TXOutput>} value */
2676proto.protocol.Transaction.raw.prototype.setVoutList = function(value) {
2677 jspb.Message.setRepeatedWrapperField(this, 7, value);
2678};
2679
2680
2681/**
2682 * @param {!proto.protocol.TXOutput=} opt_value
2683 * @param {number=} opt_index
2684 * @return {!proto.protocol.TXOutput}
2685 */
2686proto.protocol.Transaction.raw.prototype.addVout = function(opt_value, opt_index) {
2687 return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.protocol.TXOutput, opt_index);
2688};
2689
2690
2691proto.protocol.Transaction.raw.prototype.clearVoutList = function() {
2692 this.setVoutList([]);
2693};
2694
2695
2696/**
2697 * optional int64 expiration = 8;
2698 * @return {number}
2699 */
2700proto.protocol.Transaction.raw.prototype.getExpiration = function() {
2701 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
2702};
2703
2704
2705/** @param {number} value */
2706proto.protocol.Transaction.raw.prototype.setExpiration = function(value) {
2707 jspb.Message.setProto3IntField(this, 8, value);
2708};
2709
2710
2711/**
2712 * optional bytes data = 10;
2713 * @return {!(string|Uint8Array)}
2714 */
2715proto.protocol.Transaction.raw.prototype.getData = function() {
2716 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
2717};
2718
2719
2720/**
2721 * optional bytes data = 10;
2722 * This is a type-conversion wrapper around `getData()`
2723 * @return {string}
2724 */
2725proto.protocol.Transaction.raw.prototype.getData_asB64 = function() {
2726 return /** @type {string} */ (jspb.Message.bytesAsB64(
2727 this.getData()));
2728};
2729
2730
2731/**
2732 * optional bytes data = 10;
2733 * Note that Uint8Array is not supported on all browsers.
2734 * @see http://caniuse.com/Uint8Array
2735 * This is a type-conversion wrapper around `getData()`
2736 * @return {!Uint8Array}
2737 */
2738proto.protocol.Transaction.raw.prototype.getData_asU8 = function() {
2739 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
2740 this.getData()));
2741};
2742
2743
2744/** @param {!(string|Uint8Array)} value */
2745proto.protocol.Transaction.raw.prototype.setData = function(value) {
2746 jspb.Message.setProto3BytesField(this, 10, value);
2747};
2748
2749
2750/**
2751 * repeated Contract contract = 11;
2752 * @return {!Array.<!proto.protocol.Transaction.Contract>}
2753 */
2754proto.protocol.Transaction.raw.prototype.getContractList = function() {
2755 return /** @type{!Array.<!proto.protocol.Transaction.Contract>} */ (
2756 jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Contract, 11));
2757};
2758
2759
2760/** @param {!Array.<!proto.protocol.Transaction.Contract>} value */
2761proto.protocol.Transaction.raw.prototype.setContractList = function(value) {
2762 jspb.Message.setRepeatedWrapperField(this, 11, value);
2763};
2764
2765
2766/**
2767 * @param {!proto.protocol.Transaction.Contract=} opt_value
2768 * @param {number=} opt_index
2769 * @return {!proto.protocol.Transaction.Contract}
2770 */
2771proto.protocol.Transaction.raw.prototype.addContract = function(opt_value, opt_index) {
2772 return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.protocol.Transaction.Contract, opt_index);
2773};
2774
2775
2776proto.protocol.Transaction.raw.prototype.clearContractList = function() {
2777 this.setContractList([]);
2778};
2779
2780
2781/**
2782 * optional bytes scripts = 16;
2783 * @return {!(string|Uint8Array)}
2784 */
2785proto.protocol.Transaction.raw.prototype.getScripts = function() {
2786 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 16, ""));
2787};
2788
2789
2790/**
2791 * optional bytes scripts = 16;
2792 * This is a type-conversion wrapper around `getScripts()`
2793 * @return {string}
2794 */
2795proto.protocol.Transaction.raw.prototype.getScripts_asB64 = function() {
2796 return /** @type {string} */ (jspb.Message.bytesAsB64(
2797 this.getScripts()));
2798};
2799
2800
2801/**
2802 * optional bytes scripts = 16;
2803 * Note that Uint8Array is not supported on all browsers.
2804 * @see http://caniuse.com/Uint8Array
2805 * This is a type-conversion wrapper around `getScripts()`
2806 * @return {!Uint8Array}
2807 */
2808proto.protocol.Transaction.raw.prototype.getScripts_asU8 = function() {
2809 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
2810 this.getScripts()));
2811};
2812
2813
2814/** @param {!(string|Uint8Array)} value */
2815proto.protocol.Transaction.raw.prototype.setScripts = function(value) {
2816 jspb.Message.setProto3BytesField(this, 16, value);
2817};
2818
2819
2820/**
2821 * optional int64 timestamp = 17;
2822 * @return {number}
2823 */
2824proto.protocol.Transaction.raw.prototype.getTimestamp = function() {
2825 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 17, 0));
2826};
2827
2828
2829/** @param {number} value */
2830proto.protocol.Transaction.raw.prototype.setTimestamp = function(value) {
2831 jspb.Message.setProto3IntField(this, 17, value);
2832};
2833
2834
2835/**
2836 * optional raw raw_data = 1;
2837 * @return {?proto.protocol.Transaction.raw}
2838 */
2839proto.protocol.Transaction.prototype.getRawData = function() {
2840 return /** @type{?proto.protocol.Transaction.raw} */ (
2841 jspb.Message.getWrapperField(this, proto.protocol.Transaction.raw, 1));
2842};
2843
2844
2845/** @param {?proto.protocol.Transaction.raw|undefined} value */
2846proto.protocol.Transaction.prototype.setRawData = function(value) {
2847 jspb.Message.setWrapperField(this, 1, value);
2848};
2849
2850
2851proto.protocol.Transaction.prototype.clearRawData = function() {
2852 this.setRawData(undefined);
2853};
2854
2855
2856/**
2857 * Returns whether this field is set.
2858 * @return {!boolean}
2859 */
2860proto.protocol.Transaction.prototype.hasRawData = function() {
2861 return jspb.Message.getField(this, 1) != null;
2862};
2863
2864
2865/**
2866 * repeated bytes signature = 2;
2867 * @return {!(Array<!Uint8Array>|Array<string>)}
2868 */
2869proto.protocol.Transaction.prototype.getSignatureList = function() {
2870 return /** @type {!(Array<!Uint8Array>|Array<string>)} */ (jspb.Message.getRepeatedField(this, 2));
2871};
2872
2873
2874/**
2875 * repeated bytes signature = 2;
2876 * This is a type-conversion wrapper around `getSignatureList()`
2877 * @return {!Array.<string>}
2878 */
2879proto.protocol.Transaction.prototype.getSignatureList_asB64 = function() {
2880 return /** @type {!Array.<string>} */ (jspb.Message.bytesListAsB64(
2881 this.getSignatureList()));
2882};
2883
2884
2885/**
2886 * repeated bytes signature = 2;
2887 * Note that Uint8Array is not supported on all browsers.
2888 * @see http://caniuse.com/Uint8Array
2889 * This is a type-conversion wrapper around `getSignatureList()`
2890 * @return {!Array.<!Uint8Array>}
2891 */
2892proto.protocol.Transaction.prototype.getSignatureList_asU8 = function() {
2893 return /** @type {!Array.<!Uint8Array>} */ (jspb.Message.bytesListAsU8(
2894 this.getSignatureList()));
2895};
2896
2897
2898/** @param {!(Array<!Uint8Array>|Array<string>)} value */
2899proto.protocol.Transaction.prototype.setSignatureList = function(value) {
2900 jspb.Message.setField(this, 2, value || []);
2901};
2902
2903
2904/**
2905 * @param {!(string|Uint8Array)} value
2906 * @param {number=} opt_index
2907 */
2908proto.protocol.Transaction.prototype.addSignature = function(value, opt_index) {
2909 jspb.Message.addToRepeatedField(this, 2, value, opt_index);
2910};
2911
2912
2913proto.protocol.Transaction.prototype.clearSignatureList = function() {
2914 this.setSignatureList([]);
2915};
2916
2917
2918/**
2919 * repeated Result ret = 5;
2920 * @return {!Array.<!proto.protocol.Transaction.Result>}
2921 */
2922proto.protocol.Transaction.prototype.getRetList = function() {
2923 return /** @type{!Array.<!proto.protocol.Transaction.Result>} */ (
2924 jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Result, 5));
2925};
2926
2927
2928/** @param {!Array.<!proto.protocol.Transaction.Result>} value */
2929proto.protocol.Transaction.prototype.setRetList = function(value) {
2930 jspb.Message.setRepeatedWrapperField(this, 5, value);
2931};
2932
2933
2934/**
2935 * @param {!proto.protocol.Transaction.Result=} opt_value
2936 * @param {number=} opt_index
2937 * @return {!proto.protocol.Transaction.Result}
2938 */
2939proto.protocol.Transaction.prototype.addRet = function(opt_value, opt_index) {
2940 return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Transaction.Result, opt_index);
2941};
2942
2943
2944proto.protocol.Transaction.prototype.clearRetList = function() {
2945 this.setRetList([]);
2946};
2947
2948
2949
2950/**
2951 * Generated by JsPbCodeGenerator.
2952 * @param {Array=} opt_data Optional initial data array, typically from a
2953 * server response, or constructed directly in Javascript. The array is used
2954 * in place and becomes part of the constructed object. It is not cloned.
2955 * If no data is provided, the constructed object will be empty, but still
2956 * valid.
2957 * @extends {jspb.Message}
2958 * @constructor
2959 */
2960proto.protocol.BlockHeader = function(opt_data) {
2961 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
2962};
2963goog.inherits(proto.protocol.BlockHeader, jspb.Message);
2964if (goog.DEBUG && !COMPILED) {
2965 proto.protocol.BlockHeader.displayName = 'proto.protocol.BlockHeader';
2966}
2967
2968
2969if (jspb.Message.GENERATE_TO_OBJECT) {
2970/**
2971 * Creates an object representation of this proto suitable for use in Soy templates.
2972 * Field names that are reserved in JavaScript and will be renamed to pb_name.
2973 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2974 * For the list of reserved names please see:
2975 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
2976 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
2977 * for transitional soy proto support: http://goto/soy-param-migration
2978 * @return {!Object}
2979 */
2980proto.protocol.BlockHeader.prototype.toObject = function(opt_includeInstance) {
2981 return proto.protocol.BlockHeader.toObject(opt_includeInstance, this);
2982};
2983
2984
2985/**
2986 * Static version of the {@see toObject} method.
2987 * @param {boolean|undefined} includeInstance Whether to include the JSPB
2988 * instance for transitional soy proto support:
2989 * http://goto/soy-param-migration
2990 * @param {!proto.protocol.BlockHeader} msg The msg instance to transform.
2991 * @return {!Object}
2992 * @suppress {unusedLocalVariables} f is only used for nested messages
2993 */
2994proto.protocol.BlockHeader.toObject = function(includeInstance, msg) {
2995 var f, obj = {
2996 rawData: (f = msg.getRawData()) && proto.protocol.BlockHeader.raw.toObject(includeInstance, f),
2997 witnessSignature: msg.getWitnessSignature_asB64()
2998 };
2999
3000 if (includeInstance) {
3001 obj.$jspbMessageInstance = msg;
3002 }
3003 return obj;
3004};
3005}
3006
3007
3008/**
3009 * Deserializes binary data (in protobuf wire format).
3010 * @param {jspb.ByteSource} bytes The bytes to deserialize.
3011 * @return {!proto.protocol.BlockHeader}
3012 */
3013proto.protocol.BlockHeader.deserializeBinary = function(bytes) {
3014 var reader = new jspb.BinaryReader(bytes);
3015 var msg = new proto.protocol.BlockHeader;
3016 return proto.protocol.BlockHeader.deserializeBinaryFromReader(msg, reader);
3017};
3018
3019
3020/**
3021 * Deserializes binary data (in protobuf wire format) from the
3022 * given reader into the given message object.
3023 * @param {!proto.protocol.BlockHeader} msg The message object to deserialize into.
3024 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3025 * @return {!proto.protocol.BlockHeader}
3026 */
3027proto.protocol.BlockHeader.deserializeBinaryFromReader = function(msg, reader) {
3028 while (reader.nextField()) {
3029 if (reader.isEndGroup()) {
3030 break;
3031 }
3032 var field = reader.getFieldNumber();
3033 switch (field) {
3034 case 1:
3035 var value = new proto.protocol.BlockHeader.raw;
3036 reader.readMessage(value,proto.protocol.BlockHeader.raw.deserializeBinaryFromReader);
3037 msg.setRawData(value);
3038 break;
3039 case 2:
3040 var value = /** @type {!Uint8Array} */ (reader.readBytes());
3041 msg.setWitnessSignature(value);
3042 break;
3043 default:
3044 reader.skipField();
3045 break;
3046 }
3047 }
3048 return msg;
3049};
3050
3051
3052/**
3053 * Serializes the message to binary data (in protobuf wire format).
3054 * @return {!Uint8Array}
3055 */
3056proto.protocol.BlockHeader.prototype.serializeBinary = function() {
3057 var writer = new jspb.BinaryWriter();
3058 proto.protocol.BlockHeader.serializeBinaryToWriter(this, writer);
3059 return writer.getResultBuffer();
3060};
3061
3062
3063/**
3064 * Serializes the given message to binary data (in protobuf wire
3065 * format), writing to the given BinaryWriter.
3066 * @param {!proto.protocol.BlockHeader} message
3067 * @param {!jspb.BinaryWriter} writer
3068 * @suppress {unusedLocalVariables} f is only used for nested messages
3069 */
3070proto.protocol.BlockHeader.serializeBinaryToWriter = function(message, writer) {
3071 var f = undefined;
3072 f = message.getRawData();
3073 if (f != null) {
3074 writer.writeMessage(
3075 1,
3076 f,
3077 proto.protocol.BlockHeader.raw.serializeBinaryToWriter
3078 );
3079 }
3080 f = message.getWitnessSignature_asU8();
3081 if (f.length > 0) {
3082 writer.writeBytes(
3083 2,
3084 f
3085 );
3086 }
3087};
3088
3089
3090
3091/**
3092 * Generated by JsPbCodeGenerator.
3093 * @param {Array=} opt_data Optional initial data array, typically from a
3094 * server response, or constructed directly in Javascript. The array is used
3095 * in place and becomes part of the constructed object. It is not cloned.
3096 * If no data is provided, the constructed object will be empty, but still
3097 * valid.
3098 * @extends {jspb.Message}
3099 * @constructor
3100 */
3101proto.protocol.BlockHeader.raw = function(opt_data) {
3102 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
3103};
3104goog.inherits(proto.protocol.BlockHeader.raw, jspb.Message);
3105if (goog.DEBUG && !COMPILED) {
3106 proto.protocol.BlockHeader.raw.displayName = 'proto.protocol.BlockHeader.raw';
3107}
3108
3109
3110if (jspb.Message.GENERATE_TO_OBJECT) {
3111/**
3112 * Creates an object representation of this proto suitable for use in Soy templates.
3113 * Field names that are reserved in JavaScript and will be renamed to pb_name.
3114 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3115 * For the list of reserved names please see:
3116 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
3117 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
3118 * for transitional soy proto support: http://goto/soy-param-migration
3119 * @return {!Object}
3120 */
3121proto.protocol.BlockHeader.raw.prototype.toObject = function(opt_includeInstance) {
3122 return proto.protocol.BlockHeader.raw.toObject(opt_includeInstance, this);
3123};
3124
3125
3126/**
3127 * Static version of the {@see toObject} method.
3128 * @param {boolean|undefined} includeInstance Whether to include the JSPB
3129 * instance for transitional soy proto support:
3130 * http://goto/soy-param-migration
3131 * @param {!proto.protocol.BlockHeader.raw} msg The msg instance to transform.
3132 * @return {!Object}
3133 * @suppress {unusedLocalVariables} f is only used for nested messages
3134 */
3135proto.protocol.BlockHeader.raw.toObject = function(includeInstance, msg) {
3136 var f, obj = {
3137 timestamp: jspb.Message.getFieldWithDefault(msg, 1, 0),
3138 txtrieroot: msg.getTxtrieroot_asB64(),
3139 parenthash: msg.getParenthash_asB64(),
3140 number: jspb.Message.getFieldWithDefault(msg, 7, 0),
3141 witnessId: jspb.Message.getFieldWithDefault(msg, 8, 0),
3142 witnessAddress: msg.getWitnessAddress_asB64()
3143 };
3144
3145 if (includeInstance) {
3146 obj.$jspbMessageInstance = msg;
3147 }
3148 return obj;
3149};
3150}
3151
3152
3153/**
3154 * Deserializes binary data (in protobuf wire format).
3155 * @param {jspb.ByteSource} bytes The bytes to deserialize.
3156 * @return {!proto.protocol.BlockHeader.raw}
3157 */
3158proto.protocol.BlockHeader.raw.deserializeBinary = function(bytes) {
3159 var reader = new jspb.BinaryReader(bytes);
3160 var msg = new proto.protocol.BlockHeader.raw;
3161 return proto.protocol.BlockHeader.raw.deserializeBinaryFromReader(msg, reader);
3162};
3163
3164
3165/**
3166 * Deserializes binary data (in protobuf wire format) from the
3167 * given reader into the given message object.
3168 * @param {!proto.protocol.BlockHeader.raw} msg The message object to deserialize into.
3169 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3170 * @return {!proto.protocol.BlockHeader.raw}
3171 */
3172proto.protocol.BlockHeader.raw.deserializeBinaryFromReader = function(msg, reader) {
3173 while (reader.nextField()) {
3174 if (reader.isEndGroup()) {
3175 break;
3176 }
3177 var field = reader.getFieldNumber();
3178 switch (field) {
3179 case 1:
3180 var value = /** @type {number} */ (reader.readInt64());
3181 msg.setTimestamp(value);
3182 break;
3183 case 2:
3184 var value = /** @type {!Uint8Array} */ (reader.readBytes());
3185 msg.setTxtrieroot(value);
3186 break;
3187 case 3:
3188 var value = /** @type {!Uint8Array} */ (reader.readBytes());
3189 msg.setParenthash(value);
3190 break;
3191 case 7:
3192 var value = /** @type {number} */ (reader.readInt64());
3193 msg.setNumber(value);
3194 break;
3195 case 8:
3196 var value = /** @type {number} */ (reader.readInt64());
3197 msg.setWitnessId(value);
3198 break;
3199 case 9:
3200 var value = /** @type {!Uint8Array} */ (reader.readBytes());
3201 msg.setWitnessAddress(value);
3202 break;
3203 default:
3204 reader.skipField();
3205 break;
3206 }
3207 }
3208 return msg;
3209};
3210
3211
3212/**
3213 * Serializes the message to binary data (in protobuf wire format).
3214 * @return {!Uint8Array}
3215 */
3216proto.protocol.BlockHeader.raw.prototype.serializeBinary = function() {
3217 var writer = new jspb.BinaryWriter();
3218 proto.protocol.BlockHeader.raw.serializeBinaryToWriter(this, writer);
3219 return writer.getResultBuffer();
3220};
3221
3222
3223/**
3224 * Serializes the given message to binary data (in protobuf wire
3225 * format), writing to the given BinaryWriter.
3226 * @param {!proto.protocol.BlockHeader.raw} message
3227 * @param {!jspb.BinaryWriter} writer
3228 * @suppress {unusedLocalVariables} f is only used for nested messages
3229 */
3230proto.protocol.BlockHeader.raw.serializeBinaryToWriter = function(message, writer) {
3231 var f = undefined;
3232 f = message.getTimestamp();
3233 if (f !== 0) {
3234 writer.writeInt64(
3235 1,
3236 f
3237 );
3238 }
3239 f = message.getTxtrieroot_asU8();
3240 if (f.length > 0) {
3241 writer.writeBytes(
3242 2,
3243 f
3244 );
3245 }
3246 f = message.getParenthash_asU8();
3247 if (f.length > 0) {
3248 writer.writeBytes(
3249 3,
3250 f
3251 );
3252 }
3253 f = message.getNumber();
3254 if (f !== 0) {
3255 writer.writeInt64(
3256 7,
3257 f
3258 );
3259 }
3260 f = message.getWitnessId();
3261 if (f !== 0) {
3262 writer.writeInt64(
3263 8,
3264 f
3265 );
3266 }
3267 f = message.getWitnessAddress_asU8();
3268 if (f.length > 0) {
3269 writer.writeBytes(
3270 9,
3271 f
3272 );
3273 }
3274};
3275
3276
3277/**
3278 * optional int64 timestamp = 1;
3279 * @return {number}
3280 */
3281proto.protocol.BlockHeader.raw.prototype.getTimestamp = function() {
3282 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
3283};
3284
3285
3286/** @param {number} value */
3287proto.protocol.BlockHeader.raw.prototype.setTimestamp = function(value) {
3288 jspb.Message.setProto3IntField(this, 1, value);
3289};
3290
3291
3292/**
3293 * optional bytes txTrieRoot = 2;
3294 * @return {!(string|Uint8Array)}
3295 */
3296proto.protocol.BlockHeader.raw.prototype.getTxtrieroot = function() {
3297 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
3298};
3299
3300
3301/**
3302 * optional bytes txTrieRoot = 2;
3303 * This is a type-conversion wrapper around `getTxtrieroot()`
3304 * @return {string}
3305 */
3306proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asB64 = function() {
3307 return /** @type {string} */ (jspb.Message.bytesAsB64(
3308 this.getTxtrieroot()));
3309};
3310
3311
3312/**
3313 * optional bytes txTrieRoot = 2;
3314 * Note that Uint8Array is not supported on all browsers.
3315 * @see http://caniuse.com/Uint8Array
3316 * This is a type-conversion wrapper around `getTxtrieroot()`
3317 * @return {!Uint8Array}
3318 */
3319proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asU8 = function() {
3320 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
3321 this.getTxtrieroot()));
3322};
3323
3324
3325/** @param {!(string|Uint8Array)} value */
3326proto.protocol.BlockHeader.raw.prototype.setTxtrieroot = function(value) {
3327 jspb.Message.setProto3BytesField(this, 2, value);
3328};
3329
3330
3331/**
3332 * optional bytes parentHash = 3;
3333 * @return {!(string|Uint8Array)}
3334 */
3335proto.protocol.BlockHeader.raw.prototype.getParenthash = function() {
3336 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
3337};
3338
3339
3340/**
3341 * optional bytes parentHash = 3;
3342 * This is a type-conversion wrapper around `getParenthash()`
3343 * @return {string}
3344 */
3345proto.protocol.BlockHeader.raw.prototype.getParenthash_asB64 = function() {
3346 return /** @type {string} */ (jspb.Message.bytesAsB64(
3347 this.getParenthash()));
3348};
3349
3350
3351/**
3352 * optional bytes parentHash = 3;
3353 * Note that Uint8Array is not supported on all browsers.
3354 * @see http://caniuse.com/Uint8Array
3355 * This is a type-conversion wrapper around `getParenthash()`
3356 * @return {!Uint8Array}
3357 */
3358proto.protocol.BlockHeader.raw.prototype.getParenthash_asU8 = function() {
3359 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
3360 this.getParenthash()));
3361};
3362
3363
3364/** @param {!(string|Uint8Array)} value */
3365proto.protocol.BlockHeader.raw.prototype.setParenthash = function(value) {
3366 jspb.Message.setProto3BytesField(this, 3, value);
3367};
3368
3369
3370/**
3371 * optional int64 number = 7;
3372 * @return {number}
3373 */
3374proto.protocol.BlockHeader.raw.prototype.getNumber = function() {
3375 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
3376};
3377
3378
3379/** @param {number} value */
3380proto.protocol.BlockHeader.raw.prototype.setNumber = function(value) {
3381 jspb.Message.setProto3IntField(this, 7, value);
3382};
3383
3384
3385/**
3386 * optional int64 witness_id = 8;
3387 * @return {number}
3388 */
3389proto.protocol.BlockHeader.raw.prototype.getWitnessId = function() {
3390 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
3391};
3392
3393
3394/** @param {number} value */
3395proto.protocol.BlockHeader.raw.prototype.setWitnessId = function(value) {
3396 jspb.Message.setProto3IntField(this, 8, value);
3397};
3398
3399
3400/**
3401 * optional bytes witness_address = 9;
3402 * @return {!(string|Uint8Array)}
3403 */
3404proto.protocol.BlockHeader.raw.prototype.getWitnessAddress = function() {
3405 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
3406};
3407
3408
3409/**
3410 * optional bytes witness_address = 9;
3411 * This is a type-conversion wrapper around `getWitnessAddress()`
3412 * @return {string}
3413 */
3414proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asB64 = function() {
3415 return /** @type {string} */ (jspb.Message.bytesAsB64(
3416 this.getWitnessAddress()));
3417};
3418
3419
3420/**
3421 * optional bytes witness_address = 9;
3422 * Note that Uint8Array is not supported on all browsers.
3423 * @see http://caniuse.com/Uint8Array
3424 * This is a type-conversion wrapper around `getWitnessAddress()`
3425 * @return {!Uint8Array}
3426 */
3427proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asU8 = function() {
3428 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
3429 this.getWitnessAddress()));
3430};
3431
3432
3433/** @param {!(string|Uint8Array)} value */
3434proto.protocol.BlockHeader.raw.prototype.setWitnessAddress = function(value) {
3435 jspb.Message.setProto3BytesField(this, 9, value);
3436};
3437
3438
3439/**
3440 * optional raw raw_data = 1;
3441 * @return {?proto.protocol.BlockHeader.raw}
3442 */
3443proto.protocol.BlockHeader.prototype.getRawData = function() {
3444 return /** @type{?proto.protocol.BlockHeader.raw} */ (
3445 jspb.Message.getWrapperField(this, proto.protocol.BlockHeader.raw, 1));
3446};
3447
3448
3449/** @param {?proto.protocol.BlockHeader.raw|undefined} value */
3450proto.protocol.BlockHeader.prototype.setRawData = function(value) {
3451 jspb.Message.setWrapperField(this, 1, value);
3452};
3453
3454
3455proto.protocol.BlockHeader.prototype.clearRawData = function() {
3456 this.setRawData(undefined);
3457};
3458
3459
3460/**
3461 * Returns whether this field is set.
3462 * @return {!boolean}
3463 */
3464proto.protocol.BlockHeader.prototype.hasRawData = function() {
3465 return jspb.Message.getField(this, 1) != null;
3466};
3467
3468
3469/**
3470 * optional bytes witness_signature = 2;
3471 * @return {!(string|Uint8Array)}
3472 */
3473proto.protocol.BlockHeader.prototype.getWitnessSignature = function() {
3474 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
3475};
3476
3477
3478/**
3479 * optional bytes witness_signature = 2;
3480 * This is a type-conversion wrapper around `getWitnessSignature()`
3481 * @return {string}
3482 */
3483proto.protocol.BlockHeader.prototype.getWitnessSignature_asB64 = function() {
3484 return /** @type {string} */ (jspb.Message.bytesAsB64(
3485 this.getWitnessSignature()));
3486};
3487
3488
3489/**
3490 * optional bytes witness_signature = 2;
3491 * Note that Uint8Array is not supported on all browsers.
3492 * @see http://caniuse.com/Uint8Array
3493 * This is a type-conversion wrapper around `getWitnessSignature()`
3494 * @return {!Uint8Array}
3495 */
3496proto.protocol.BlockHeader.prototype.getWitnessSignature_asU8 = function() {
3497 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
3498 this.getWitnessSignature()));
3499};
3500
3501
3502/** @param {!(string|Uint8Array)} value */
3503proto.protocol.BlockHeader.prototype.setWitnessSignature = function(value) {
3504 jspb.Message.setProto3BytesField(this, 2, value);
3505};
3506
3507
3508
3509/**
3510 * Generated by JsPbCodeGenerator.
3511 * @param {Array=} opt_data Optional initial data array, typically from a
3512 * server response, or constructed directly in Javascript. The array is used
3513 * in place and becomes part of the constructed object. It is not cloned.
3514 * If no data is provided, the constructed object will be empty, but still
3515 * valid.
3516 * @extends {jspb.Message}
3517 * @constructor
3518 */
3519proto.protocol.Block = function(opt_data) {
3520 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Block.repeatedFields_, null);
3521};
3522goog.inherits(proto.protocol.Block, jspb.Message);
3523if (goog.DEBUG && !COMPILED) {
3524 proto.protocol.Block.displayName = 'proto.protocol.Block';
3525}
3526/**
3527 * List of repeated fields within this message type.
3528 * @private {!Array<number>}
3529 * @const
3530 */
3531proto.protocol.Block.repeatedFields_ = [1];
3532
3533
3534
3535if (jspb.Message.GENERATE_TO_OBJECT) {
3536/**
3537 * Creates an object representation of this proto suitable for use in Soy templates.
3538 * Field names that are reserved in JavaScript and will be renamed to pb_name.
3539 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3540 * For the list of reserved names please see:
3541 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
3542 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
3543 * for transitional soy proto support: http://goto/soy-param-migration
3544 * @return {!Object}
3545 */
3546proto.protocol.Block.prototype.toObject = function(opt_includeInstance) {
3547 return proto.protocol.Block.toObject(opt_includeInstance, this);
3548};
3549
3550
3551/**
3552 * Static version of the {@see toObject} method.
3553 * @param {boolean|undefined} includeInstance Whether to include the JSPB
3554 * instance for transitional soy proto support:
3555 * http://goto/soy-param-migration
3556 * @param {!proto.protocol.Block} msg The msg instance to transform.
3557 * @return {!Object}
3558 * @suppress {unusedLocalVariables} f is only used for nested messages
3559 */
3560proto.protocol.Block.toObject = function(includeInstance, msg) {
3561 var f, obj = {
3562 transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(),
3563 proto.protocol.Transaction.toObject, includeInstance),
3564 blockHeader: (f = msg.getBlockHeader()) && proto.protocol.BlockHeader.toObject(includeInstance, f)
3565 };
3566
3567 if (includeInstance) {
3568 obj.$jspbMessageInstance = msg;
3569 }
3570 return obj;
3571};
3572}
3573
3574
3575/**
3576 * Deserializes binary data (in protobuf wire format).
3577 * @param {jspb.ByteSource} bytes The bytes to deserialize.
3578 * @return {!proto.protocol.Block}
3579 */
3580proto.protocol.Block.deserializeBinary = function(bytes) {
3581 var reader = new jspb.BinaryReader(bytes);
3582 var msg = new proto.protocol.Block;
3583 return proto.protocol.Block.deserializeBinaryFromReader(msg, reader);
3584};
3585
3586
3587/**
3588 * Deserializes binary data (in protobuf wire format) from the
3589 * given reader into the given message object.
3590 * @param {!proto.protocol.Block} msg The message object to deserialize into.
3591 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3592 * @return {!proto.protocol.Block}
3593 */
3594proto.protocol.Block.deserializeBinaryFromReader = function(msg, reader) {
3595 while (reader.nextField()) {
3596 if (reader.isEndGroup()) {
3597 break;
3598 }
3599 var field = reader.getFieldNumber();
3600 switch (field) {
3601 case 1:
3602 var value = new proto.protocol.Transaction;
3603 reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader);
3604 msg.addTransactions(value);
3605 break;
3606 case 2:
3607 var value = new proto.protocol.BlockHeader;
3608 reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader);
3609 msg.setBlockHeader(value);
3610 break;
3611 default:
3612 reader.skipField();
3613 break;
3614 }
3615 }
3616 return msg;
3617};
3618
3619
3620/**
3621 * Serializes the message to binary data (in protobuf wire format).
3622 * @return {!Uint8Array}
3623 */
3624proto.protocol.Block.prototype.serializeBinary = function() {
3625 var writer = new jspb.BinaryWriter();
3626 proto.protocol.Block.serializeBinaryToWriter(this, writer);
3627 return writer.getResultBuffer();
3628};
3629
3630
3631/**
3632 * Serializes the given message to binary data (in protobuf wire
3633 * format), writing to the given BinaryWriter.
3634 * @param {!proto.protocol.Block} message
3635 * @param {!jspb.BinaryWriter} writer
3636 * @suppress {unusedLocalVariables} f is only used for nested messages
3637 */
3638proto.protocol.Block.serializeBinaryToWriter = function(message, writer) {
3639 var f = undefined;
3640 f = message.getTransactionsList();
3641 if (f.length > 0) {
3642 writer.writeRepeatedMessage(
3643 1,
3644 f,
3645 proto.protocol.Transaction.serializeBinaryToWriter
3646 );
3647 }
3648 f = message.getBlockHeader();
3649 if (f != null) {
3650 writer.writeMessage(
3651 2,
3652 f,
3653 proto.protocol.BlockHeader.serializeBinaryToWriter
3654 );
3655 }
3656};
3657
3658
3659/**
3660 * repeated Transaction transactions = 1;
3661 * @return {!Array.<!proto.protocol.Transaction>}
3662 */
3663proto.protocol.Block.prototype.getTransactionsList = function() {
3664 return /** @type{!Array.<!proto.protocol.Transaction>} */ (
3665 jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1));
3666};
3667
3668
3669/** @param {!Array.<!proto.protocol.Transaction>} value */
3670proto.protocol.Block.prototype.setTransactionsList = function(value) {
3671 jspb.Message.setRepeatedWrapperField(this, 1, value);
3672};
3673
3674
3675/**
3676 * @param {!proto.protocol.Transaction=} opt_value
3677 * @param {number=} opt_index
3678 * @return {!proto.protocol.Transaction}
3679 */
3680proto.protocol.Block.prototype.addTransactions = function(opt_value, opt_index) {
3681 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index);
3682};
3683
3684
3685proto.protocol.Block.prototype.clearTransactionsList = function() {
3686 this.setTransactionsList([]);
3687};
3688
3689
3690/**
3691 * optional BlockHeader block_header = 2;
3692 * @return {?proto.protocol.BlockHeader}
3693 */
3694proto.protocol.Block.prototype.getBlockHeader = function() {
3695 return /** @type{?proto.protocol.BlockHeader} */ (
3696 jspb.Message.getWrapperField(this, proto.protocol.BlockHeader, 2));
3697};
3698
3699
3700/** @param {?proto.protocol.BlockHeader|undefined} value */
3701proto.protocol.Block.prototype.setBlockHeader = function(value) {
3702 jspb.Message.setWrapperField(this, 2, value);
3703};
3704
3705
3706proto.protocol.Block.prototype.clearBlockHeader = function() {
3707 this.setBlockHeader(undefined);
3708};
3709
3710
3711/**
3712 * Returns whether this field is set.
3713 * @return {!boolean}
3714 */
3715proto.protocol.Block.prototype.hasBlockHeader = function() {
3716 return jspb.Message.getField(this, 2) != null;
3717};
3718
3719
3720
3721/**
3722 * Generated by JsPbCodeGenerator.
3723 * @param {Array=} opt_data Optional initial data array, typically from a
3724 * server response, or constructed directly in Javascript. The array is used
3725 * in place and becomes part of the constructed object. It is not cloned.
3726 * If no data is provided, the constructed object will be empty, but still
3727 * valid.
3728 * @extends {jspb.Message}
3729 * @constructor
3730 */
3731proto.protocol.ChainInventory = function(opt_data) {
3732 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.ChainInventory.repeatedFields_, null);
3733};
3734goog.inherits(proto.protocol.ChainInventory, jspb.Message);
3735if (goog.DEBUG && !COMPILED) {
3736 proto.protocol.ChainInventory.displayName = 'proto.protocol.ChainInventory';
3737}
3738/**
3739 * List of repeated fields within this message type.
3740 * @private {!Array<number>}
3741 * @const
3742 */
3743proto.protocol.ChainInventory.repeatedFields_ = [1];
3744
3745
3746
3747if (jspb.Message.GENERATE_TO_OBJECT) {
3748/**
3749 * Creates an object representation of this proto suitable for use in Soy templates.
3750 * Field names that are reserved in JavaScript and will be renamed to pb_name.
3751 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3752 * For the list of reserved names please see:
3753 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
3754 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
3755 * for transitional soy proto support: http://goto/soy-param-migration
3756 * @return {!Object}
3757 */
3758proto.protocol.ChainInventory.prototype.toObject = function(opt_includeInstance) {
3759 return proto.protocol.ChainInventory.toObject(opt_includeInstance, this);
3760};
3761
3762
3763/**
3764 * Static version of the {@see toObject} method.
3765 * @param {boolean|undefined} includeInstance Whether to include the JSPB
3766 * instance for transitional soy proto support:
3767 * http://goto/soy-param-migration
3768 * @param {!proto.protocol.ChainInventory} msg The msg instance to transform.
3769 * @return {!Object}
3770 * @suppress {unusedLocalVariables} f is only used for nested messages
3771 */
3772proto.protocol.ChainInventory.toObject = function(includeInstance, msg) {
3773 var f, obj = {
3774 idsList: jspb.Message.toObjectList(msg.getIdsList(),
3775 proto.protocol.ChainInventory.BlockId.toObject, includeInstance),
3776 remainNum: jspb.Message.getFieldWithDefault(msg, 2, 0)
3777 };
3778
3779 if (includeInstance) {
3780 obj.$jspbMessageInstance = msg;
3781 }
3782 return obj;
3783};
3784}
3785
3786
3787/**
3788 * Deserializes binary data (in protobuf wire format).
3789 * @param {jspb.ByteSource} bytes The bytes to deserialize.
3790 * @return {!proto.protocol.ChainInventory}
3791 */
3792proto.protocol.ChainInventory.deserializeBinary = function(bytes) {
3793 var reader = new jspb.BinaryReader(bytes);
3794 var msg = new proto.protocol.ChainInventory;
3795 return proto.protocol.ChainInventory.deserializeBinaryFromReader(msg, reader);
3796};
3797
3798
3799/**
3800 * Deserializes binary data (in protobuf wire format) from the
3801 * given reader into the given message object.
3802 * @param {!proto.protocol.ChainInventory} msg The message object to deserialize into.
3803 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3804 * @return {!proto.protocol.ChainInventory}
3805 */
3806proto.protocol.ChainInventory.deserializeBinaryFromReader = function(msg, reader) {
3807 while (reader.nextField()) {
3808 if (reader.isEndGroup()) {
3809 break;
3810 }
3811 var field = reader.getFieldNumber();
3812 switch (field) {
3813 case 1:
3814 var value = new proto.protocol.ChainInventory.BlockId;
3815 reader.readMessage(value,proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader);
3816 msg.addIds(value);
3817 break;
3818 case 2:
3819 var value = /** @type {number} */ (reader.readInt64());
3820 msg.setRemainNum(value);
3821 break;
3822 default:
3823 reader.skipField();
3824 break;
3825 }
3826 }
3827 return msg;
3828};
3829
3830
3831/**
3832 * Serializes the message to binary data (in protobuf wire format).
3833 * @return {!Uint8Array}
3834 */
3835proto.protocol.ChainInventory.prototype.serializeBinary = function() {
3836 var writer = new jspb.BinaryWriter();
3837 proto.protocol.ChainInventory.serializeBinaryToWriter(this, writer);
3838 return writer.getResultBuffer();
3839};
3840
3841
3842/**
3843 * Serializes the given message to binary data (in protobuf wire
3844 * format), writing to the given BinaryWriter.
3845 * @param {!proto.protocol.ChainInventory} message
3846 * @param {!jspb.BinaryWriter} writer
3847 * @suppress {unusedLocalVariables} f is only used for nested messages
3848 */
3849proto.protocol.ChainInventory.serializeBinaryToWriter = function(message, writer) {
3850 var f = undefined;
3851 f = message.getIdsList();
3852 if (f.length > 0) {
3853 writer.writeRepeatedMessage(
3854 1,
3855 f,
3856 proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter
3857 );
3858 }
3859 f = message.getRemainNum();
3860 if (f !== 0) {
3861 writer.writeInt64(
3862 2,
3863 f
3864 );
3865 }
3866};
3867
3868
3869
3870/**
3871 * Generated by JsPbCodeGenerator.
3872 * @param {Array=} opt_data Optional initial data array, typically from a
3873 * server response, or constructed directly in Javascript. The array is used
3874 * in place and becomes part of the constructed object. It is not cloned.
3875 * If no data is provided, the constructed object will be empty, but still
3876 * valid.
3877 * @extends {jspb.Message}
3878 * @constructor
3879 */
3880proto.protocol.ChainInventory.BlockId = function(opt_data) {
3881 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
3882};
3883goog.inherits(proto.protocol.ChainInventory.BlockId, jspb.Message);
3884if (goog.DEBUG && !COMPILED) {
3885 proto.protocol.ChainInventory.BlockId.displayName = 'proto.protocol.ChainInventory.BlockId';
3886}
3887
3888
3889if (jspb.Message.GENERATE_TO_OBJECT) {
3890/**
3891 * Creates an object representation of this proto suitable for use in Soy templates.
3892 * Field names that are reserved in JavaScript and will be renamed to pb_name.
3893 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3894 * For the list of reserved names please see:
3895 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
3896 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
3897 * for transitional soy proto support: http://goto/soy-param-migration
3898 * @return {!Object}
3899 */
3900proto.protocol.ChainInventory.BlockId.prototype.toObject = function(opt_includeInstance) {
3901 return proto.protocol.ChainInventory.BlockId.toObject(opt_includeInstance, this);
3902};
3903
3904
3905/**
3906 * Static version of the {@see toObject} method.
3907 * @param {boolean|undefined} includeInstance Whether to include the JSPB
3908 * instance for transitional soy proto support:
3909 * http://goto/soy-param-migration
3910 * @param {!proto.protocol.ChainInventory.BlockId} msg The msg instance to transform.
3911 * @return {!Object}
3912 * @suppress {unusedLocalVariables} f is only used for nested messages
3913 */
3914proto.protocol.ChainInventory.BlockId.toObject = function(includeInstance, msg) {
3915 var f, obj = {
3916 hash: msg.getHash_asB64(),
3917 number: jspb.Message.getFieldWithDefault(msg, 2, 0)
3918 };
3919
3920 if (includeInstance) {
3921 obj.$jspbMessageInstance = msg;
3922 }
3923 return obj;
3924};
3925}
3926
3927
3928/**
3929 * Deserializes binary data (in protobuf wire format).
3930 * @param {jspb.ByteSource} bytes The bytes to deserialize.
3931 * @return {!proto.protocol.ChainInventory.BlockId}
3932 */
3933proto.protocol.ChainInventory.BlockId.deserializeBinary = function(bytes) {
3934 var reader = new jspb.BinaryReader(bytes);
3935 var msg = new proto.protocol.ChainInventory.BlockId;
3936 return proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader(msg, reader);
3937};
3938
3939
3940/**
3941 * Deserializes binary data (in protobuf wire format) from the
3942 * given reader into the given message object.
3943 * @param {!proto.protocol.ChainInventory.BlockId} msg The message object to deserialize into.
3944 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3945 * @return {!proto.protocol.ChainInventory.BlockId}
3946 */
3947proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) {
3948 while (reader.nextField()) {
3949 if (reader.isEndGroup()) {
3950 break;
3951 }
3952 var field = reader.getFieldNumber();
3953 switch (field) {
3954 case 1:
3955 var value = /** @type {!Uint8Array} */ (reader.readBytes());
3956 msg.setHash(value);
3957 break;
3958 case 2:
3959 var value = /** @type {number} */ (reader.readInt64());
3960 msg.setNumber(value);
3961 break;
3962 default:
3963 reader.skipField();
3964 break;
3965 }
3966 }
3967 return msg;
3968};
3969
3970
3971/**
3972 * Serializes the message to binary data (in protobuf wire format).
3973 * @return {!Uint8Array}
3974 */
3975proto.protocol.ChainInventory.BlockId.prototype.serializeBinary = function() {
3976 var writer = new jspb.BinaryWriter();
3977 proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter(this, writer);
3978 return writer.getResultBuffer();
3979};
3980
3981
3982/**
3983 * Serializes the given message to binary data (in protobuf wire
3984 * format), writing to the given BinaryWriter.
3985 * @param {!proto.protocol.ChainInventory.BlockId} message
3986 * @param {!jspb.BinaryWriter} writer
3987 * @suppress {unusedLocalVariables} f is only used for nested messages
3988 */
3989proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter = function(message, writer) {
3990 var f = undefined;
3991 f = message.getHash_asU8();
3992 if (f.length > 0) {
3993 writer.writeBytes(
3994 1,
3995 f
3996 );
3997 }
3998 f = message.getNumber();
3999 if (f !== 0) {
4000 writer.writeInt64(
4001 2,
4002 f
4003 );
4004 }
4005};
4006
4007
4008/**
4009 * optional bytes hash = 1;
4010 * @return {!(string|Uint8Array)}
4011 */
4012proto.protocol.ChainInventory.BlockId.prototype.getHash = function() {
4013 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
4014};
4015
4016
4017/**
4018 * optional bytes hash = 1;
4019 * This is a type-conversion wrapper around `getHash()`
4020 * @return {string}
4021 */
4022proto.protocol.ChainInventory.BlockId.prototype.getHash_asB64 = function() {
4023 return /** @type {string} */ (jspb.Message.bytesAsB64(
4024 this.getHash()));
4025};
4026
4027
4028/**
4029 * optional bytes hash = 1;
4030 * Note that Uint8Array is not supported on all browsers.
4031 * @see http://caniuse.com/Uint8Array
4032 * This is a type-conversion wrapper around `getHash()`
4033 * @return {!Uint8Array}
4034 */
4035proto.protocol.ChainInventory.BlockId.prototype.getHash_asU8 = function() {
4036 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
4037 this.getHash()));
4038};
4039
4040
4041/** @param {!(string|Uint8Array)} value */
4042proto.protocol.ChainInventory.BlockId.prototype.setHash = function(value) {
4043 jspb.Message.setProto3BytesField(this, 1, value);
4044};
4045
4046
4047/**
4048 * optional int64 number = 2;
4049 * @return {number}
4050 */
4051proto.protocol.ChainInventory.BlockId.prototype.getNumber = function() {
4052 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
4053};
4054
4055
4056/** @param {number} value */
4057proto.protocol.ChainInventory.BlockId.prototype.setNumber = function(value) {
4058 jspb.Message.setProto3IntField(this, 2, value);
4059};
4060
4061
4062/**
4063 * repeated BlockId ids = 1;
4064 * @return {!Array.<!proto.protocol.ChainInventory.BlockId>}
4065 */
4066proto.protocol.ChainInventory.prototype.getIdsList = function() {
4067 return /** @type{!Array.<!proto.protocol.ChainInventory.BlockId>} */ (
4068 jspb.Message.getRepeatedWrapperField(this, proto.protocol.ChainInventory.BlockId, 1));
4069};
4070
4071
4072/** @param {!Array.<!proto.protocol.ChainInventory.BlockId>} value */
4073proto.protocol.ChainInventory.prototype.setIdsList = function(value) {
4074 jspb.Message.setRepeatedWrapperField(this, 1, value);
4075};
4076
4077
4078/**
4079 * @param {!proto.protocol.ChainInventory.BlockId=} opt_value
4080 * @param {number=} opt_index
4081 * @return {!proto.protocol.ChainInventory.BlockId}
4082 */
4083proto.protocol.ChainInventory.prototype.addIds = function(opt_value, opt_index) {
4084 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.ChainInventory.BlockId, opt_index);
4085};
4086
4087
4088proto.protocol.ChainInventory.prototype.clearIdsList = function() {
4089 this.setIdsList([]);
4090};
4091
4092
4093/**
4094 * optional int64 remain_num = 2;
4095 * @return {number}
4096 */
4097proto.protocol.ChainInventory.prototype.getRemainNum = function() {
4098 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
4099};
4100
4101
4102/** @param {number} value */
4103proto.protocol.ChainInventory.prototype.setRemainNum = function(value) {
4104 jspb.Message.setProto3IntField(this, 2, value);
4105};
4106
4107
4108
4109/**
4110 * Generated by JsPbCodeGenerator.
4111 * @param {Array=} opt_data Optional initial data array, typically from a
4112 * server response, or constructed directly in Javascript. The array is used
4113 * in place and becomes part of the constructed object. It is not cloned.
4114 * If no data is provided, the constructed object will be empty, but still
4115 * valid.
4116 * @extends {jspb.Message}
4117 * @constructor
4118 */
4119proto.protocol.BlockInventory = function(opt_data) {
4120 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.BlockInventory.repeatedFields_, null);
4121};
4122goog.inherits(proto.protocol.BlockInventory, jspb.Message);
4123if (goog.DEBUG && !COMPILED) {
4124 proto.protocol.BlockInventory.displayName = 'proto.protocol.BlockInventory';
4125}
4126/**
4127 * List of repeated fields within this message type.
4128 * @private {!Array<number>}
4129 * @const
4130 */
4131proto.protocol.BlockInventory.repeatedFields_ = [1];
4132
4133
4134
4135if (jspb.Message.GENERATE_TO_OBJECT) {
4136/**
4137 * Creates an object representation of this proto suitable for use in Soy templates.
4138 * Field names that are reserved in JavaScript and will be renamed to pb_name.
4139 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4140 * For the list of reserved names please see:
4141 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
4142 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
4143 * for transitional soy proto support: http://goto/soy-param-migration
4144 * @return {!Object}
4145 */
4146proto.protocol.BlockInventory.prototype.toObject = function(opt_includeInstance) {
4147 return proto.protocol.BlockInventory.toObject(opt_includeInstance, this);
4148};
4149
4150
4151/**
4152 * Static version of the {@see toObject} method.
4153 * @param {boolean|undefined} includeInstance Whether to include the JSPB
4154 * instance for transitional soy proto support:
4155 * http://goto/soy-param-migration
4156 * @param {!proto.protocol.BlockInventory} msg The msg instance to transform.
4157 * @return {!Object}
4158 * @suppress {unusedLocalVariables} f is only used for nested messages
4159 */
4160proto.protocol.BlockInventory.toObject = function(includeInstance, msg) {
4161 var f, obj = {
4162 idsList: jspb.Message.toObjectList(msg.getIdsList(),
4163 proto.protocol.BlockInventory.BlockId.toObject, includeInstance),
4164 type: jspb.Message.getFieldWithDefault(msg, 2, 0)
4165 };
4166
4167 if (includeInstance) {
4168 obj.$jspbMessageInstance = msg;
4169 }
4170 return obj;
4171};
4172}
4173
4174
4175/**
4176 * Deserializes binary data (in protobuf wire format).
4177 * @param {jspb.ByteSource} bytes The bytes to deserialize.
4178 * @return {!proto.protocol.BlockInventory}
4179 */
4180proto.protocol.BlockInventory.deserializeBinary = function(bytes) {
4181 var reader = new jspb.BinaryReader(bytes);
4182 var msg = new proto.protocol.BlockInventory;
4183 return proto.protocol.BlockInventory.deserializeBinaryFromReader(msg, reader);
4184};
4185
4186
4187/**
4188 * Deserializes binary data (in protobuf wire format) from the
4189 * given reader into the given message object.
4190 * @param {!proto.protocol.BlockInventory} msg The message object to deserialize into.
4191 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4192 * @return {!proto.protocol.BlockInventory}
4193 */
4194proto.protocol.BlockInventory.deserializeBinaryFromReader = function(msg, reader) {
4195 while (reader.nextField()) {
4196 if (reader.isEndGroup()) {
4197 break;
4198 }
4199 var field = reader.getFieldNumber();
4200 switch (field) {
4201 case 1:
4202 var value = new proto.protocol.BlockInventory.BlockId;
4203 reader.readMessage(value,proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader);
4204 msg.addIds(value);
4205 break;
4206 case 2:
4207 var value = /** @type {!proto.protocol.BlockInventory.Type} */ (reader.readEnum());
4208 msg.setType(value);
4209 break;
4210 default:
4211 reader.skipField();
4212 break;
4213 }
4214 }
4215 return msg;
4216};
4217
4218
4219/**
4220 * Serializes the message to binary data (in protobuf wire format).
4221 * @return {!Uint8Array}
4222 */
4223proto.protocol.BlockInventory.prototype.serializeBinary = function() {
4224 var writer = new jspb.BinaryWriter();
4225 proto.protocol.BlockInventory.serializeBinaryToWriter(this, writer);
4226 return writer.getResultBuffer();
4227};
4228
4229
4230/**
4231 * Serializes the given message to binary data (in protobuf wire
4232 * format), writing to the given BinaryWriter.
4233 * @param {!proto.protocol.BlockInventory} message
4234 * @param {!jspb.BinaryWriter} writer
4235 * @suppress {unusedLocalVariables} f is only used for nested messages
4236 */
4237proto.protocol.BlockInventory.serializeBinaryToWriter = function(message, writer) {
4238 var f = undefined;
4239 f = message.getIdsList();
4240 if (f.length > 0) {
4241 writer.writeRepeatedMessage(
4242 1,
4243 f,
4244 proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter
4245 );
4246 }
4247 f = message.getType();
4248 if (f !== 0.0) {
4249 writer.writeEnum(
4250 2,
4251 f
4252 );
4253 }
4254};
4255
4256
4257/**
4258 * @enum {number}
4259 */
4260proto.protocol.BlockInventory.Type = {
4261 SYNC: 0,
4262 ADVTISE: 1,
4263 FETCH: 2
4264};
4265
4266
4267/**
4268 * Generated by JsPbCodeGenerator.
4269 * @param {Array=} opt_data Optional initial data array, typically from a
4270 * server response, or constructed directly in Javascript. The array is used
4271 * in place and becomes part of the constructed object. It is not cloned.
4272 * If no data is provided, the constructed object will be empty, but still
4273 * valid.
4274 * @extends {jspb.Message}
4275 * @constructor
4276 */
4277proto.protocol.BlockInventory.BlockId = function(opt_data) {
4278 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
4279};
4280goog.inherits(proto.protocol.BlockInventory.BlockId, jspb.Message);
4281if (goog.DEBUG && !COMPILED) {
4282 proto.protocol.BlockInventory.BlockId.displayName = 'proto.protocol.BlockInventory.BlockId';
4283}
4284
4285
4286if (jspb.Message.GENERATE_TO_OBJECT) {
4287/**
4288 * Creates an object representation of this proto suitable for use in Soy templates.
4289 * Field names that are reserved in JavaScript and will be renamed to pb_name.
4290 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4291 * For the list of reserved names please see:
4292 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
4293 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
4294 * for transitional soy proto support: http://goto/soy-param-migration
4295 * @return {!Object}
4296 */
4297proto.protocol.BlockInventory.BlockId.prototype.toObject = function(opt_includeInstance) {
4298 return proto.protocol.BlockInventory.BlockId.toObject(opt_includeInstance, this);
4299};
4300
4301
4302/**
4303 * Static version of the {@see toObject} method.
4304 * @param {boolean|undefined} includeInstance Whether to include the JSPB
4305 * instance for transitional soy proto support:
4306 * http://goto/soy-param-migration
4307 * @param {!proto.protocol.BlockInventory.BlockId} msg The msg instance to transform.
4308 * @return {!Object}
4309 * @suppress {unusedLocalVariables} f is only used for nested messages
4310 */
4311proto.protocol.BlockInventory.BlockId.toObject = function(includeInstance, msg) {
4312 var f, obj = {
4313 hash: msg.getHash_asB64(),
4314 number: jspb.Message.getFieldWithDefault(msg, 2, 0)
4315 };
4316
4317 if (includeInstance) {
4318 obj.$jspbMessageInstance = msg;
4319 }
4320 return obj;
4321};
4322}
4323
4324
4325/**
4326 * Deserializes binary data (in protobuf wire format).
4327 * @param {jspb.ByteSource} bytes The bytes to deserialize.
4328 * @return {!proto.protocol.BlockInventory.BlockId}
4329 */
4330proto.protocol.BlockInventory.BlockId.deserializeBinary = function(bytes) {
4331 var reader = new jspb.BinaryReader(bytes);
4332 var msg = new proto.protocol.BlockInventory.BlockId;
4333 return proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader(msg, reader);
4334};
4335
4336
4337/**
4338 * Deserializes binary data (in protobuf wire format) from the
4339 * given reader into the given message object.
4340 * @param {!proto.protocol.BlockInventory.BlockId} msg The message object to deserialize into.
4341 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4342 * @return {!proto.protocol.BlockInventory.BlockId}
4343 */
4344proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) {
4345 while (reader.nextField()) {
4346 if (reader.isEndGroup()) {
4347 break;
4348 }
4349 var field = reader.getFieldNumber();
4350 switch (field) {
4351 case 1:
4352 var value = /** @type {!Uint8Array} */ (reader.readBytes());
4353 msg.setHash(value);
4354 break;
4355 case 2:
4356 var value = /** @type {number} */ (reader.readInt64());
4357 msg.setNumber(value);
4358 break;
4359 default:
4360 reader.skipField();
4361 break;
4362 }
4363 }
4364 return msg;
4365};
4366
4367
4368/**
4369 * Serializes the message to binary data (in protobuf wire format).
4370 * @return {!Uint8Array}
4371 */
4372proto.protocol.BlockInventory.BlockId.prototype.serializeBinary = function() {
4373 var writer = new jspb.BinaryWriter();
4374 proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter(this, writer);
4375 return writer.getResultBuffer();
4376};
4377
4378
4379/**
4380 * Serializes the given message to binary data (in protobuf wire
4381 * format), writing to the given BinaryWriter.
4382 * @param {!proto.protocol.BlockInventory.BlockId} message
4383 * @param {!jspb.BinaryWriter} writer
4384 * @suppress {unusedLocalVariables} f is only used for nested messages
4385 */
4386proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter = function(message, writer) {
4387 var f = undefined;
4388 f = message.getHash_asU8();
4389 if (f.length > 0) {
4390 writer.writeBytes(
4391 1,
4392 f
4393 );
4394 }
4395 f = message.getNumber();
4396 if (f !== 0) {
4397 writer.writeInt64(
4398 2,
4399 f
4400 );
4401 }
4402};
4403
4404
4405/**
4406 * optional bytes hash = 1;
4407 * @return {!(string|Uint8Array)}
4408 */
4409proto.protocol.BlockInventory.BlockId.prototype.getHash = function() {
4410 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
4411};
4412
4413
4414/**
4415 * optional bytes hash = 1;
4416 * This is a type-conversion wrapper around `getHash()`
4417 * @return {string}
4418 */
4419proto.protocol.BlockInventory.BlockId.prototype.getHash_asB64 = function() {
4420 return /** @type {string} */ (jspb.Message.bytesAsB64(
4421 this.getHash()));
4422};
4423
4424
4425/**
4426 * optional bytes hash = 1;
4427 * Note that Uint8Array is not supported on all browsers.
4428 * @see http://caniuse.com/Uint8Array
4429 * This is a type-conversion wrapper around `getHash()`
4430 * @return {!Uint8Array}
4431 */
4432proto.protocol.BlockInventory.BlockId.prototype.getHash_asU8 = function() {
4433 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
4434 this.getHash()));
4435};
4436
4437
4438/** @param {!(string|Uint8Array)} value */
4439proto.protocol.BlockInventory.BlockId.prototype.setHash = function(value) {
4440 jspb.Message.setProto3BytesField(this, 1, value);
4441};
4442
4443
4444/**
4445 * optional int64 number = 2;
4446 * @return {number}
4447 */
4448proto.protocol.BlockInventory.BlockId.prototype.getNumber = function() {
4449 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
4450};
4451
4452
4453/** @param {number} value */
4454proto.protocol.BlockInventory.BlockId.prototype.setNumber = function(value) {
4455 jspb.Message.setProto3IntField(this, 2, value);
4456};
4457
4458
4459/**
4460 * repeated BlockId ids = 1;
4461 * @return {!Array.<!proto.protocol.BlockInventory.BlockId>}
4462 */
4463proto.protocol.BlockInventory.prototype.getIdsList = function() {
4464 return /** @type{!Array.<!proto.protocol.BlockInventory.BlockId>} */ (
4465 jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockInventory.BlockId, 1));
4466};
4467
4468
4469/** @param {!Array.<!proto.protocol.BlockInventory.BlockId>} value */
4470proto.protocol.BlockInventory.prototype.setIdsList = function(value) {
4471 jspb.Message.setRepeatedWrapperField(this, 1, value);
4472};
4473
4474
4475/**
4476 * @param {!proto.protocol.BlockInventory.BlockId=} opt_value
4477 * @param {number=} opt_index
4478 * @return {!proto.protocol.BlockInventory.BlockId}
4479 */
4480proto.protocol.BlockInventory.prototype.addIds = function(opt_value, opt_index) {
4481 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.BlockInventory.BlockId, opt_index);
4482};
4483
4484
4485proto.protocol.BlockInventory.prototype.clearIdsList = function() {
4486 this.setIdsList([]);
4487};
4488
4489
4490/**
4491 * optional Type type = 2;
4492 * @return {!proto.protocol.BlockInventory.Type}
4493 */
4494proto.protocol.BlockInventory.prototype.getType = function() {
4495 return /** @type {!proto.protocol.BlockInventory.Type} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
4496};
4497
4498
4499/** @param {!proto.protocol.BlockInventory.Type} value */
4500proto.protocol.BlockInventory.prototype.setType = function(value) {
4501 jspb.Message.setProto3EnumField(this, 2, value);
4502};
4503
4504
4505
4506/**
4507 * Generated by JsPbCodeGenerator.
4508 * @param {Array=} opt_data Optional initial data array, typically from a
4509 * server response, or constructed directly in Javascript. The array is used
4510 * in place and becomes part of the constructed object. It is not cloned.
4511 * If no data is provided, the constructed object will be empty, but still
4512 * valid.
4513 * @extends {jspb.Message}
4514 * @constructor
4515 */
4516proto.protocol.Inventory = function(opt_data) {
4517 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Inventory.repeatedFields_, null);
4518};
4519goog.inherits(proto.protocol.Inventory, jspb.Message);
4520if (goog.DEBUG && !COMPILED) {
4521 proto.protocol.Inventory.displayName = 'proto.protocol.Inventory';
4522}
4523/**
4524 * List of repeated fields within this message type.
4525 * @private {!Array<number>}
4526 * @const
4527 */
4528proto.protocol.Inventory.repeatedFields_ = [2];
4529
4530
4531
4532if (jspb.Message.GENERATE_TO_OBJECT) {
4533/**
4534 * Creates an object representation of this proto suitable for use in Soy templates.
4535 * Field names that are reserved in JavaScript and will be renamed to pb_name.
4536 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4537 * For the list of reserved names please see:
4538 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
4539 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
4540 * for transitional soy proto support: http://goto/soy-param-migration
4541 * @return {!Object}
4542 */
4543proto.protocol.Inventory.prototype.toObject = function(opt_includeInstance) {
4544 return proto.protocol.Inventory.toObject(opt_includeInstance, this);
4545};
4546
4547
4548/**
4549 * Static version of the {@see toObject} method.
4550 * @param {boolean|undefined} includeInstance Whether to include the JSPB
4551 * instance for transitional soy proto support:
4552 * http://goto/soy-param-migration
4553 * @param {!proto.protocol.Inventory} msg The msg instance to transform.
4554 * @return {!Object}
4555 * @suppress {unusedLocalVariables} f is only used for nested messages
4556 */
4557proto.protocol.Inventory.toObject = function(includeInstance, msg) {
4558 var f, obj = {
4559 type: jspb.Message.getFieldWithDefault(msg, 1, 0),
4560 idsList: msg.getIdsList_asB64()
4561 };
4562
4563 if (includeInstance) {
4564 obj.$jspbMessageInstance = msg;
4565 }
4566 return obj;
4567};
4568}
4569
4570
4571/**
4572 * Deserializes binary data (in protobuf wire format).
4573 * @param {jspb.ByteSource} bytes The bytes to deserialize.
4574 * @return {!proto.protocol.Inventory}
4575 */
4576proto.protocol.Inventory.deserializeBinary = function(bytes) {
4577 var reader = new jspb.BinaryReader(bytes);
4578 var msg = new proto.protocol.Inventory;
4579 return proto.protocol.Inventory.deserializeBinaryFromReader(msg, reader);
4580};
4581
4582
4583/**
4584 * Deserializes binary data (in protobuf wire format) from the
4585 * given reader into the given message object.
4586 * @param {!proto.protocol.Inventory} msg The message object to deserialize into.
4587 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4588 * @return {!proto.protocol.Inventory}
4589 */
4590proto.protocol.Inventory.deserializeBinaryFromReader = function(msg, reader) {
4591 while (reader.nextField()) {
4592 if (reader.isEndGroup()) {
4593 break;
4594 }
4595 var field = reader.getFieldNumber();
4596 switch (field) {
4597 case 1:
4598 var value = /** @type {!proto.protocol.Inventory.InventoryType} */ (reader.readEnum());
4599 msg.setType(value);
4600 break;
4601 case 2:
4602 var value = /** @type {!Uint8Array} */ (reader.readBytes());
4603 msg.addIds(value);
4604 break;
4605 default:
4606 reader.skipField();
4607 break;
4608 }
4609 }
4610 return msg;
4611};
4612
4613
4614/**
4615 * Serializes the message to binary data (in protobuf wire format).
4616 * @return {!Uint8Array}
4617 */
4618proto.protocol.Inventory.prototype.serializeBinary = function() {
4619 var writer = new jspb.BinaryWriter();
4620 proto.protocol.Inventory.serializeBinaryToWriter(this, writer);
4621 return writer.getResultBuffer();
4622};
4623
4624
4625/**
4626 * Serializes the given message to binary data (in protobuf wire
4627 * format), writing to the given BinaryWriter.
4628 * @param {!proto.protocol.Inventory} message
4629 * @param {!jspb.BinaryWriter} writer
4630 * @suppress {unusedLocalVariables} f is only used for nested messages
4631 */
4632proto.protocol.Inventory.serializeBinaryToWriter = function(message, writer) {
4633 var f = undefined;
4634 f = message.getType();
4635 if (f !== 0.0) {
4636 writer.writeEnum(
4637 1,
4638 f
4639 );
4640 }
4641 f = message.getIdsList_asU8();
4642 if (f.length > 0) {
4643 writer.writeRepeatedBytes(
4644 2,
4645 f
4646 );
4647 }
4648};
4649
4650
4651/**
4652 * @enum {number}
4653 */
4654proto.protocol.Inventory.InventoryType = {
4655 TRX: 0,
4656 BLOCK: 1
4657};
4658
4659/**
4660 * optional InventoryType type = 1;
4661 * @return {!proto.protocol.Inventory.InventoryType}
4662 */
4663proto.protocol.Inventory.prototype.getType = function() {
4664 return /** @type {!proto.protocol.Inventory.InventoryType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
4665};
4666
4667
4668/** @param {!proto.protocol.Inventory.InventoryType} value */
4669proto.protocol.Inventory.prototype.setType = function(value) {
4670 jspb.Message.setProto3EnumField(this, 1, value);
4671};
4672
4673
4674/**
4675 * repeated bytes ids = 2;
4676 * @return {!(Array<!Uint8Array>|Array<string>)}
4677 */
4678proto.protocol.Inventory.prototype.getIdsList = function() {
4679 return /** @type {!(Array<!Uint8Array>|Array<string>)} */ (jspb.Message.getRepeatedField(this, 2));
4680};
4681
4682
4683/**
4684 * repeated bytes ids = 2;
4685 * This is a type-conversion wrapper around `getIdsList()`
4686 * @return {!Array.<string>}
4687 */
4688proto.protocol.Inventory.prototype.getIdsList_asB64 = function() {
4689 return /** @type {!Array.<string>} */ (jspb.Message.bytesListAsB64(
4690 this.getIdsList()));
4691};
4692
4693
4694/**
4695 * repeated bytes ids = 2;
4696 * Note that Uint8Array is not supported on all browsers.
4697 * @see http://caniuse.com/Uint8Array
4698 * This is a type-conversion wrapper around `getIdsList()`
4699 * @return {!Array.<!Uint8Array>}
4700 */
4701proto.protocol.Inventory.prototype.getIdsList_asU8 = function() {
4702 return /** @type {!Array.<!Uint8Array>} */ (jspb.Message.bytesListAsU8(
4703 this.getIdsList()));
4704};
4705
4706
4707/** @param {!(Array<!Uint8Array>|Array<string>)} value */
4708proto.protocol.Inventory.prototype.setIdsList = function(value) {
4709 jspb.Message.setField(this, 2, value || []);
4710};
4711
4712
4713/**
4714 * @param {!(string|Uint8Array)} value
4715 * @param {number=} opt_index
4716 */
4717proto.protocol.Inventory.prototype.addIds = function(value, opt_index) {
4718 jspb.Message.addToRepeatedField(this, 2, value, opt_index);
4719};
4720
4721
4722proto.protocol.Inventory.prototype.clearIdsList = function() {
4723 this.setIdsList([]);
4724};
4725
4726
4727
4728/**
4729 * Generated by JsPbCodeGenerator.
4730 * @param {Array=} opt_data Optional initial data array, typically from a
4731 * server response, or constructed directly in Javascript. The array is used
4732 * in place and becomes part of the constructed object. It is not cloned.
4733 * If no data is provided, the constructed object will be empty, but still
4734 * valid.
4735 * @extends {jspb.Message}
4736 * @constructor
4737 */
4738proto.protocol.Items = function(opt_data) {
4739 jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Items.repeatedFields_, null);
4740};
4741goog.inherits(proto.protocol.Items, jspb.Message);
4742if (goog.DEBUG && !COMPILED) {
4743 proto.protocol.Items.displayName = 'proto.protocol.Items';
4744}
4745/**
4746 * List of repeated fields within this message type.
4747 * @private {!Array<number>}
4748 * @const
4749 */
4750proto.protocol.Items.repeatedFields_ = [2,3,4];
4751
4752
4753
4754if (jspb.Message.GENERATE_TO_OBJECT) {
4755/**
4756 * Creates an object representation of this proto suitable for use in Soy templates.
4757 * Field names that are reserved in JavaScript and will be renamed to pb_name.
4758 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4759 * For the list of reserved names please see:
4760 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
4761 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
4762 * for transitional soy proto support: http://goto/soy-param-migration
4763 * @return {!Object}
4764 */
4765proto.protocol.Items.prototype.toObject = function(opt_includeInstance) {
4766 return proto.protocol.Items.toObject(opt_includeInstance, this);
4767};
4768
4769
4770/**
4771 * Static version of the {@see toObject} method.
4772 * @param {boolean|undefined} includeInstance Whether to include the JSPB
4773 * instance for transitional soy proto support:
4774 * http://goto/soy-param-migration
4775 * @param {!proto.protocol.Items} msg The msg instance to transform.
4776 * @return {!Object}
4777 * @suppress {unusedLocalVariables} f is only used for nested messages
4778 */
4779proto.protocol.Items.toObject = function(includeInstance, msg) {
4780 var f, obj = {
4781 type: jspb.Message.getFieldWithDefault(msg, 1, 0),
4782 blocksList: jspb.Message.toObjectList(msg.getBlocksList(),
4783 proto.protocol.Block.toObject, includeInstance),
4784 blockHeadersList: jspb.Message.toObjectList(msg.getBlockHeadersList(),
4785 proto.protocol.BlockHeader.toObject, includeInstance),
4786 transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(),
4787 proto.protocol.Transaction.toObject, includeInstance)
4788 };
4789
4790 if (includeInstance) {
4791 obj.$jspbMessageInstance = msg;
4792 }
4793 return obj;
4794};
4795}
4796
4797
4798/**
4799 * Deserializes binary data (in protobuf wire format).
4800 * @param {jspb.ByteSource} bytes The bytes to deserialize.
4801 * @return {!proto.protocol.Items}
4802 */
4803proto.protocol.Items.deserializeBinary = function(bytes) {
4804 var reader = new jspb.BinaryReader(bytes);
4805 var msg = new proto.protocol.Items;
4806 return proto.protocol.Items.deserializeBinaryFromReader(msg, reader);
4807};
4808
4809
4810/**
4811 * Deserializes binary data (in protobuf wire format) from the
4812 * given reader into the given message object.
4813 * @param {!proto.protocol.Items} msg The message object to deserialize into.
4814 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4815 * @return {!proto.protocol.Items}
4816 */
4817proto.protocol.Items.deserializeBinaryFromReader = function(msg, reader) {
4818 while (reader.nextField()) {
4819 if (reader.isEndGroup()) {
4820 break;
4821 }
4822 var field = reader.getFieldNumber();
4823 switch (field) {
4824 case 1:
4825 var value = /** @type {!proto.protocol.Items.ItemType} */ (reader.readEnum());
4826 msg.setType(value);
4827 break;
4828 case 2:
4829 var value = new proto.protocol.Block;
4830 reader.readMessage(value,proto.protocol.Block.deserializeBinaryFromReader);
4831 msg.addBlocks(value);
4832 break;
4833 case 3:
4834 var value = new proto.protocol.BlockHeader;
4835 reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader);
4836 msg.addBlockHeaders(value);
4837 break;
4838 case 4:
4839 var value = new proto.protocol.Transaction;
4840 reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader);
4841 msg.addTransactions(value);
4842 break;
4843 default:
4844 reader.skipField();
4845 break;
4846 }
4847 }
4848 return msg;
4849};
4850
4851
4852/**
4853 * Serializes the message to binary data (in protobuf wire format).
4854 * @return {!Uint8Array}
4855 */
4856proto.protocol.Items.prototype.serializeBinary = function() {
4857 var writer = new jspb.BinaryWriter();
4858 proto.protocol.Items.serializeBinaryToWriter(this, writer);
4859 return writer.getResultBuffer();
4860};
4861
4862
4863/**
4864 * Serializes the given message to binary data (in protobuf wire
4865 * format), writing to the given BinaryWriter.
4866 * @param {!proto.protocol.Items} message
4867 * @param {!jspb.BinaryWriter} writer
4868 * @suppress {unusedLocalVariables} f is only used for nested messages
4869 */
4870proto.protocol.Items.serializeBinaryToWriter = function(message, writer) {
4871 var f = undefined;
4872 f = message.getType();
4873 if (f !== 0.0) {
4874 writer.writeEnum(
4875 1,
4876 f
4877 );
4878 }
4879 f = message.getBlocksList();
4880 if (f.length > 0) {
4881 writer.writeRepeatedMessage(
4882 2,
4883 f,
4884 proto.protocol.Block.serializeBinaryToWriter
4885 );
4886 }
4887 f = message.getBlockHeadersList();
4888 if (f.length > 0) {
4889 writer.writeRepeatedMessage(
4890 3,
4891 f,
4892 proto.protocol.BlockHeader.serializeBinaryToWriter
4893 );
4894 }
4895 f = message.getTransactionsList();
4896 if (f.length > 0) {
4897 writer.writeRepeatedMessage(
4898 4,
4899 f,
4900 proto.protocol.Transaction.serializeBinaryToWriter
4901 );
4902 }
4903};
4904
4905
4906/**
4907 * @enum {number}
4908 */
4909proto.protocol.Items.ItemType = {
4910 ERR: 0,
4911 TRX: 1,
4912 BLOCK: 2,
4913 BLOCKHEADER: 3
4914};
4915
4916/**
4917 * optional ItemType type = 1;
4918 * @return {!proto.protocol.Items.ItemType}
4919 */
4920proto.protocol.Items.prototype.getType = function() {
4921 return /** @type {!proto.protocol.Items.ItemType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
4922};
4923
4924
4925/** @param {!proto.protocol.Items.ItemType} value */
4926proto.protocol.Items.prototype.setType = function(value) {
4927 jspb.Message.setProto3EnumField(this, 1, value);
4928};
4929
4930
4931/**
4932 * repeated Block blocks = 2;
4933 * @return {!Array.<!proto.protocol.Block>}
4934 */
4935proto.protocol.Items.prototype.getBlocksList = function() {
4936 return /** @type{!Array.<!proto.protocol.Block>} */ (
4937 jspb.Message.getRepeatedWrapperField(this, proto.protocol.Block, 2));
4938};
4939
4940
4941/** @param {!Array.<!proto.protocol.Block>} value */
4942proto.protocol.Items.prototype.setBlocksList = function(value) {
4943 jspb.Message.setRepeatedWrapperField(this, 2, value);
4944};
4945
4946
4947/**
4948 * @param {!proto.protocol.Block=} opt_value
4949 * @param {number=} opt_index
4950 * @return {!proto.protocol.Block}
4951 */
4952proto.protocol.Items.prototype.addBlocks = function(opt_value, opt_index) {
4953 return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Block, opt_index);
4954};
4955
4956
4957proto.protocol.Items.prototype.clearBlocksList = function() {
4958 this.setBlocksList([]);
4959};
4960
4961
4962/**
4963 * repeated BlockHeader block_headers = 3;
4964 * @return {!Array.<!proto.protocol.BlockHeader>}
4965 */
4966proto.protocol.Items.prototype.getBlockHeadersList = function() {
4967 return /** @type{!Array.<!proto.protocol.BlockHeader>} */ (
4968 jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockHeader, 3));
4969};
4970
4971
4972/** @param {!Array.<!proto.protocol.BlockHeader>} value */
4973proto.protocol.Items.prototype.setBlockHeadersList = function(value) {
4974 jspb.Message.setRepeatedWrapperField(this, 3, value);
4975};
4976
4977
4978/**
4979 * @param {!proto.protocol.BlockHeader=} opt_value
4980 * @param {number=} opt_index
4981 * @return {!proto.protocol.BlockHeader}
4982 */
4983proto.protocol.Items.prototype.addBlockHeaders = function(opt_value, opt_index) {
4984 return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.BlockHeader, opt_index);
4985};
4986
4987
4988proto.protocol.Items.prototype.clearBlockHeadersList = function() {
4989 this.setBlockHeadersList([]);
4990};
4991
4992
4993/**
4994 * repeated Transaction transactions = 4;
4995 * @return {!Array.<!proto.protocol.Transaction>}
4996 */
4997proto.protocol.Items.prototype.getTransactionsList = function() {
4998 return /** @type{!Array.<!proto.protocol.Transaction>} */ (
4999 jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 4));
5000};
5001
5002
5003/** @param {!Array.<!proto.protocol.Transaction>} value */
5004proto.protocol.Items.prototype.setTransactionsList = function(value) {
5005 jspb.Message.setRepeatedWrapperField(this, 4, value);
5006};
5007
5008
5009/**
5010 * @param {!proto.protocol.Transaction=} opt_value
5011 * @param {number=} opt_index
5012 * @return {!proto.protocol.Transaction}
5013 */
5014proto.protocol.Items.prototype.addTransactions = function(opt_value, opt_index) {
5015 return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.Transaction, opt_index);
5016};
5017
5018
5019proto.protocol.Items.prototype.clearTransactionsList = function() {
5020 this.setTransactionsList([]);
5021};
5022
5023
5024
5025/**
5026 * Generated by JsPbCodeGenerator.
5027 * @param {Array=} opt_data Optional initial data array, typically from a
5028 * server response, or constructed directly in Javascript. The array is used
5029 * in place and becomes part of the constructed object. It is not cloned.
5030 * If no data is provided, the constructed object will be empty, but still
5031 * valid.
5032 * @extends {jspb.Message}
5033 * @constructor
5034 */
5035proto.protocol.DisconnectMessage = function(opt_data) {
5036 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
5037};
5038goog.inherits(proto.protocol.DisconnectMessage, jspb.Message);
5039if (goog.DEBUG && !COMPILED) {
5040 proto.protocol.DisconnectMessage.displayName = 'proto.protocol.DisconnectMessage';
5041}
5042
5043
5044if (jspb.Message.GENERATE_TO_OBJECT) {
5045/**
5046 * Creates an object representation of this proto suitable for use in Soy templates.
5047 * Field names that are reserved in JavaScript and will be renamed to pb_name.
5048 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
5049 * For the list of reserved names please see:
5050 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
5051 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
5052 * for transitional soy proto support: http://goto/soy-param-migration
5053 * @return {!Object}
5054 */
5055proto.protocol.DisconnectMessage.prototype.toObject = function(opt_includeInstance) {
5056 return proto.protocol.DisconnectMessage.toObject(opt_includeInstance, this);
5057};
5058
5059
5060/**
5061 * Static version of the {@see toObject} method.
5062 * @param {boolean|undefined} includeInstance Whether to include the JSPB
5063 * instance for transitional soy proto support:
5064 * http://goto/soy-param-migration
5065 * @param {!proto.protocol.DisconnectMessage} msg The msg instance to transform.
5066 * @return {!Object}
5067 * @suppress {unusedLocalVariables} f is only used for nested messages
5068 */
5069proto.protocol.DisconnectMessage.toObject = function(includeInstance, msg) {
5070 var f, obj = {
5071 reason: jspb.Message.getFieldWithDefault(msg, 1, 0)
5072 };
5073
5074 if (includeInstance) {
5075 obj.$jspbMessageInstance = msg;
5076 }
5077 return obj;
5078};
5079}
5080
5081
5082/**
5083 * Deserializes binary data (in protobuf wire format).
5084 * @param {jspb.ByteSource} bytes The bytes to deserialize.
5085 * @return {!proto.protocol.DisconnectMessage}
5086 */
5087proto.protocol.DisconnectMessage.deserializeBinary = function(bytes) {
5088 var reader = new jspb.BinaryReader(bytes);
5089 var msg = new proto.protocol.DisconnectMessage;
5090 return proto.protocol.DisconnectMessage.deserializeBinaryFromReader(msg, reader);
5091};
5092
5093
5094/**
5095 * Deserializes binary data (in protobuf wire format) from the
5096 * given reader into the given message object.
5097 * @param {!proto.protocol.DisconnectMessage} msg The message object to deserialize into.
5098 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
5099 * @return {!proto.protocol.DisconnectMessage}
5100 */
5101proto.protocol.DisconnectMessage.deserializeBinaryFromReader = function(msg, reader) {
5102 while (reader.nextField()) {
5103 if (reader.isEndGroup()) {
5104 break;
5105 }
5106 var field = reader.getFieldNumber();
5107 switch (field) {
5108 case 1:
5109 var value = /** @type {!proto.protocol.ReasonCode} */ (reader.readEnum());
5110 msg.setReason(value);
5111 break;
5112 default:
5113 reader.skipField();
5114 break;
5115 }
5116 }
5117 return msg;
5118};
5119
5120
5121/**
5122 * Serializes the message to binary data (in protobuf wire format).
5123 * @return {!Uint8Array}
5124 */
5125proto.protocol.DisconnectMessage.prototype.serializeBinary = function() {
5126 var writer = new jspb.BinaryWriter();
5127 proto.protocol.DisconnectMessage.serializeBinaryToWriter(this, writer);
5128 return writer.getResultBuffer();
5129};
5130
5131
5132/**
5133 * Serializes the given message to binary data (in protobuf wire
5134 * format), writing to the given BinaryWriter.
5135 * @param {!proto.protocol.DisconnectMessage} message
5136 * @param {!jspb.BinaryWriter} writer
5137 * @suppress {unusedLocalVariables} f is only used for nested messages
5138 */
5139proto.protocol.DisconnectMessage.serializeBinaryToWriter = function(message, writer) {
5140 var f = undefined;
5141 f = message.getReason();
5142 if (f !== 0.0) {
5143 writer.writeEnum(
5144 1,
5145 f
5146 );
5147 }
5148};
5149
5150
5151/**
5152 * optional ReasonCode reason = 1;
5153 * @return {!proto.protocol.ReasonCode}
5154 */
5155proto.protocol.DisconnectMessage.prototype.getReason = function() {
5156 return /** @type {!proto.protocol.ReasonCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
5157};
5158
5159
5160/** @param {!proto.protocol.ReasonCode} value */
5161proto.protocol.DisconnectMessage.prototype.setReason = function(value) {
5162 jspb.Message.setProto3EnumField(this, 1, value);
5163};
5164
5165
5166
5167/**
5168 * Generated by JsPbCodeGenerator.
5169 * @param {Array=} opt_data Optional initial data array, typically from a
5170 * server response, or constructed directly in Javascript. The array is used
5171 * in place and becomes part of the constructed object. It is not cloned.
5172 * If no data is provided, the constructed object will be empty, but still
5173 * valid.
5174 * @extends {jspb.Message}
5175 * @constructor
5176 */
5177proto.protocol.HelloMessage = function(opt_data) {
5178 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
5179};
5180goog.inherits(proto.protocol.HelloMessage, jspb.Message);
5181if (goog.DEBUG && !COMPILED) {
5182 proto.protocol.HelloMessage.displayName = 'proto.protocol.HelloMessage';
5183}
5184
5185
5186if (jspb.Message.GENERATE_TO_OBJECT) {
5187/**
5188 * Creates an object representation of this proto suitable for use in Soy templates.
5189 * Field names that are reserved in JavaScript and will be renamed to pb_name.
5190 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
5191 * For the list of reserved names please see:
5192 * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
5193 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
5194 * for transitional soy proto support: http://goto/soy-param-migration
5195 * @return {!Object}
5196 */
5197proto.protocol.HelloMessage.prototype.toObject = function(opt_includeInstance) {
5198 return proto.protocol.HelloMessage.toObject(opt_includeInstance, this);
5199};
5200
5201
5202/**
5203 * Static version of the {@see toObject} method.
5204 * @param {boolean|undefined} includeInstance Whether to include the JSPB
5205 * instance for transitional soy proto support:
5206 * http://goto/soy-param-migration
5207 * @param {!proto.protocol.HelloMessage} msg The msg instance to transform.
5208 * @return {!Object}
5209 * @suppress {unusedLocalVariables} f is only used for nested messages
5210 */
5211proto.protocol.HelloMessage.toObject = function(includeInstance, msg) {
5212 var f, obj = {
5213 from: (f = msg.getFrom()) && core_Discover_pb.Endpoint.toObject(includeInstance, f),
5214 version: jspb.Message.getFieldWithDefault(msg, 2, 0)
5215 };
5216
5217 if (includeInstance) {
5218 obj.$jspbMessageInstance = msg;
5219 }
5220 return obj;
5221};
5222}
5223
5224
5225/**
5226 * Deserializes binary data (in protobuf wire format).
5227 * @param {jspb.ByteSource} bytes The bytes to deserialize.
5228 * @return {!proto.protocol.HelloMessage}
5229 */
5230proto.protocol.HelloMessage.deserializeBinary = function(bytes) {
5231 var reader = new jspb.BinaryReader(bytes);
5232 var msg = new proto.protocol.HelloMessage;
5233 return proto.protocol.HelloMessage.deserializeBinaryFromReader(msg, reader);
5234};
5235
5236
5237/**
5238 * Deserializes binary data (in protobuf wire format) from the
5239 * given reader into the given message object.
5240 * @param {!proto.protocol.HelloMessage} msg The message object to deserialize into.
5241 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
5242 * @return {!proto.protocol.HelloMessage}
5243 */
5244proto.protocol.HelloMessage.deserializeBinaryFromReader = function(msg, reader) {
5245 while (reader.nextField()) {
5246 if (reader.isEndGroup()) {
5247 break;
5248 }
5249 var field = reader.getFieldNumber();
5250 switch (field) {
5251 case 1:
5252 var value = new core_Discover_pb.Endpoint;
5253 reader.readMessage(value,core_Discover_pb.Endpoint.deserializeBinaryFromReader);
5254 msg.setFrom(value);
5255 break;
5256 case 2:
5257 var value = /** @type {number} */ (reader.readInt32());
5258 msg.setVersion(value);
5259 break;
5260 default:
5261 reader.skipField();
5262 break;
5263 }
5264 }
5265 return msg;
5266};
5267
5268
5269/**
5270 * Serializes the message to binary data (in protobuf wire format).
5271 * @return {!Uint8Array}
5272 */
5273proto.protocol.HelloMessage.prototype.serializeBinary = function() {
5274 var writer = new jspb.BinaryWriter();
5275 proto.protocol.HelloMessage.serializeBinaryToWriter(this, writer);
5276 return writer.getResultBuffer();
5277};
5278
5279
5280/**
5281 * Serializes the given message to binary data (in protobuf wire
5282 * format), writing to the given BinaryWriter.
5283 * @param {!proto.protocol.HelloMessage} message
5284 * @param {!jspb.BinaryWriter} writer
5285 * @suppress {unusedLocalVariables} f is only used for nested messages
5286 */
5287proto.protocol.HelloMessage.serializeBinaryToWriter = function(message, writer) {
5288 var f = undefined;
5289 f = message.getFrom();
5290 if (f != null) {
5291 writer.writeMessage(
5292 1,
5293 f,
5294 core_Discover_pb.Endpoint.serializeBinaryToWriter
5295 );
5296 }
5297 f = message.getVersion();
5298 if (f !== 0) {
5299 writer.writeInt32(
5300 2,
5301 f
5302 );
5303 }
5304};
5305
5306
5307/**
5308 * optional Endpoint from = 1;
5309 * @return {?proto.protocol.Endpoint}
5310 */
5311proto.protocol.HelloMessage.prototype.getFrom = function() {
5312 return /** @type{?proto.protocol.Endpoint} */ (
5313 jspb.Message.getWrapperField(this, core_Discover_pb.Endpoint, 1));
5314};
5315
5316
5317/** @param {?proto.protocol.Endpoint|undefined} value */
5318proto.protocol.HelloMessage.prototype.setFrom = function(value) {
5319 jspb.Message.setWrapperField(this, 1, value);
5320};
5321
5322
5323proto.protocol.HelloMessage.prototype.clearFrom = function() {
5324 this.setFrom(undefined);
5325};
5326
5327
5328/**
5329 * Returns whether this field is set.
5330 * @return {!boolean}
5331 */
5332proto.protocol.HelloMessage.prototype.hasFrom = function() {
5333 return jspb.Message.getField(this, 1) != null;
5334};
5335
5336
5337/**
5338 * optional int32 version = 2;
5339 * @return {number}
5340 */
5341proto.protocol.HelloMessage.prototype.getVersion = function() {
5342 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
5343};
5344
5345
5346/** @param {number} value */
5347proto.protocol.HelloMessage.prototype.setVersion = function(value) {
5348 jspb.Message.setProto3IntField(this, 2, value);
5349};
5350
5351
5352/**
5353 * @enum {number}
5354 */
5355proto.protocol.AccountType = {
5356 NORMAL: 0,
5357 ASSETISSUE: 1,
5358 CONTRACT: 2
5359};
5360
5361/**
5362 * @enum {number}
5363 */
5364proto.protocol.ReasonCode = {
5365 REQUESTED: 0,
5366 TCP_ERROR: 1,
5367 BAD_PROTOCOL: 2,
5368 USELESS_PEER: 3,
5369 TOO_MANY_PEERS: 4,
5370 DUPLICATE_PEER: 5,
5371 INCOMPATIBLE_PROTOCOL: 6,
5372 NULL_IDENTITY: 7,
5373 PEER_QUITING: 8,
5374 UNEXPECTED_IDENTITY: 9,
5375 LOCAL_IDENTITY: 10,
5376 PING_TIMEOUT: 11,
5377 USER_REASON: 12,
5378 UNKNOWN: 255
5379};
5380
5381goog.object.extend(exports, proto.protocol);