github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/payload_pb.js (about) 1 // source: payload.proto 2 /** 3 * @fileoverview 4 * @enhanceable 5 * @suppress {missingRequire} reports error on implicit type usages. 6 * @suppress {messageConventions} JS Compiler reports an error if a variable or 7 * field starts with 'MSG_' and isn't a translatable message. 8 * @public 9 */ 10 // GENERATED CODE -- DO NOT EDIT! 11 /* eslint-disable */ 12 // @ts-nocheck 13 14 var jspb = require('google-protobuf'); 15 var goog = jspb; 16 var global = Function('return this')(); 17 18 var gogoproto_gogo_pb = require('./gogoproto/gogo_pb.js'); 19 goog.object.extend(proto, gogoproto_gogo_pb); 20 var permission_pb = require('./permission_pb.js'); 21 goog.object.extend(proto, permission_pb); 22 var registry_pb = require('./registry_pb.js'); 23 goog.object.extend(proto, registry_pb); 24 var spec_pb = require('./spec_pb.js'); 25 goog.object.extend(proto, spec_pb); 26 goog.exportSymbol('proto.payload.Any', null, global); 27 goog.exportSymbol('proto.payload.Ballot', null, global); 28 goog.exportSymbol('proto.payload.Ballot.ProposalState', null, global); 29 goog.exportSymbol('proto.payload.BatchTx', null, global); 30 goog.exportSymbol('proto.payload.BondTx', null, global); 31 goog.exportSymbol('proto.payload.CallTx', null, global); 32 goog.exportSymbol('proto.payload.ContractMeta', null, global); 33 goog.exportSymbol('proto.payload.GovTx', null, global); 34 goog.exportSymbol('proto.payload.IdentifyTx', null, global); 35 goog.exportSymbol('proto.payload.NameTx', null, global); 36 goog.exportSymbol('proto.payload.PermsTx', null, global); 37 goog.exportSymbol('proto.payload.Proposal', null, global); 38 goog.exportSymbol('proto.payload.ProposalTx', null, global); 39 goog.exportSymbol('proto.payload.SendTx', null, global); 40 goog.exportSymbol('proto.payload.TxInput', null, global); 41 goog.exportSymbol('proto.payload.TxOutput', null, global); 42 goog.exportSymbol('proto.payload.UnbondTx', null, global); 43 goog.exportSymbol('proto.payload.Vote', null, global); 44 /** 45 * Generated by JsPbCodeGenerator. 46 * @param {Array=} opt_data Optional initial data array, typically from a 47 * server response, or constructed directly in Javascript. The array is used 48 * in place and becomes part of the constructed object. It is not cloned. 49 * If no data is provided, the constructed object will be empty, but still 50 * valid. 51 * @extends {jspb.Message} 52 * @constructor 53 */ 54 proto.payload.Any = function(opt_data) { 55 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 56 }; 57 goog.inherits(proto.payload.Any, jspb.Message); 58 if (goog.DEBUG && !COMPILED) { 59 /** 60 * @public 61 * @override 62 */ 63 proto.payload.Any.displayName = 'proto.payload.Any'; 64 } 65 /** 66 * Generated by JsPbCodeGenerator. 67 * @param {Array=} opt_data Optional initial data array, typically from a 68 * server response, or constructed directly in Javascript. The array is used 69 * in place and becomes part of the constructed object. It is not cloned. 70 * If no data is provided, the constructed object will be empty, but still 71 * valid. 72 * @extends {jspb.Message} 73 * @constructor 74 */ 75 proto.payload.TxInput = function(opt_data) { 76 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 77 }; 78 goog.inherits(proto.payload.TxInput, jspb.Message); 79 if (goog.DEBUG && !COMPILED) { 80 /** 81 * @public 82 * @override 83 */ 84 proto.payload.TxInput.displayName = 'proto.payload.TxInput'; 85 } 86 /** 87 * Generated by JsPbCodeGenerator. 88 * @param {Array=} opt_data Optional initial data array, typically from a 89 * server response, or constructed directly in Javascript. The array is used 90 * in place and becomes part of the constructed object. It is not cloned. 91 * If no data is provided, the constructed object will be empty, but still 92 * valid. 93 * @extends {jspb.Message} 94 * @constructor 95 */ 96 proto.payload.TxOutput = function(opt_data) { 97 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 98 }; 99 goog.inherits(proto.payload.TxOutput, jspb.Message); 100 if (goog.DEBUG && !COMPILED) { 101 /** 102 * @public 103 * @override 104 */ 105 proto.payload.TxOutput.displayName = 'proto.payload.TxOutput'; 106 } 107 /** 108 * Generated by JsPbCodeGenerator. 109 * @param {Array=} opt_data Optional initial data array, typically from a 110 * server response, or constructed directly in Javascript. The array is used 111 * in place and becomes part of the constructed object. It is not cloned. 112 * If no data is provided, the constructed object will be empty, but still 113 * valid. 114 * @extends {jspb.Message} 115 * @constructor 116 */ 117 proto.payload.CallTx = function(opt_data) { 118 jspb.Message.initialize(this, opt_data, 0, -1, proto.payload.CallTx.repeatedFields_, null); 119 }; 120 goog.inherits(proto.payload.CallTx, jspb.Message); 121 if (goog.DEBUG && !COMPILED) { 122 /** 123 * @public 124 * @override 125 */ 126 proto.payload.CallTx.displayName = 'proto.payload.CallTx'; 127 } 128 /** 129 * Generated by JsPbCodeGenerator. 130 * @param {Array=} opt_data Optional initial data array, typically from a 131 * server response, or constructed directly in Javascript. The array is used 132 * in place and becomes part of the constructed object. It is not cloned. 133 * If no data is provided, the constructed object will be empty, but still 134 * valid. 135 * @extends {jspb.Message} 136 * @constructor 137 */ 138 proto.payload.ContractMeta = function(opt_data) { 139 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 140 }; 141 goog.inherits(proto.payload.ContractMeta, jspb.Message); 142 if (goog.DEBUG && !COMPILED) { 143 /** 144 * @public 145 * @override 146 */ 147 proto.payload.ContractMeta.displayName = 'proto.payload.ContractMeta'; 148 } 149 /** 150 * Generated by JsPbCodeGenerator. 151 * @param {Array=} opt_data Optional initial data array, typically from a 152 * server response, or constructed directly in Javascript. The array is used 153 * in place and becomes part of the constructed object. It is not cloned. 154 * If no data is provided, the constructed object will be empty, but still 155 * valid. 156 * @extends {jspb.Message} 157 * @constructor 158 */ 159 proto.payload.SendTx = function(opt_data) { 160 jspb.Message.initialize(this, opt_data, 0, -1, proto.payload.SendTx.repeatedFields_, null); 161 }; 162 goog.inherits(proto.payload.SendTx, jspb.Message); 163 if (goog.DEBUG && !COMPILED) { 164 /** 165 * @public 166 * @override 167 */ 168 proto.payload.SendTx.displayName = 'proto.payload.SendTx'; 169 } 170 /** 171 * Generated by JsPbCodeGenerator. 172 * @param {Array=} opt_data Optional initial data array, typically from a 173 * server response, or constructed directly in Javascript. The array is used 174 * in place and becomes part of the constructed object. It is not cloned. 175 * If no data is provided, the constructed object will be empty, but still 176 * valid. 177 * @extends {jspb.Message} 178 * @constructor 179 */ 180 proto.payload.PermsTx = function(opt_data) { 181 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 182 }; 183 goog.inherits(proto.payload.PermsTx, jspb.Message); 184 if (goog.DEBUG && !COMPILED) { 185 /** 186 * @public 187 * @override 188 */ 189 proto.payload.PermsTx.displayName = 'proto.payload.PermsTx'; 190 } 191 /** 192 * Generated by JsPbCodeGenerator. 193 * @param {Array=} opt_data Optional initial data array, typically from a 194 * server response, or constructed directly in Javascript. The array is used 195 * in place and becomes part of the constructed object. It is not cloned. 196 * If no data is provided, the constructed object will be empty, but still 197 * valid. 198 * @extends {jspb.Message} 199 * @constructor 200 */ 201 proto.payload.NameTx = function(opt_data) { 202 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 203 }; 204 goog.inherits(proto.payload.NameTx, jspb.Message); 205 if (goog.DEBUG && !COMPILED) { 206 /** 207 * @public 208 * @override 209 */ 210 proto.payload.NameTx.displayName = 'proto.payload.NameTx'; 211 } 212 /** 213 * Generated by JsPbCodeGenerator. 214 * @param {Array=} opt_data Optional initial data array, typically from a 215 * server response, or constructed directly in Javascript. The array is used 216 * in place and becomes part of the constructed object. It is not cloned. 217 * If no data is provided, the constructed object will be empty, but still 218 * valid. 219 * @extends {jspb.Message} 220 * @constructor 221 */ 222 proto.payload.BondTx = function(opt_data) { 223 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 224 }; 225 goog.inherits(proto.payload.BondTx, jspb.Message); 226 if (goog.DEBUG && !COMPILED) { 227 /** 228 * @public 229 * @override 230 */ 231 proto.payload.BondTx.displayName = 'proto.payload.BondTx'; 232 } 233 /** 234 * Generated by JsPbCodeGenerator. 235 * @param {Array=} opt_data Optional initial data array, typically from a 236 * server response, or constructed directly in Javascript. The array is used 237 * in place and becomes part of the constructed object. It is not cloned. 238 * If no data is provided, the constructed object will be empty, but still 239 * valid. 240 * @extends {jspb.Message} 241 * @constructor 242 */ 243 proto.payload.UnbondTx = function(opt_data) { 244 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 245 }; 246 goog.inherits(proto.payload.UnbondTx, jspb.Message); 247 if (goog.DEBUG && !COMPILED) { 248 /** 249 * @public 250 * @override 251 */ 252 proto.payload.UnbondTx.displayName = 'proto.payload.UnbondTx'; 253 } 254 /** 255 * Generated by JsPbCodeGenerator. 256 * @param {Array=} opt_data Optional initial data array, typically from a 257 * server response, or constructed directly in Javascript. The array is used 258 * in place and becomes part of the constructed object. It is not cloned. 259 * If no data is provided, the constructed object will be empty, but still 260 * valid. 261 * @extends {jspb.Message} 262 * @constructor 263 */ 264 proto.payload.GovTx = function(opt_data) { 265 jspb.Message.initialize(this, opt_data, 0, -1, proto.payload.GovTx.repeatedFields_, null); 266 }; 267 goog.inherits(proto.payload.GovTx, jspb.Message); 268 if (goog.DEBUG && !COMPILED) { 269 /** 270 * @public 271 * @override 272 */ 273 proto.payload.GovTx.displayName = 'proto.payload.GovTx'; 274 } 275 /** 276 * Generated by JsPbCodeGenerator. 277 * @param {Array=} opt_data Optional initial data array, typically from a 278 * server response, or constructed directly in Javascript. The array is used 279 * in place and becomes part of the constructed object. It is not cloned. 280 * If no data is provided, the constructed object will be empty, but still 281 * valid. 282 * @extends {jspb.Message} 283 * @constructor 284 */ 285 proto.payload.ProposalTx = function(opt_data) { 286 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 287 }; 288 goog.inherits(proto.payload.ProposalTx, jspb.Message); 289 if (goog.DEBUG && !COMPILED) { 290 /** 291 * @public 292 * @override 293 */ 294 proto.payload.ProposalTx.displayName = 'proto.payload.ProposalTx'; 295 } 296 /** 297 * Generated by JsPbCodeGenerator. 298 * @param {Array=} opt_data Optional initial data array, typically from a 299 * server response, or constructed directly in Javascript. The array is used 300 * in place and becomes part of the constructed object. It is not cloned. 301 * If no data is provided, the constructed object will be empty, but still 302 * valid. 303 * @extends {jspb.Message} 304 * @constructor 305 */ 306 proto.payload.IdentifyTx = function(opt_data) { 307 jspb.Message.initialize(this, opt_data, 0, -1, proto.payload.IdentifyTx.repeatedFields_, null); 308 }; 309 goog.inherits(proto.payload.IdentifyTx, jspb.Message); 310 if (goog.DEBUG && !COMPILED) { 311 /** 312 * @public 313 * @override 314 */ 315 proto.payload.IdentifyTx.displayName = 'proto.payload.IdentifyTx'; 316 } 317 /** 318 * Generated by JsPbCodeGenerator. 319 * @param {Array=} opt_data Optional initial data array, typically from a 320 * server response, or constructed directly in Javascript. The array is used 321 * in place and becomes part of the constructed object. It is not cloned. 322 * If no data is provided, the constructed object will be empty, but still 323 * valid. 324 * @extends {jspb.Message} 325 * @constructor 326 */ 327 proto.payload.BatchTx = function(opt_data) { 328 jspb.Message.initialize(this, opt_data, 0, -1, proto.payload.BatchTx.repeatedFields_, null); 329 }; 330 goog.inherits(proto.payload.BatchTx, jspb.Message); 331 if (goog.DEBUG && !COMPILED) { 332 /** 333 * @public 334 * @override 335 */ 336 proto.payload.BatchTx.displayName = 'proto.payload.BatchTx'; 337 } 338 /** 339 * Generated by JsPbCodeGenerator. 340 * @param {Array=} opt_data Optional initial data array, typically from a 341 * server response, or constructed directly in Javascript. The array is used 342 * in place and becomes part of the constructed object. It is not cloned. 343 * If no data is provided, the constructed object will be empty, but still 344 * valid. 345 * @extends {jspb.Message} 346 * @constructor 347 */ 348 proto.payload.Vote = function(opt_data) { 349 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 350 }; 351 goog.inherits(proto.payload.Vote, jspb.Message); 352 if (goog.DEBUG && !COMPILED) { 353 /** 354 * @public 355 * @override 356 */ 357 proto.payload.Vote.displayName = 'proto.payload.Vote'; 358 } 359 /** 360 * Generated by JsPbCodeGenerator. 361 * @param {Array=} opt_data Optional initial data array, typically from a 362 * server response, or constructed directly in Javascript. The array is used 363 * in place and becomes part of the constructed object. It is not cloned. 364 * If no data is provided, the constructed object will be empty, but still 365 * valid. 366 * @extends {jspb.Message} 367 * @constructor 368 */ 369 proto.payload.Proposal = function(opt_data) { 370 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 371 }; 372 goog.inherits(proto.payload.Proposal, jspb.Message); 373 if (goog.DEBUG && !COMPILED) { 374 /** 375 * @public 376 * @override 377 */ 378 proto.payload.Proposal.displayName = 'proto.payload.Proposal'; 379 } 380 /** 381 * Generated by JsPbCodeGenerator. 382 * @param {Array=} opt_data Optional initial data array, typically from a 383 * server response, or constructed directly in Javascript. The array is used 384 * in place and becomes part of the constructed object. It is not cloned. 385 * If no data is provided, the constructed object will be empty, but still 386 * valid. 387 * @extends {jspb.Message} 388 * @constructor 389 */ 390 proto.payload.Ballot = function(opt_data) { 391 jspb.Message.initialize(this, opt_data, 0, -1, proto.payload.Ballot.repeatedFields_, null); 392 }; 393 goog.inherits(proto.payload.Ballot, jspb.Message); 394 if (goog.DEBUG && !COMPILED) { 395 /** 396 * @public 397 * @override 398 */ 399 proto.payload.Ballot.displayName = 'proto.payload.Ballot'; 400 } 401 402 403 404 if (jspb.Message.GENERATE_TO_OBJECT) { 405 /** 406 * Creates an object representation of this proto. 407 * Field names that are reserved in JavaScript and will be renamed to pb_name. 408 * Optional fields that are not set will be set to undefined. 409 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 410 * For the list of reserved names please see: 411 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 412 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 413 * JSPB instance for transitional soy proto support: 414 * http://goto/soy-param-migration 415 * @return {!Object} 416 */ 417 proto.payload.Any.prototype.toObject = function(opt_includeInstance) { 418 return proto.payload.Any.toObject(opt_includeInstance, this); 419 }; 420 421 422 /** 423 * Static version of the {@see toObject} method. 424 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 425 * the JSPB instance for transitional soy proto support: 426 * http://goto/soy-param-migration 427 * @param {!proto.payload.Any} msg The msg instance to transform. 428 * @return {!Object} 429 * @suppress {unusedLocalVariables} f is only used for nested messages 430 */ 431 proto.payload.Any.toObject = function(includeInstance, msg) { 432 var f, obj = { 433 calltx: (f = msg.getCalltx()) && proto.payload.CallTx.toObject(includeInstance, f), 434 sendtx: (f = msg.getSendtx()) && proto.payload.SendTx.toObject(includeInstance, f), 435 nametx: (f = msg.getNametx()) && proto.payload.NameTx.toObject(includeInstance, f), 436 permstx: (f = msg.getPermstx()) && proto.payload.PermsTx.toObject(includeInstance, f), 437 govtx: (f = msg.getGovtx()) && proto.payload.GovTx.toObject(includeInstance, f), 438 bondtx: (f = msg.getBondtx()) && proto.payload.BondTx.toObject(includeInstance, f), 439 unbondtx: (f = msg.getUnbondtx()) && proto.payload.UnbondTx.toObject(includeInstance, f), 440 batchtx: (f = msg.getBatchtx()) && proto.payload.BatchTx.toObject(includeInstance, f), 441 proposaltx: (f = msg.getProposaltx()) && proto.payload.ProposalTx.toObject(includeInstance, f), 442 identifytx: (f = msg.getIdentifytx()) && proto.payload.IdentifyTx.toObject(includeInstance, f) 443 }; 444 445 if (includeInstance) { 446 obj.$jspbMessageInstance = msg; 447 } 448 return obj; 449 }; 450 } 451 452 453 /** 454 * Deserializes binary data (in protobuf wire format). 455 * @param {jspb.ByteSource} bytes The bytes to deserialize. 456 * @return {!proto.payload.Any} 457 */ 458 proto.payload.Any.deserializeBinary = function(bytes) { 459 var reader = new jspb.BinaryReader(bytes); 460 var msg = new proto.payload.Any; 461 return proto.payload.Any.deserializeBinaryFromReader(msg, reader); 462 }; 463 464 465 /** 466 * Deserializes binary data (in protobuf wire format) from the 467 * given reader into the given message object. 468 * @param {!proto.payload.Any} msg The message object to deserialize into. 469 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 470 * @return {!proto.payload.Any} 471 */ 472 proto.payload.Any.deserializeBinaryFromReader = function(msg, reader) { 473 while (reader.nextField()) { 474 if (reader.isEndGroup()) { 475 break; 476 } 477 var field = reader.getFieldNumber(); 478 switch (field) { 479 case 1: 480 var value = new proto.payload.CallTx; 481 reader.readMessage(value,proto.payload.CallTx.deserializeBinaryFromReader); 482 msg.setCalltx(value); 483 break; 484 case 2: 485 var value = new proto.payload.SendTx; 486 reader.readMessage(value,proto.payload.SendTx.deserializeBinaryFromReader); 487 msg.setSendtx(value); 488 break; 489 case 3: 490 var value = new proto.payload.NameTx; 491 reader.readMessage(value,proto.payload.NameTx.deserializeBinaryFromReader); 492 msg.setNametx(value); 493 break; 494 case 4: 495 var value = new proto.payload.PermsTx; 496 reader.readMessage(value,proto.payload.PermsTx.deserializeBinaryFromReader); 497 msg.setPermstx(value); 498 break; 499 case 5: 500 var value = new proto.payload.GovTx; 501 reader.readMessage(value,proto.payload.GovTx.deserializeBinaryFromReader); 502 msg.setGovtx(value); 503 break; 504 case 6: 505 var value = new proto.payload.BondTx; 506 reader.readMessage(value,proto.payload.BondTx.deserializeBinaryFromReader); 507 msg.setBondtx(value); 508 break; 509 case 7: 510 var value = new proto.payload.UnbondTx; 511 reader.readMessage(value,proto.payload.UnbondTx.deserializeBinaryFromReader); 512 msg.setUnbondtx(value); 513 break; 514 case 8: 515 var value = new proto.payload.BatchTx; 516 reader.readMessage(value,proto.payload.BatchTx.deserializeBinaryFromReader); 517 msg.setBatchtx(value); 518 break; 519 case 9: 520 var value = new proto.payload.ProposalTx; 521 reader.readMessage(value,proto.payload.ProposalTx.deserializeBinaryFromReader); 522 msg.setProposaltx(value); 523 break; 524 case 10: 525 var value = new proto.payload.IdentifyTx; 526 reader.readMessage(value,proto.payload.IdentifyTx.deserializeBinaryFromReader); 527 msg.setIdentifytx(value); 528 break; 529 default: 530 reader.skipField(); 531 break; 532 } 533 } 534 return msg; 535 }; 536 537 538 /** 539 * Serializes the message to binary data (in protobuf wire format). 540 * @return {!Uint8Array} 541 */ 542 proto.payload.Any.prototype.serializeBinary = function() { 543 var writer = new jspb.BinaryWriter(); 544 proto.payload.Any.serializeBinaryToWriter(this, writer); 545 return writer.getResultBuffer(); 546 }; 547 548 549 /** 550 * Serializes the given message to binary data (in protobuf wire 551 * format), writing to the given BinaryWriter. 552 * @param {!proto.payload.Any} message 553 * @param {!jspb.BinaryWriter} writer 554 * @suppress {unusedLocalVariables} f is only used for nested messages 555 */ 556 proto.payload.Any.serializeBinaryToWriter = function(message, writer) { 557 var f = undefined; 558 f = message.getCalltx(); 559 if (f != null) { 560 writer.writeMessage( 561 1, 562 f, 563 proto.payload.CallTx.serializeBinaryToWriter 564 ); 565 } 566 f = message.getSendtx(); 567 if (f != null) { 568 writer.writeMessage( 569 2, 570 f, 571 proto.payload.SendTx.serializeBinaryToWriter 572 ); 573 } 574 f = message.getNametx(); 575 if (f != null) { 576 writer.writeMessage( 577 3, 578 f, 579 proto.payload.NameTx.serializeBinaryToWriter 580 ); 581 } 582 f = message.getPermstx(); 583 if (f != null) { 584 writer.writeMessage( 585 4, 586 f, 587 proto.payload.PermsTx.serializeBinaryToWriter 588 ); 589 } 590 f = message.getGovtx(); 591 if (f != null) { 592 writer.writeMessage( 593 5, 594 f, 595 proto.payload.GovTx.serializeBinaryToWriter 596 ); 597 } 598 f = message.getBondtx(); 599 if (f != null) { 600 writer.writeMessage( 601 6, 602 f, 603 proto.payload.BondTx.serializeBinaryToWriter 604 ); 605 } 606 f = message.getUnbondtx(); 607 if (f != null) { 608 writer.writeMessage( 609 7, 610 f, 611 proto.payload.UnbondTx.serializeBinaryToWriter 612 ); 613 } 614 f = message.getBatchtx(); 615 if (f != null) { 616 writer.writeMessage( 617 8, 618 f, 619 proto.payload.BatchTx.serializeBinaryToWriter 620 ); 621 } 622 f = message.getProposaltx(); 623 if (f != null) { 624 writer.writeMessage( 625 9, 626 f, 627 proto.payload.ProposalTx.serializeBinaryToWriter 628 ); 629 } 630 f = message.getIdentifytx(); 631 if (f != null) { 632 writer.writeMessage( 633 10, 634 f, 635 proto.payload.IdentifyTx.serializeBinaryToWriter 636 ); 637 } 638 }; 639 640 641 /** 642 * optional CallTx CallTx = 1; 643 * @return {?proto.payload.CallTx} 644 */ 645 proto.payload.Any.prototype.getCalltx = function() { 646 return /** @type{?proto.payload.CallTx} */ ( 647 jspb.Message.getWrapperField(this, proto.payload.CallTx, 1)); 648 }; 649 650 651 /** 652 * @param {?proto.payload.CallTx|undefined} value 653 * @return {!proto.payload.Any} returns this 654 */ 655 proto.payload.Any.prototype.setCalltx = function(value) { 656 return jspb.Message.setWrapperField(this, 1, value); 657 }; 658 659 660 /** 661 * Clears the message field making it undefined. 662 * @return {!proto.payload.Any} returns this 663 */ 664 proto.payload.Any.prototype.clearCalltx = function() { 665 return this.setCalltx(undefined); 666 }; 667 668 669 /** 670 * Returns whether this field is set. 671 * @return {boolean} 672 */ 673 proto.payload.Any.prototype.hasCalltx = function() { 674 return jspb.Message.getField(this, 1) != null; 675 }; 676 677 678 /** 679 * optional SendTx SendTx = 2; 680 * @return {?proto.payload.SendTx} 681 */ 682 proto.payload.Any.prototype.getSendtx = function() { 683 return /** @type{?proto.payload.SendTx} */ ( 684 jspb.Message.getWrapperField(this, proto.payload.SendTx, 2)); 685 }; 686 687 688 /** 689 * @param {?proto.payload.SendTx|undefined} value 690 * @return {!proto.payload.Any} returns this 691 */ 692 proto.payload.Any.prototype.setSendtx = function(value) { 693 return jspb.Message.setWrapperField(this, 2, value); 694 }; 695 696 697 /** 698 * Clears the message field making it undefined. 699 * @return {!proto.payload.Any} returns this 700 */ 701 proto.payload.Any.prototype.clearSendtx = function() { 702 return this.setSendtx(undefined); 703 }; 704 705 706 /** 707 * Returns whether this field is set. 708 * @return {boolean} 709 */ 710 proto.payload.Any.prototype.hasSendtx = function() { 711 return jspb.Message.getField(this, 2) != null; 712 }; 713 714 715 /** 716 * optional NameTx NameTx = 3; 717 * @return {?proto.payload.NameTx} 718 */ 719 proto.payload.Any.prototype.getNametx = function() { 720 return /** @type{?proto.payload.NameTx} */ ( 721 jspb.Message.getWrapperField(this, proto.payload.NameTx, 3)); 722 }; 723 724 725 /** 726 * @param {?proto.payload.NameTx|undefined} value 727 * @return {!proto.payload.Any} returns this 728 */ 729 proto.payload.Any.prototype.setNametx = function(value) { 730 return jspb.Message.setWrapperField(this, 3, value); 731 }; 732 733 734 /** 735 * Clears the message field making it undefined. 736 * @return {!proto.payload.Any} returns this 737 */ 738 proto.payload.Any.prototype.clearNametx = function() { 739 return this.setNametx(undefined); 740 }; 741 742 743 /** 744 * Returns whether this field is set. 745 * @return {boolean} 746 */ 747 proto.payload.Any.prototype.hasNametx = function() { 748 return jspb.Message.getField(this, 3) != null; 749 }; 750 751 752 /** 753 * optional PermsTx PermsTx = 4; 754 * @return {?proto.payload.PermsTx} 755 */ 756 proto.payload.Any.prototype.getPermstx = function() { 757 return /** @type{?proto.payload.PermsTx} */ ( 758 jspb.Message.getWrapperField(this, proto.payload.PermsTx, 4)); 759 }; 760 761 762 /** 763 * @param {?proto.payload.PermsTx|undefined} value 764 * @return {!proto.payload.Any} returns this 765 */ 766 proto.payload.Any.prototype.setPermstx = function(value) { 767 return jspb.Message.setWrapperField(this, 4, value); 768 }; 769 770 771 /** 772 * Clears the message field making it undefined. 773 * @return {!proto.payload.Any} returns this 774 */ 775 proto.payload.Any.prototype.clearPermstx = function() { 776 return this.setPermstx(undefined); 777 }; 778 779 780 /** 781 * Returns whether this field is set. 782 * @return {boolean} 783 */ 784 proto.payload.Any.prototype.hasPermstx = function() { 785 return jspb.Message.getField(this, 4) != null; 786 }; 787 788 789 /** 790 * optional GovTx GovTx = 5; 791 * @return {?proto.payload.GovTx} 792 */ 793 proto.payload.Any.prototype.getGovtx = function() { 794 return /** @type{?proto.payload.GovTx} */ ( 795 jspb.Message.getWrapperField(this, proto.payload.GovTx, 5)); 796 }; 797 798 799 /** 800 * @param {?proto.payload.GovTx|undefined} value 801 * @return {!proto.payload.Any} returns this 802 */ 803 proto.payload.Any.prototype.setGovtx = function(value) { 804 return jspb.Message.setWrapperField(this, 5, value); 805 }; 806 807 808 /** 809 * Clears the message field making it undefined. 810 * @return {!proto.payload.Any} returns this 811 */ 812 proto.payload.Any.prototype.clearGovtx = function() { 813 return this.setGovtx(undefined); 814 }; 815 816 817 /** 818 * Returns whether this field is set. 819 * @return {boolean} 820 */ 821 proto.payload.Any.prototype.hasGovtx = function() { 822 return jspb.Message.getField(this, 5) != null; 823 }; 824 825 826 /** 827 * optional BondTx BondTx = 6; 828 * @return {?proto.payload.BondTx} 829 */ 830 proto.payload.Any.prototype.getBondtx = function() { 831 return /** @type{?proto.payload.BondTx} */ ( 832 jspb.Message.getWrapperField(this, proto.payload.BondTx, 6)); 833 }; 834 835 836 /** 837 * @param {?proto.payload.BondTx|undefined} value 838 * @return {!proto.payload.Any} returns this 839 */ 840 proto.payload.Any.prototype.setBondtx = function(value) { 841 return jspb.Message.setWrapperField(this, 6, value); 842 }; 843 844 845 /** 846 * Clears the message field making it undefined. 847 * @return {!proto.payload.Any} returns this 848 */ 849 proto.payload.Any.prototype.clearBondtx = function() { 850 return this.setBondtx(undefined); 851 }; 852 853 854 /** 855 * Returns whether this field is set. 856 * @return {boolean} 857 */ 858 proto.payload.Any.prototype.hasBondtx = function() { 859 return jspb.Message.getField(this, 6) != null; 860 }; 861 862 863 /** 864 * optional UnbondTx UnbondTx = 7; 865 * @return {?proto.payload.UnbondTx} 866 */ 867 proto.payload.Any.prototype.getUnbondtx = function() { 868 return /** @type{?proto.payload.UnbondTx} */ ( 869 jspb.Message.getWrapperField(this, proto.payload.UnbondTx, 7)); 870 }; 871 872 873 /** 874 * @param {?proto.payload.UnbondTx|undefined} value 875 * @return {!proto.payload.Any} returns this 876 */ 877 proto.payload.Any.prototype.setUnbondtx = function(value) { 878 return jspb.Message.setWrapperField(this, 7, value); 879 }; 880 881 882 /** 883 * Clears the message field making it undefined. 884 * @return {!proto.payload.Any} returns this 885 */ 886 proto.payload.Any.prototype.clearUnbondtx = function() { 887 return this.setUnbondtx(undefined); 888 }; 889 890 891 /** 892 * Returns whether this field is set. 893 * @return {boolean} 894 */ 895 proto.payload.Any.prototype.hasUnbondtx = function() { 896 return jspb.Message.getField(this, 7) != null; 897 }; 898 899 900 /** 901 * optional BatchTx BatchTx = 8; 902 * @return {?proto.payload.BatchTx} 903 */ 904 proto.payload.Any.prototype.getBatchtx = function() { 905 return /** @type{?proto.payload.BatchTx} */ ( 906 jspb.Message.getWrapperField(this, proto.payload.BatchTx, 8)); 907 }; 908 909 910 /** 911 * @param {?proto.payload.BatchTx|undefined} value 912 * @return {!proto.payload.Any} returns this 913 */ 914 proto.payload.Any.prototype.setBatchtx = function(value) { 915 return jspb.Message.setWrapperField(this, 8, value); 916 }; 917 918 919 /** 920 * Clears the message field making it undefined. 921 * @return {!proto.payload.Any} returns this 922 */ 923 proto.payload.Any.prototype.clearBatchtx = function() { 924 return this.setBatchtx(undefined); 925 }; 926 927 928 /** 929 * Returns whether this field is set. 930 * @return {boolean} 931 */ 932 proto.payload.Any.prototype.hasBatchtx = function() { 933 return jspb.Message.getField(this, 8) != null; 934 }; 935 936 937 /** 938 * optional ProposalTx ProposalTx = 9; 939 * @return {?proto.payload.ProposalTx} 940 */ 941 proto.payload.Any.prototype.getProposaltx = function() { 942 return /** @type{?proto.payload.ProposalTx} */ ( 943 jspb.Message.getWrapperField(this, proto.payload.ProposalTx, 9)); 944 }; 945 946 947 /** 948 * @param {?proto.payload.ProposalTx|undefined} value 949 * @return {!proto.payload.Any} returns this 950 */ 951 proto.payload.Any.prototype.setProposaltx = function(value) { 952 return jspb.Message.setWrapperField(this, 9, value); 953 }; 954 955 956 /** 957 * Clears the message field making it undefined. 958 * @return {!proto.payload.Any} returns this 959 */ 960 proto.payload.Any.prototype.clearProposaltx = function() { 961 return this.setProposaltx(undefined); 962 }; 963 964 965 /** 966 * Returns whether this field is set. 967 * @return {boolean} 968 */ 969 proto.payload.Any.prototype.hasProposaltx = function() { 970 return jspb.Message.getField(this, 9) != null; 971 }; 972 973 974 /** 975 * optional IdentifyTx IdentifyTx = 10; 976 * @return {?proto.payload.IdentifyTx} 977 */ 978 proto.payload.Any.prototype.getIdentifytx = function() { 979 return /** @type{?proto.payload.IdentifyTx} */ ( 980 jspb.Message.getWrapperField(this, proto.payload.IdentifyTx, 10)); 981 }; 982 983 984 /** 985 * @param {?proto.payload.IdentifyTx|undefined} value 986 * @return {!proto.payload.Any} returns this 987 */ 988 proto.payload.Any.prototype.setIdentifytx = function(value) { 989 return jspb.Message.setWrapperField(this, 10, value); 990 }; 991 992 993 /** 994 * Clears the message field making it undefined. 995 * @return {!proto.payload.Any} returns this 996 */ 997 proto.payload.Any.prototype.clearIdentifytx = function() { 998 return this.setIdentifytx(undefined); 999 }; 1000 1001 1002 /** 1003 * Returns whether this field is set. 1004 * @return {boolean} 1005 */ 1006 proto.payload.Any.prototype.hasIdentifytx = function() { 1007 return jspb.Message.getField(this, 10) != null; 1008 }; 1009 1010 1011 1012 1013 1014 if (jspb.Message.GENERATE_TO_OBJECT) { 1015 /** 1016 * Creates an object representation of this proto. 1017 * Field names that are reserved in JavaScript and will be renamed to pb_name. 1018 * Optional fields that are not set will be set to undefined. 1019 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 1020 * For the list of reserved names please see: 1021 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 1022 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 1023 * JSPB instance for transitional soy proto support: 1024 * http://goto/soy-param-migration 1025 * @return {!Object} 1026 */ 1027 proto.payload.TxInput.prototype.toObject = function(opt_includeInstance) { 1028 return proto.payload.TxInput.toObject(opt_includeInstance, this); 1029 }; 1030 1031 1032 /** 1033 * Static version of the {@see toObject} method. 1034 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 1035 * the JSPB instance for transitional soy proto support: 1036 * http://goto/soy-param-migration 1037 * @param {!proto.payload.TxInput} msg The msg instance to transform. 1038 * @return {!Object} 1039 * @suppress {unusedLocalVariables} f is only used for nested messages 1040 */ 1041 proto.payload.TxInput.toObject = function(includeInstance, msg) { 1042 var f, obj = { 1043 address: msg.getAddress_asB64(), 1044 amount: jspb.Message.getFieldWithDefault(msg, 2, 0), 1045 sequence: jspb.Message.getFieldWithDefault(msg, 3, 0) 1046 }; 1047 1048 if (includeInstance) { 1049 obj.$jspbMessageInstance = msg; 1050 } 1051 return obj; 1052 }; 1053 } 1054 1055 1056 /** 1057 * Deserializes binary data (in protobuf wire format). 1058 * @param {jspb.ByteSource} bytes The bytes to deserialize. 1059 * @return {!proto.payload.TxInput} 1060 */ 1061 proto.payload.TxInput.deserializeBinary = function(bytes) { 1062 var reader = new jspb.BinaryReader(bytes); 1063 var msg = new proto.payload.TxInput; 1064 return proto.payload.TxInput.deserializeBinaryFromReader(msg, reader); 1065 }; 1066 1067 1068 /** 1069 * Deserializes binary data (in protobuf wire format) from the 1070 * given reader into the given message object. 1071 * @param {!proto.payload.TxInput} msg The message object to deserialize into. 1072 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 1073 * @return {!proto.payload.TxInput} 1074 */ 1075 proto.payload.TxInput.deserializeBinaryFromReader = function(msg, reader) { 1076 while (reader.nextField()) { 1077 if (reader.isEndGroup()) { 1078 break; 1079 } 1080 var field = reader.getFieldNumber(); 1081 switch (field) { 1082 case 1: 1083 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 1084 msg.setAddress(value); 1085 break; 1086 case 2: 1087 var value = /** @type {number} */ (reader.readUint64()); 1088 msg.setAmount(value); 1089 break; 1090 case 3: 1091 var value = /** @type {number} */ (reader.readUint64()); 1092 msg.setSequence(value); 1093 break; 1094 default: 1095 reader.skipField(); 1096 break; 1097 } 1098 } 1099 return msg; 1100 }; 1101 1102 1103 /** 1104 * Serializes the message to binary data (in protobuf wire format). 1105 * @return {!Uint8Array} 1106 */ 1107 proto.payload.TxInput.prototype.serializeBinary = function() { 1108 var writer = new jspb.BinaryWriter(); 1109 proto.payload.TxInput.serializeBinaryToWriter(this, writer); 1110 return writer.getResultBuffer(); 1111 }; 1112 1113 1114 /** 1115 * Serializes the given message to binary data (in protobuf wire 1116 * format), writing to the given BinaryWriter. 1117 * @param {!proto.payload.TxInput} message 1118 * @param {!jspb.BinaryWriter} writer 1119 * @suppress {unusedLocalVariables} f is only used for nested messages 1120 */ 1121 proto.payload.TxInput.serializeBinaryToWriter = function(message, writer) { 1122 var f = undefined; 1123 f = message.getAddress_asU8(); 1124 if (f.length > 0) { 1125 writer.writeBytes( 1126 1, 1127 f 1128 ); 1129 } 1130 f = message.getAmount(); 1131 if (f !== 0) { 1132 writer.writeUint64( 1133 2, 1134 f 1135 ); 1136 } 1137 f = message.getSequence(); 1138 if (f !== 0) { 1139 writer.writeUint64( 1140 3, 1141 f 1142 ); 1143 } 1144 }; 1145 1146 1147 /** 1148 * optional bytes Address = 1; 1149 * @return {!(string|Uint8Array)} 1150 */ 1151 proto.payload.TxInput.prototype.getAddress = function() { 1152 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 1153 }; 1154 1155 1156 /** 1157 * optional bytes Address = 1; 1158 * This is a type-conversion wrapper around `getAddress()` 1159 * @return {string} 1160 */ 1161 proto.payload.TxInput.prototype.getAddress_asB64 = function() { 1162 return /** @type {string} */ (jspb.Message.bytesAsB64( 1163 this.getAddress())); 1164 }; 1165 1166 1167 /** 1168 * optional bytes Address = 1; 1169 * Note that Uint8Array is not supported on all browsers. 1170 * @see http://caniuse.com/Uint8Array 1171 * This is a type-conversion wrapper around `getAddress()` 1172 * @return {!Uint8Array} 1173 */ 1174 proto.payload.TxInput.prototype.getAddress_asU8 = function() { 1175 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 1176 this.getAddress())); 1177 }; 1178 1179 1180 /** 1181 * @param {!(string|Uint8Array)} value 1182 * @return {!proto.payload.TxInput} returns this 1183 */ 1184 proto.payload.TxInput.prototype.setAddress = function(value) { 1185 return jspb.Message.setProto3BytesField(this, 1, value); 1186 }; 1187 1188 1189 /** 1190 * optional uint64 Amount = 2; 1191 * @return {number} 1192 */ 1193 proto.payload.TxInput.prototype.getAmount = function() { 1194 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); 1195 }; 1196 1197 1198 /** 1199 * @param {number} value 1200 * @return {!proto.payload.TxInput} returns this 1201 */ 1202 proto.payload.TxInput.prototype.setAmount = function(value) { 1203 return jspb.Message.setProto3IntField(this, 2, value); 1204 }; 1205 1206 1207 /** 1208 * optional uint64 Sequence = 3; 1209 * @return {number} 1210 */ 1211 proto.payload.TxInput.prototype.getSequence = function() { 1212 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); 1213 }; 1214 1215 1216 /** 1217 * @param {number} value 1218 * @return {!proto.payload.TxInput} returns this 1219 */ 1220 proto.payload.TxInput.prototype.setSequence = function(value) { 1221 return jspb.Message.setProto3IntField(this, 3, value); 1222 }; 1223 1224 1225 1226 1227 1228 if (jspb.Message.GENERATE_TO_OBJECT) { 1229 /** 1230 * Creates an object representation of this proto. 1231 * Field names that are reserved in JavaScript and will be renamed to pb_name. 1232 * Optional fields that are not set will be set to undefined. 1233 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 1234 * For the list of reserved names please see: 1235 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 1236 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 1237 * JSPB instance for transitional soy proto support: 1238 * http://goto/soy-param-migration 1239 * @return {!Object} 1240 */ 1241 proto.payload.TxOutput.prototype.toObject = function(opt_includeInstance) { 1242 return proto.payload.TxOutput.toObject(opt_includeInstance, this); 1243 }; 1244 1245 1246 /** 1247 * Static version of the {@see toObject} method. 1248 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 1249 * the JSPB instance for transitional soy proto support: 1250 * http://goto/soy-param-migration 1251 * @param {!proto.payload.TxOutput} msg The msg instance to transform. 1252 * @return {!Object} 1253 * @suppress {unusedLocalVariables} f is only used for nested messages 1254 */ 1255 proto.payload.TxOutput.toObject = function(includeInstance, msg) { 1256 var f, obj = { 1257 address: msg.getAddress_asB64(), 1258 amount: jspb.Message.getFieldWithDefault(msg, 2, 0) 1259 }; 1260 1261 if (includeInstance) { 1262 obj.$jspbMessageInstance = msg; 1263 } 1264 return obj; 1265 }; 1266 } 1267 1268 1269 /** 1270 * Deserializes binary data (in protobuf wire format). 1271 * @param {jspb.ByteSource} bytes The bytes to deserialize. 1272 * @return {!proto.payload.TxOutput} 1273 */ 1274 proto.payload.TxOutput.deserializeBinary = function(bytes) { 1275 var reader = new jspb.BinaryReader(bytes); 1276 var msg = new proto.payload.TxOutput; 1277 return proto.payload.TxOutput.deserializeBinaryFromReader(msg, reader); 1278 }; 1279 1280 1281 /** 1282 * Deserializes binary data (in protobuf wire format) from the 1283 * given reader into the given message object. 1284 * @param {!proto.payload.TxOutput} msg The message object to deserialize into. 1285 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 1286 * @return {!proto.payload.TxOutput} 1287 */ 1288 proto.payload.TxOutput.deserializeBinaryFromReader = function(msg, reader) { 1289 while (reader.nextField()) { 1290 if (reader.isEndGroup()) { 1291 break; 1292 } 1293 var field = reader.getFieldNumber(); 1294 switch (field) { 1295 case 1: 1296 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 1297 msg.setAddress(value); 1298 break; 1299 case 2: 1300 var value = /** @type {number} */ (reader.readUint64()); 1301 msg.setAmount(value); 1302 break; 1303 default: 1304 reader.skipField(); 1305 break; 1306 } 1307 } 1308 return msg; 1309 }; 1310 1311 1312 /** 1313 * Serializes the message to binary data (in protobuf wire format). 1314 * @return {!Uint8Array} 1315 */ 1316 proto.payload.TxOutput.prototype.serializeBinary = function() { 1317 var writer = new jspb.BinaryWriter(); 1318 proto.payload.TxOutput.serializeBinaryToWriter(this, writer); 1319 return writer.getResultBuffer(); 1320 }; 1321 1322 1323 /** 1324 * Serializes the given message to binary data (in protobuf wire 1325 * format), writing to the given BinaryWriter. 1326 * @param {!proto.payload.TxOutput} message 1327 * @param {!jspb.BinaryWriter} writer 1328 * @suppress {unusedLocalVariables} f is only used for nested messages 1329 */ 1330 proto.payload.TxOutput.serializeBinaryToWriter = function(message, writer) { 1331 var f = undefined; 1332 f = message.getAddress_asU8(); 1333 if (f.length > 0) { 1334 writer.writeBytes( 1335 1, 1336 f 1337 ); 1338 } 1339 f = message.getAmount(); 1340 if (f !== 0) { 1341 writer.writeUint64( 1342 2, 1343 f 1344 ); 1345 } 1346 }; 1347 1348 1349 /** 1350 * optional bytes Address = 1; 1351 * @return {!(string|Uint8Array)} 1352 */ 1353 proto.payload.TxOutput.prototype.getAddress = function() { 1354 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 1355 }; 1356 1357 1358 /** 1359 * optional bytes Address = 1; 1360 * This is a type-conversion wrapper around `getAddress()` 1361 * @return {string} 1362 */ 1363 proto.payload.TxOutput.prototype.getAddress_asB64 = function() { 1364 return /** @type {string} */ (jspb.Message.bytesAsB64( 1365 this.getAddress())); 1366 }; 1367 1368 1369 /** 1370 * optional bytes Address = 1; 1371 * Note that Uint8Array is not supported on all browsers. 1372 * @see http://caniuse.com/Uint8Array 1373 * This is a type-conversion wrapper around `getAddress()` 1374 * @return {!Uint8Array} 1375 */ 1376 proto.payload.TxOutput.prototype.getAddress_asU8 = function() { 1377 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 1378 this.getAddress())); 1379 }; 1380 1381 1382 /** 1383 * @param {!(string|Uint8Array)} value 1384 * @return {!proto.payload.TxOutput} returns this 1385 */ 1386 proto.payload.TxOutput.prototype.setAddress = function(value) { 1387 return jspb.Message.setProto3BytesField(this, 1, value); 1388 }; 1389 1390 1391 /** 1392 * optional uint64 Amount = 2; 1393 * @return {number} 1394 */ 1395 proto.payload.TxOutput.prototype.getAmount = function() { 1396 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); 1397 }; 1398 1399 1400 /** 1401 * @param {number} value 1402 * @return {!proto.payload.TxOutput} returns this 1403 */ 1404 proto.payload.TxOutput.prototype.setAmount = function(value) { 1405 return jspb.Message.setProto3IntField(this, 2, value); 1406 }; 1407 1408 1409 1410 /** 1411 * List of repeated fields within this message type. 1412 * @private {!Array<number>} 1413 * @const 1414 */ 1415 proto.payload.CallTx.repeatedFields_ = [7]; 1416 1417 1418 1419 if (jspb.Message.GENERATE_TO_OBJECT) { 1420 /** 1421 * Creates an object representation of this proto. 1422 * Field names that are reserved in JavaScript and will be renamed to pb_name. 1423 * Optional fields that are not set will be set to undefined. 1424 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 1425 * For the list of reserved names please see: 1426 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 1427 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 1428 * JSPB instance for transitional soy proto support: 1429 * http://goto/soy-param-migration 1430 * @return {!Object} 1431 */ 1432 proto.payload.CallTx.prototype.toObject = function(opt_includeInstance) { 1433 return proto.payload.CallTx.toObject(opt_includeInstance, this); 1434 }; 1435 1436 1437 /** 1438 * Static version of the {@see toObject} method. 1439 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 1440 * the JSPB instance for transitional soy proto support: 1441 * http://goto/soy-param-migration 1442 * @param {!proto.payload.CallTx} msg The msg instance to transform. 1443 * @return {!Object} 1444 * @suppress {unusedLocalVariables} f is only used for nested messages 1445 */ 1446 proto.payload.CallTx.toObject = function(includeInstance, msg) { 1447 var f, obj = { 1448 input: (f = msg.getInput()) && proto.payload.TxInput.toObject(includeInstance, f), 1449 address: msg.getAddress_asB64(), 1450 gaslimit: jspb.Message.getFieldWithDefault(msg, 3, 0), 1451 fee: jspb.Message.getFieldWithDefault(msg, 4, 0), 1452 data: msg.getData_asB64(), 1453 wasm: msg.getWasm_asB64(), 1454 contractmetaList: jspb.Message.toObjectList(msg.getContractmetaList(), 1455 proto.payload.ContractMeta.toObject, includeInstance), 1456 gasprice: jspb.Message.getFieldWithDefault(msg, 8, 0) 1457 }; 1458 1459 if (includeInstance) { 1460 obj.$jspbMessageInstance = msg; 1461 } 1462 return obj; 1463 }; 1464 } 1465 1466 1467 /** 1468 * Deserializes binary data (in protobuf wire format). 1469 * @param {jspb.ByteSource} bytes The bytes to deserialize. 1470 * @return {!proto.payload.CallTx} 1471 */ 1472 proto.payload.CallTx.deserializeBinary = function(bytes) { 1473 var reader = new jspb.BinaryReader(bytes); 1474 var msg = new proto.payload.CallTx; 1475 return proto.payload.CallTx.deserializeBinaryFromReader(msg, reader); 1476 }; 1477 1478 1479 /** 1480 * Deserializes binary data (in protobuf wire format) from the 1481 * given reader into the given message object. 1482 * @param {!proto.payload.CallTx} msg The message object to deserialize into. 1483 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 1484 * @return {!proto.payload.CallTx} 1485 */ 1486 proto.payload.CallTx.deserializeBinaryFromReader = function(msg, reader) { 1487 while (reader.nextField()) { 1488 if (reader.isEndGroup()) { 1489 break; 1490 } 1491 var field = reader.getFieldNumber(); 1492 switch (field) { 1493 case 1: 1494 var value = new proto.payload.TxInput; 1495 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 1496 msg.setInput(value); 1497 break; 1498 case 2: 1499 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 1500 msg.setAddress(value); 1501 break; 1502 case 3: 1503 var value = /** @type {number} */ (reader.readUint64()); 1504 msg.setGaslimit(value); 1505 break; 1506 case 4: 1507 var value = /** @type {number} */ (reader.readUint64()); 1508 msg.setFee(value); 1509 break; 1510 case 5: 1511 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 1512 msg.setData(value); 1513 break; 1514 case 6: 1515 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 1516 msg.setWasm(value); 1517 break; 1518 case 7: 1519 var value = new proto.payload.ContractMeta; 1520 reader.readMessage(value,proto.payload.ContractMeta.deserializeBinaryFromReader); 1521 msg.addContractmeta(value); 1522 break; 1523 case 8: 1524 var value = /** @type {number} */ (reader.readUint64()); 1525 msg.setGasprice(value); 1526 break; 1527 default: 1528 reader.skipField(); 1529 break; 1530 } 1531 } 1532 return msg; 1533 }; 1534 1535 1536 /** 1537 * Serializes the message to binary data (in protobuf wire format). 1538 * @return {!Uint8Array} 1539 */ 1540 proto.payload.CallTx.prototype.serializeBinary = function() { 1541 var writer = new jspb.BinaryWriter(); 1542 proto.payload.CallTx.serializeBinaryToWriter(this, writer); 1543 return writer.getResultBuffer(); 1544 }; 1545 1546 1547 /** 1548 * Serializes the given message to binary data (in protobuf wire 1549 * format), writing to the given BinaryWriter. 1550 * @param {!proto.payload.CallTx} message 1551 * @param {!jspb.BinaryWriter} writer 1552 * @suppress {unusedLocalVariables} f is only used for nested messages 1553 */ 1554 proto.payload.CallTx.serializeBinaryToWriter = function(message, writer) { 1555 var f = undefined; 1556 f = message.getInput(); 1557 if (f != null) { 1558 writer.writeMessage( 1559 1, 1560 f, 1561 proto.payload.TxInput.serializeBinaryToWriter 1562 ); 1563 } 1564 f = message.getAddress_asU8(); 1565 if (f.length > 0) { 1566 writer.writeBytes( 1567 2, 1568 f 1569 ); 1570 } 1571 f = message.getGaslimit(); 1572 if (f !== 0) { 1573 writer.writeUint64( 1574 3, 1575 f 1576 ); 1577 } 1578 f = message.getFee(); 1579 if (f !== 0) { 1580 writer.writeUint64( 1581 4, 1582 f 1583 ); 1584 } 1585 f = message.getData_asU8(); 1586 if (f.length > 0) { 1587 writer.writeBytes( 1588 5, 1589 f 1590 ); 1591 } 1592 f = message.getWasm_asU8(); 1593 if (f.length > 0) { 1594 writer.writeBytes( 1595 6, 1596 f 1597 ); 1598 } 1599 f = message.getContractmetaList(); 1600 if (f.length > 0) { 1601 writer.writeRepeatedMessage( 1602 7, 1603 f, 1604 proto.payload.ContractMeta.serializeBinaryToWriter 1605 ); 1606 } 1607 f = message.getGasprice(); 1608 if (f !== 0) { 1609 writer.writeUint64( 1610 8, 1611 f 1612 ); 1613 } 1614 }; 1615 1616 1617 /** 1618 * optional TxInput Input = 1; 1619 * @return {?proto.payload.TxInput} 1620 */ 1621 proto.payload.CallTx.prototype.getInput = function() { 1622 return /** @type{?proto.payload.TxInput} */ ( 1623 jspb.Message.getWrapperField(this, proto.payload.TxInput, 1)); 1624 }; 1625 1626 1627 /** 1628 * @param {?proto.payload.TxInput|undefined} value 1629 * @return {!proto.payload.CallTx} returns this 1630 */ 1631 proto.payload.CallTx.prototype.setInput = function(value) { 1632 return jspb.Message.setWrapperField(this, 1, value); 1633 }; 1634 1635 1636 /** 1637 * Clears the message field making it undefined. 1638 * @return {!proto.payload.CallTx} returns this 1639 */ 1640 proto.payload.CallTx.prototype.clearInput = function() { 1641 return this.setInput(undefined); 1642 }; 1643 1644 1645 /** 1646 * Returns whether this field is set. 1647 * @return {boolean} 1648 */ 1649 proto.payload.CallTx.prototype.hasInput = function() { 1650 return jspb.Message.getField(this, 1) != null; 1651 }; 1652 1653 1654 /** 1655 * optional bytes Address = 2; 1656 * @return {!(string|Uint8Array)} 1657 */ 1658 proto.payload.CallTx.prototype.getAddress = function() { 1659 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 1660 }; 1661 1662 1663 /** 1664 * optional bytes Address = 2; 1665 * This is a type-conversion wrapper around `getAddress()` 1666 * @return {string} 1667 */ 1668 proto.payload.CallTx.prototype.getAddress_asB64 = function() { 1669 return /** @type {string} */ (jspb.Message.bytesAsB64( 1670 this.getAddress())); 1671 }; 1672 1673 1674 /** 1675 * optional bytes Address = 2; 1676 * Note that Uint8Array is not supported on all browsers. 1677 * @see http://caniuse.com/Uint8Array 1678 * This is a type-conversion wrapper around `getAddress()` 1679 * @return {!Uint8Array} 1680 */ 1681 proto.payload.CallTx.prototype.getAddress_asU8 = function() { 1682 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 1683 this.getAddress())); 1684 }; 1685 1686 1687 /** 1688 * @param {!(string|Uint8Array)} value 1689 * @return {!proto.payload.CallTx} returns this 1690 */ 1691 proto.payload.CallTx.prototype.setAddress = function(value) { 1692 return jspb.Message.setProto3BytesField(this, 2, value); 1693 }; 1694 1695 1696 /** 1697 * optional uint64 GasLimit = 3; 1698 * @return {number} 1699 */ 1700 proto.payload.CallTx.prototype.getGaslimit = function() { 1701 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); 1702 }; 1703 1704 1705 /** 1706 * @param {number} value 1707 * @return {!proto.payload.CallTx} returns this 1708 */ 1709 proto.payload.CallTx.prototype.setGaslimit = function(value) { 1710 return jspb.Message.setProto3IntField(this, 3, value); 1711 }; 1712 1713 1714 /** 1715 * optional uint64 Fee = 4; 1716 * @return {number} 1717 */ 1718 proto.payload.CallTx.prototype.getFee = function() { 1719 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); 1720 }; 1721 1722 1723 /** 1724 * @param {number} value 1725 * @return {!proto.payload.CallTx} returns this 1726 */ 1727 proto.payload.CallTx.prototype.setFee = function(value) { 1728 return jspb.Message.setProto3IntField(this, 4, value); 1729 }; 1730 1731 1732 /** 1733 * optional bytes Data = 5; 1734 * @return {!(string|Uint8Array)} 1735 */ 1736 proto.payload.CallTx.prototype.getData = function() { 1737 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); 1738 }; 1739 1740 1741 /** 1742 * optional bytes Data = 5; 1743 * This is a type-conversion wrapper around `getData()` 1744 * @return {string} 1745 */ 1746 proto.payload.CallTx.prototype.getData_asB64 = function() { 1747 return /** @type {string} */ (jspb.Message.bytesAsB64( 1748 this.getData())); 1749 }; 1750 1751 1752 /** 1753 * optional bytes Data = 5; 1754 * Note that Uint8Array is not supported on all browsers. 1755 * @see http://caniuse.com/Uint8Array 1756 * This is a type-conversion wrapper around `getData()` 1757 * @return {!Uint8Array} 1758 */ 1759 proto.payload.CallTx.prototype.getData_asU8 = function() { 1760 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 1761 this.getData())); 1762 }; 1763 1764 1765 /** 1766 * @param {!(string|Uint8Array)} value 1767 * @return {!proto.payload.CallTx} returns this 1768 */ 1769 proto.payload.CallTx.prototype.setData = function(value) { 1770 return jspb.Message.setProto3BytesField(this, 5, value); 1771 }; 1772 1773 1774 /** 1775 * optional bytes WASM = 6; 1776 * @return {!(string|Uint8Array)} 1777 */ 1778 proto.payload.CallTx.prototype.getWasm = function() { 1779 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); 1780 }; 1781 1782 1783 /** 1784 * optional bytes WASM = 6; 1785 * This is a type-conversion wrapper around `getWasm()` 1786 * @return {string} 1787 */ 1788 proto.payload.CallTx.prototype.getWasm_asB64 = function() { 1789 return /** @type {string} */ (jspb.Message.bytesAsB64( 1790 this.getWasm())); 1791 }; 1792 1793 1794 /** 1795 * optional bytes WASM = 6; 1796 * Note that Uint8Array is not supported on all browsers. 1797 * @see http://caniuse.com/Uint8Array 1798 * This is a type-conversion wrapper around `getWasm()` 1799 * @return {!Uint8Array} 1800 */ 1801 proto.payload.CallTx.prototype.getWasm_asU8 = function() { 1802 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 1803 this.getWasm())); 1804 }; 1805 1806 1807 /** 1808 * @param {!(string|Uint8Array)} value 1809 * @return {!proto.payload.CallTx} returns this 1810 */ 1811 proto.payload.CallTx.prototype.setWasm = function(value) { 1812 return jspb.Message.setProto3BytesField(this, 6, value); 1813 }; 1814 1815 1816 /** 1817 * repeated ContractMeta ContractMeta = 7; 1818 * @return {!Array<!proto.payload.ContractMeta>} 1819 */ 1820 proto.payload.CallTx.prototype.getContractmetaList = function() { 1821 return /** @type{!Array<!proto.payload.ContractMeta>} */ ( 1822 jspb.Message.getRepeatedWrapperField(this, proto.payload.ContractMeta, 7)); 1823 }; 1824 1825 1826 /** 1827 * @param {!Array<!proto.payload.ContractMeta>} value 1828 * @return {!proto.payload.CallTx} returns this 1829 */ 1830 proto.payload.CallTx.prototype.setContractmetaList = function(value) { 1831 return jspb.Message.setRepeatedWrapperField(this, 7, value); 1832 }; 1833 1834 1835 /** 1836 * @param {!proto.payload.ContractMeta=} opt_value 1837 * @param {number=} opt_index 1838 * @return {!proto.payload.ContractMeta} 1839 */ 1840 proto.payload.CallTx.prototype.addContractmeta = function(opt_value, opt_index) { 1841 return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.payload.ContractMeta, opt_index); 1842 }; 1843 1844 1845 /** 1846 * Clears the list making it empty but non-null. 1847 * @return {!proto.payload.CallTx} returns this 1848 */ 1849 proto.payload.CallTx.prototype.clearContractmetaList = function() { 1850 return this.setContractmetaList([]); 1851 }; 1852 1853 1854 /** 1855 * optional uint64 GasPrice = 8; 1856 * @return {number} 1857 */ 1858 proto.payload.CallTx.prototype.getGasprice = function() { 1859 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); 1860 }; 1861 1862 1863 /** 1864 * @param {number} value 1865 * @return {!proto.payload.CallTx} returns this 1866 */ 1867 proto.payload.CallTx.prototype.setGasprice = function(value) { 1868 return jspb.Message.setProto3IntField(this, 8, value); 1869 }; 1870 1871 1872 1873 1874 1875 if (jspb.Message.GENERATE_TO_OBJECT) { 1876 /** 1877 * Creates an object representation of this proto. 1878 * Field names that are reserved in JavaScript and will be renamed to pb_name. 1879 * Optional fields that are not set will be set to undefined. 1880 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 1881 * For the list of reserved names please see: 1882 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 1883 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 1884 * JSPB instance for transitional soy proto support: 1885 * http://goto/soy-param-migration 1886 * @return {!Object} 1887 */ 1888 proto.payload.ContractMeta.prototype.toObject = function(opt_includeInstance) { 1889 return proto.payload.ContractMeta.toObject(opt_includeInstance, this); 1890 }; 1891 1892 1893 /** 1894 * Static version of the {@see toObject} method. 1895 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 1896 * the JSPB instance for transitional soy proto support: 1897 * http://goto/soy-param-migration 1898 * @param {!proto.payload.ContractMeta} msg The msg instance to transform. 1899 * @return {!Object} 1900 * @suppress {unusedLocalVariables} f is only used for nested messages 1901 */ 1902 proto.payload.ContractMeta.toObject = function(includeInstance, msg) { 1903 var f, obj = { 1904 codehash: msg.getCodehash_asB64(), 1905 meta: jspb.Message.getFieldWithDefault(msg, 2, "") 1906 }; 1907 1908 if (includeInstance) { 1909 obj.$jspbMessageInstance = msg; 1910 } 1911 return obj; 1912 }; 1913 } 1914 1915 1916 /** 1917 * Deserializes binary data (in protobuf wire format). 1918 * @param {jspb.ByteSource} bytes The bytes to deserialize. 1919 * @return {!proto.payload.ContractMeta} 1920 */ 1921 proto.payload.ContractMeta.deserializeBinary = function(bytes) { 1922 var reader = new jspb.BinaryReader(bytes); 1923 var msg = new proto.payload.ContractMeta; 1924 return proto.payload.ContractMeta.deserializeBinaryFromReader(msg, reader); 1925 }; 1926 1927 1928 /** 1929 * Deserializes binary data (in protobuf wire format) from the 1930 * given reader into the given message object. 1931 * @param {!proto.payload.ContractMeta} msg The message object to deserialize into. 1932 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 1933 * @return {!proto.payload.ContractMeta} 1934 */ 1935 proto.payload.ContractMeta.deserializeBinaryFromReader = function(msg, reader) { 1936 while (reader.nextField()) { 1937 if (reader.isEndGroup()) { 1938 break; 1939 } 1940 var field = reader.getFieldNumber(); 1941 switch (field) { 1942 case 1: 1943 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 1944 msg.setCodehash(value); 1945 break; 1946 case 2: 1947 var value = /** @type {string} */ (reader.readString()); 1948 msg.setMeta(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 */ 1963 proto.payload.ContractMeta.prototype.serializeBinary = function() { 1964 var writer = new jspb.BinaryWriter(); 1965 proto.payload.ContractMeta.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.payload.ContractMeta} message 1974 * @param {!jspb.BinaryWriter} writer 1975 * @suppress {unusedLocalVariables} f is only used for nested messages 1976 */ 1977 proto.payload.ContractMeta.serializeBinaryToWriter = function(message, writer) { 1978 var f = undefined; 1979 f = message.getCodehash_asU8(); 1980 if (f.length > 0) { 1981 writer.writeBytes( 1982 1, 1983 f 1984 ); 1985 } 1986 f = message.getMeta(); 1987 if (f.length > 0) { 1988 writer.writeString( 1989 2, 1990 f 1991 ); 1992 } 1993 }; 1994 1995 1996 /** 1997 * optional bytes CodeHash = 1; 1998 * @return {!(string|Uint8Array)} 1999 */ 2000 proto.payload.ContractMeta.prototype.getCodehash = function() { 2001 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 2002 }; 2003 2004 2005 /** 2006 * optional bytes CodeHash = 1; 2007 * This is a type-conversion wrapper around `getCodehash()` 2008 * @return {string} 2009 */ 2010 proto.payload.ContractMeta.prototype.getCodehash_asB64 = function() { 2011 return /** @type {string} */ (jspb.Message.bytesAsB64( 2012 this.getCodehash())); 2013 }; 2014 2015 2016 /** 2017 * optional bytes CodeHash = 1; 2018 * Note that Uint8Array is not supported on all browsers. 2019 * @see http://caniuse.com/Uint8Array 2020 * This is a type-conversion wrapper around `getCodehash()` 2021 * @return {!Uint8Array} 2022 */ 2023 proto.payload.ContractMeta.prototype.getCodehash_asU8 = function() { 2024 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 2025 this.getCodehash())); 2026 }; 2027 2028 2029 /** 2030 * @param {!(string|Uint8Array)} value 2031 * @return {!proto.payload.ContractMeta} returns this 2032 */ 2033 proto.payload.ContractMeta.prototype.setCodehash = function(value) { 2034 return jspb.Message.setProto3BytesField(this, 1, value); 2035 }; 2036 2037 2038 /** 2039 * optional string Meta = 2; 2040 * @return {string} 2041 */ 2042 proto.payload.ContractMeta.prototype.getMeta = function() { 2043 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 2044 }; 2045 2046 2047 /** 2048 * @param {string} value 2049 * @return {!proto.payload.ContractMeta} returns this 2050 */ 2051 proto.payload.ContractMeta.prototype.setMeta = function(value) { 2052 return jspb.Message.setProto3StringField(this, 2, value); 2053 }; 2054 2055 2056 2057 /** 2058 * List of repeated fields within this message type. 2059 * @private {!Array<number>} 2060 * @const 2061 */ 2062 proto.payload.SendTx.repeatedFields_ = [1,2]; 2063 2064 2065 2066 if (jspb.Message.GENERATE_TO_OBJECT) { 2067 /** 2068 * Creates an object representation of this proto. 2069 * Field names that are reserved in JavaScript and will be renamed to pb_name. 2070 * Optional fields that are not set will be set to undefined. 2071 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 2072 * For the list of reserved names please see: 2073 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 2074 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 2075 * JSPB instance for transitional soy proto support: 2076 * http://goto/soy-param-migration 2077 * @return {!Object} 2078 */ 2079 proto.payload.SendTx.prototype.toObject = function(opt_includeInstance) { 2080 return proto.payload.SendTx.toObject(opt_includeInstance, this); 2081 }; 2082 2083 2084 /** 2085 * Static version of the {@see toObject} method. 2086 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 2087 * the JSPB instance for transitional soy proto support: 2088 * http://goto/soy-param-migration 2089 * @param {!proto.payload.SendTx} msg The msg instance to transform. 2090 * @return {!Object} 2091 * @suppress {unusedLocalVariables} f is only used for nested messages 2092 */ 2093 proto.payload.SendTx.toObject = function(includeInstance, msg) { 2094 var f, obj = { 2095 inputsList: jspb.Message.toObjectList(msg.getInputsList(), 2096 proto.payload.TxInput.toObject, includeInstance), 2097 outputsList: jspb.Message.toObjectList(msg.getOutputsList(), 2098 proto.payload.TxOutput.toObject, includeInstance) 2099 }; 2100 2101 if (includeInstance) { 2102 obj.$jspbMessageInstance = msg; 2103 } 2104 return obj; 2105 }; 2106 } 2107 2108 2109 /** 2110 * Deserializes binary data (in protobuf wire format). 2111 * @param {jspb.ByteSource} bytes The bytes to deserialize. 2112 * @return {!proto.payload.SendTx} 2113 */ 2114 proto.payload.SendTx.deserializeBinary = function(bytes) { 2115 var reader = new jspb.BinaryReader(bytes); 2116 var msg = new proto.payload.SendTx; 2117 return proto.payload.SendTx.deserializeBinaryFromReader(msg, reader); 2118 }; 2119 2120 2121 /** 2122 * Deserializes binary data (in protobuf wire format) from the 2123 * given reader into the given message object. 2124 * @param {!proto.payload.SendTx} msg The message object to deserialize into. 2125 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 2126 * @return {!proto.payload.SendTx} 2127 */ 2128 proto.payload.SendTx.deserializeBinaryFromReader = function(msg, reader) { 2129 while (reader.nextField()) { 2130 if (reader.isEndGroup()) { 2131 break; 2132 } 2133 var field = reader.getFieldNumber(); 2134 switch (field) { 2135 case 1: 2136 var value = new proto.payload.TxInput; 2137 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 2138 msg.addInputs(value); 2139 break; 2140 case 2: 2141 var value = new proto.payload.TxOutput; 2142 reader.readMessage(value,proto.payload.TxOutput.deserializeBinaryFromReader); 2143 msg.addOutputs(value); 2144 break; 2145 default: 2146 reader.skipField(); 2147 break; 2148 } 2149 } 2150 return msg; 2151 }; 2152 2153 2154 /** 2155 * Serializes the message to binary data (in protobuf wire format). 2156 * @return {!Uint8Array} 2157 */ 2158 proto.payload.SendTx.prototype.serializeBinary = function() { 2159 var writer = new jspb.BinaryWriter(); 2160 proto.payload.SendTx.serializeBinaryToWriter(this, writer); 2161 return writer.getResultBuffer(); 2162 }; 2163 2164 2165 /** 2166 * Serializes the given message to binary data (in protobuf wire 2167 * format), writing to the given BinaryWriter. 2168 * @param {!proto.payload.SendTx} message 2169 * @param {!jspb.BinaryWriter} writer 2170 * @suppress {unusedLocalVariables} f is only used for nested messages 2171 */ 2172 proto.payload.SendTx.serializeBinaryToWriter = function(message, writer) { 2173 var f = undefined; 2174 f = message.getInputsList(); 2175 if (f.length > 0) { 2176 writer.writeRepeatedMessage( 2177 1, 2178 f, 2179 proto.payload.TxInput.serializeBinaryToWriter 2180 ); 2181 } 2182 f = message.getOutputsList(); 2183 if (f.length > 0) { 2184 writer.writeRepeatedMessage( 2185 2, 2186 f, 2187 proto.payload.TxOutput.serializeBinaryToWriter 2188 ); 2189 } 2190 }; 2191 2192 2193 /** 2194 * repeated TxInput Inputs = 1; 2195 * @return {!Array<!proto.payload.TxInput>} 2196 */ 2197 proto.payload.SendTx.prototype.getInputsList = function() { 2198 return /** @type{!Array<!proto.payload.TxInput>} */ ( 2199 jspb.Message.getRepeatedWrapperField(this, proto.payload.TxInput, 1)); 2200 }; 2201 2202 2203 /** 2204 * @param {!Array<!proto.payload.TxInput>} value 2205 * @return {!proto.payload.SendTx} returns this 2206 */ 2207 proto.payload.SendTx.prototype.setInputsList = function(value) { 2208 return jspb.Message.setRepeatedWrapperField(this, 1, value); 2209 }; 2210 2211 2212 /** 2213 * @param {!proto.payload.TxInput=} opt_value 2214 * @param {number=} opt_index 2215 * @return {!proto.payload.TxInput} 2216 */ 2217 proto.payload.SendTx.prototype.addInputs = function(opt_value, opt_index) { 2218 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.payload.TxInput, opt_index); 2219 }; 2220 2221 2222 /** 2223 * Clears the list making it empty but non-null. 2224 * @return {!proto.payload.SendTx} returns this 2225 */ 2226 proto.payload.SendTx.prototype.clearInputsList = function() { 2227 return this.setInputsList([]); 2228 }; 2229 2230 2231 /** 2232 * repeated TxOutput Outputs = 2; 2233 * @return {!Array<!proto.payload.TxOutput>} 2234 */ 2235 proto.payload.SendTx.prototype.getOutputsList = function() { 2236 return /** @type{!Array<!proto.payload.TxOutput>} */ ( 2237 jspb.Message.getRepeatedWrapperField(this, proto.payload.TxOutput, 2)); 2238 }; 2239 2240 2241 /** 2242 * @param {!Array<!proto.payload.TxOutput>} value 2243 * @return {!proto.payload.SendTx} returns this 2244 */ 2245 proto.payload.SendTx.prototype.setOutputsList = function(value) { 2246 return jspb.Message.setRepeatedWrapperField(this, 2, value); 2247 }; 2248 2249 2250 /** 2251 * @param {!proto.payload.TxOutput=} opt_value 2252 * @param {number=} opt_index 2253 * @return {!proto.payload.TxOutput} 2254 */ 2255 proto.payload.SendTx.prototype.addOutputs = function(opt_value, opt_index) { 2256 return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.payload.TxOutput, opt_index); 2257 }; 2258 2259 2260 /** 2261 * Clears the list making it empty but non-null. 2262 * @return {!proto.payload.SendTx} returns this 2263 */ 2264 proto.payload.SendTx.prototype.clearOutputsList = function() { 2265 return this.setOutputsList([]); 2266 }; 2267 2268 2269 2270 2271 2272 if (jspb.Message.GENERATE_TO_OBJECT) { 2273 /** 2274 * Creates an object representation of this proto. 2275 * Field names that are reserved in JavaScript and will be renamed to pb_name. 2276 * Optional fields that are not set will be set to undefined. 2277 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 2278 * For the list of reserved names please see: 2279 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 2280 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 2281 * JSPB instance for transitional soy proto support: 2282 * http://goto/soy-param-migration 2283 * @return {!Object} 2284 */ 2285 proto.payload.PermsTx.prototype.toObject = function(opt_includeInstance) { 2286 return proto.payload.PermsTx.toObject(opt_includeInstance, this); 2287 }; 2288 2289 2290 /** 2291 * Static version of the {@see toObject} method. 2292 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 2293 * the JSPB instance for transitional soy proto support: 2294 * http://goto/soy-param-migration 2295 * @param {!proto.payload.PermsTx} msg The msg instance to transform. 2296 * @return {!Object} 2297 * @suppress {unusedLocalVariables} f is only used for nested messages 2298 */ 2299 proto.payload.PermsTx.toObject = function(includeInstance, msg) { 2300 var f, obj = { 2301 input: (f = msg.getInput()) && proto.payload.TxInput.toObject(includeInstance, f), 2302 permargs: (f = msg.getPermargs()) && permission_pb.PermArgs.toObject(includeInstance, f) 2303 }; 2304 2305 if (includeInstance) { 2306 obj.$jspbMessageInstance = msg; 2307 } 2308 return obj; 2309 }; 2310 } 2311 2312 2313 /** 2314 * Deserializes binary data (in protobuf wire format). 2315 * @param {jspb.ByteSource} bytes The bytes to deserialize. 2316 * @return {!proto.payload.PermsTx} 2317 */ 2318 proto.payload.PermsTx.deserializeBinary = function(bytes) { 2319 var reader = new jspb.BinaryReader(bytes); 2320 var msg = new proto.payload.PermsTx; 2321 return proto.payload.PermsTx.deserializeBinaryFromReader(msg, reader); 2322 }; 2323 2324 2325 /** 2326 * Deserializes binary data (in protobuf wire format) from the 2327 * given reader into the given message object. 2328 * @param {!proto.payload.PermsTx} msg The message object to deserialize into. 2329 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 2330 * @return {!proto.payload.PermsTx} 2331 */ 2332 proto.payload.PermsTx.deserializeBinaryFromReader = function(msg, reader) { 2333 while (reader.nextField()) { 2334 if (reader.isEndGroup()) { 2335 break; 2336 } 2337 var field = reader.getFieldNumber(); 2338 switch (field) { 2339 case 1: 2340 var value = new proto.payload.TxInput; 2341 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 2342 msg.setInput(value); 2343 break; 2344 case 2: 2345 var value = new permission_pb.PermArgs; 2346 reader.readMessage(value,permission_pb.PermArgs.deserializeBinaryFromReader); 2347 msg.setPermargs(value); 2348 break; 2349 default: 2350 reader.skipField(); 2351 break; 2352 } 2353 } 2354 return msg; 2355 }; 2356 2357 2358 /** 2359 * Serializes the message to binary data (in protobuf wire format). 2360 * @return {!Uint8Array} 2361 */ 2362 proto.payload.PermsTx.prototype.serializeBinary = function() { 2363 var writer = new jspb.BinaryWriter(); 2364 proto.payload.PermsTx.serializeBinaryToWriter(this, writer); 2365 return writer.getResultBuffer(); 2366 }; 2367 2368 2369 /** 2370 * Serializes the given message to binary data (in protobuf wire 2371 * format), writing to the given BinaryWriter. 2372 * @param {!proto.payload.PermsTx} message 2373 * @param {!jspb.BinaryWriter} writer 2374 * @suppress {unusedLocalVariables} f is only used for nested messages 2375 */ 2376 proto.payload.PermsTx.serializeBinaryToWriter = function(message, writer) { 2377 var f = undefined; 2378 f = message.getInput(); 2379 if (f != null) { 2380 writer.writeMessage( 2381 1, 2382 f, 2383 proto.payload.TxInput.serializeBinaryToWriter 2384 ); 2385 } 2386 f = message.getPermargs(); 2387 if (f != null) { 2388 writer.writeMessage( 2389 2, 2390 f, 2391 permission_pb.PermArgs.serializeBinaryToWriter 2392 ); 2393 } 2394 }; 2395 2396 2397 /** 2398 * optional TxInput Input = 1; 2399 * @return {?proto.payload.TxInput} 2400 */ 2401 proto.payload.PermsTx.prototype.getInput = function() { 2402 return /** @type{?proto.payload.TxInput} */ ( 2403 jspb.Message.getWrapperField(this, proto.payload.TxInput, 1)); 2404 }; 2405 2406 2407 /** 2408 * @param {?proto.payload.TxInput|undefined} value 2409 * @return {!proto.payload.PermsTx} returns this 2410 */ 2411 proto.payload.PermsTx.prototype.setInput = function(value) { 2412 return jspb.Message.setWrapperField(this, 1, value); 2413 }; 2414 2415 2416 /** 2417 * Clears the message field making it undefined. 2418 * @return {!proto.payload.PermsTx} returns this 2419 */ 2420 proto.payload.PermsTx.prototype.clearInput = function() { 2421 return this.setInput(undefined); 2422 }; 2423 2424 2425 /** 2426 * Returns whether this field is set. 2427 * @return {boolean} 2428 */ 2429 proto.payload.PermsTx.prototype.hasInput = function() { 2430 return jspb.Message.getField(this, 1) != null; 2431 }; 2432 2433 2434 /** 2435 * optional permission.PermArgs PermArgs = 2; 2436 * @return {?proto.permission.PermArgs} 2437 */ 2438 proto.payload.PermsTx.prototype.getPermargs = function() { 2439 return /** @type{?proto.permission.PermArgs} */ ( 2440 jspb.Message.getWrapperField(this, permission_pb.PermArgs, 2)); 2441 }; 2442 2443 2444 /** 2445 * @param {?proto.permission.PermArgs|undefined} value 2446 * @return {!proto.payload.PermsTx} returns this 2447 */ 2448 proto.payload.PermsTx.prototype.setPermargs = function(value) { 2449 return jspb.Message.setWrapperField(this, 2, value); 2450 }; 2451 2452 2453 /** 2454 * Clears the message field making it undefined. 2455 * @return {!proto.payload.PermsTx} returns this 2456 */ 2457 proto.payload.PermsTx.prototype.clearPermargs = function() { 2458 return this.setPermargs(undefined); 2459 }; 2460 2461 2462 /** 2463 * Returns whether this field is set. 2464 * @return {boolean} 2465 */ 2466 proto.payload.PermsTx.prototype.hasPermargs = function() { 2467 return jspb.Message.getField(this, 2) != null; 2468 }; 2469 2470 2471 2472 2473 2474 if (jspb.Message.GENERATE_TO_OBJECT) { 2475 /** 2476 * Creates an object representation of this proto. 2477 * Field names that are reserved in JavaScript and will be renamed to pb_name. 2478 * Optional fields that are not set will be set to undefined. 2479 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 2480 * For the list of reserved names please see: 2481 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 2482 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 2483 * JSPB instance for transitional soy proto support: 2484 * http://goto/soy-param-migration 2485 * @return {!Object} 2486 */ 2487 proto.payload.NameTx.prototype.toObject = function(opt_includeInstance) { 2488 return proto.payload.NameTx.toObject(opt_includeInstance, this); 2489 }; 2490 2491 2492 /** 2493 * Static version of the {@see toObject} method. 2494 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 2495 * the JSPB instance for transitional soy proto support: 2496 * http://goto/soy-param-migration 2497 * @param {!proto.payload.NameTx} msg The msg instance to transform. 2498 * @return {!Object} 2499 * @suppress {unusedLocalVariables} f is only used for nested messages 2500 */ 2501 proto.payload.NameTx.toObject = function(includeInstance, msg) { 2502 var f, obj = { 2503 input: (f = msg.getInput()) && proto.payload.TxInput.toObject(includeInstance, f), 2504 name: jspb.Message.getFieldWithDefault(msg, 2, ""), 2505 data: jspb.Message.getFieldWithDefault(msg, 3, ""), 2506 fee: jspb.Message.getFieldWithDefault(msg, 4, 0) 2507 }; 2508 2509 if (includeInstance) { 2510 obj.$jspbMessageInstance = msg; 2511 } 2512 return obj; 2513 }; 2514 } 2515 2516 2517 /** 2518 * Deserializes binary data (in protobuf wire format). 2519 * @param {jspb.ByteSource} bytes The bytes to deserialize. 2520 * @return {!proto.payload.NameTx} 2521 */ 2522 proto.payload.NameTx.deserializeBinary = function(bytes) { 2523 var reader = new jspb.BinaryReader(bytes); 2524 var msg = new proto.payload.NameTx; 2525 return proto.payload.NameTx.deserializeBinaryFromReader(msg, reader); 2526 }; 2527 2528 2529 /** 2530 * Deserializes binary data (in protobuf wire format) from the 2531 * given reader into the given message object. 2532 * @param {!proto.payload.NameTx} msg The message object to deserialize into. 2533 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 2534 * @return {!proto.payload.NameTx} 2535 */ 2536 proto.payload.NameTx.deserializeBinaryFromReader = function(msg, reader) { 2537 while (reader.nextField()) { 2538 if (reader.isEndGroup()) { 2539 break; 2540 } 2541 var field = reader.getFieldNumber(); 2542 switch (field) { 2543 case 1: 2544 var value = new proto.payload.TxInput; 2545 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 2546 msg.setInput(value); 2547 break; 2548 case 2: 2549 var value = /** @type {string} */ (reader.readString()); 2550 msg.setName(value); 2551 break; 2552 case 3: 2553 var value = /** @type {string} */ (reader.readString()); 2554 msg.setData(value); 2555 break; 2556 case 4: 2557 var value = /** @type {number} */ (reader.readUint64()); 2558 msg.setFee(value); 2559 break; 2560 default: 2561 reader.skipField(); 2562 break; 2563 } 2564 } 2565 return msg; 2566 }; 2567 2568 2569 /** 2570 * Serializes the message to binary data (in protobuf wire format). 2571 * @return {!Uint8Array} 2572 */ 2573 proto.payload.NameTx.prototype.serializeBinary = function() { 2574 var writer = new jspb.BinaryWriter(); 2575 proto.payload.NameTx.serializeBinaryToWriter(this, writer); 2576 return writer.getResultBuffer(); 2577 }; 2578 2579 2580 /** 2581 * Serializes the given message to binary data (in protobuf wire 2582 * format), writing to the given BinaryWriter. 2583 * @param {!proto.payload.NameTx} message 2584 * @param {!jspb.BinaryWriter} writer 2585 * @suppress {unusedLocalVariables} f is only used for nested messages 2586 */ 2587 proto.payload.NameTx.serializeBinaryToWriter = function(message, writer) { 2588 var f = undefined; 2589 f = message.getInput(); 2590 if (f != null) { 2591 writer.writeMessage( 2592 1, 2593 f, 2594 proto.payload.TxInput.serializeBinaryToWriter 2595 ); 2596 } 2597 f = message.getName(); 2598 if (f.length > 0) { 2599 writer.writeString( 2600 2, 2601 f 2602 ); 2603 } 2604 f = message.getData(); 2605 if (f.length > 0) { 2606 writer.writeString( 2607 3, 2608 f 2609 ); 2610 } 2611 f = message.getFee(); 2612 if (f !== 0) { 2613 writer.writeUint64( 2614 4, 2615 f 2616 ); 2617 } 2618 }; 2619 2620 2621 /** 2622 * optional TxInput Input = 1; 2623 * @return {?proto.payload.TxInput} 2624 */ 2625 proto.payload.NameTx.prototype.getInput = function() { 2626 return /** @type{?proto.payload.TxInput} */ ( 2627 jspb.Message.getWrapperField(this, proto.payload.TxInput, 1)); 2628 }; 2629 2630 2631 /** 2632 * @param {?proto.payload.TxInput|undefined} value 2633 * @return {!proto.payload.NameTx} returns this 2634 */ 2635 proto.payload.NameTx.prototype.setInput = function(value) { 2636 return jspb.Message.setWrapperField(this, 1, value); 2637 }; 2638 2639 2640 /** 2641 * Clears the message field making it undefined. 2642 * @return {!proto.payload.NameTx} returns this 2643 */ 2644 proto.payload.NameTx.prototype.clearInput = function() { 2645 return this.setInput(undefined); 2646 }; 2647 2648 2649 /** 2650 * Returns whether this field is set. 2651 * @return {boolean} 2652 */ 2653 proto.payload.NameTx.prototype.hasInput = function() { 2654 return jspb.Message.getField(this, 1) != null; 2655 }; 2656 2657 2658 /** 2659 * optional string Name = 2; 2660 * @return {string} 2661 */ 2662 proto.payload.NameTx.prototype.getName = function() { 2663 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 2664 }; 2665 2666 2667 /** 2668 * @param {string} value 2669 * @return {!proto.payload.NameTx} returns this 2670 */ 2671 proto.payload.NameTx.prototype.setName = function(value) { 2672 return jspb.Message.setProto3StringField(this, 2, value); 2673 }; 2674 2675 2676 /** 2677 * optional string Data = 3; 2678 * @return {string} 2679 */ 2680 proto.payload.NameTx.prototype.getData = function() { 2681 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 2682 }; 2683 2684 2685 /** 2686 * @param {string} value 2687 * @return {!proto.payload.NameTx} returns this 2688 */ 2689 proto.payload.NameTx.prototype.setData = function(value) { 2690 return jspb.Message.setProto3StringField(this, 3, value); 2691 }; 2692 2693 2694 /** 2695 * optional uint64 Fee = 4; 2696 * @return {number} 2697 */ 2698 proto.payload.NameTx.prototype.getFee = function() { 2699 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); 2700 }; 2701 2702 2703 /** 2704 * @param {number} value 2705 * @return {!proto.payload.NameTx} returns this 2706 */ 2707 proto.payload.NameTx.prototype.setFee = function(value) { 2708 return jspb.Message.setProto3IntField(this, 4, value); 2709 }; 2710 2711 2712 2713 2714 2715 if (jspb.Message.GENERATE_TO_OBJECT) { 2716 /** 2717 * Creates an object representation of this proto. 2718 * Field names that are reserved in JavaScript and will be renamed to pb_name. 2719 * Optional fields that are not set will be set to undefined. 2720 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 2721 * For the list of reserved names please see: 2722 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 2723 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 2724 * JSPB instance for transitional soy proto support: 2725 * http://goto/soy-param-migration 2726 * @return {!Object} 2727 */ 2728 proto.payload.BondTx.prototype.toObject = function(opt_includeInstance) { 2729 return proto.payload.BondTx.toObject(opt_includeInstance, this); 2730 }; 2731 2732 2733 /** 2734 * Static version of the {@see toObject} method. 2735 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 2736 * the JSPB instance for transitional soy proto support: 2737 * http://goto/soy-param-migration 2738 * @param {!proto.payload.BondTx} msg The msg instance to transform. 2739 * @return {!Object} 2740 * @suppress {unusedLocalVariables} f is only used for nested messages 2741 */ 2742 proto.payload.BondTx.toObject = function(includeInstance, msg) { 2743 var f, obj = { 2744 input: (f = msg.getInput()) && proto.payload.TxInput.toObject(includeInstance, f) 2745 }; 2746 2747 if (includeInstance) { 2748 obj.$jspbMessageInstance = msg; 2749 } 2750 return obj; 2751 }; 2752 } 2753 2754 2755 /** 2756 * Deserializes binary data (in protobuf wire format). 2757 * @param {jspb.ByteSource} bytes The bytes to deserialize. 2758 * @return {!proto.payload.BondTx} 2759 */ 2760 proto.payload.BondTx.deserializeBinary = function(bytes) { 2761 var reader = new jspb.BinaryReader(bytes); 2762 var msg = new proto.payload.BondTx; 2763 return proto.payload.BondTx.deserializeBinaryFromReader(msg, reader); 2764 }; 2765 2766 2767 /** 2768 * Deserializes binary data (in protobuf wire format) from the 2769 * given reader into the given message object. 2770 * @param {!proto.payload.BondTx} msg The message object to deserialize into. 2771 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 2772 * @return {!proto.payload.BondTx} 2773 */ 2774 proto.payload.BondTx.deserializeBinaryFromReader = function(msg, reader) { 2775 while (reader.nextField()) { 2776 if (reader.isEndGroup()) { 2777 break; 2778 } 2779 var field = reader.getFieldNumber(); 2780 switch (field) { 2781 case 1: 2782 var value = new proto.payload.TxInput; 2783 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 2784 msg.setInput(value); 2785 break; 2786 default: 2787 reader.skipField(); 2788 break; 2789 } 2790 } 2791 return msg; 2792 }; 2793 2794 2795 /** 2796 * Serializes the message to binary data (in protobuf wire format). 2797 * @return {!Uint8Array} 2798 */ 2799 proto.payload.BondTx.prototype.serializeBinary = function() { 2800 var writer = new jspb.BinaryWriter(); 2801 proto.payload.BondTx.serializeBinaryToWriter(this, writer); 2802 return writer.getResultBuffer(); 2803 }; 2804 2805 2806 /** 2807 * Serializes the given message to binary data (in protobuf wire 2808 * format), writing to the given BinaryWriter. 2809 * @param {!proto.payload.BondTx} message 2810 * @param {!jspb.BinaryWriter} writer 2811 * @suppress {unusedLocalVariables} f is only used for nested messages 2812 */ 2813 proto.payload.BondTx.serializeBinaryToWriter = function(message, writer) { 2814 var f = undefined; 2815 f = message.getInput(); 2816 if (f != null) { 2817 writer.writeMessage( 2818 1, 2819 f, 2820 proto.payload.TxInput.serializeBinaryToWriter 2821 ); 2822 } 2823 }; 2824 2825 2826 /** 2827 * optional TxInput Input = 1; 2828 * @return {?proto.payload.TxInput} 2829 */ 2830 proto.payload.BondTx.prototype.getInput = function() { 2831 return /** @type{?proto.payload.TxInput} */ ( 2832 jspb.Message.getWrapperField(this, proto.payload.TxInput, 1)); 2833 }; 2834 2835 2836 /** 2837 * @param {?proto.payload.TxInput|undefined} value 2838 * @return {!proto.payload.BondTx} returns this 2839 */ 2840 proto.payload.BondTx.prototype.setInput = function(value) { 2841 return jspb.Message.setWrapperField(this, 1, value); 2842 }; 2843 2844 2845 /** 2846 * Clears the message field making it undefined. 2847 * @return {!proto.payload.BondTx} returns this 2848 */ 2849 proto.payload.BondTx.prototype.clearInput = function() { 2850 return this.setInput(undefined); 2851 }; 2852 2853 2854 /** 2855 * Returns whether this field is set. 2856 * @return {boolean} 2857 */ 2858 proto.payload.BondTx.prototype.hasInput = function() { 2859 return jspb.Message.getField(this, 1) != null; 2860 }; 2861 2862 2863 2864 2865 2866 if (jspb.Message.GENERATE_TO_OBJECT) { 2867 /** 2868 * Creates an object representation of this proto. 2869 * Field names that are reserved in JavaScript and will be renamed to pb_name. 2870 * Optional fields that are not set will be set to undefined. 2871 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 2872 * For the list of reserved names please see: 2873 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 2874 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 2875 * JSPB instance for transitional soy proto support: 2876 * http://goto/soy-param-migration 2877 * @return {!Object} 2878 */ 2879 proto.payload.UnbondTx.prototype.toObject = function(opt_includeInstance) { 2880 return proto.payload.UnbondTx.toObject(opt_includeInstance, this); 2881 }; 2882 2883 2884 /** 2885 * Static version of the {@see toObject} method. 2886 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 2887 * the JSPB instance for transitional soy proto support: 2888 * http://goto/soy-param-migration 2889 * @param {!proto.payload.UnbondTx} msg The msg instance to transform. 2890 * @return {!Object} 2891 * @suppress {unusedLocalVariables} f is only used for nested messages 2892 */ 2893 proto.payload.UnbondTx.toObject = function(includeInstance, msg) { 2894 var f, obj = { 2895 input: (f = msg.getInput()) && proto.payload.TxInput.toObject(includeInstance, f), 2896 output: (f = msg.getOutput()) && proto.payload.TxOutput.toObject(includeInstance, f) 2897 }; 2898 2899 if (includeInstance) { 2900 obj.$jspbMessageInstance = msg; 2901 } 2902 return obj; 2903 }; 2904 } 2905 2906 2907 /** 2908 * Deserializes binary data (in protobuf wire format). 2909 * @param {jspb.ByteSource} bytes The bytes to deserialize. 2910 * @return {!proto.payload.UnbondTx} 2911 */ 2912 proto.payload.UnbondTx.deserializeBinary = function(bytes) { 2913 var reader = new jspb.BinaryReader(bytes); 2914 var msg = new proto.payload.UnbondTx; 2915 return proto.payload.UnbondTx.deserializeBinaryFromReader(msg, reader); 2916 }; 2917 2918 2919 /** 2920 * Deserializes binary data (in protobuf wire format) from the 2921 * given reader into the given message object. 2922 * @param {!proto.payload.UnbondTx} msg The message object to deserialize into. 2923 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 2924 * @return {!proto.payload.UnbondTx} 2925 */ 2926 proto.payload.UnbondTx.deserializeBinaryFromReader = function(msg, reader) { 2927 while (reader.nextField()) { 2928 if (reader.isEndGroup()) { 2929 break; 2930 } 2931 var field = reader.getFieldNumber(); 2932 switch (field) { 2933 case 1: 2934 var value = new proto.payload.TxInput; 2935 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 2936 msg.setInput(value); 2937 break; 2938 case 2: 2939 var value = new proto.payload.TxOutput; 2940 reader.readMessage(value,proto.payload.TxOutput.deserializeBinaryFromReader); 2941 msg.setOutput(value); 2942 break; 2943 default: 2944 reader.skipField(); 2945 break; 2946 } 2947 } 2948 return msg; 2949 }; 2950 2951 2952 /** 2953 * Serializes the message to binary data (in protobuf wire format). 2954 * @return {!Uint8Array} 2955 */ 2956 proto.payload.UnbondTx.prototype.serializeBinary = function() { 2957 var writer = new jspb.BinaryWriter(); 2958 proto.payload.UnbondTx.serializeBinaryToWriter(this, writer); 2959 return writer.getResultBuffer(); 2960 }; 2961 2962 2963 /** 2964 * Serializes the given message to binary data (in protobuf wire 2965 * format), writing to the given BinaryWriter. 2966 * @param {!proto.payload.UnbondTx} message 2967 * @param {!jspb.BinaryWriter} writer 2968 * @suppress {unusedLocalVariables} f is only used for nested messages 2969 */ 2970 proto.payload.UnbondTx.serializeBinaryToWriter = function(message, writer) { 2971 var f = undefined; 2972 f = message.getInput(); 2973 if (f != null) { 2974 writer.writeMessage( 2975 1, 2976 f, 2977 proto.payload.TxInput.serializeBinaryToWriter 2978 ); 2979 } 2980 f = message.getOutput(); 2981 if (f != null) { 2982 writer.writeMessage( 2983 2, 2984 f, 2985 proto.payload.TxOutput.serializeBinaryToWriter 2986 ); 2987 } 2988 }; 2989 2990 2991 /** 2992 * optional TxInput Input = 1; 2993 * @return {?proto.payload.TxInput} 2994 */ 2995 proto.payload.UnbondTx.prototype.getInput = function() { 2996 return /** @type{?proto.payload.TxInput} */ ( 2997 jspb.Message.getWrapperField(this, proto.payload.TxInput, 1)); 2998 }; 2999 3000 3001 /** 3002 * @param {?proto.payload.TxInput|undefined} value 3003 * @return {!proto.payload.UnbondTx} returns this 3004 */ 3005 proto.payload.UnbondTx.prototype.setInput = function(value) { 3006 return jspb.Message.setWrapperField(this, 1, value); 3007 }; 3008 3009 3010 /** 3011 * Clears the message field making it undefined. 3012 * @return {!proto.payload.UnbondTx} returns this 3013 */ 3014 proto.payload.UnbondTx.prototype.clearInput = function() { 3015 return this.setInput(undefined); 3016 }; 3017 3018 3019 /** 3020 * Returns whether this field is set. 3021 * @return {boolean} 3022 */ 3023 proto.payload.UnbondTx.prototype.hasInput = function() { 3024 return jspb.Message.getField(this, 1) != null; 3025 }; 3026 3027 3028 /** 3029 * optional TxOutput Output = 2; 3030 * @return {?proto.payload.TxOutput} 3031 */ 3032 proto.payload.UnbondTx.prototype.getOutput = function() { 3033 return /** @type{?proto.payload.TxOutput} */ ( 3034 jspb.Message.getWrapperField(this, proto.payload.TxOutput, 2)); 3035 }; 3036 3037 3038 /** 3039 * @param {?proto.payload.TxOutput|undefined} value 3040 * @return {!proto.payload.UnbondTx} returns this 3041 */ 3042 proto.payload.UnbondTx.prototype.setOutput = function(value) { 3043 return jspb.Message.setWrapperField(this, 2, value); 3044 }; 3045 3046 3047 /** 3048 * Clears the message field making it undefined. 3049 * @return {!proto.payload.UnbondTx} returns this 3050 */ 3051 proto.payload.UnbondTx.prototype.clearOutput = function() { 3052 return this.setOutput(undefined); 3053 }; 3054 3055 3056 /** 3057 * Returns whether this field is set. 3058 * @return {boolean} 3059 */ 3060 proto.payload.UnbondTx.prototype.hasOutput = function() { 3061 return jspb.Message.getField(this, 2) != null; 3062 }; 3063 3064 3065 3066 /** 3067 * List of repeated fields within this message type. 3068 * @private {!Array<number>} 3069 * @const 3070 */ 3071 proto.payload.GovTx.repeatedFields_ = [1,2]; 3072 3073 3074 3075 if (jspb.Message.GENERATE_TO_OBJECT) { 3076 /** 3077 * Creates an object representation of this proto. 3078 * Field names that are reserved in JavaScript and will be renamed to pb_name. 3079 * Optional fields that are not set will be set to undefined. 3080 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 3081 * For the list of reserved names please see: 3082 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 3083 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 3084 * JSPB instance for transitional soy proto support: 3085 * http://goto/soy-param-migration 3086 * @return {!Object} 3087 */ 3088 proto.payload.GovTx.prototype.toObject = function(opt_includeInstance) { 3089 return proto.payload.GovTx.toObject(opt_includeInstance, this); 3090 }; 3091 3092 3093 /** 3094 * Static version of the {@see toObject} method. 3095 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 3096 * the JSPB instance for transitional soy proto support: 3097 * http://goto/soy-param-migration 3098 * @param {!proto.payload.GovTx} msg The msg instance to transform. 3099 * @return {!Object} 3100 * @suppress {unusedLocalVariables} f is only used for nested messages 3101 */ 3102 proto.payload.GovTx.toObject = function(includeInstance, msg) { 3103 var f, obj = { 3104 inputsList: jspb.Message.toObjectList(msg.getInputsList(), 3105 proto.payload.TxInput.toObject, includeInstance), 3106 accountupdatesList: jspb.Message.toObjectList(msg.getAccountupdatesList(), 3107 spec_pb.TemplateAccount.toObject, includeInstance) 3108 }; 3109 3110 if (includeInstance) { 3111 obj.$jspbMessageInstance = msg; 3112 } 3113 return obj; 3114 }; 3115 } 3116 3117 3118 /** 3119 * Deserializes binary data (in protobuf wire format). 3120 * @param {jspb.ByteSource} bytes The bytes to deserialize. 3121 * @return {!proto.payload.GovTx} 3122 */ 3123 proto.payload.GovTx.deserializeBinary = function(bytes) { 3124 var reader = new jspb.BinaryReader(bytes); 3125 var msg = new proto.payload.GovTx; 3126 return proto.payload.GovTx.deserializeBinaryFromReader(msg, reader); 3127 }; 3128 3129 3130 /** 3131 * Deserializes binary data (in protobuf wire format) from the 3132 * given reader into the given message object. 3133 * @param {!proto.payload.GovTx} msg The message object to deserialize into. 3134 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 3135 * @return {!proto.payload.GovTx} 3136 */ 3137 proto.payload.GovTx.deserializeBinaryFromReader = function(msg, reader) { 3138 while (reader.nextField()) { 3139 if (reader.isEndGroup()) { 3140 break; 3141 } 3142 var field = reader.getFieldNumber(); 3143 switch (field) { 3144 case 1: 3145 var value = new proto.payload.TxInput; 3146 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 3147 msg.addInputs(value); 3148 break; 3149 case 2: 3150 var value = new spec_pb.TemplateAccount; 3151 reader.readMessage(value,spec_pb.TemplateAccount.deserializeBinaryFromReader); 3152 msg.addAccountupdates(value); 3153 break; 3154 default: 3155 reader.skipField(); 3156 break; 3157 } 3158 } 3159 return msg; 3160 }; 3161 3162 3163 /** 3164 * Serializes the message to binary data (in protobuf wire format). 3165 * @return {!Uint8Array} 3166 */ 3167 proto.payload.GovTx.prototype.serializeBinary = function() { 3168 var writer = new jspb.BinaryWriter(); 3169 proto.payload.GovTx.serializeBinaryToWriter(this, writer); 3170 return writer.getResultBuffer(); 3171 }; 3172 3173 3174 /** 3175 * Serializes the given message to binary data (in protobuf wire 3176 * format), writing to the given BinaryWriter. 3177 * @param {!proto.payload.GovTx} message 3178 * @param {!jspb.BinaryWriter} writer 3179 * @suppress {unusedLocalVariables} f is only used for nested messages 3180 */ 3181 proto.payload.GovTx.serializeBinaryToWriter = function(message, writer) { 3182 var f = undefined; 3183 f = message.getInputsList(); 3184 if (f.length > 0) { 3185 writer.writeRepeatedMessage( 3186 1, 3187 f, 3188 proto.payload.TxInput.serializeBinaryToWriter 3189 ); 3190 } 3191 f = message.getAccountupdatesList(); 3192 if (f.length > 0) { 3193 writer.writeRepeatedMessage( 3194 2, 3195 f, 3196 spec_pb.TemplateAccount.serializeBinaryToWriter 3197 ); 3198 } 3199 }; 3200 3201 3202 /** 3203 * repeated TxInput Inputs = 1; 3204 * @return {!Array<!proto.payload.TxInput>} 3205 */ 3206 proto.payload.GovTx.prototype.getInputsList = function() { 3207 return /** @type{!Array<!proto.payload.TxInput>} */ ( 3208 jspb.Message.getRepeatedWrapperField(this, proto.payload.TxInput, 1)); 3209 }; 3210 3211 3212 /** 3213 * @param {!Array<!proto.payload.TxInput>} value 3214 * @return {!proto.payload.GovTx} returns this 3215 */ 3216 proto.payload.GovTx.prototype.setInputsList = function(value) { 3217 return jspb.Message.setRepeatedWrapperField(this, 1, value); 3218 }; 3219 3220 3221 /** 3222 * @param {!proto.payload.TxInput=} opt_value 3223 * @param {number=} opt_index 3224 * @return {!proto.payload.TxInput} 3225 */ 3226 proto.payload.GovTx.prototype.addInputs = function(opt_value, opt_index) { 3227 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.payload.TxInput, opt_index); 3228 }; 3229 3230 3231 /** 3232 * Clears the list making it empty but non-null. 3233 * @return {!proto.payload.GovTx} returns this 3234 */ 3235 proto.payload.GovTx.prototype.clearInputsList = function() { 3236 return this.setInputsList([]); 3237 }; 3238 3239 3240 /** 3241 * repeated spec.TemplateAccount AccountUpdates = 2; 3242 * @return {!Array<!proto.spec.TemplateAccount>} 3243 */ 3244 proto.payload.GovTx.prototype.getAccountupdatesList = function() { 3245 return /** @type{!Array<!proto.spec.TemplateAccount>} */ ( 3246 jspb.Message.getRepeatedWrapperField(this, spec_pb.TemplateAccount, 2)); 3247 }; 3248 3249 3250 /** 3251 * @param {!Array<!proto.spec.TemplateAccount>} value 3252 * @return {!proto.payload.GovTx} returns this 3253 */ 3254 proto.payload.GovTx.prototype.setAccountupdatesList = function(value) { 3255 return jspb.Message.setRepeatedWrapperField(this, 2, value); 3256 }; 3257 3258 3259 /** 3260 * @param {!proto.spec.TemplateAccount=} opt_value 3261 * @param {number=} opt_index 3262 * @return {!proto.spec.TemplateAccount} 3263 */ 3264 proto.payload.GovTx.prototype.addAccountupdates = function(opt_value, opt_index) { 3265 return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spec.TemplateAccount, opt_index); 3266 }; 3267 3268 3269 /** 3270 * Clears the list making it empty but non-null. 3271 * @return {!proto.payload.GovTx} returns this 3272 */ 3273 proto.payload.GovTx.prototype.clearAccountupdatesList = function() { 3274 return this.setAccountupdatesList([]); 3275 }; 3276 3277 3278 3279 3280 3281 if (jspb.Message.GENERATE_TO_OBJECT) { 3282 /** 3283 * Creates an object representation of this proto. 3284 * Field names that are reserved in JavaScript and will be renamed to pb_name. 3285 * Optional fields that are not set will be set to undefined. 3286 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 3287 * For the list of reserved names please see: 3288 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 3289 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 3290 * JSPB instance for transitional soy proto support: 3291 * http://goto/soy-param-migration 3292 * @return {!Object} 3293 */ 3294 proto.payload.ProposalTx.prototype.toObject = function(opt_includeInstance) { 3295 return proto.payload.ProposalTx.toObject(opt_includeInstance, this); 3296 }; 3297 3298 3299 /** 3300 * Static version of the {@see toObject} method. 3301 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 3302 * the JSPB instance for transitional soy proto support: 3303 * http://goto/soy-param-migration 3304 * @param {!proto.payload.ProposalTx} msg The msg instance to transform. 3305 * @return {!Object} 3306 * @suppress {unusedLocalVariables} f is only used for nested messages 3307 */ 3308 proto.payload.ProposalTx.toObject = function(includeInstance, msg) { 3309 var f, obj = { 3310 input: (f = msg.getInput()) && proto.payload.TxInput.toObject(includeInstance, f), 3311 votingweight: jspb.Message.getFieldWithDefault(msg, 2, 0), 3312 proposalhash: msg.getProposalhash_asB64(), 3313 proposal: (f = msg.getProposal()) && proto.payload.Proposal.toObject(includeInstance, f) 3314 }; 3315 3316 if (includeInstance) { 3317 obj.$jspbMessageInstance = msg; 3318 } 3319 return obj; 3320 }; 3321 } 3322 3323 3324 /** 3325 * Deserializes binary data (in protobuf wire format). 3326 * @param {jspb.ByteSource} bytes The bytes to deserialize. 3327 * @return {!proto.payload.ProposalTx} 3328 */ 3329 proto.payload.ProposalTx.deserializeBinary = function(bytes) { 3330 var reader = new jspb.BinaryReader(bytes); 3331 var msg = new proto.payload.ProposalTx; 3332 return proto.payload.ProposalTx.deserializeBinaryFromReader(msg, reader); 3333 }; 3334 3335 3336 /** 3337 * Deserializes binary data (in protobuf wire format) from the 3338 * given reader into the given message object. 3339 * @param {!proto.payload.ProposalTx} msg The message object to deserialize into. 3340 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 3341 * @return {!proto.payload.ProposalTx} 3342 */ 3343 proto.payload.ProposalTx.deserializeBinaryFromReader = function(msg, reader) { 3344 while (reader.nextField()) { 3345 if (reader.isEndGroup()) { 3346 break; 3347 } 3348 var field = reader.getFieldNumber(); 3349 switch (field) { 3350 case 1: 3351 var value = new proto.payload.TxInput; 3352 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 3353 msg.setInput(value); 3354 break; 3355 case 2: 3356 var value = /** @type {number} */ (reader.readInt64()); 3357 msg.setVotingweight(value); 3358 break; 3359 case 3: 3360 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 3361 msg.setProposalhash(value); 3362 break; 3363 case 4: 3364 var value = new proto.payload.Proposal; 3365 reader.readMessage(value,proto.payload.Proposal.deserializeBinaryFromReader); 3366 msg.setProposal(value); 3367 break; 3368 default: 3369 reader.skipField(); 3370 break; 3371 } 3372 } 3373 return msg; 3374 }; 3375 3376 3377 /** 3378 * Serializes the message to binary data (in protobuf wire format). 3379 * @return {!Uint8Array} 3380 */ 3381 proto.payload.ProposalTx.prototype.serializeBinary = function() { 3382 var writer = new jspb.BinaryWriter(); 3383 proto.payload.ProposalTx.serializeBinaryToWriter(this, writer); 3384 return writer.getResultBuffer(); 3385 }; 3386 3387 3388 /** 3389 * Serializes the given message to binary data (in protobuf wire 3390 * format), writing to the given BinaryWriter. 3391 * @param {!proto.payload.ProposalTx} message 3392 * @param {!jspb.BinaryWriter} writer 3393 * @suppress {unusedLocalVariables} f is only used for nested messages 3394 */ 3395 proto.payload.ProposalTx.serializeBinaryToWriter = function(message, writer) { 3396 var f = undefined; 3397 f = message.getInput(); 3398 if (f != null) { 3399 writer.writeMessage( 3400 1, 3401 f, 3402 proto.payload.TxInput.serializeBinaryToWriter 3403 ); 3404 } 3405 f = message.getVotingweight(); 3406 if (f !== 0) { 3407 writer.writeInt64( 3408 2, 3409 f 3410 ); 3411 } 3412 f = message.getProposalhash_asU8(); 3413 if (f.length > 0) { 3414 writer.writeBytes( 3415 3, 3416 f 3417 ); 3418 } 3419 f = message.getProposal(); 3420 if (f != null) { 3421 writer.writeMessage( 3422 4, 3423 f, 3424 proto.payload.Proposal.serializeBinaryToWriter 3425 ); 3426 } 3427 }; 3428 3429 3430 /** 3431 * optional TxInput Input = 1; 3432 * @return {?proto.payload.TxInput} 3433 */ 3434 proto.payload.ProposalTx.prototype.getInput = function() { 3435 return /** @type{?proto.payload.TxInput} */ ( 3436 jspb.Message.getWrapperField(this, proto.payload.TxInput, 1)); 3437 }; 3438 3439 3440 /** 3441 * @param {?proto.payload.TxInput|undefined} value 3442 * @return {!proto.payload.ProposalTx} returns this 3443 */ 3444 proto.payload.ProposalTx.prototype.setInput = function(value) { 3445 return jspb.Message.setWrapperField(this, 1, value); 3446 }; 3447 3448 3449 /** 3450 * Clears the message field making it undefined. 3451 * @return {!proto.payload.ProposalTx} returns this 3452 */ 3453 proto.payload.ProposalTx.prototype.clearInput = function() { 3454 return this.setInput(undefined); 3455 }; 3456 3457 3458 /** 3459 * Returns whether this field is set. 3460 * @return {boolean} 3461 */ 3462 proto.payload.ProposalTx.prototype.hasInput = function() { 3463 return jspb.Message.getField(this, 1) != null; 3464 }; 3465 3466 3467 /** 3468 * optional int64 VotingWeight = 2; 3469 * @return {number} 3470 */ 3471 proto.payload.ProposalTx.prototype.getVotingweight = function() { 3472 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); 3473 }; 3474 3475 3476 /** 3477 * @param {number} value 3478 * @return {!proto.payload.ProposalTx} returns this 3479 */ 3480 proto.payload.ProposalTx.prototype.setVotingweight = function(value) { 3481 return jspb.Message.setProto3IntField(this, 2, value); 3482 }; 3483 3484 3485 /** 3486 * optional bytes ProposalHash = 3; 3487 * @return {!(string|Uint8Array)} 3488 */ 3489 proto.payload.ProposalTx.prototype.getProposalhash = function() { 3490 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 3491 }; 3492 3493 3494 /** 3495 * optional bytes ProposalHash = 3; 3496 * This is a type-conversion wrapper around `getProposalhash()` 3497 * @return {string} 3498 */ 3499 proto.payload.ProposalTx.prototype.getProposalhash_asB64 = function() { 3500 return /** @type {string} */ (jspb.Message.bytesAsB64( 3501 this.getProposalhash())); 3502 }; 3503 3504 3505 /** 3506 * optional bytes ProposalHash = 3; 3507 * Note that Uint8Array is not supported on all browsers. 3508 * @see http://caniuse.com/Uint8Array 3509 * This is a type-conversion wrapper around `getProposalhash()` 3510 * @return {!Uint8Array} 3511 */ 3512 proto.payload.ProposalTx.prototype.getProposalhash_asU8 = function() { 3513 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 3514 this.getProposalhash())); 3515 }; 3516 3517 3518 /** 3519 * @param {!(string|Uint8Array)} value 3520 * @return {!proto.payload.ProposalTx} returns this 3521 */ 3522 proto.payload.ProposalTx.prototype.setProposalhash = function(value) { 3523 return jspb.Message.setProto3BytesField(this, 3, value); 3524 }; 3525 3526 3527 /** 3528 * optional Proposal Proposal = 4; 3529 * @return {?proto.payload.Proposal} 3530 */ 3531 proto.payload.ProposalTx.prototype.getProposal = function() { 3532 return /** @type{?proto.payload.Proposal} */ ( 3533 jspb.Message.getWrapperField(this, proto.payload.Proposal, 4)); 3534 }; 3535 3536 3537 /** 3538 * @param {?proto.payload.Proposal|undefined} value 3539 * @return {!proto.payload.ProposalTx} returns this 3540 */ 3541 proto.payload.ProposalTx.prototype.setProposal = function(value) { 3542 return jspb.Message.setWrapperField(this, 4, value); 3543 }; 3544 3545 3546 /** 3547 * Clears the message field making it undefined. 3548 * @return {!proto.payload.ProposalTx} returns this 3549 */ 3550 proto.payload.ProposalTx.prototype.clearProposal = function() { 3551 return this.setProposal(undefined); 3552 }; 3553 3554 3555 /** 3556 * Returns whether this field is set. 3557 * @return {boolean} 3558 */ 3559 proto.payload.ProposalTx.prototype.hasProposal = function() { 3560 return jspb.Message.getField(this, 4) != null; 3561 }; 3562 3563 3564 3565 /** 3566 * List of repeated fields within this message type. 3567 * @private {!Array<number>} 3568 * @const 3569 */ 3570 proto.payload.IdentifyTx.repeatedFields_ = [1]; 3571 3572 3573 3574 if (jspb.Message.GENERATE_TO_OBJECT) { 3575 /** 3576 * Creates an object representation of this proto. 3577 * Field names that are reserved in JavaScript and will be renamed to pb_name. 3578 * Optional fields that are not set will be set to undefined. 3579 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 3580 * For the list of reserved names please see: 3581 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 3582 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 3583 * JSPB instance for transitional soy proto support: 3584 * http://goto/soy-param-migration 3585 * @return {!Object} 3586 */ 3587 proto.payload.IdentifyTx.prototype.toObject = function(opt_includeInstance) { 3588 return proto.payload.IdentifyTx.toObject(opt_includeInstance, this); 3589 }; 3590 3591 3592 /** 3593 * Static version of the {@see toObject} method. 3594 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 3595 * the JSPB instance for transitional soy proto support: 3596 * http://goto/soy-param-migration 3597 * @param {!proto.payload.IdentifyTx} msg The msg instance to transform. 3598 * @return {!Object} 3599 * @suppress {unusedLocalVariables} f is only used for nested messages 3600 */ 3601 proto.payload.IdentifyTx.toObject = function(includeInstance, msg) { 3602 var f, obj = { 3603 inputsList: jspb.Message.toObjectList(msg.getInputsList(), 3604 proto.payload.TxInput.toObject, includeInstance), 3605 node: (f = msg.getNode()) && registry_pb.NodeIdentity.toObject(includeInstance, f) 3606 }; 3607 3608 if (includeInstance) { 3609 obj.$jspbMessageInstance = msg; 3610 } 3611 return obj; 3612 }; 3613 } 3614 3615 3616 /** 3617 * Deserializes binary data (in protobuf wire format). 3618 * @param {jspb.ByteSource} bytes The bytes to deserialize. 3619 * @return {!proto.payload.IdentifyTx} 3620 */ 3621 proto.payload.IdentifyTx.deserializeBinary = function(bytes) { 3622 var reader = new jspb.BinaryReader(bytes); 3623 var msg = new proto.payload.IdentifyTx; 3624 return proto.payload.IdentifyTx.deserializeBinaryFromReader(msg, reader); 3625 }; 3626 3627 3628 /** 3629 * Deserializes binary data (in protobuf wire format) from the 3630 * given reader into the given message object. 3631 * @param {!proto.payload.IdentifyTx} msg The message object to deserialize into. 3632 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 3633 * @return {!proto.payload.IdentifyTx} 3634 */ 3635 proto.payload.IdentifyTx.deserializeBinaryFromReader = function(msg, reader) { 3636 while (reader.nextField()) { 3637 if (reader.isEndGroup()) { 3638 break; 3639 } 3640 var field = reader.getFieldNumber(); 3641 switch (field) { 3642 case 1: 3643 var value = new proto.payload.TxInput; 3644 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 3645 msg.addInputs(value); 3646 break; 3647 case 2: 3648 var value = new registry_pb.NodeIdentity; 3649 reader.readMessage(value,registry_pb.NodeIdentity.deserializeBinaryFromReader); 3650 msg.setNode(value); 3651 break; 3652 default: 3653 reader.skipField(); 3654 break; 3655 } 3656 } 3657 return msg; 3658 }; 3659 3660 3661 /** 3662 * Serializes the message to binary data (in protobuf wire format). 3663 * @return {!Uint8Array} 3664 */ 3665 proto.payload.IdentifyTx.prototype.serializeBinary = function() { 3666 var writer = new jspb.BinaryWriter(); 3667 proto.payload.IdentifyTx.serializeBinaryToWriter(this, writer); 3668 return writer.getResultBuffer(); 3669 }; 3670 3671 3672 /** 3673 * Serializes the given message to binary data (in protobuf wire 3674 * format), writing to the given BinaryWriter. 3675 * @param {!proto.payload.IdentifyTx} message 3676 * @param {!jspb.BinaryWriter} writer 3677 * @suppress {unusedLocalVariables} f is only used for nested messages 3678 */ 3679 proto.payload.IdentifyTx.serializeBinaryToWriter = function(message, writer) { 3680 var f = undefined; 3681 f = message.getInputsList(); 3682 if (f.length > 0) { 3683 writer.writeRepeatedMessage( 3684 1, 3685 f, 3686 proto.payload.TxInput.serializeBinaryToWriter 3687 ); 3688 } 3689 f = message.getNode(); 3690 if (f != null) { 3691 writer.writeMessage( 3692 2, 3693 f, 3694 registry_pb.NodeIdentity.serializeBinaryToWriter 3695 ); 3696 } 3697 }; 3698 3699 3700 /** 3701 * repeated TxInput Inputs = 1; 3702 * @return {!Array<!proto.payload.TxInput>} 3703 */ 3704 proto.payload.IdentifyTx.prototype.getInputsList = function() { 3705 return /** @type{!Array<!proto.payload.TxInput>} */ ( 3706 jspb.Message.getRepeatedWrapperField(this, proto.payload.TxInput, 1)); 3707 }; 3708 3709 3710 /** 3711 * @param {!Array<!proto.payload.TxInput>} value 3712 * @return {!proto.payload.IdentifyTx} returns this 3713 */ 3714 proto.payload.IdentifyTx.prototype.setInputsList = function(value) { 3715 return jspb.Message.setRepeatedWrapperField(this, 1, value); 3716 }; 3717 3718 3719 /** 3720 * @param {!proto.payload.TxInput=} opt_value 3721 * @param {number=} opt_index 3722 * @return {!proto.payload.TxInput} 3723 */ 3724 proto.payload.IdentifyTx.prototype.addInputs = function(opt_value, opt_index) { 3725 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.payload.TxInput, opt_index); 3726 }; 3727 3728 3729 /** 3730 * Clears the list making it empty but non-null. 3731 * @return {!proto.payload.IdentifyTx} returns this 3732 */ 3733 proto.payload.IdentifyTx.prototype.clearInputsList = function() { 3734 return this.setInputsList([]); 3735 }; 3736 3737 3738 /** 3739 * optional registry.NodeIdentity Node = 2; 3740 * @return {?proto.registry.NodeIdentity} 3741 */ 3742 proto.payload.IdentifyTx.prototype.getNode = function() { 3743 return /** @type{?proto.registry.NodeIdentity} */ ( 3744 jspb.Message.getWrapperField(this, registry_pb.NodeIdentity, 2)); 3745 }; 3746 3747 3748 /** 3749 * @param {?proto.registry.NodeIdentity|undefined} value 3750 * @return {!proto.payload.IdentifyTx} returns this 3751 */ 3752 proto.payload.IdentifyTx.prototype.setNode = function(value) { 3753 return jspb.Message.setWrapperField(this, 2, value); 3754 }; 3755 3756 3757 /** 3758 * Clears the message field making it undefined. 3759 * @return {!proto.payload.IdentifyTx} returns this 3760 */ 3761 proto.payload.IdentifyTx.prototype.clearNode = function() { 3762 return this.setNode(undefined); 3763 }; 3764 3765 3766 /** 3767 * Returns whether this field is set. 3768 * @return {boolean} 3769 */ 3770 proto.payload.IdentifyTx.prototype.hasNode = function() { 3771 return jspb.Message.getField(this, 2) != null; 3772 }; 3773 3774 3775 3776 /** 3777 * List of repeated fields within this message type. 3778 * @private {!Array<number>} 3779 * @const 3780 */ 3781 proto.payload.BatchTx.repeatedFields_ = [1,2]; 3782 3783 3784 3785 if (jspb.Message.GENERATE_TO_OBJECT) { 3786 /** 3787 * Creates an object representation of this proto. 3788 * Field names that are reserved in JavaScript and will be renamed to pb_name. 3789 * Optional fields that are not set will be set to undefined. 3790 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 3791 * For the list of reserved names please see: 3792 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 3793 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 3794 * JSPB instance for transitional soy proto support: 3795 * http://goto/soy-param-migration 3796 * @return {!Object} 3797 */ 3798 proto.payload.BatchTx.prototype.toObject = function(opt_includeInstance) { 3799 return proto.payload.BatchTx.toObject(opt_includeInstance, this); 3800 }; 3801 3802 3803 /** 3804 * Static version of the {@see toObject} method. 3805 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 3806 * the JSPB instance for transitional soy proto support: 3807 * http://goto/soy-param-migration 3808 * @param {!proto.payload.BatchTx} msg The msg instance to transform. 3809 * @return {!Object} 3810 * @suppress {unusedLocalVariables} f is only used for nested messages 3811 */ 3812 proto.payload.BatchTx.toObject = function(includeInstance, msg) { 3813 var f, obj = { 3814 inputsList: jspb.Message.toObjectList(msg.getInputsList(), 3815 proto.payload.TxInput.toObject, includeInstance), 3816 txsList: jspb.Message.toObjectList(msg.getTxsList(), 3817 proto.payload.Any.toObject, includeInstance) 3818 }; 3819 3820 if (includeInstance) { 3821 obj.$jspbMessageInstance = msg; 3822 } 3823 return obj; 3824 }; 3825 } 3826 3827 3828 /** 3829 * Deserializes binary data (in protobuf wire format). 3830 * @param {jspb.ByteSource} bytes The bytes to deserialize. 3831 * @return {!proto.payload.BatchTx} 3832 */ 3833 proto.payload.BatchTx.deserializeBinary = function(bytes) { 3834 var reader = new jspb.BinaryReader(bytes); 3835 var msg = new proto.payload.BatchTx; 3836 return proto.payload.BatchTx.deserializeBinaryFromReader(msg, reader); 3837 }; 3838 3839 3840 /** 3841 * Deserializes binary data (in protobuf wire format) from the 3842 * given reader into the given message object. 3843 * @param {!proto.payload.BatchTx} msg The message object to deserialize into. 3844 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 3845 * @return {!proto.payload.BatchTx} 3846 */ 3847 proto.payload.BatchTx.deserializeBinaryFromReader = function(msg, reader) { 3848 while (reader.nextField()) { 3849 if (reader.isEndGroup()) { 3850 break; 3851 } 3852 var field = reader.getFieldNumber(); 3853 switch (field) { 3854 case 1: 3855 var value = new proto.payload.TxInput; 3856 reader.readMessage(value,proto.payload.TxInput.deserializeBinaryFromReader); 3857 msg.addInputs(value); 3858 break; 3859 case 2: 3860 var value = new proto.payload.Any; 3861 reader.readMessage(value,proto.payload.Any.deserializeBinaryFromReader); 3862 msg.addTxs(value); 3863 break; 3864 default: 3865 reader.skipField(); 3866 break; 3867 } 3868 } 3869 return msg; 3870 }; 3871 3872 3873 /** 3874 * Serializes the message to binary data (in protobuf wire format). 3875 * @return {!Uint8Array} 3876 */ 3877 proto.payload.BatchTx.prototype.serializeBinary = function() { 3878 var writer = new jspb.BinaryWriter(); 3879 proto.payload.BatchTx.serializeBinaryToWriter(this, writer); 3880 return writer.getResultBuffer(); 3881 }; 3882 3883 3884 /** 3885 * Serializes the given message to binary data (in protobuf wire 3886 * format), writing to the given BinaryWriter. 3887 * @param {!proto.payload.BatchTx} message 3888 * @param {!jspb.BinaryWriter} writer 3889 * @suppress {unusedLocalVariables} f is only used for nested messages 3890 */ 3891 proto.payload.BatchTx.serializeBinaryToWriter = function(message, writer) { 3892 var f = undefined; 3893 f = message.getInputsList(); 3894 if (f.length > 0) { 3895 writer.writeRepeatedMessage( 3896 1, 3897 f, 3898 proto.payload.TxInput.serializeBinaryToWriter 3899 ); 3900 } 3901 f = message.getTxsList(); 3902 if (f.length > 0) { 3903 writer.writeRepeatedMessage( 3904 2, 3905 f, 3906 proto.payload.Any.serializeBinaryToWriter 3907 ); 3908 } 3909 }; 3910 3911 3912 /** 3913 * repeated TxInput Inputs = 1; 3914 * @return {!Array<!proto.payload.TxInput>} 3915 */ 3916 proto.payload.BatchTx.prototype.getInputsList = function() { 3917 return /** @type{!Array<!proto.payload.TxInput>} */ ( 3918 jspb.Message.getRepeatedWrapperField(this, proto.payload.TxInput, 1)); 3919 }; 3920 3921 3922 /** 3923 * @param {!Array<!proto.payload.TxInput>} value 3924 * @return {!proto.payload.BatchTx} returns this 3925 */ 3926 proto.payload.BatchTx.prototype.setInputsList = function(value) { 3927 return jspb.Message.setRepeatedWrapperField(this, 1, value); 3928 }; 3929 3930 3931 /** 3932 * @param {!proto.payload.TxInput=} opt_value 3933 * @param {number=} opt_index 3934 * @return {!proto.payload.TxInput} 3935 */ 3936 proto.payload.BatchTx.prototype.addInputs = function(opt_value, opt_index) { 3937 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.payload.TxInput, opt_index); 3938 }; 3939 3940 3941 /** 3942 * Clears the list making it empty but non-null. 3943 * @return {!proto.payload.BatchTx} returns this 3944 */ 3945 proto.payload.BatchTx.prototype.clearInputsList = function() { 3946 return this.setInputsList([]); 3947 }; 3948 3949 3950 /** 3951 * repeated Any Txs = 2; 3952 * @return {!Array<!proto.payload.Any>} 3953 */ 3954 proto.payload.BatchTx.prototype.getTxsList = function() { 3955 return /** @type{!Array<!proto.payload.Any>} */ ( 3956 jspb.Message.getRepeatedWrapperField(this, proto.payload.Any, 2)); 3957 }; 3958 3959 3960 /** 3961 * @param {!Array<!proto.payload.Any>} value 3962 * @return {!proto.payload.BatchTx} returns this 3963 */ 3964 proto.payload.BatchTx.prototype.setTxsList = function(value) { 3965 return jspb.Message.setRepeatedWrapperField(this, 2, value); 3966 }; 3967 3968 3969 /** 3970 * @param {!proto.payload.Any=} opt_value 3971 * @param {number=} opt_index 3972 * @return {!proto.payload.Any} 3973 */ 3974 proto.payload.BatchTx.prototype.addTxs = function(opt_value, opt_index) { 3975 return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.payload.Any, opt_index); 3976 }; 3977 3978 3979 /** 3980 * Clears the list making it empty but non-null. 3981 * @return {!proto.payload.BatchTx} returns this 3982 */ 3983 proto.payload.BatchTx.prototype.clearTxsList = function() { 3984 return this.setTxsList([]); 3985 }; 3986 3987 3988 3989 3990 3991 if (jspb.Message.GENERATE_TO_OBJECT) { 3992 /** 3993 * Creates an object representation of this proto. 3994 * Field names that are reserved in JavaScript and will be renamed to pb_name. 3995 * Optional fields that are not set will be set to undefined. 3996 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 3997 * For the list of reserved names please see: 3998 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 3999 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 4000 * JSPB instance for transitional soy proto support: 4001 * http://goto/soy-param-migration 4002 * @return {!Object} 4003 */ 4004 proto.payload.Vote.prototype.toObject = function(opt_includeInstance) { 4005 return proto.payload.Vote.toObject(opt_includeInstance, this); 4006 }; 4007 4008 4009 /** 4010 * Static version of the {@see toObject} method. 4011 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 4012 * the JSPB instance for transitional soy proto support: 4013 * http://goto/soy-param-migration 4014 * @param {!proto.payload.Vote} msg The msg instance to transform. 4015 * @return {!Object} 4016 * @suppress {unusedLocalVariables} f is only used for nested messages 4017 */ 4018 proto.payload.Vote.toObject = function(includeInstance, msg) { 4019 var f, obj = { 4020 address: msg.getAddress_asB64(), 4021 votingweight: jspb.Message.getFieldWithDefault(msg, 2, 0) 4022 }; 4023 4024 if (includeInstance) { 4025 obj.$jspbMessageInstance = msg; 4026 } 4027 return obj; 4028 }; 4029 } 4030 4031 4032 /** 4033 * Deserializes binary data (in protobuf wire format). 4034 * @param {jspb.ByteSource} bytes The bytes to deserialize. 4035 * @return {!proto.payload.Vote} 4036 */ 4037 proto.payload.Vote.deserializeBinary = function(bytes) { 4038 var reader = new jspb.BinaryReader(bytes); 4039 var msg = new proto.payload.Vote; 4040 return proto.payload.Vote.deserializeBinaryFromReader(msg, reader); 4041 }; 4042 4043 4044 /** 4045 * Deserializes binary data (in protobuf wire format) from the 4046 * given reader into the given message object. 4047 * @param {!proto.payload.Vote} msg The message object to deserialize into. 4048 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 4049 * @return {!proto.payload.Vote} 4050 */ 4051 proto.payload.Vote.deserializeBinaryFromReader = function(msg, reader) { 4052 while (reader.nextField()) { 4053 if (reader.isEndGroup()) { 4054 break; 4055 } 4056 var field = reader.getFieldNumber(); 4057 switch (field) { 4058 case 1: 4059 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 4060 msg.setAddress(value); 4061 break; 4062 case 2: 4063 var value = /** @type {number} */ (reader.readInt64()); 4064 msg.setVotingweight(value); 4065 break; 4066 default: 4067 reader.skipField(); 4068 break; 4069 } 4070 } 4071 return msg; 4072 }; 4073 4074 4075 /** 4076 * Serializes the message to binary data (in protobuf wire format). 4077 * @return {!Uint8Array} 4078 */ 4079 proto.payload.Vote.prototype.serializeBinary = function() { 4080 var writer = new jspb.BinaryWriter(); 4081 proto.payload.Vote.serializeBinaryToWriter(this, writer); 4082 return writer.getResultBuffer(); 4083 }; 4084 4085 4086 /** 4087 * Serializes the given message to binary data (in protobuf wire 4088 * format), writing to the given BinaryWriter. 4089 * @param {!proto.payload.Vote} message 4090 * @param {!jspb.BinaryWriter} writer 4091 * @suppress {unusedLocalVariables} f is only used for nested messages 4092 */ 4093 proto.payload.Vote.serializeBinaryToWriter = function(message, writer) { 4094 var f = undefined; 4095 f = message.getAddress_asU8(); 4096 if (f.length > 0) { 4097 writer.writeBytes( 4098 1, 4099 f 4100 ); 4101 } 4102 f = message.getVotingweight(); 4103 if (f !== 0) { 4104 writer.writeInt64( 4105 2, 4106 f 4107 ); 4108 } 4109 }; 4110 4111 4112 /** 4113 * optional bytes Address = 1; 4114 * @return {!(string|Uint8Array)} 4115 */ 4116 proto.payload.Vote.prototype.getAddress = function() { 4117 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 4118 }; 4119 4120 4121 /** 4122 * optional bytes Address = 1; 4123 * This is a type-conversion wrapper around `getAddress()` 4124 * @return {string} 4125 */ 4126 proto.payload.Vote.prototype.getAddress_asB64 = function() { 4127 return /** @type {string} */ (jspb.Message.bytesAsB64( 4128 this.getAddress())); 4129 }; 4130 4131 4132 /** 4133 * optional bytes Address = 1; 4134 * Note that Uint8Array is not supported on all browsers. 4135 * @see http://caniuse.com/Uint8Array 4136 * This is a type-conversion wrapper around `getAddress()` 4137 * @return {!Uint8Array} 4138 */ 4139 proto.payload.Vote.prototype.getAddress_asU8 = function() { 4140 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 4141 this.getAddress())); 4142 }; 4143 4144 4145 /** 4146 * @param {!(string|Uint8Array)} value 4147 * @return {!proto.payload.Vote} returns this 4148 */ 4149 proto.payload.Vote.prototype.setAddress = function(value) { 4150 return jspb.Message.setProto3BytesField(this, 1, value); 4151 }; 4152 4153 4154 /** 4155 * optional int64 VotingWeight = 2; 4156 * @return {number} 4157 */ 4158 proto.payload.Vote.prototype.getVotingweight = function() { 4159 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); 4160 }; 4161 4162 4163 /** 4164 * @param {number} value 4165 * @return {!proto.payload.Vote} returns this 4166 */ 4167 proto.payload.Vote.prototype.setVotingweight = function(value) { 4168 return jspb.Message.setProto3IntField(this, 2, value); 4169 }; 4170 4171 4172 4173 4174 4175 if (jspb.Message.GENERATE_TO_OBJECT) { 4176 /** 4177 * Creates an object representation of this proto. 4178 * Field names that are reserved in JavaScript and will be renamed to pb_name. 4179 * Optional fields that are not set will be set to undefined. 4180 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 4181 * For the list of reserved names please see: 4182 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 4183 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 4184 * JSPB instance for transitional soy proto support: 4185 * http://goto/soy-param-migration 4186 * @return {!Object} 4187 */ 4188 proto.payload.Proposal.prototype.toObject = function(opt_includeInstance) { 4189 return proto.payload.Proposal.toObject(opt_includeInstance, this); 4190 }; 4191 4192 4193 /** 4194 * Static version of the {@see toObject} method. 4195 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 4196 * the JSPB instance for transitional soy proto support: 4197 * http://goto/soy-param-migration 4198 * @param {!proto.payload.Proposal} msg The msg instance to transform. 4199 * @return {!Object} 4200 * @suppress {unusedLocalVariables} f is only used for nested messages 4201 */ 4202 proto.payload.Proposal.toObject = function(includeInstance, msg) { 4203 var f, obj = { 4204 name: jspb.Message.getFieldWithDefault(msg, 1, ""), 4205 description: jspb.Message.getFieldWithDefault(msg, 2, ""), 4206 batchtx: (f = msg.getBatchtx()) && proto.payload.BatchTx.toObject(includeInstance, f) 4207 }; 4208 4209 if (includeInstance) { 4210 obj.$jspbMessageInstance = msg; 4211 } 4212 return obj; 4213 }; 4214 } 4215 4216 4217 /** 4218 * Deserializes binary data (in protobuf wire format). 4219 * @param {jspb.ByteSource} bytes The bytes to deserialize. 4220 * @return {!proto.payload.Proposal} 4221 */ 4222 proto.payload.Proposal.deserializeBinary = function(bytes) { 4223 var reader = new jspb.BinaryReader(bytes); 4224 var msg = new proto.payload.Proposal; 4225 return proto.payload.Proposal.deserializeBinaryFromReader(msg, reader); 4226 }; 4227 4228 4229 /** 4230 * Deserializes binary data (in protobuf wire format) from the 4231 * given reader into the given message object. 4232 * @param {!proto.payload.Proposal} msg The message object to deserialize into. 4233 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 4234 * @return {!proto.payload.Proposal} 4235 */ 4236 proto.payload.Proposal.deserializeBinaryFromReader = function(msg, reader) { 4237 while (reader.nextField()) { 4238 if (reader.isEndGroup()) { 4239 break; 4240 } 4241 var field = reader.getFieldNumber(); 4242 switch (field) { 4243 case 1: 4244 var value = /** @type {string} */ (reader.readString()); 4245 msg.setName(value); 4246 break; 4247 case 2: 4248 var value = /** @type {string} */ (reader.readString()); 4249 msg.setDescription(value); 4250 break; 4251 case 3: 4252 var value = new proto.payload.BatchTx; 4253 reader.readMessage(value,proto.payload.BatchTx.deserializeBinaryFromReader); 4254 msg.setBatchtx(value); 4255 break; 4256 default: 4257 reader.skipField(); 4258 break; 4259 } 4260 } 4261 return msg; 4262 }; 4263 4264 4265 /** 4266 * Serializes the message to binary data (in protobuf wire format). 4267 * @return {!Uint8Array} 4268 */ 4269 proto.payload.Proposal.prototype.serializeBinary = function() { 4270 var writer = new jspb.BinaryWriter(); 4271 proto.payload.Proposal.serializeBinaryToWriter(this, writer); 4272 return writer.getResultBuffer(); 4273 }; 4274 4275 4276 /** 4277 * Serializes the given message to binary data (in protobuf wire 4278 * format), writing to the given BinaryWriter. 4279 * @param {!proto.payload.Proposal} message 4280 * @param {!jspb.BinaryWriter} writer 4281 * @suppress {unusedLocalVariables} f is only used for nested messages 4282 */ 4283 proto.payload.Proposal.serializeBinaryToWriter = function(message, writer) { 4284 var f = undefined; 4285 f = message.getName(); 4286 if (f.length > 0) { 4287 writer.writeString( 4288 1, 4289 f 4290 ); 4291 } 4292 f = message.getDescription(); 4293 if (f.length > 0) { 4294 writer.writeString( 4295 2, 4296 f 4297 ); 4298 } 4299 f = message.getBatchtx(); 4300 if (f != null) { 4301 writer.writeMessage( 4302 3, 4303 f, 4304 proto.payload.BatchTx.serializeBinaryToWriter 4305 ); 4306 } 4307 }; 4308 4309 4310 /** 4311 * optional string Name = 1; 4312 * @return {string} 4313 */ 4314 proto.payload.Proposal.prototype.getName = function() { 4315 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 4316 }; 4317 4318 4319 /** 4320 * @param {string} value 4321 * @return {!proto.payload.Proposal} returns this 4322 */ 4323 proto.payload.Proposal.prototype.setName = function(value) { 4324 return jspb.Message.setProto3StringField(this, 1, value); 4325 }; 4326 4327 4328 /** 4329 * optional string Description = 2; 4330 * @return {string} 4331 */ 4332 proto.payload.Proposal.prototype.getDescription = function() { 4333 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 4334 }; 4335 4336 4337 /** 4338 * @param {string} value 4339 * @return {!proto.payload.Proposal} returns this 4340 */ 4341 proto.payload.Proposal.prototype.setDescription = function(value) { 4342 return jspb.Message.setProto3StringField(this, 2, value); 4343 }; 4344 4345 4346 /** 4347 * optional BatchTx BatchTx = 3; 4348 * @return {?proto.payload.BatchTx} 4349 */ 4350 proto.payload.Proposal.prototype.getBatchtx = function() { 4351 return /** @type{?proto.payload.BatchTx} */ ( 4352 jspb.Message.getWrapperField(this, proto.payload.BatchTx, 3)); 4353 }; 4354 4355 4356 /** 4357 * @param {?proto.payload.BatchTx|undefined} value 4358 * @return {!proto.payload.Proposal} returns this 4359 */ 4360 proto.payload.Proposal.prototype.setBatchtx = function(value) { 4361 return jspb.Message.setWrapperField(this, 3, value); 4362 }; 4363 4364 4365 /** 4366 * Clears the message field making it undefined. 4367 * @return {!proto.payload.Proposal} returns this 4368 */ 4369 proto.payload.Proposal.prototype.clearBatchtx = function() { 4370 return this.setBatchtx(undefined); 4371 }; 4372 4373 4374 /** 4375 * Returns whether this field is set. 4376 * @return {boolean} 4377 */ 4378 proto.payload.Proposal.prototype.hasBatchtx = function() { 4379 return jspb.Message.getField(this, 3) != null; 4380 }; 4381 4382 4383 4384 /** 4385 * List of repeated fields within this message type. 4386 * @private {!Array<number>} 4387 * @const 4388 */ 4389 proto.payload.Ballot.repeatedFields_ = [5]; 4390 4391 4392 4393 if (jspb.Message.GENERATE_TO_OBJECT) { 4394 /** 4395 * Creates an object representation of this proto. 4396 * Field names that are reserved in JavaScript and will be renamed to pb_name. 4397 * Optional fields that are not set will be set to undefined. 4398 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 4399 * For the list of reserved names please see: 4400 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 4401 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 4402 * JSPB instance for transitional soy proto support: 4403 * http://goto/soy-param-migration 4404 * @return {!Object} 4405 */ 4406 proto.payload.Ballot.prototype.toObject = function(opt_includeInstance) { 4407 return proto.payload.Ballot.toObject(opt_includeInstance, this); 4408 }; 4409 4410 4411 /** 4412 * Static version of the {@see toObject} method. 4413 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 4414 * the JSPB instance for transitional soy proto support: 4415 * http://goto/soy-param-migration 4416 * @param {!proto.payload.Ballot} msg The msg instance to transform. 4417 * @return {!Object} 4418 * @suppress {unusedLocalVariables} f is only used for nested messages 4419 */ 4420 proto.payload.Ballot.toObject = function(includeInstance, msg) { 4421 var f, obj = { 4422 proposal: (f = msg.getProposal()) && proto.payload.Proposal.toObject(includeInstance, f), 4423 finalizingtx: msg.getFinalizingtx_asB64(), 4424 proposalstate: jspb.Message.getFieldWithDefault(msg, 4, 0), 4425 votesList: jspb.Message.toObjectList(msg.getVotesList(), 4426 proto.payload.Vote.toObject, includeInstance) 4427 }; 4428 4429 if (includeInstance) { 4430 obj.$jspbMessageInstance = msg; 4431 } 4432 return obj; 4433 }; 4434 } 4435 4436 4437 /** 4438 * Deserializes binary data (in protobuf wire format). 4439 * @param {jspb.ByteSource} bytes The bytes to deserialize. 4440 * @return {!proto.payload.Ballot} 4441 */ 4442 proto.payload.Ballot.deserializeBinary = function(bytes) { 4443 var reader = new jspb.BinaryReader(bytes); 4444 var msg = new proto.payload.Ballot; 4445 return proto.payload.Ballot.deserializeBinaryFromReader(msg, reader); 4446 }; 4447 4448 4449 /** 4450 * Deserializes binary data (in protobuf wire format) from the 4451 * given reader into the given message object. 4452 * @param {!proto.payload.Ballot} msg The message object to deserialize into. 4453 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 4454 * @return {!proto.payload.Ballot} 4455 */ 4456 proto.payload.Ballot.deserializeBinaryFromReader = function(msg, reader) { 4457 while (reader.nextField()) { 4458 if (reader.isEndGroup()) { 4459 break; 4460 } 4461 var field = reader.getFieldNumber(); 4462 switch (field) { 4463 case 1: 4464 var value = new proto.payload.Proposal; 4465 reader.readMessage(value,proto.payload.Proposal.deserializeBinaryFromReader); 4466 msg.setProposal(value); 4467 break; 4468 case 2: 4469 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 4470 msg.setFinalizingtx(value); 4471 break; 4472 case 4: 4473 var value = /** @type {!proto.payload.Ballot.ProposalState} */ (reader.readEnum()); 4474 msg.setProposalstate(value); 4475 break; 4476 case 5: 4477 var value = new proto.payload.Vote; 4478 reader.readMessage(value,proto.payload.Vote.deserializeBinaryFromReader); 4479 msg.addVotes(value); 4480 break; 4481 default: 4482 reader.skipField(); 4483 break; 4484 } 4485 } 4486 return msg; 4487 }; 4488 4489 4490 /** 4491 * Serializes the message to binary data (in protobuf wire format). 4492 * @return {!Uint8Array} 4493 */ 4494 proto.payload.Ballot.prototype.serializeBinary = function() { 4495 var writer = new jspb.BinaryWriter(); 4496 proto.payload.Ballot.serializeBinaryToWriter(this, writer); 4497 return writer.getResultBuffer(); 4498 }; 4499 4500 4501 /** 4502 * Serializes the given message to binary data (in protobuf wire 4503 * format), writing to the given BinaryWriter. 4504 * @param {!proto.payload.Ballot} message 4505 * @param {!jspb.BinaryWriter} writer 4506 * @suppress {unusedLocalVariables} f is only used for nested messages 4507 */ 4508 proto.payload.Ballot.serializeBinaryToWriter = function(message, writer) { 4509 var f = undefined; 4510 f = message.getProposal(); 4511 if (f != null) { 4512 writer.writeMessage( 4513 1, 4514 f, 4515 proto.payload.Proposal.serializeBinaryToWriter 4516 ); 4517 } 4518 f = message.getFinalizingtx_asU8(); 4519 if (f.length > 0) { 4520 writer.writeBytes( 4521 2, 4522 f 4523 ); 4524 } 4525 f = message.getProposalstate(); 4526 if (f !== 0.0) { 4527 writer.writeEnum( 4528 4, 4529 f 4530 ); 4531 } 4532 f = message.getVotesList(); 4533 if (f.length > 0) { 4534 writer.writeRepeatedMessage( 4535 5, 4536 f, 4537 proto.payload.Vote.serializeBinaryToWriter 4538 ); 4539 } 4540 }; 4541 4542 4543 /** 4544 * @enum {number} 4545 */ 4546 proto.payload.Ballot.ProposalState = { 4547 PROPOSED: 0, 4548 EXECUTED: 1, 4549 FAILED: 2 4550 }; 4551 4552 /** 4553 * optional Proposal Proposal = 1; 4554 * @return {?proto.payload.Proposal} 4555 */ 4556 proto.payload.Ballot.prototype.getProposal = function() { 4557 return /** @type{?proto.payload.Proposal} */ ( 4558 jspb.Message.getWrapperField(this, proto.payload.Proposal, 1)); 4559 }; 4560 4561 4562 /** 4563 * @param {?proto.payload.Proposal|undefined} value 4564 * @return {!proto.payload.Ballot} returns this 4565 */ 4566 proto.payload.Ballot.prototype.setProposal = function(value) { 4567 return jspb.Message.setWrapperField(this, 1, value); 4568 }; 4569 4570 4571 /** 4572 * Clears the message field making it undefined. 4573 * @return {!proto.payload.Ballot} returns this 4574 */ 4575 proto.payload.Ballot.prototype.clearProposal = function() { 4576 return this.setProposal(undefined); 4577 }; 4578 4579 4580 /** 4581 * Returns whether this field is set. 4582 * @return {boolean} 4583 */ 4584 proto.payload.Ballot.prototype.hasProposal = function() { 4585 return jspb.Message.getField(this, 1) != null; 4586 }; 4587 4588 4589 /** 4590 * optional bytes FinalizingTx = 2; 4591 * @return {!(string|Uint8Array)} 4592 */ 4593 proto.payload.Ballot.prototype.getFinalizingtx = function() { 4594 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 4595 }; 4596 4597 4598 /** 4599 * optional bytes FinalizingTx = 2; 4600 * This is a type-conversion wrapper around `getFinalizingtx()` 4601 * @return {string} 4602 */ 4603 proto.payload.Ballot.prototype.getFinalizingtx_asB64 = function() { 4604 return /** @type {string} */ (jspb.Message.bytesAsB64( 4605 this.getFinalizingtx())); 4606 }; 4607 4608 4609 /** 4610 * optional bytes FinalizingTx = 2; 4611 * Note that Uint8Array is not supported on all browsers. 4612 * @see http://caniuse.com/Uint8Array 4613 * This is a type-conversion wrapper around `getFinalizingtx()` 4614 * @return {!Uint8Array} 4615 */ 4616 proto.payload.Ballot.prototype.getFinalizingtx_asU8 = function() { 4617 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 4618 this.getFinalizingtx())); 4619 }; 4620 4621 4622 /** 4623 * @param {!(string|Uint8Array)} value 4624 * @return {!proto.payload.Ballot} returns this 4625 */ 4626 proto.payload.Ballot.prototype.setFinalizingtx = function(value) { 4627 return jspb.Message.setProto3BytesField(this, 2, value); 4628 }; 4629 4630 4631 /** 4632 * optional ProposalState proposalState = 4; 4633 * @return {!proto.payload.Ballot.ProposalState} 4634 */ 4635 proto.payload.Ballot.prototype.getProposalstate = function() { 4636 return /** @type {!proto.payload.Ballot.ProposalState} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); 4637 }; 4638 4639 4640 /** 4641 * @param {!proto.payload.Ballot.ProposalState} value 4642 * @return {!proto.payload.Ballot} returns this 4643 */ 4644 proto.payload.Ballot.prototype.setProposalstate = function(value) { 4645 return jspb.Message.setProto3EnumField(this, 4, value); 4646 }; 4647 4648 4649 /** 4650 * repeated Vote Votes = 5; 4651 * @return {!Array<!proto.payload.Vote>} 4652 */ 4653 proto.payload.Ballot.prototype.getVotesList = function() { 4654 return /** @type{!Array<!proto.payload.Vote>} */ ( 4655 jspb.Message.getRepeatedWrapperField(this, proto.payload.Vote, 5)); 4656 }; 4657 4658 4659 /** 4660 * @param {!Array<!proto.payload.Vote>} value 4661 * @return {!proto.payload.Ballot} returns this 4662 */ 4663 proto.payload.Ballot.prototype.setVotesList = function(value) { 4664 return jspb.Message.setRepeatedWrapperField(this, 5, value); 4665 }; 4666 4667 4668 /** 4669 * @param {!proto.payload.Vote=} opt_value 4670 * @param {number=} opt_index 4671 * @return {!proto.payload.Vote} 4672 */ 4673 proto.payload.Ballot.prototype.addVotes = function(opt_value, opt_index) { 4674 return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.payload.Vote, opt_index); 4675 }; 4676 4677 4678 /** 4679 * Clears the list making it empty but non-null. 4680 * @return {!proto.payload.Ballot} returns this 4681 */ 4682 proto.payload.Ballot.prototype.clearVotesList = function() { 4683 return this.setVotesList([]); 4684 }; 4685 4686 4687 goog.object.extend(exports, proto.payload);