UNPKG

mcps-sdk-js

Version:

MCPS JavaScript SDK

1,085 lines (932 loc) 33.7 kB
// source: wasm/genesis.proto /** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var gogoproto_gogo_pb = require('../gogoproto/gogo_pb.js'); goog.object.extend(proto, gogoproto_gogo_pb); var wasm_types_pb = require('../wasm/types_pb.js'); goog.object.extend(proto, wasm_types_pb); goog.exportSymbol('proto.wasmd.x.wasmd.v1beta1.Code', null, global); goog.exportSymbol('proto.wasmd.x.wasmd.v1beta1.Contract', null, global); goog.exportSymbol('proto.wasmd.x.wasmd.v1beta1.GenesisState', null, global); goog.exportSymbol('proto.wasmd.x.wasmd.v1beta1.Sequence', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wasmd.x.wasmd.v1beta1.GenesisState = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.wasmd.x.wasmd.v1beta1.GenesisState.repeatedFields_, null); }; goog.inherits(proto.wasmd.x.wasmd.v1beta1.GenesisState, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wasmd.x.wasmd.v1beta1.GenesisState.displayName = 'proto.wasmd.x.wasmd.v1beta1.GenesisState'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wasmd.x.wasmd.v1beta1.Code = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wasmd.x.wasmd.v1beta1.Code, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wasmd.x.wasmd.v1beta1.Code.displayName = 'proto.wasmd.x.wasmd.v1beta1.Code'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wasmd.x.wasmd.v1beta1.Contract = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.wasmd.x.wasmd.v1beta1.Contract.repeatedFields_, null); }; goog.inherits(proto.wasmd.x.wasmd.v1beta1.Contract, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wasmd.x.wasmd.v1beta1.Contract.displayName = 'proto.wasmd.x.wasmd.v1beta1.Contract'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wasmd.x.wasmd.v1beta1.Sequence = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wasmd.x.wasmd.v1beta1.Sequence, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wasmd.x.wasmd.v1beta1.Sequence.displayName = 'proto.wasmd.x.wasmd.v1beta1.Sequence'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.wasmd.x.wasmd.v1beta1.GenesisState.repeatedFields_ = [2,3,4]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.toObject = function(opt_includeInstance) { return proto.wasmd.x.wasmd.v1beta1.GenesisState.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wasmd.x.wasmd.v1beta1.GenesisState} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.GenesisState.toObject = function(includeInstance, msg) { var f, obj = { params: (f = msg.getParams()) && wasm_types_pb.Params.toObject(includeInstance, f), codesList: jspb.Message.toObjectList(msg.getCodesList(), proto.wasmd.x.wasmd.v1beta1.Code.toObject, includeInstance), contractsList: jspb.Message.toObjectList(msg.getContractsList(), proto.wasmd.x.wasmd.v1beta1.Contract.toObject, includeInstance), sequencesList: jspb.Message.toObjectList(msg.getSequencesList(), proto.wasmd.x.wasmd.v1beta1.Sequence.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wasmd.x.wasmd.v1beta1.GenesisState; return proto.wasmd.x.wasmd.v1beta1.GenesisState.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wasmd.x.wasmd.v1beta1.GenesisState} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new wasm_types_pb.Params; reader.readMessage(value,wasm_types_pb.Params.deserializeBinaryFromReader); msg.setParams(value); break; case 2: var value = new proto.wasmd.x.wasmd.v1beta1.Code; reader.readMessage(value,proto.wasmd.x.wasmd.v1beta1.Code.deserializeBinaryFromReader); msg.addCodes(value); break; case 3: var value = new proto.wasmd.x.wasmd.v1beta1.Contract; reader.readMessage(value,proto.wasmd.x.wasmd.v1beta1.Contract.deserializeBinaryFromReader); msg.addContracts(value); break; case 4: var value = new proto.wasmd.x.wasmd.v1beta1.Sequence; reader.readMessage(value,proto.wasmd.x.wasmd.v1beta1.Sequence.deserializeBinaryFromReader); msg.addSequences(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wasmd.x.wasmd.v1beta1.GenesisState.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wasmd.x.wasmd.v1beta1.GenesisState} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.GenesisState.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getParams(); if (f != null) { writer.writeMessage( 1, f, wasm_types_pb.Params.serializeBinaryToWriter ); } f = message.getCodesList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, proto.wasmd.x.wasmd.v1beta1.Code.serializeBinaryToWriter ); } f = message.getContractsList(); if (f.length > 0) { writer.writeRepeatedMessage( 3, f, proto.wasmd.x.wasmd.v1beta1.Contract.serializeBinaryToWriter ); } f = message.getSequencesList(); if (f.length > 0) { writer.writeRepeatedMessage( 4, f, proto.wasmd.x.wasmd.v1beta1.Sequence.serializeBinaryToWriter ); } }; /** * optional Params params = 1; * @return {?proto.wasmd.x.wasmd.v1beta1.Params} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.getParams = function() { return /** @type{?proto.wasmd.x.wasmd.v1beta1.Params} */ ( jspb.Message.getWrapperField(this, wasm_types_pb.Params, 1)); }; /** * @param {?proto.wasmd.x.wasmd.v1beta1.Params|undefined} value * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.setParams = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.clearParams = function() { return this.setParams(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.hasParams = function() { return jspb.Message.getField(this, 1) != null; }; /** * repeated Code codes = 2; * @return {!Array<!proto.wasmd.x.wasmd.v1beta1.Code>} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.getCodesList = function() { return /** @type{!Array<!proto.wasmd.x.wasmd.v1beta1.Code>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.wasmd.x.wasmd.v1beta1.Code, 2)); }; /** * @param {!Array<!proto.wasmd.x.wasmd.v1beta1.Code>} value * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.setCodesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.wasmd.x.wasmd.v1beta1.Code=} opt_value * @param {number=} opt_index * @return {!proto.wasmd.x.wasmd.v1beta1.Code} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.addCodes = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.wasmd.x.wasmd.v1beta1.Code, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.clearCodesList = function() { return this.setCodesList([]); }; /** * repeated Contract contracts = 3; * @return {!Array<!proto.wasmd.x.wasmd.v1beta1.Contract>} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.getContractsList = function() { return /** @type{!Array<!proto.wasmd.x.wasmd.v1beta1.Contract>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.wasmd.x.wasmd.v1beta1.Contract, 3)); }; /** * @param {!Array<!proto.wasmd.x.wasmd.v1beta1.Contract>} value * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.setContractsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 3, value); }; /** * @param {!proto.wasmd.x.wasmd.v1beta1.Contract=} opt_value * @param {number=} opt_index * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.addContracts = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.wasmd.x.wasmd.v1beta1.Contract, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.clearContractsList = function() { return this.setContractsList([]); }; /** * repeated Sequence sequences = 4; * @return {!Array<!proto.wasmd.x.wasmd.v1beta1.Sequence>} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.getSequencesList = function() { return /** @type{!Array<!proto.wasmd.x.wasmd.v1beta1.Sequence>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.wasmd.x.wasmd.v1beta1.Sequence, 4)); }; /** * @param {!Array<!proto.wasmd.x.wasmd.v1beta1.Sequence>} value * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.setSequencesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 4, value); }; /** * @param {!proto.wasmd.x.wasmd.v1beta1.Sequence=} opt_value * @param {number=} opt_index * @return {!proto.wasmd.x.wasmd.v1beta1.Sequence} */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.addSequences = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.wasmd.x.wasmd.v1beta1.Sequence, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.wasmd.x.wasmd.v1beta1.GenesisState} returns this */ proto.wasmd.x.wasmd.v1beta1.GenesisState.prototype.clearSequencesList = function() { return this.setSequencesList([]); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.toObject = function(opt_includeInstance) { return proto.wasmd.x.wasmd.v1beta1.Code.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wasmd.x.wasmd.v1beta1.Code} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.Code.toObject = function(includeInstance, msg) { var f, obj = { codeId: jspb.Message.getFieldWithDefault(msg, 1, 0), codeInfo: (f = msg.getCodeInfo()) && wasm_types_pb.CodeInfo.toObject(includeInstance, f), codeBytes: msg.getCodeBytes_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wasmd.x.wasmd.v1beta1.Code} */ proto.wasmd.x.wasmd.v1beta1.Code.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wasmd.x.wasmd.v1beta1.Code; return proto.wasmd.x.wasmd.v1beta1.Code.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wasmd.x.wasmd.v1beta1.Code} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wasmd.x.wasmd.v1beta1.Code} */ proto.wasmd.x.wasmd.v1beta1.Code.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readUint64()); msg.setCodeId(value); break; case 2: var value = new wasm_types_pb.CodeInfo; reader.readMessage(value,wasm_types_pb.CodeInfo.deserializeBinaryFromReader); msg.setCodeInfo(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCodeBytes(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wasmd.x.wasmd.v1beta1.Code.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wasmd.x.wasmd.v1beta1.Code} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.Code.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCodeId(); if (f !== 0) { writer.writeUint64( 1, f ); } f = message.getCodeInfo(); if (f != null) { writer.writeMessage( 2, f, wasm_types_pb.CodeInfo.serializeBinaryToWriter ); } f = message.getCodeBytes_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } }; /** * optional uint64 code_id = 1; * @return {number} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.getCodeId = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.wasmd.x.wasmd.v1beta1.Code} returns this */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.setCodeId = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional CodeInfo code_info = 2; * @return {?proto.wasmd.x.wasmd.v1beta1.CodeInfo} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.getCodeInfo = function() { return /** @type{?proto.wasmd.x.wasmd.v1beta1.CodeInfo} */ ( jspb.Message.getWrapperField(this, wasm_types_pb.CodeInfo, 2)); }; /** * @param {?proto.wasmd.x.wasmd.v1beta1.CodeInfo|undefined} value * @return {!proto.wasmd.x.wasmd.v1beta1.Code} returns this */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.setCodeInfo = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.wasmd.x.wasmd.v1beta1.Code} returns this */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.clearCodeInfo = function() { return this.setCodeInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.hasCodeInfo = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional bytes code_bytes = 3; * @return {!(string|Uint8Array)} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.getCodeBytes = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes code_bytes = 3; * This is a type-conversion wrapper around `getCodeBytes()` * @return {string} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.getCodeBytes_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCodeBytes())); }; /** * optional bytes code_bytes = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCodeBytes()` * @return {!Uint8Array} */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.getCodeBytes_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCodeBytes())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.wasmd.x.wasmd.v1beta1.Code} returns this */ proto.wasmd.x.wasmd.v1beta1.Code.prototype.setCodeBytes = function(value) { return jspb.Message.setProto3BytesField(this, 3, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.wasmd.x.wasmd.v1beta1.Contract.repeatedFields_ = [3]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.toObject = function(opt_includeInstance) { return proto.wasmd.x.wasmd.v1beta1.Contract.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wasmd.x.wasmd.v1beta1.Contract} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.Contract.toObject = function(includeInstance, msg) { var f, obj = { contractAddress: jspb.Message.getFieldWithDefault(msg, 1, ""), contractInfo: (f = msg.getContractInfo()) && wasm_types_pb.ContractInfo.toObject(includeInstance, f), contractStateList: jspb.Message.toObjectList(msg.getContractStateList(), wasm_types_pb.Model.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} */ proto.wasmd.x.wasmd.v1beta1.Contract.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wasmd.x.wasmd.v1beta1.Contract; return proto.wasmd.x.wasmd.v1beta1.Contract.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wasmd.x.wasmd.v1beta1.Contract} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} */ proto.wasmd.x.wasmd.v1beta1.Contract.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setContractAddress(value); break; case 2: var value = new wasm_types_pb.ContractInfo; reader.readMessage(value,wasm_types_pb.ContractInfo.deserializeBinaryFromReader); msg.setContractInfo(value); break; case 3: var value = new wasm_types_pb.Model; reader.readMessage(value,wasm_types_pb.Model.deserializeBinaryFromReader); msg.addContractState(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wasmd.x.wasmd.v1beta1.Contract.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wasmd.x.wasmd.v1beta1.Contract} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.Contract.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getContractAddress(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getContractInfo(); if (f != null) { writer.writeMessage( 2, f, wasm_types_pb.ContractInfo.serializeBinaryToWriter ); } f = message.getContractStateList(); if (f.length > 0) { writer.writeRepeatedMessage( 3, f, wasm_types_pb.Model.serializeBinaryToWriter ); } }; /** * optional string contract_address = 1; * @return {string} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.getContractAddress = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} returns this */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.setContractAddress = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional ContractInfo contract_info = 2; * @return {?proto.wasmd.x.wasmd.v1beta1.ContractInfo} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.getContractInfo = function() { return /** @type{?proto.wasmd.x.wasmd.v1beta1.ContractInfo} */ ( jspb.Message.getWrapperField(this, wasm_types_pb.ContractInfo, 2)); }; /** * @param {?proto.wasmd.x.wasmd.v1beta1.ContractInfo|undefined} value * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} returns this */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.setContractInfo = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} returns this */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.clearContractInfo = function() { return this.setContractInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.hasContractInfo = function() { return jspb.Message.getField(this, 2) != null; }; /** * repeated Model contract_state = 3; * @return {!Array<!proto.wasmd.x.wasmd.v1beta1.Model>} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.getContractStateList = function() { return /** @type{!Array<!proto.wasmd.x.wasmd.v1beta1.Model>} */ ( jspb.Message.getRepeatedWrapperField(this, wasm_types_pb.Model, 3)); }; /** * @param {!Array<!proto.wasmd.x.wasmd.v1beta1.Model>} value * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} returns this */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.setContractStateList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 3, value); }; /** * @param {!proto.wasmd.x.wasmd.v1beta1.Model=} opt_value * @param {number=} opt_index * @return {!proto.wasmd.x.wasmd.v1beta1.Model} */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.addContractState = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.wasmd.x.wasmd.v1beta1.Model, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.wasmd.x.wasmd.v1beta1.Contract} returns this */ proto.wasmd.x.wasmd.v1beta1.Contract.prototype.clearContractStateList = function() { return this.setContractStateList([]); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.toObject = function(opt_includeInstance) { return proto.wasmd.x.wasmd.v1beta1.Sequence.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wasmd.x.wasmd.v1beta1.Sequence} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.Sequence.toObject = function(includeInstance, msg) { var f, obj = { idKey: msg.getIdKey_asB64(), value: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wasmd.x.wasmd.v1beta1.Sequence} */ proto.wasmd.x.wasmd.v1beta1.Sequence.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wasmd.x.wasmd.v1beta1.Sequence; return proto.wasmd.x.wasmd.v1beta1.Sequence.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wasmd.x.wasmd.v1beta1.Sequence} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wasmd.x.wasmd.v1beta1.Sequence} */ proto.wasmd.x.wasmd.v1beta1.Sequence.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setIdKey(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setValue(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wasmd.x.wasmd.v1beta1.Sequence.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wasmd.x.wasmd.v1beta1.Sequence} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wasmd.x.wasmd.v1beta1.Sequence.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIdKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getValue(); if (f !== 0) { writer.writeUint64( 2, f ); } }; /** * optional bytes id_key = 1; * @return {!(string|Uint8Array)} */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.getIdKey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes id_key = 1; * This is a type-conversion wrapper around `getIdKey()` * @return {string} */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.getIdKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getIdKey())); }; /** * optional bytes id_key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getIdKey()` * @return {!Uint8Array} */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.getIdKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getIdKey())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.wasmd.x.wasmd.v1beta1.Sequence} returns this */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.setIdKey = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 value = 2; * @return {number} */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.getValue = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.wasmd.x.wasmd.v1beta1.Sequence} returns this */ proto.wasmd.x.wasmd.v1beta1.Sequence.prototype.setValue = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; goog.object.extend(exports, proto.wasmd.x.wasmd.v1beta1);